@atlaskit/editor-common 111.8.13 → 111.8.14
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 +7 -0
- package/dist/cjs/messages/syncBlock.js +15 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/transforms/index.js +0 -6
- package/dist/cjs/transforms/sync-block.js +1 -47
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/messages/syncBlock.js +15 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/transforms/index.js +1 -1
- package/dist/es2019/transforms/sync-block.js +0 -41
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/messages/syncBlock.js +15 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/transforms/index.js +1 -1
- package/dist/esm/transforms/sync-block.js +0 -44
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/analytics/types/block-menu-events.d.ts +6 -4
- package/dist/types/messages/syncBlock.d.ts +15 -0
- package/dist/types/transforms/index.d.ts +1 -1
- package/dist/types/transforms/sync-block.d.ts +0 -7
- package/dist/types/types/index.d.ts +9 -0
- package/dist/types-ts4.5/analytics/types/block-menu-events.d.ts +6 -4
- package/dist/types-ts4.5/messages/syncBlock.d.ts +15 -0
- package/dist/types-ts4.5/transforms/index.d.ts +1 -1
- package/dist/types-ts4.5/transforms/sync-block.d.ts +0 -7
- package/dist/types-ts4.5/types/index.d.ts +9 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 111.8.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9068b92adf796`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9068b92adf796) -
|
|
8
|
+
[ux] EDITOR-4439 Implement option to raise warn flag on paste for unsupported content
|
|
9
|
+
|
|
3
10
|
## 111.8.13
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -310,5 +310,20 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
|
|
|
310
310
|
id: 'fabric.editor.unsyncConfirmationModalDescriptionMultiple',
|
|
311
311
|
defaultMessage: 'Your content will stay here. In {syncBlockCount} other synced locations it will appear as an “Unsynced block”. ',
|
|
312
312
|
description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with multiple references'
|
|
313
|
+
},
|
|
314
|
+
cannotPasteSyncedBlockTitle: {
|
|
315
|
+
id: 'fabric.editor.cannotPasteSyncedBlockTitle',
|
|
316
|
+
defaultMessage: 'Unable to paste',
|
|
317
|
+
description: 'Title in flag which appears when a synced block cannot be pasted'
|
|
318
|
+
},
|
|
319
|
+
cannotPasteSyncedBlockDescription: {
|
|
320
|
+
id: 'fabric.editor.cannotPasteSyncedBlockDescription',
|
|
321
|
+
defaultMessage: 'We’re still building this feature. Currently, you can only paste synced content once your work item has been created. ',
|
|
322
|
+
description: 'Description in flag which appears when a synced block cannot be pasted'
|
|
323
|
+
},
|
|
324
|
+
cannotPasteSyncedBlockAction: {
|
|
325
|
+
id: 'fabric.editor.cannotPasteSyncedBlockAction',
|
|
326
|
+
defaultMessage: 'Learn more',
|
|
327
|
+
description: 'Action in flag which appears when a synced block cannot be pasted to learn more'
|
|
313
328
|
}
|
|
314
329
|
});
|
|
@@ -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 = "0.0.0-development";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -159,12 +159,6 @@ Object.defineProperty(exports, "transformSliceToRemoveOpenNestedExpand", {
|
|
|
159
159
|
return _expand.transformSliceToRemoveOpenNestedExpand;
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
|
-
Object.defineProperty(exports, "transformSyncBlock", {
|
|
163
|
-
enumerable: true,
|
|
164
|
-
get: function get() {
|
|
165
|
-
return _syncBlock.transformSyncBlock;
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
162
|
Object.defineProperty(exports, "transformTaskListToBlockNodes", {
|
|
169
163
|
enumerable: true,
|
|
170
164
|
get: function get() {
|
|
@@ -1,57 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
var _adfSchema = require("@atlaskit/adf-schema");
|
|
6
|
+
exports.removeBreakoutFromRendererSyncBlockHTML = void 0;
|
|
11
7
|
var _styles = require("../styles");
|
|
12
8
|
var _syncBlock = require("../sync-block");
|
|
13
|
-
var _slice = require("../utils/slice");
|
|
14
|
-
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; }
|
|
15
|
-
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; }
|
|
16
|
-
var transformSyncBlockNode = function transformSyncBlockNode(node, schema, isFromEditor) {
|
|
17
|
-
// if copying from renderer, flatten out the content and remove the sync block
|
|
18
|
-
if (!isFromEditor) {
|
|
19
|
-
return node.content;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// sync blocks need a unique localId to function correctly
|
|
23
|
-
var newAttrs = _objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
24
|
-
localId: _adfSchema.uuid.generate()
|
|
25
|
-
});
|
|
26
|
-
return schema.nodes.syncBlock.create(newAttrs, null, (0, _toConsumableArray2.default)(node.marks));
|
|
27
|
-
};
|
|
28
|
-
var transformBodiedSyncBlockNode = function transformBodiedSyncBlockNode(node, isFromEditor) {
|
|
29
|
-
// if copying from renderer, flatten out the content and remove the bodied sync block
|
|
30
|
-
if (!isFromEditor) {
|
|
31
|
-
return node.content;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// this is not possible as all bodiedSyncBlocks have already been converted into a syncBlock by now.
|
|
35
|
-
return node;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
|
|
40
|
-
* Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
|
|
41
|
-
*/
|
|
42
|
-
var transformSyncBlock = exports.transformSyncBlock = function transformSyncBlock(slice, schema, pasteSource) {
|
|
43
|
-
var isFromEditor = pasteSource === 'fabric-editor';
|
|
44
|
-
slice = (0, _slice.mapSlice)(slice, function (node) {
|
|
45
|
-
if (node.type === schema.nodes.syncBlock) {
|
|
46
|
-
return transformSyncBlockNode(node, schema, isFromEditor);
|
|
47
|
-
} else if (node.type === schema.nodes.bodiedSyncBlock) {
|
|
48
|
-
return transformBodiedSyncBlockNode(node, isFromEditor);
|
|
49
|
-
}
|
|
50
|
-
return node;
|
|
51
|
-
});
|
|
52
|
-
return slice;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
9
|
/**
|
|
56
10
|
* Remove breakout mark from renderer sync block.
|
|
57
11
|
*
|
|
@@ -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 = "0.0.0-development";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -304,5 +304,20 @@ export const syncBlockMessages = defineMessages({
|
|
|
304
304
|
id: 'fabric.editor.unsyncConfirmationModalDescriptionMultiple',
|
|
305
305
|
defaultMessage: 'Your content will stay here. In {syncBlockCount} other synced locations it will appear as an “Unsynced block”. ',
|
|
306
306
|
description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with multiple references'
|
|
307
|
+
},
|
|
308
|
+
cannotPasteSyncedBlockTitle: {
|
|
309
|
+
id: 'fabric.editor.cannotPasteSyncedBlockTitle',
|
|
310
|
+
defaultMessage: 'Unable to paste',
|
|
311
|
+
description: 'Title in flag which appears when a synced block cannot be pasted'
|
|
312
|
+
},
|
|
313
|
+
cannotPasteSyncedBlockDescription: {
|
|
314
|
+
id: 'fabric.editor.cannotPasteSyncedBlockDescription',
|
|
315
|
+
defaultMessage: 'We’re still building this feature. Currently, you can only paste synced content once your work item has been created. ',
|
|
316
|
+
description: 'Description in flag which appears when a synced block cannot be pasted'
|
|
317
|
+
},
|
|
318
|
+
cannotPasteSyncedBlockAction: {
|
|
319
|
+
id: 'fabric.editor.cannotPasteSyncedBlockAction',
|
|
320
|
+
defaultMessage: 'Learn more',
|
|
321
|
+
description: 'Action in flag which appears when a synced block cannot be pasted to learn more'
|
|
307
322
|
}
|
|
308
323
|
});
|
|
@@ -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 = "0.0.0-development";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -8,4 +8,4 @@ export { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToC
|
|
|
8
8
|
export { transformSliceToDecisionList } from './decision-list';
|
|
9
9
|
export { transformListStructure, transformBetweenListTypes, transformListRecursively, transformToTaskList, transformTaskListToBlockNodes, getFormattedNode } from './list-transforms';
|
|
10
10
|
export { isBulletOrOrderedList, isTaskList, getSupportedListTypesSet, convertBlockToInlineContent } from './list-utils';
|
|
11
|
-
export {
|
|
11
|
+
export { removeBreakoutFromRendererSyncBlockHTML } from './sync-block';
|
|
@@ -1,46 +1,5 @@
|
|
|
1
|
-
import { uuid } from '@atlaskit/adf-schema';
|
|
2
1
|
import { BreakoutCssClassName } from '../styles';
|
|
3
2
|
import { SyncBlockRendererDataAttributeName } from '../sync-block';
|
|
4
|
-
import { mapSlice } from '../utils/slice';
|
|
5
|
-
const transformSyncBlockNode = (node, schema, isFromEditor) => {
|
|
6
|
-
// if copying from renderer, flatten out the content and remove the sync block
|
|
7
|
-
if (!isFromEditor) {
|
|
8
|
-
return node.content;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// sync blocks need a unique localId to function correctly
|
|
12
|
-
const newAttrs = {
|
|
13
|
-
...node.attrs,
|
|
14
|
-
localId: uuid.generate()
|
|
15
|
-
};
|
|
16
|
-
return schema.nodes.syncBlock.create(newAttrs, null, [...node.marks]);
|
|
17
|
-
};
|
|
18
|
-
const transformBodiedSyncBlockNode = (node, isFromEditor) => {
|
|
19
|
-
// if copying from renderer, flatten out the content and remove the bodied sync block
|
|
20
|
-
if (!isFromEditor) {
|
|
21
|
-
return node.content;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// this is not possible as all bodiedSyncBlocks have already been converted into a syncBlock by now.
|
|
25
|
-
return node;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
|
|
30
|
-
* Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
|
|
31
|
-
*/
|
|
32
|
-
export const transformSyncBlock = (slice, schema, pasteSource) => {
|
|
33
|
-
const isFromEditor = pasteSource === 'fabric-editor';
|
|
34
|
-
slice = mapSlice(slice, node => {
|
|
35
|
-
if (node.type === schema.nodes.syncBlock) {
|
|
36
|
-
return transformSyncBlockNode(node, schema, isFromEditor);
|
|
37
|
-
} else if (node.type === schema.nodes.bodiedSyncBlock) {
|
|
38
|
-
return transformBodiedSyncBlockNode(node, isFromEditor);
|
|
39
|
-
}
|
|
40
|
-
return node;
|
|
41
|
-
});
|
|
42
|
-
return slice;
|
|
43
|
-
};
|
|
44
3
|
|
|
45
4
|
/**
|
|
46
5
|
* Remove breakout mark from renderer sync block.
|
|
@@ -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 = "0.0.0-development";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -304,5 +304,20 @@ export var syncBlockMessages = defineMessages({
|
|
|
304
304
|
id: 'fabric.editor.unsyncConfirmationModalDescriptionMultiple',
|
|
305
305
|
defaultMessage: 'Your content will stay here. In {syncBlockCount} other synced locations it will appear as an “Unsynced block”. ',
|
|
306
306
|
description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with multiple references'
|
|
307
|
+
},
|
|
308
|
+
cannotPasteSyncedBlockTitle: {
|
|
309
|
+
id: 'fabric.editor.cannotPasteSyncedBlockTitle',
|
|
310
|
+
defaultMessage: 'Unable to paste',
|
|
311
|
+
description: 'Title in flag which appears when a synced block cannot be pasted'
|
|
312
|
+
},
|
|
313
|
+
cannotPasteSyncedBlockDescription: {
|
|
314
|
+
id: 'fabric.editor.cannotPasteSyncedBlockDescription',
|
|
315
|
+
defaultMessage: 'We’re still building this feature. Currently, you can only paste synced content once your work item has been created. ',
|
|
316
|
+
description: 'Description in flag which appears when a synced block cannot be pasted'
|
|
317
|
+
},
|
|
318
|
+
cannotPasteSyncedBlockAction: {
|
|
319
|
+
id: 'fabric.editor.cannotPasteSyncedBlockAction',
|
|
320
|
+
defaultMessage: 'Learn more',
|
|
321
|
+
description: 'Action in flag which appears when a synced block cannot be pasted to learn more'
|
|
307
322
|
}
|
|
308
323
|
});
|
|
@@ -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 = "0.0.0-development";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -8,4 +8,4 @@ export { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToC
|
|
|
8
8
|
export { transformSliceToDecisionList } from './decision-list';
|
|
9
9
|
export { transformListStructure, transformBetweenListTypes, transformListRecursively, transformToTaskList, transformTaskListToBlockNodes, getFormattedNode } from './list-transforms';
|
|
10
10
|
export { isBulletOrOrderedList, isTaskList, getSupportedListTypesSet, convertBlockToInlineContent } from './list-utils';
|
|
11
|
-
export {
|
|
11
|
+
export { removeBreakoutFromRendererSyncBlockHTML } from './sync-block';
|
|
@@ -1,49 +1,5 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
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; }
|
|
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
|
-
import { uuid } from '@atlaskit/adf-schema';
|
|
6
1
|
import { BreakoutCssClassName } from '../styles';
|
|
7
2
|
import { SyncBlockRendererDataAttributeName } from '../sync-block';
|
|
8
|
-
import { mapSlice } from '../utils/slice';
|
|
9
|
-
var transformSyncBlockNode = function transformSyncBlockNode(node, schema, isFromEditor) {
|
|
10
|
-
// if copying from renderer, flatten out the content and remove the sync block
|
|
11
|
-
if (!isFromEditor) {
|
|
12
|
-
return node.content;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// sync blocks need a unique localId to function correctly
|
|
16
|
-
var newAttrs = _objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
17
|
-
localId: uuid.generate()
|
|
18
|
-
});
|
|
19
|
-
return schema.nodes.syncBlock.create(newAttrs, null, _toConsumableArray(node.marks));
|
|
20
|
-
};
|
|
21
|
-
var transformBodiedSyncBlockNode = function transformBodiedSyncBlockNode(node, isFromEditor) {
|
|
22
|
-
// if copying from renderer, flatten out the content and remove the bodied sync block
|
|
23
|
-
if (!isFromEditor) {
|
|
24
|
-
return node.content;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// this is not possible as all bodiedSyncBlocks have already been converted into a syncBlock by now.
|
|
28
|
-
return node;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
|
|
33
|
-
* Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
|
|
34
|
-
*/
|
|
35
|
-
export var transformSyncBlock = function transformSyncBlock(slice, schema, pasteSource) {
|
|
36
|
-
var isFromEditor = pasteSource === 'fabric-editor';
|
|
37
|
-
slice = mapSlice(slice, function (node) {
|
|
38
|
-
if (node.type === schema.nodes.syncBlock) {
|
|
39
|
-
return transformSyncBlockNode(node, schema, isFromEditor);
|
|
40
|
-
} else if (node.type === schema.nodes.bodiedSyncBlock) {
|
|
41
|
-
return transformBodiedSyncBlockNode(node, isFromEditor);
|
|
42
|
-
}
|
|
43
|
-
return node;
|
|
44
|
-
});
|
|
45
|
-
return slice;
|
|
46
|
-
};
|
|
47
3
|
|
|
48
4
|
/**
|
|
49
5
|
* Remove breakout mark from renderer sync block.
|
|
@@ -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 = "0.0.0-development";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -33,15 +33,17 @@ interface ElementTransformErrorAttr {
|
|
|
33
33
|
triggeredFrom: INPUT_METHOD.MOUSE | INPUT_METHOD.KEYBOARD;
|
|
34
34
|
}
|
|
35
35
|
export type ElementTransformErrorAEP = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.ELEMENT, ACTION_SUBJECT_ID.TRANSFORM, ElementTransformErrorAttr>;
|
|
36
|
-
interface
|
|
36
|
+
interface ElementTransformAttr {
|
|
37
37
|
duration: number;
|
|
38
|
+
inputMethod: INPUT_METHOD.BLOCK_MENU;
|
|
38
39
|
isList: boolean;
|
|
39
40
|
isNested: boolean;
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
outputNodesCount: number;
|
|
42
|
+
sourceNodesCount: number;
|
|
43
|
+
sourceNodesCountByType: Record<string, number>;
|
|
42
44
|
startTime: number;
|
|
43
45
|
targetNodeType: string;
|
|
44
46
|
}
|
|
45
|
-
export type ElementTransformPerformanceAEP =
|
|
47
|
+
export type ElementTransformPerformanceAEP = TrackAEP<ACTION.TRANSFORMED, ACTION_SUBJECT.ELEMENT, undefined, ElementTransformAttr, undefined>;
|
|
46
48
|
export type BlockMenuEventPayload = BlockMenuOpenedAEP | BlockMenuItemClickedAEP | ElementConvertedAEP | ElementTransformErrorAEP | ElementTransformPerformanceAEP;
|
|
47
49
|
export {};
|
|
@@ -304,4 +304,19 @@ export declare const syncBlockMessages: {
|
|
|
304
304
|
defaultMessage: string;
|
|
305
305
|
description: string;
|
|
306
306
|
};
|
|
307
|
+
cannotPasteSyncedBlockTitle: {
|
|
308
|
+
id: string;
|
|
309
|
+
defaultMessage: string;
|
|
310
|
+
description: string;
|
|
311
|
+
};
|
|
312
|
+
cannotPasteSyncedBlockDescription: {
|
|
313
|
+
id: string;
|
|
314
|
+
defaultMessage: string;
|
|
315
|
+
description: string;
|
|
316
|
+
};
|
|
317
|
+
cannotPasteSyncedBlockAction: {
|
|
318
|
+
id: string;
|
|
319
|
+
defaultMessage: string;
|
|
320
|
+
description: string;
|
|
321
|
+
};
|
|
307
322
|
};
|
|
@@ -5,5 +5,5 @@ export { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToC
|
|
|
5
5
|
export { transformSliceToDecisionList } from './decision-list';
|
|
6
6
|
export { transformListStructure, transformBetweenListTypes, transformListRecursively, transformToTaskList, transformTaskListToBlockNodes, getFormattedNode, } from './list-transforms';
|
|
7
7
|
export { isBulletOrOrderedList, isTaskList, getSupportedListTypesSet, convertBlockToInlineContent, } from './list-utils';
|
|
8
|
-
export {
|
|
8
|
+
export { removeBreakoutFromRendererSyncBlockHTML } from './sync-block';
|
|
9
9
|
export type { TransformContext, TransformFunction } from './list-types';
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import type { Schema, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { PasteSource } from '../analytics';
|
|
3
|
-
/**
|
|
4
|
-
* If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
|
|
5
|
-
* Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
|
|
6
|
-
*/
|
|
7
|
-
export declare const transformSyncBlock: (slice: Slice, schema: Schema, pasteSource: PasteSource) => Slice;
|
|
8
1
|
/**
|
|
9
2
|
* Remove breakout mark from renderer sync block.
|
|
10
3
|
*
|
|
@@ -47,6 +47,7 @@ export type { QuickInsertPluginState, QuickInsertPluginStateKeys, QuickInsertOpt
|
|
|
47
47
|
export type { Refs, RefsNode, DocBuilder } from './doc-builder';
|
|
48
48
|
export type { SelectionToolbarGroup, SelectionToolbarHandler } from './selection-toolbar';
|
|
49
49
|
export type { FeedbackInfo } from './feedback-dialog';
|
|
50
|
+
import type { MessageDescriptor } from 'react-intl-next';
|
|
50
51
|
/**
|
|
51
52
|
* @deprecated
|
|
52
53
|
*/
|
|
@@ -59,3 +60,11 @@ import type { EditorPresetBuilder, ExtractPresetAPI } from '../preset';
|
|
|
59
60
|
export type ExtractPublicEditorAPI<T extends EditorPresetBuilder<any, any>> = ExtractPresetAPI<T>;
|
|
60
61
|
export type { UserPreferencesProvider, UserPreferences } from './user-preferences';
|
|
61
62
|
export { DIRECTION } from './block-controls';
|
|
63
|
+
export type PasteWarningOptions = {
|
|
64
|
+
cannotPasteSyncedBlock?: {
|
|
65
|
+
description: MessageDescriptor;
|
|
66
|
+
title: MessageDescriptor;
|
|
67
|
+
urlHref: string;
|
|
68
|
+
urlText: MessageDescriptor;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -33,15 +33,17 @@ interface ElementTransformErrorAttr {
|
|
|
33
33
|
triggeredFrom: INPUT_METHOD.MOUSE | INPUT_METHOD.KEYBOARD;
|
|
34
34
|
}
|
|
35
35
|
export type ElementTransformErrorAEP = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.ELEMENT, ACTION_SUBJECT_ID.TRANSFORM, ElementTransformErrorAttr>;
|
|
36
|
-
interface
|
|
36
|
+
interface ElementTransformAttr {
|
|
37
37
|
duration: number;
|
|
38
|
+
inputMethod: INPUT_METHOD.BLOCK_MENU;
|
|
38
39
|
isList: boolean;
|
|
39
40
|
isNested: boolean;
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
outputNodesCount: number;
|
|
42
|
+
sourceNodesCount: number;
|
|
43
|
+
sourceNodesCountByType: Record<string, number>;
|
|
42
44
|
startTime: number;
|
|
43
45
|
targetNodeType: string;
|
|
44
46
|
}
|
|
45
|
-
export type ElementTransformPerformanceAEP =
|
|
47
|
+
export type ElementTransformPerformanceAEP = TrackAEP<ACTION.TRANSFORMED, ACTION_SUBJECT.ELEMENT, undefined, ElementTransformAttr, undefined>;
|
|
46
48
|
export type BlockMenuEventPayload = BlockMenuOpenedAEP | BlockMenuItemClickedAEP | ElementConvertedAEP | ElementTransformErrorAEP | ElementTransformPerformanceAEP;
|
|
47
49
|
export {};
|
|
@@ -304,4 +304,19 @@ export declare const syncBlockMessages: {
|
|
|
304
304
|
defaultMessage: string;
|
|
305
305
|
description: string;
|
|
306
306
|
};
|
|
307
|
+
cannotPasteSyncedBlockTitle: {
|
|
308
|
+
id: string;
|
|
309
|
+
defaultMessage: string;
|
|
310
|
+
description: string;
|
|
311
|
+
};
|
|
312
|
+
cannotPasteSyncedBlockDescription: {
|
|
313
|
+
id: string;
|
|
314
|
+
defaultMessage: string;
|
|
315
|
+
description: string;
|
|
316
|
+
};
|
|
317
|
+
cannotPasteSyncedBlockAction: {
|
|
318
|
+
id: string;
|
|
319
|
+
defaultMessage: string;
|
|
320
|
+
description: string;
|
|
321
|
+
};
|
|
307
322
|
};
|
|
@@ -5,5 +5,5 @@ export { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToC
|
|
|
5
5
|
export { transformSliceToDecisionList } from './decision-list';
|
|
6
6
|
export { transformListStructure, transformBetweenListTypes, transformListRecursively, transformToTaskList, transformTaskListToBlockNodes, getFormattedNode, } from './list-transforms';
|
|
7
7
|
export { isBulletOrOrderedList, isTaskList, getSupportedListTypesSet, convertBlockToInlineContent, } from './list-utils';
|
|
8
|
-
export {
|
|
8
|
+
export { removeBreakoutFromRendererSyncBlockHTML } from './sync-block';
|
|
9
9
|
export type { TransformContext, TransformFunction } from './list-types';
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import type { Schema, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { PasteSource } from '../analytics';
|
|
3
|
-
/**
|
|
4
|
-
* If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
|
|
5
|
-
* Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
|
|
6
|
-
*/
|
|
7
|
-
export declare const transformSyncBlock: (slice: Slice, schema: Schema, pasteSource: PasteSource) => Slice;
|
|
8
1
|
/**
|
|
9
2
|
* Remove breakout mark from renderer sync block.
|
|
10
3
|
*
|
|
@@ -47,6 +47,7 @@ export type { QuickInsertPluginState, QuickInsertPluginStateKeys, QuickInsertOpt
|
|
|
47
47
|
export type { Refs, RefsNode, DocBuilder } from './doc-builder';
|
|
48
48
|
export type { SelectionToolbarGroup, SelectionToolbarHandler } from './selection-toolbar';
|
|
49
49
|
export type { FeedbackInfo } from './feedback-dialog';
|
|
50
|
+
import type { MessageDescriptor } from 'react-intl-next';
|
|
50
51
|
/**
|
|
51
52
|
* @deprecated
|
|
52
53
|
*/
|
|
@@ -59,3 +60,11 @@ import type { EditorPresetBuilder, ExtractPresetAPI } from '../preset';
|
|
|
59
60
|
export type ExtractPublicEditorAPI<T extends EditorPresetBuilder<any, any>> = ExtractPresetAPI<T>;
|
|
60
61
|
export type { UserPreferencesProvider, UserPreferences } from './user-preferences';
|
|
61
62
|
export { DIRECTION } from './block-controls';
|
|
63
|
+
export type PasteWarningOptions = {
|
|
64
|
+
cannotPasteSyncedBlock?: {
|
|
65
|
+
description: MessageDescriptor;
|
|
66
|
+
title: MessageDescriptor;
|
|
67
|
+
urlHref: string;
|
|
68
|
+
urlText: MessageDescriptor;
|
|
69
|
+
};
|
|
70
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "111.8.
|
|
3
|
+
"version": "111.8.14",
|
|
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/"
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"@atlaskit/link": "^3.3.0",
|
|
56
56
|
"@atlaskit/link-datasource": "^4.32.0",
|
|
57
57
|
"@atlaskit/link-picker": "^4.2.0",
|
|
58
|
-
"@atlaskit/media-card": "^79.
|
|
58
|
+
"@atlaskit/media-card": "^79.15.0",
|
|
59
59
|
"@atlaskit/media-client": "^35.7.0",
|
|
60
60
|
"@atlaskit/media-client-react": "^4.1.0",
|
|
61
61
|
"@atlaskit/media-common": "^12.3.0",
|
|
62
62
|
"@atlaskit/media-file-preview": "^0.15.0",
|
|
63
63
|
"@atlaskit/media-picker": "^70.1.0",
|
|
64
64
|
"@atlaskit/media-ui": "^28.7.0",
|
|
65
|
-
"@atlaskit/media-viewer": "^52.
|
|
65
|
+
"@atlaskit/media-viewer": "^52.7.0",
|
|
66
66
|
"@atlaskit/mention": "^24.4.0",
|
|
67
67
|
"@atlaskit/menu": "^8.4.0",
|
|
68
68
|
"@atlaskit/onboarding": "^14.5.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
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.32.0",
|
|
85
85
|
"@atlaskit/tokens": "^10.1.0",
|
|
86
86
|
"@atlaskit/tooltip": "^20.14.0",
|
|
87
87
|
"@atlaskit/width-detector": "^5.0.0",
|