@atlaskit/editor-plugin-panel 9.0.2 → 9.0.4

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,18 @@
1
1
  # @atlaskit/editor-plugin-panel
2
2
 
3
+ ## 9.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`549df2f66099e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/549df2f66099e) -
8
+ Fixed mixed HTML/Editor content copy/paste issue on Custom Panel node.
9
+
10
+ ## 9.0.3
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 9.0.2
4
17
 
5
18
  ### Patch Changes
@@ -12,6 +12,7 @@ var _editorPalette = require("@atlaskit/editor-palette");
12
12
  var _state = require("@atlaskit/editor-prosemirror/state");
13
13
  var _utils = require("@atlaskit/editor-prosemirror/utils");
14
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
15
16
  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; }
16
17
  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; }
17
18
  var findPanel = exports.findPanel = function findPanel(state, selection) {
@@ -42,6 +43,13 @@ var panelAttrsToDom = exports.panelAttrsToDom = function panelAttrsToDom(attrs,
42
43
  'data-panel-icon-text': panelIconText
43
44
  });
44
45
  }
46
+ // Required for parseDOM to correctly parse custom panel when NodeView DOM is copied directly
47
+ // Schema's parseDOM expects data-panel-icon on all custom panels, not just ones with color
48
+ if (isCustomPanel && (0, _expValEquals.expValEquals)('platform_editor_copy_paste_issue_fix', 'isEnabled', true)) {
49
+ panelAttrs = _objectSpread(_objectSpread({}, panelAttrs), {}, {
50
+ 'data-panel-icon': panelIcon
51
+ });
52
+ }
45
53
  if ((0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid')) {
46
54
  panelAttrs = _objectSpread(_objectSpread({}, panelAttrs), {}, {
47
55
  'data-local-id': attrs.localId
@@ -4,6 +4,7 @@ import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
4
4
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { findParentNode, findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
6
6
  import { fg } from '@atlaskit/platform-feature-flags';
7
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
8
  export const findPanel = (state, selection) => {
8
9
  const {
9
10
  panel
@@ -37,6 +38,14 @@ export const panelAttrsToDom = (attrs, allowCustomPanel) => {
37
38
  'data-panel-icon-text': panelIconText
38
39
  };
39
40
  }
41
+ // Required for parseDOM to correctly parse custom panel when NodeView DOM is copied directly
42
+ // Schema's parseDOM expects data-panel-icon on all custom panels, not just ones with color
43
+ if (isCustomPanel && expValEquals('platform_editor_copy_paste_issue_fix', 'isEnabled', true)) {
44
+ panelAttrs = {
45
+ ...panelAttrs,
46
+ 'data-panel-icon': panelIcon
47
+ };
48
+ }
40
49
  if (fg('platform_editor_adf_with_localid')) {
41
50
  panelAttrs = {
42
51
  ...panelAttrs,
@@ -7,6 +7,7 @@ import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
7
7
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
8
8
  import { findParentNode, findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
11
  export var findPanel = function findPanel(state, selection) {
11
12
  var panel = state.schema.nodes.panel;
12
13
  return findSelectedNodeOfType(panel)(selection || state.selection) || findParentNodeOfType(panel)(selection || state.selection);
@@ -35,6 +36,13 @@ export var panelAttrsToDom = function panelAttrsToDom(attrs, allowCustomPanel) {
35
36
  'data-panel-icon-text': panelIconText
36
37
  });
37
38
  }
39
+ // Required for parseDOM to correctly parse custom panel when NodeView DOM is copied directly
40
+ // Schema's parseDOM expects data-panel-icon on all custom panels, not just ones with color
41
+ if (isCustomPanel && expValEquals('platform_editor_copy_paste_issue_fix', 'isEnabled', true)) {
42
+ panelAttrs = _objectSpread(_objectSpread({}, panelAttrs), {}, {
43
+ 'data-panel-icon': panelIcon
44
+ });
45
+ }
38
46
  if (fg('platform_editor_adf_with_localid')) {
39
47
  panelAttrs = _objectSpread(_objectSpread({}, panelAttrs), {}, {
40
48
  'data-local-id': attrs.localId
@@ -18,6 +18,7 @@ export type DomPanelAtrrs = {
18
18
  class: string;
19
19
  'data-local-id'?: string;
20
20
  'data-panel-color'?: string;
21
+ 'data-panel-icon'?: string;
21
22
  'data-panel-icon-id'?: string;
22
23
  'data-panel-icon-text'?: string;
23
24
  'data-panel-type': string;
@@ -18,6 +18,7 @@ export type DomPanelAtrrs = {
18
18
  class: string;
19
19
  'data-local-id'?: string;
20
20
  'data-panel-color'?: string;
21
+ 'data-panel-icon'?: string;
21
22
  'data-panel-icon-id'?: string;
22
23
  'data-panel-icon-text'?: string;
23
24
  'data-panel-type': string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-panel",
3
- "version": "9.0.2",
3
+ "version": "9.0.4",
4
4
  "description": "Panel plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,13 +42,13 @@
42
42
  "@atlaskit/icon": "^29.4.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
44
  "@atlaskit/theme": "^21.0.0",
45
- "@atlaskit/tmp-editor-statsig": "^16.11.0",
46
- "@atlaskit/tokens": "^9.1.0",
45
+ "@atlaskit/tmp-editor-statsig": "^16.28.0",
46
+ "@atlaskit/tokens": "^10.1.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "uuid": "^3.1.0"
49
49
  },
50
50
  "peerDependencies": {
51
- "@atlaskit/editor-common": "^111.7.0",
51
+ "@atlaskit/editor-common": "^111.8.0",
52
52
  "react": "^18.2.0",
53
53
  "react-dom": "^18.2.0",
54
54
  "react-intl-next": "npm:react-intl@^5.18.1"