@atlaskit/editor-plugin-status 8.1.1 → 8.1.3

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/editor-plugin-status
2
2
 
3
+ ## 8.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`baf7b89a7b895`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/baf7b89a7b895) -
8
+ Give colour picker menu an accessible label
9
+ - Updated dependencies
10
+
11
+ ## 8.1.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [`8eca3ae04714e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8eca3ae04714e) -
16
+ Fixed mixed HTML/Editor content copy/paste issue on Status node.
17
+ - Updated dependencies
18
+
3
19
  ## 8.1.1
4
20
 
5
21
  ### Patch Changes
@@ -10,6 +10,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
  var _messages = require("@atlaskit/editor-common/messages");
12
12
  var _model = require("@atlaskit/editor-prosemirror/model");
13
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
13
14
  var _statusNodeSpec = require("./statusNodeSpec");
14
15
  /**
15
16
  *
@@ -62,10 +63,20 @@ var StatusNodeView = exports.StatusNodeView = /*#__PURE__*/function () {
62
63
  }
63
64
  if (this.textContainer && node.attrs.text !== this.node.attrs.text) {
64
65
  this.textContainer.textContent = node.attrs.text;
66
+ // Also update data-text on outer wrapper for parseDOM extraction when copying
67
+ if ((0, _expValEquals.expValEquals)('platform_editor_copy_paste_issue_fix', 'isEnabled', true)) {
68
+ var _this$domElement;
69
+ (_this$domElement = this.domElement) === null || _this$domElement === void 0 || _this$domElement.setAttribute('data-text', node.attrs.text);
70
+ }
65
71
  }
66
72
  if (node.attrs.color !== this.node.attrs.color) {
67
73
  var _this$box;
68
74
  (_this$box = this.box) === null || _this$box === void 0 || _this$box.setAttribute('data-color', node.attrs.color);
75
+ // Also update data-color on outer wrapper for parseDOM extraction when copying
76
+ if ((0, _expValEquals.expValEquals)('platform_editor_copy_paste_issue_fix', 'isEnabled', true)) {
77
+ var _this$domElement2;
78
+ (_this$domElement2 = this.domElement) === null || _this$domElement2 === void 0 || _this$domElement2.setAttribute('data-color', node.attrs.color);
79
+ }
69
80
  }
