@atlaskit/editor-plugin-panel 5.4.6 → 6.0.1

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-panel
2
2
 
3
+ ## 6.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`5f1d8eb6b1fa2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5f1d8eb6b1fa2) -
8
+ EDITOR-1464 Update toDOM methods to include localId
9
+ - Updated dependencies
10
+
11
+ ## 6.0.0
12
+
13
+ ### Patch Changes
14
+
15
+ - [`e882e86092666`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e882e86092666) -
16
+ [ux] Register expand, layout and code block itmes in block menu. Update panel item.
17
+ - Updated dependencies
18
+
3
19
  ## 5.4.6
4
20
 
5
21
  ### Patch Changes
@@ -37,7 +37,7 @@ var panelPlugin = function panelPlugin(_ref) {
37
37
  key: _blockMenu.FORMAT_PANEL_MENU_ITEM.key,
38
38
  parent: {
39
39
  type: 'block-menu-section',
40
- key: 'nested-menu-format-section-primary',
40
+ key: _blockMenu.FORMAT_MENU_ITEM.key,
41
41
  rank: _blockMenu.FORMAT_NESTED_MENU_RANK[_blockMenu.FORMAT_PANEL_MENU_ITEM.key]
42
42
  },
43
43
  component: (0, _panelBlockMenuItem.createPanelBlockMenuItem)(api)
@@ -42,6 +42,11 @@ var panelAttrsToDom = exports.panelAttrsToDom = function panelAttrsToDom(attrs,
42
42
  'data-panel-icon-text': panelIconText
43
43
  });
44
44
  }
45
+ if ((0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid')) {
46
+ panelAttrs = _objectSpread(_objectSpread({}, panelAttrs), {}, {
47
+ 'data-local-id': attrs.localId
48
+ });
49
+ }
45
50
  var iconDiv = ['div',
46
51
  // EDITOR-266 This fixes an issue in LCM where if you have nested panels
47
52
  // The icon colour will be overridden by the parent panel style, this is used to create a more specific css selector
@@ -14,6 +14,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
14
14
  var _editorToolbar = require("@atlaskit/editor-toolbar");
15
15
  var _informationCircle = _interopRequireDefault(require("@atlaskit/icon/core/information-circle"));
16
16
  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); }
17
+ var nodeName = 'panel';
17
18
  var PanelBlockMenuItem = function PanelBlockMenuItem(_ref) {
18
19
  var api = _ref.api;
19
20
  var _useIntl = (0, _reactIntlNext.useIntl)(),
@@ -25,13 +26,13 @@ var PanelBlockMenuItem = function PanelBlockMenuItem(_ref) {
25
26
  }
26
27
  if (selection instanceof _state.NodeSelection) {
27
28
  // Note: we are checking for any type of panel, not just of type infopanel
28
- return selection.node.type.name === 'panel';
29
+ return selection.node.type.name === nodeName;
29
30
  }
30
31
  return false;
31
32
  }, [selection]);
32
33
  var handleClick = function handleClick() {
33
34
  var _api$blockMenu;
34
- api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode('panel'));
35
+ api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode(nodeName));
35
36
  };
36
37
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
37
38
  onClick: handleClick,
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { extendedPanel, extendedPanelWithLocalId, PanelType } from '@atlaskit/adf-schema';
3
3
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
- import { FORMAT_PANEL_MENU_ITEM, FORMAT_NESTED_MENU_RANK } from '@atlaskit/editor-common/block-menu';
4
+ import { FORMAT_MENU_ITEM, FORMAT_PANEL_MENU_ITEM, FORMAT_NESTED_MENU_RANK } from '@atlaskit/editor-common/block-menu';
5
5
  import { insertSelectedItem } from '@atlaskit/editor-common/insert';
6
6
  import { blockTypeMessages } from '@atlaskit/editor-common/messages';
7
7
  import { IconCustomPanel, IconPanel, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning } from '@atlaskit/editor-common/quick-insert';
