@atlaskit/editor-common 111.8.13 → 111.9.0

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/messages/syncBlock.js +15 -0
  3. package/dist/cjs/monitoring/error.js +1 -1
  4. package/dist/cjs/transforms/index.js +0 -6
  5. package/dist/cjs/transforms/sync-block.js +1 -47
  6. package/dist/cjs/ui/DropList/index.js +1 -1
  7. package/dist/cjs/ui/Popup/index.js +1 -1
  8. package/dist/cjs/ui-menu/ColorPickerButton/index.js +1 -1
  9. package/dist/es2019/messages/syncBlock.js +15 -0
  10. package/dist/es2019/monitoring/error.js +1 -1
  11. package/dist/es2019/transforms/index.js +1 -1
  12. package/dist/es2019/transforms/sync-block.js +0 -41
  13. package/dist/es2019/ui/DropList/index.js +1 -1
  14. package/dist/es2019/ui/Popup/index.js +1 -1
  15. package/dist/es2019/ui-menu/ColorPickerButton/index.js +1 -1
  16. package/dist/esm/messages/syncBlock.js +15 -0
  17. package/dist/esm/monitoring/error.js +1 -1
  18. package/dist/esm/transforms/index.js +1 -1
  19. package/dist/esm/transforms/sync-block.js +0 -44
  20. package/dist/esm/ui/DropList/index.js +1 -1
  21. package/dist/esm/ui/Popup/index.js +1 -1
  22. package/dist/esm/ui-menu/ColorPickerButton/index.js +1 -1
  23. package/dist/types/analytics/types/ai-streaming.d.ts +2 -0
  24. package/dist/types/analytics/types/block-menu-events.d.ts +6 -4
  25. package/dist/types/messages/syncBlock.d.ts +15 -0
  26. package/dist/types/transforms/index.d.ts +1 -1
  27. package/dist/types/transforms/sync-block.d.ts +0 -7
  28. package/dist/types/types/index.d.ts +9 -0
  29. package/dist/types-ts4.5/analytics/types/ai-streaming.d.ts +2 -0
  30. package/dist/types-ts4.5/analytics/types/block-menu-events.d.ts +6 -4
  31. package/dist/types-ts4.5/messages/syncBlock.d.ts +15 -0
  32. package/dist/types-ts4.5/transforms/index.d.ts +1 -1
  33. package/dist/types-ts4.5/transforms/sync-block.d.ts +0 -7
  34. package/dist/types-ts4.5/types/index.d.ts +9 -0
  35. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 111.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c082975fb2a0c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c082975fb2a0c) -
8
+ Added a new watchment plugin to the localId editror plugin for it to keep track of all localIds
9
+ created/updated since the start of the editor session. This is needed so the orchestrator is able
10
+ to identify when it cant lookup a localId, what the reason is for the localId being missing.
11
+
12
+ ### Patch Changes
13
+
14
+ - [`baf7b89a7b895`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/baf7b89a7b895) -
15
+ Give colour picker menu an accessible label
16
+ - Updated dependencies
17
+
18
+ ## 111.8.14
19
+
20
+ ### Patch Changes
21
+
22
+ - [`9068b92adf796`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9068b92adf796) -
23
+ [ux] EDITOR-4439 Implement option to raise warn flag on paste for unsupported content
24
+
3
25
  ## 111.8.13
4
26
 
5
27
  ### 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 = "111.8.12";
