@atlaskit/editor-plugin-status 8.1.1 → 8.1.2

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,13 @@
1
1
  # @atlaskit/editor-plugin-status
2
2
 
3
+ ## 8.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8eca3ae04714e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8eca3ae04714e) -
8
+ Fixed mixed HTML/Editor content copy/paste issue on Status node.
9
+ - Updated dependencies
10
+
3
11
  ## 8.1.1
4
12
 
5
13
  ### 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
@@ -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 ? {
@@ -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
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.2",
4
4
  "description": "Status plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,12 +34,12 @@
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.30.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"