@@ -27,7 +27,7 @@ const panelPlugin = ({
27
27
  key: FORMAT_PANEL_MENU_ITEM.key,
28
28
  parent: {
29
29
  type: 'block-menu-section',
30
- key: 'nested-menu-format-section-primary',
30
+ key: FORMAT_MENU_ITEM.key,
31
31
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_PANEL_MENU_ITEM.key]
32
32
  },
33
33
  component: createPanelBlockMenuItem(api)
@@ -37,6 +37,12 @@ export const panelAttrsToDom = (attrs, allowCustomPanel) => {
37
37
  'data-panel-icon-text': panelIconText
38
38
  };
39
39
  }
40
+ if (fg('platform_editor_adf_with_localid')) {
41
+ panelAttrs = {
42
+ ...panelAttrs,
43
+ 'data-local-id': attrs.localId
44
+ };
45
+ }
40
46
  const iconDiv = ['div',
41
47
  // EDITOR-266 This fixes an issue in LCM where if you have nested panels
42
48
  // The icon colour will be overridden by the parent panel style, this is used to create a more specific css selector
@@ -5,6 +5,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
5
5
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
6
6
  import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
7
7
  import InformationCircleIcon from '@atlaskit/icon/core/information-circle';
8
+ const nodeName = 'panel';
8
9
  const PanelBlockMenuItem = ({
9
10
  api
10
11
  }) => {
@@ -18,13 +19,13 @@ const PanelBlockMenuItem = ({
18
19
  }
19
20
  if (selection instanceof NodeSelection) {
20
21
  // Note: we are checking for any type of panel, not just of type infopanel
21
- return selection.node.type.name === 'panel';
22
+ return selection.node.type.name === nodeName;
22
23
  }
23
24
  return false;
24
25
  }, [selection]);
25
26
  const handleClick = () => {
26
27
  var _api$blockMenu;
27
- api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode('panel'));
28
+ api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode(nodeName));
28
29
  };
29
30
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
30
31
  onClick: handleClick,
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import React from 'react';
5
5
  import { extendedPanel, extendedPanelWithLocalId, PanelType } from '@atlaskit/adf-schema';
6
6
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
7
- import { FORMAT_PANEL_MENU_ITEM, FORMAT_NESTED_MENU_RANK } from '@atlaskit/editor-common/block-menu';
7
+ import { FORMAT_MENU_ITEM, FORMAT_PANEL_MENU_ITEM, FORMAT_NESTED_MENU_RANK } from '@atlaskit/editor-common/block-menu';
8
8
  import { insertSelectedItem } from '@atlaskit/editor-common/insert';
9
9
  import { blockTypeMessages } from '@atlaskit/editor-common/messages';
10
10
  import { IconCustomPanel, IconPanel, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning } from '@atlaskit/editor-common/quick-insert';
@@ -30,7 +30,7 @@ var panelPlugin = function panelPlugin(_ref) {
30
30
  key: FORMAT_PANEL_MENU_ITEM.key,
31
31
  parent: {
32
32
  type: 'block-menu-section',
33
- key: 'nested-menu-format-section-primary',
33
+ key: FORMAT_MENU_ITEM.key,
34
34
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_PANEL_MENU_ITEM.key]
35
35
  },
36
36
  component: createPanelBlockMenuItem(api)
@@ -35,6 +35,11 @@ export var panelAttrsToDom = function panelAttrsToDom(attrs, allowCustomPanel) {
35
35
  'data-panel-icon-text': panelIconText
36
36
  });
37
37
  }