70
81
  if (!node.attrs.text) {
71
82
  this.setPlaceholder();
@@ -24,12 +24,16 @@ var statusToDOM = exports.statusToDOM = function statusToDOM(node) {
24
24
  color = _node$attrs.color,
25
25
  style = _node$attrs.style,
26
26
  localId = _node$attrs.localId;
27
- var editorNodeWrapperAttrs = {
27
+ var editorNodeWrapperAttrs = _objectSpread({
28
28
  class: 'statusView-content-wrap inlineNodeView',
29
29
  'data-testid': 'statusContainerView',
30
30
  'data-prosemirror-node-name': 'status',
31
31
  localid: localId
32
- };
32
+ }, (0, _expValEquals.expValEquals)('platform_editor_copy_paste_issue_fix', 'isEnabled', true) ? {
33
+ 'data-node-type': 'status',
34
+ 'data-color': color,
35
+ 'data-text': text // Text stored as attribute for parseDOM extraction
36
+ } : {});
33
37
  var statusElementAttrs = {
34
38
  style: (0, _lazyNodeView.convertToInlineCss)(isAndroidChromium ? {
35
39
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
@@ -341,7 +341,7 @@ var StatusPickerWithIntl = /*#__PURE__*/function (_React$Component) {
341
341
  return null;
342
342
  }
343
343
  return target && (0, _react2.jsx)(PopupWithListeners, {
344
- ariaLabel: (0, _platformFeatureFlags.fg)('editor_a11y_aria_label_removal_popup') ? intl.formatMessage(_messages.statusMessages.statusEditorLabel) : undefined,
344
+ ariaLabel: (0, _platformFeatureFlags.fg)('_editor_a11y_aria_label_removal_popup') ? intl.formatMessage(_messages.statusMessages.statusEditorLabel) : undefined,
345
345
  target: target,
346
346
  offset: [0, 8],
347
347
  handleClickOutside: this.handleClickOutside,
@@ -1,6 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { statusMessages as messages } from '@atlaskit/editor-common/messages';
3
3
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  import { statusToDOM } from './statusNodeSpec';
5
6
 
6
7
  /**
@@ -50,10 +51,20 @@ export class StatusNodeView {
50
51
  }
51
52
  if (this.textContainer && node.attrs.text !== this.node.attrs.text) {
52
53
  this.textContainer.textContent = node.attrs.text;
54
+ // Also update data-text on outer wrapper for parseDOM extraction when copying
55
+ if (expValEquals('platform_editor_copy_paste_issue_fix', 'isEnabled', true)) {
56
+ var _this$domElement;
57
+ (_this$domElement = this.domElement) === null || _this$domElement === void 0 ? void 0 : _this$domElement.setAttribute('data-text', node.attrs.text);
58
+ }
53
59
  }
54
60
  if (node.attrs.color !== this.node.attrs.color) {
55
61
  var _this$box;
56
62
  (_this$box = this.box) === null || _this$box === void 0 ? void 0 : _this$box.setAttribute('data-color', node.attrs.color);
63
+ // Also update data-color on outer wrapper for parseDOM extraction when copying
64
+ if (expValEquals('platform_editor_copy_paste_issue_fix', 'isEnabled', true)) {
65
+ var _this$domElement2;
66
+ (_this$domElement2 = this.domElement) === null || _this$domElement2 === void 0 ? void 0 : _this$domElement2.setAttribute('data-color', node.attrs.color);
67
+ }
57
68
  }
58
69
  if (!node.attrs.text) {
59
70
  this.setPlaceholder();
@@ -20,7 +20,13 @@ export const statusToDOM = node => {
20
20
  class: 'statusView-content-wrap inlineNodeView',
21
21
  'data-testid': 'statusContainerView',
22
22
  'data-prosemirror-node-name': 'status',
23
- localid: localId
23
+ localid: localId,
24
+ // Required for parseDOM to correctly parse status when NodeView DOM is copied directly
25
+ ...(expValEquals('platform_editor_copy_paste_issue_fix', 'isEnabled', true) ? {
26
+ 'data-node-type': 'status',
27
+ 'data-color': color,
28
+ 'data-text': text // Text stored as attribute for parseDOM extraction
29
+ } : {})
24
30
  };
25
31
  const statusElementAttrs = {
26
32
  style: convertToInlineCss(isAndroidChromium ? {
@@ -311,7 +311,7 @@ class StatusPickerWithIntl extends React.Component {
311
311
  return null;
312
312
  }
313
313
  return target && jsx(PopupWithListeners, {
314
- ariaLabel: fg('editor_a11y_aria_label_removal_popup') ? intl.formatMessage(messages.statusEditorLabel) : undefined,
314
+ ariaLabel: fg('_editor_a11y_aria_label_removal_popup') ? intl.formatMessage(messages.statusEditorLabel) : undefined,
315
315
  target: target,
316
316
  offset: [0, 8],
317
317
  handleClickOutside: this.handleClickOutside,
@@ -3,6 +3,7 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import { statusMessages as messages } from '@atlaskit/editor-common/messages';
5
5
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
6
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
7
  import { statusToDOM } from './statusNodeSpec';
7
8
 
8
9
  /**
@@ -56,10 +57,20 @@ export var StatusNodeView = /*#__PURE__*/function () {
56
57
  }
57
58
  if (this.textContainer && node.attrs.text !== this.node.attrs.text) {
58
59
  this.textContainer.textContent = node.attrs.text;
60
+ // Also update data-text on outer wrapper for parseDOM extraction when copying
61
+ if (expValEquals('platform_editor_copy_paste_issue_fix', 'isEnabled', true)) {
62
+ var _this$domElement;
63
+ (_this$domElement = this.domElement) === null || _this$domElement === void 0 || _this$domElement.setAttribute('data-text', node.attrs.text);
64
+ }
59
65
  }
60
66
  if (node.attrs.color !== this.node.attrs.color) {
61
67
  var _this$box;
62
68
  (_this$box = this.box) === null || _this$box === void 0 || _this$box.setAttribute('data-color', node.attrs.color);
69
+ // Also update data-color on outer wrapper for parseDOM extraction when copying
70
+ if (expValEquals('platform_editor_copy_paste_issue_fix', 'isEnabled', true)) {
71
+ var _this$domElement2;
72
+ (_this$domElement2 = this.domElement) === null || _this$domElement2 === void 0 || _this$domElement2.setAttribute('data-color', node.attrs.color);
73
+ }
63
74
  }
64
75
  if (!node.attrs.text) {
65
76
  this.setPlaceholder();
@@ -18,12 +18,16 @@ export var statusToDOM = function statusToDOM(node) {
18
18
  color = _node$attrs.color,
19
19
  style = _node$attrs.style,
20
20
  localId = _node$attrs.localId;
21
- var editorNodeWrapperAttrs = {
21
+ var editorNodeWrapperAttrs = _objectSpread({
22
22
  class: 'statusView-content-wrap inlineNodeView',
23
23
  'data-testid': 'statusContainerView',
24
24
  'data-prosemirror-node-name': 'status',
25
25
  localid: localId
26
- };
26
+ }, expValEquals('platform_editor_copy_paste_issue_fix', 'isEnabled', true) ? {
27
+ 'data-node-type': 'status',
28
+ 'data-color': color,
29
+ 'data-text': text // Text stored as attribute for parseDOM extraction
30
+ } : {});
27
31
  var statusElementAttrs = {
28
32
  style: convertToInlineCss(isAndroidChromium ? {
29
33
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
@@ -338,7 +338,7 @@ var StatusPickerWithIntl = /*#__PURE__*/function (_React$Component) {
338
338
  return null;
339
339
  }
340
340
  return target && jsx(PopupWithListeners, {
341
- ariaLabel: fg('editor_a11y_aria_label_removal_popup') ? intl.formatMessage(messages.statusEditorLabel) : undefined,
341
+ ariaLabel: fg('_editor_a11y_aria_label_removal_popup') ? intl.formatMessage(messages.statusEditorLabel) : undefined,
342
342
  target: target,
343
343
  offset: [0, 8],
344
344
  handleClickOutside: this.handleClickOutside,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-status",
3
- "version": "8.1.1",
3
+ "version": "8.1.3",
4
4
  "description": "Status plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,18 +34,18 @@
34
34
  "@atlaskit/editor-plugin-analytics": "^7.0.0",
35
35
  "@atlaskit/editor-prosemirror": "^7.2.0",
36
36
  "@atlaskit/editor-shared-styles": "^3.10.0",
37
- "@atlaskit/icon": "^29.4.0",
37
+ "@atlaskit/icon": "^30.0.0",
38
38
  "@atlaskit/platform-feature-flags": "^1.1.0",
39
39
  "@atlaskit/status": "^3.1.0",
40
40
  "@atlaskit/theme": "^21.0.0",
41
- "@atlaskit/tmp-editor-statsig": "^16.23.0",
42
- "@atlaskit/tokens": "^10.0.0",
41
+ "@atlaskit/tmp-editor-statsig": "^16.34.0",
42
+ "@atlaskit/tokens": "^10.1.0",
43
43
  "@atlaskit/visually-hidden": "^3.0.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@emotion/react": "^11.7.1"
46
46
  },
47
47
  "peerDependencies": {
48
- "@atlaskit/editor-common": "^111.8.0",
48
+ "@atlaskit/editor-common": "^111.9.0",
49
49
  "react": "^18.2.0",
50
50
  "react-dom": "^18.2.0",
51
51
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -94,7 +94,7 @@
94
94
  "platform-component-visual-refresh": {
95
95
  "type": "boolean"
96
96
  },
97
- "editor_a11y_aria_label_removal_popup": {
97
+ "_editor_a11y_aria_label_removal_popup": {
98
98
  "type": "boolean"
99
99
  },
100
100
  "platform-lozenge-custom-letterspacing": {