22
+ var packageVersion = "111.8.14";
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.transformSyncBlock = exports.removeBreakoutFromRendererSyncBlockHTML = void 0;
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 = "111.8.12";
27
+ var packageVersion = "111.8.14";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -323,7 +323,7 @@ var Popup = exports.default = /*#__PURE__*/function (_React$Component) {
323
323
  * We set aria-label to undefined if it's null, no more 'Popup' fallback.
324
324
  * It is meaningless for screen readers and causes confusion.
325
325
  */
326
- var ariaLabel = (0, _platformFeatureFlags.fg)('editor_a11y_aria_label_removal_popup') ? (_this$props$ariaLabel = this.props.ariaLabel) !== null && _this$props$ariaLabel !== void 0 ? _this$props$ariaLabel : undefined : this.props.ariaLabel === null ? undefined : this.props.ariaLabel || 'Popup';
326
+ var ariaLabel = (0, _platformFeatureFlags.fg)('_editor_a11y_aria_label_removal_popup') ? (_this$props$ariaLabel = this.props.ariaLabel) !== null && _this$props$ariaLabel !== void 0 ? _this$props$ariaLabel : undefined : this.props.ariaLabel === null ? undefined : this.props.ariaLabel || 'Popup';
327
327
  var getRole = function getRole() {
328
328
  // Provide a valid role only when aria-label is present to satisfy a11y rules, as when aria-label is present, role is required
329
329
  // use role = dialog as default role, as dialog role itself is not a parent role that requires specific children to function as some other ARIA roles(menu) do
@@ -166,7 +166,7 @@ var ColorPickerButton = function ColorPickerButton(props) {
166
166
  // we need an index of > 500 to display over it
167
167
  ,
168
168
  zIndex: props.setDisableParentScroll ? 600 : undefined,
169
- ariaLabel: (0, _platformFeatureFlags.fg)('editor_a11y_aria_label_removal_popup') ? formatMessage(_colorPickerButton.colorPickerButtonMessages.colorPickerMenuLabel) : 'Color picker popup',
169
+ ariaLabel: (0, _platformFeatureFlags.fg)('_editor_a11y_aria_label_removal_popup') ? formatMessage(_colorPickerButton.colorPickerButtonMessages.colorPickerMenuLabel) : 'Color picker popup',
170
170
  onPositionCalculated: onPositionCalculated
171
171
  }, (0, _react2.jsx)("div", {
172
172
  css: colorPickerWrapper,
@@ -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 = "111.8.12";
7
+ const packageVersion = "111.8.14";
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 { transformSyncBlock, removeBreakoutFromRendererSyncBlockHTML } from './sync-block';
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 = "111.8.12";
17
+ const packageVersion = "111.8.14";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -290,7 +290,7 @@ export default class Popup extends React.Component {
290
290
  * We set aria-label to undefined if it's null, no more 'Popup' fallback.
291
291
  * It is meaningless for screen readers and causes confusion.
292
292
  */
293
- const ariaLabel = fg('editor_a11y_aria_label_removal_popup') ? (_this$props$ariaLabel = this.props.ariaLabel) !== null && _this$props$ariaLabel !== void 0 ? _this$props$ariaLabel : undefined : this.props.ariaLabel === null ? undefined : this.props.ariaLabel || 'Popup';
293
+ const ariaLabel = fg('_editor_a11y_aria_label_removal_popup') ? (_this$props$ariaLabel = this.props.ariaLabel) !== null && _this$props$ariaLabel !== void 0 ? _this$props$ariaLabel : undefined : this.props.ariaLabel === null ? undefined : this.props.ariaLabel || 'Popup';
294
294
  const getRole = () => {
295
295
  // Provide a valid role only when aria-label is present to satisfy a11y rules, as when aria-label is present, role is required
296
296
  // use role = dialog as default role, as dialog role itself is not a parent role that requires specific children to function as some other ARIA roles(menu) do
@@ -148,7 +148,7 @@ const ColorPickerButton = props => {
148
148
  // we need an index of > 500 to display over it
149
149
  ,
150
150
  zIndex: props.setDisableParentScroll ? 600 : undefined,
151
- ariaLabel: fg('editor_a11y_aria_label_removal_popup') ? formatMessage(colorPickerButtonMessages.colorPickerMenuLabel) : 'Color picker popup',
151
+ ariaLabel: fg('_editor_a11y_aria_label_removal_popup') ? formatMessage(colorPickerButtonMessages.colorPickerMenuLabel) : 'Color picker popup',
152
152
  onPositionCalculated: onPositionCalculated
153
153
  }, jsx("div", {
154
154
  css: colorPickerWrapper,
@@ -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 = "111.8.12";
13
+ var packageVersion = "111.8.14";
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 { transformSyncBlock, removeBreakoutFromRendererSyncBlockHTML } from './sync-block';
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 = "111.8.12";
24
+ var packageVersion = "111.8.14";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -316,7 +316,7 @@ var Popup = /*#__PURE__*/function (_React$Component) {
316
316
  * We set aria-label to undefined if it's null, no more 'Popup' fallback.
317
317
  * It is meaningless for screen readers and causes confusion.
318
318
  */
319
- var ariaLabel = fg('editor_a11y_aria_label_removal_popup') ? (_this$props$ariaLabel = this.props.ariaLabel) !== null && _this$props$ariaLabel !== void 0 ? _this$props$ariaLabel : undefined : this.props.ariaLabel === null ? undefined : this.props.ariaLabel || 'Popup';
319
+ var ariaLabel = fg('_editor_a11y_aria_label_removal_popup') ? (_this$props$ariaLabel = this.props.ariaLabel) !== null && _this$props$ariaLabel !== void 0 ? _this$props$ariaLabel : undefined : this.props.ariaLabel === null ? undefined : this.props.ariaLabel || 'Popup';
320
320
  var getRole = function getRole() {
321
321
  // Provide a valid role only when aria-label is present to satisfy a11y rules, as when aria-label is present, role is required
322
322
  // use role = dialog as default role, as dialog role itself is not a parent role that requires specific children to function as some other ARIA roles(menu) do
@@ -158,7 +158,7 @@ var ColorPickerButton = function ColorPickerButton(props) {
158
158
  // we need an index of > 500 to display over it
159
159
  ,
160
160
  zIndex: props.setDisableParentScroll ? 600 : undefined,
161
- ariaLabel: fg('editor_a11y_aria_label_removal_popup') ? formatMessage(colorPickerButtonMessages.colorPickerMenuLabel) : 'Color picker popup',
161
+ ariaLabel: fg('_editor_a11y_aria_label_removal_popup') ? formatMessage(colorPickerButtonMessages.colorPickerMenuLabel) : 'Color picker popup',
162
162
  onPositionCalculated: onPositionCalculated
163
163
  }, jsx("div", {
164
164
  css: colorPickerWrapper,
@@ -3,6 +3,8 @@ import type { OperationalAEP, UIAEP } from './utils';
3
3
  type AILocalIdNotFoundErrorAEP = OperationalAEP<ACTION.LOCAL_ID_NOT_FOUND, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.EXPERIENCE_APPLICATION, {
4
4
  docSize: number | undefined;
5
5
  localIdLength: number;
6
+ localIdStatus: string;
7
+ localIdStatusSize: number;
6
8
  scrubbedLocalId: string;
7
9
  }>;
8
10
  type AIStreamingNoDocChangeAEP = OperationalAEP<ACTION.NO_DOC_CHANGE_FOUND, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.EXPERIENCE_APPLICATION, {
@@ -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 ElementTransformPerformanceAttr {
36
+ interface ElementTransformAttr {
37
37
  duration: number;
38
+ inputMethod: INPUT_METHOD.BLOCK_MENU;
38
39
  isList: boolean;
39
40
  isNested: boolean;
40
- nodeCount: number;
41
- sourceNodeTypes: Record<string, number>;
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 = OperationalAEP<ACTION.TRANSFORMED, ACTION_SUBJECT.ELEMENT, ACTION_SUBJECT_ID.TRANSFORM, ElementTransformPerformanceAttr>;
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 { transformSyncBlock, removeBreakoutFromRendererSyncBlockHTML } from './sync-block';
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
+ };
@@ -3,6 +3,8 @@ import type { OperationalAEP, UIAEP } from './utils';
3
3
  type AILocalIdNotFoundErrorAEP = OperationalAEP<ACTION.LOCAL_ID_NOT_FOUND, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.EXPERIENCE_APPLICATION, {
4
4
  docSize: number | undefined;
5
5
  localIdLength: number;
6
+ localIdStatus: string;
7
+ localIdStatusSize: number;
6
8
  scrubbedLocalId: string;
7
9
  }>;
8
10
  type AIStreamingNoDocChangeAEP = OperationalAEP<ACTION.NO_DOC_CHANGE_FOUND, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.EXPERIENCE_APPLICATION, {
@@ -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 ElementTransformPerformanceAttr {
36
+ interface ElementTransformAttr {
37
37
  duration: number;
38
+ inputMethod: INPUT_METHOD.BLOCK_MENU;
38
39
  isList: boolean;
39
40
  isNested: boolean;
40
- nodeCount: number;
41
- sourceNodeTypes: Record<string, number>;
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 = OperationalAEP<ACTION.TRANSFORMED, ACTION_SUBJECT.ELEMENT, ACTION_SUBJECT_ID.TRANSFORM, ElementTransformPerformanceAttr>;
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 { transformSyncBlock, removeBreakoutFromRendererSyncBlockHTML } from './sync-block';
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.13",
3
+ "version": "111.9.0",
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.14.0",
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.6.0",
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.31.0",
84
+ "@atlaskit/tmp-editor-statsig": "^16.34.0",
85
85
  "@atlaskit/tokens": "^10.1.0",
86
86
  "@atlaskit/tooltip": "^20.14.0",
87
87
  "@atlaskit/width-detector": "^5.0.0",
@@ -199,7 +199,7 @@
199
199
  "platform_editor_nested_dnd_styles_changes": {
200
200
  "type": "boolean"
201
201
  },
202
- "editor_a11y_aria_label_removal_popup": {
202
+ "_editor_a11y_aria_label_removal_popup": {
203
203
  "type": "boolean"
204
204
  },
205
205
  "platform_editor_bordered_panel_nested_in_table": {