38
+ if (fg('platform_editor_adf_with_localid')) {
39
+ panelAttrs = _objectSpread(_objectSpread({}, panelAttrs), {}, {
40
+ 'data-local-id': attrs.localId
41
+ });
42
+ }
38
43
  var iconDiv = ['div',
39
44
  // EDITOR-266 This fixes an issue in LCM where if you have nested panels
40
45
  // The icon colour will be overridden by the parent panel style, this is used to create a more specific css selector
@@ -5,6 +5,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
5
5
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
6
6
  import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
7
7
  import InformationCircleIcon from '@atlaskit/icon/core/information-circle';
8
+ var nodeName = 'panel';
8
9
  var PanelBlockMenuItem = function PanelBlockMenuItem(_ref) {
9
10
  var api = _ref.api;
10
11
  var _useIntl = useIntl(),
@@ -16,13 +17,13 @@ var PanelBlockMenuItem = function PanelBlockMenuItem(_ref) {
16
17
  }
17
18
  if (selection instanceof NodeSelection) {
18
19
  // Note: we are checking for any type of panel, not just of type infopanel
19
- return selection.node.type.name === 'panel';
20
+ return selection.node.type.name === nodeName;
20
21
  }
21
22
  return false;
22
23
  }, [selection]);
23
24
  var handleClick = function handleClick() {
24
25
  var _api$blockMenu;
25
- api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode('panel'));
26
+ api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode(nodeName));
26
27
  };
27
28
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
28
29
  onClick: handleClick,
@@ -15,6 +15,7 @@ export interface PanelPluginConfig {
15
15
  }
16
16
  export type DomPanelAtrrs = {
17
17
  class: string;
18
+ 'data-local-id'?: string;
18
19
  'data-panel-color'?: string;
19
20
  'data-panel-icon-id'?: string;
20
21
  'data-panel-icon-text'?: string;
@@ -15,6 +15,7 @@ export interface PanelPluginConfig {
15
15
  }
16
16
  export type DomPanelAtrrs = {
17
17
  class: string;
18
+ 'data-local-id'?: string;
18
19
  'data-panel-color'?: string;
19
20
  'data-panel-icon-id'?: string;
20
21
  'data-panel-icon-text'?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-panel",
3
- "version": "5.4.6",
3
+ "version": "6.0.1",
4
4
  "description": "Panel plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,11 +29,11 @@
29
29
  "dependencies": {
30
30
  "@atlaskit/adf-schema": "^50.2.3",
31
31
  "@atlaskit/editor-palette": "^2.1.0",
32
- "@atlaskit/editor-plugin-analytics": "^3.0.0",
33
- "@atlaskit/editor-plugin-block-menu": "^0.0.20",
34
- "@atlaskit/editor-plugin-decorations": "^3.1.0",
35
- "@atlaskit/editor-plugin-emoji": "^4.3.0",
36
- "@atlaskit/editor-plugin-selection": "^3.2.0",
32
+ "@atlaskit/editor-plugin-analytics": "^4.0.0",
33
+ "@atlaskit/editor-plugin-block-menu": "^1.0.0",
34
+ "@atlaskit/editor-plugin-decorations": "^4.0.0",
35
+ "@atlaskit/editor-plugin-emoji": "^5.0.0",
36
+ "@atlaskit/editor-plugin-selection": "^4.0.0",
37
37
  "@atlaskit/editor-prosemirror": "7.0.0",
38
38
  "@atlaskit/editor-shared-styles": "^3.6.0",
39
39
  "@atlaskit/editor-toolbar": "^0.6.0",
@@ -41,13 +41,13 @@
41
41
  "@atlaskit/icon": "^28.1.0",
42
42
  "@atlaskit/platform-feature-flags": "^1.1.0",
43
43
  "@atlaskit/theme": "^20.0.0",
44
- "@atlaskit/tmp-editor-statsig": "^11.12.0",
44
+ "@atlaskit/tmp-editor-statsig": "^12.0.0",
45
45
  "@atlaskit/tokens": "^6.1.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "uuid": "^3.1.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "@atlaskit/editor-common": "^107.35.0",
50
+ "@atlaskit/editor-common": "^108.0.0",
51
51
  "react": "^18.2.0",
52
52
  "react-dom": "^18.2.0",
53
53
  "react-intl-next": "npm:react-intl@^5.18.1"