@atlaskit/editor-plugin-panel 8.1.13 → 8.1.15

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,19 @@
1
1
  # @atlaskit/editor-plugin-panel
2
2
 
3
+ ## 8.1.15
4
+
5
+ ### Patch Changes
6
+
7
+ - [`55920a92e882a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/55920a92e882a) -
8
+ tsignores added for help-center local consumpton removed
9
+ - Updated dependencies
10
+
11
+ ## 8.1.14
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 8.1.13
4
18
 
5
19
  ### Patch Changes
@@ -15,11 +15,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
15
15
  useLongPressSelection = _pluginOptions$useLon === void 0 ? false : _pluginOptions$useLon;
16
16
  return new _safePlugin.SafePlugin({
17
17
  key: _panelPluginType.pluginKey,
18
- // @ts-ignore - Workaround for help-center local consumption
19
-
20
18
  appendTransaction: function appendTransaction(transactions, oldState, newState) {
21
- // @ts-ignore - Workaround for help-center local consumption
22
-
23
19
  var tr = transactions.find(function (tr) {
24
20
  return tr.getMeta('uiEvent') === 'cut';
25
21
  });
@@ -28,8 +24,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
28
24
  }
29
25
  },
30
26
  props: {
31
- // @ts-ignore - Workaround for help-center local consumption
32
-
33
27
  nodeViews: {
34
28
  panel: (0, _panel2.getPanelNodeView)(pluginOptions, api, nodeViewPortalProviderAPI, providerFactory)
35
29
  },
@@ -32,13 +32,20 @@ var PanelBlockMenuItem = function PanelBlockMenuItem(_ref) {
32
32
  return false;
33
33
  }, [selection]);
34
34
  var handleClick = function handleClick(event) {
35
- var _api$blockMenu;
36
35
  var triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? _analytics.INPUT_METHOD.KEYBOARD : _analytics.INPUT_METHOD.MOUSE;
37
36
  var inputMethod = _analytics.INPUT_METHOD.BLOCK_MENU;
38
- selection && (api === null || api === void 0 ? 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.transformNode(selection.$from.doc.type.schema.nodes.panel, {
39
- inputMethod: inputMethod,
40
- triggeredFrom: triggeredFrom
41
- })));
37
+ api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
38
+ var _api$blockMenu;
39
+ var tr = _ref2.tr;
40
+ var command = api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.panel, {
41
+ inputMethod: inputMethod,
42
+ triggeredFrom: triggeredFrom,
43
+ targetTypeName: nodeName
44
+ });
45
+ return command ? command({
46
+ tr: tr
47
+ }) : null;
48
+ });
42
49
  };
43
50
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
44
51
  onClick: handleClick,
@@ -10,19 +10,13 @@ export const createPlugin = (dispatch, providerFactory, pluginOptions, api, node
10
10
  } = pluginOptions;
11
11
  return new SafePlugin({
12
12
  key: pluginKey,
13
- // @ts-ignore - Workaround for help-center local consumption
14
-
15
13
  appendTransaction: (transactions, oldState, newState) => {
16
- // @ts-ignore - Workaround for help-center local consumption
17
-
18
14
  const tr = transactions.find(tr => tr.getMeta('uiEvent') === 'cut');
19
15
  if (tr) {
20
16
  return handleCut(newState, oldState);
21
17
  }
22
18
  },
23
19
  props: {
24
- // @ts-ignore - Workaround for help-center local consumption
25
-
26
20
  nodeViews: {
27
21
  panel: getPanelNodeView(pluginOptions, api, nodeViewPortalProviderAPI, providerFactory)
28
22
  },
@@ -25,13 +25,21 @@ const PanelBlockMenuItem = ({
25
25
  return false;
26
26
  }, [selection]);
27
27
  const handleClick = event => {
28
- var _api$blockMenu;
29
28
  const triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? INPUT_METHOD.KEYBOARD : INPUT_METHOD.MOUSE;
30
29
  const inputMethod = INPUT_METHOD.BLOCK_MENU;
31
- selection && (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.transformNode(selection.$from.doc.type.schema.nodes.panel, {
32
- inputMethod,
33
- triggeredFrom
34
- })));
30
+ api === null || api === void 0 ? void 0 : api.core.actions.execute(({
31
+ tr
32
+ }) => {
33
+ var _api$blockMenu;
34
+ const command = api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.panel, {
35
+ inputMethod,
36
+ triggeredFrom,
37
+ targetTypeName: nodeName
38
+ });
39
+ return command ? command({
40
+ tr
41
+ }) : null;
42
+ });
35
43
  };
36
44
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
37
45
  onClick: handleClick,
@@ -9,11 +9,7 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, plugi
9
9
  useLongPressSelection = _pluginOptions$useLon === void 0 ? false : _pluginOptions$useLon;
10
10
  return new SafePlugin({
11
11
  key: pluginKey,
12
- // @ts-ignore - Workaround for help-center local consumption
13
-
14
12
  appendTransaction: function appendTransaction(transactions, oldState, newState) {
15
- // @ts-ignore - Workaround for help-center local consumption
16
-
17
13
  var tr = transactions.find(function (tr) {
18
14
  return tr.getMeta('uiEvent') === 'cut';
19
15
  });
@@ -22,8 +18,6 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, plugi
22
18
  }
23
19
  },
24
20
  props: {
25
- // @ts-ignore - Workaround for help-center local consumption
26
-
27
21
  nodeViews: {
28
22
  panel: getPanelNodeView(pluginOptions, api, nodeViewPortalProviderAPI, providerFactory)
29
23
  },
@@ -23,13 +23,20 @@ var PanelBlockMenuItem = function PanelBlockMenuItem(_ref) {
23
23
  return false;
24
24
  }, [selection]);
25
25
  var handleClick = function handleClick(event) {
26
- var _api$blockMenu;
27
26
  var triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? INPUT_METHOD.KEYBOARD : INPUT_METHOD.MOUSE;
28
27
  var inputMethod = INPUT_METHOD.BLOCK_MENU;
29
- selection && (api === null || api === void 0 ? 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.transformNode(selection.$from.doc.type.schema.nodes.panel, {
30
- inputMethod: inputMethod,
31
- triggeredFrom: triggeredFrom
32
- })));
28
+ api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
29
+ var _api$blockMenu;
30
+ var tr = _ref2.tr;
31
+ var command = api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.panel, {
32
+ inputMethod: inputMethod,
33
+ triggeredFrom: triggeredFrom,
34
+ targetTypeName: nodeName
35
+ });
36
+ return command ? command({
37
+ tr: tr
38
+ }) : null;
39
+ });
33
40
  };
34
41
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
35
42
  onClick: handleClick,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-panel",
3
- "version": "8.1.13",
3
+ "version": "8.1.15",
4
4
  "description": "Panel plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,19 +30,19 @@
30
30
  "@atlaskit/adf-schema": "^51.4.0",
31
31
  "@atlaskit/editor-palette": "^2.1.0",
32
32
  "@atlaskit/editor-plugin-analytics": "^6.2.0",
33
- "@atlaskit/editor-plugin-block-menu": "^5.0.0",
33
+ "@atlaskit/editor-plugin-block-menu": "^5.1.0",
34
34
  "@atlaskit/editor-plugin-decorations": "^6.1.0",
35
35
  "@atlaskit/editor-plugin-emoji": "^7.7.0",
36
36
  "@atlaskit/editor-plugin-selection": "^6.1.0",
37
37
  "@atlaskit/editor-plugin-toolbar": "^3.4.0",
38
38
  "@atlaskit/editor-prosemirror": "7.0.0",
39
39
  "@atlaskit/editor-shared-styles": "^3.10.0",
40
- "@atlaskit/editor-toolbar": "^0.17.0",
40
+ "@atlaskit/editor-toolbar": "^0.18.0",
41
41
  "@atlaskit/emoji": "^69.8.0",
42
42
  "@atlaskit/icon": "^29.0.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
44
  "@atlaskit/theme": "^21.0.0",
45
- "@atlaskit/tmp-editor-statsig": "^14.0.0",
45
+ "@atlaskit/tmp-editor-statsig": "^14.2.0",
46
46
  "@atlaskit/tokens": "^8.4.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "uuid": "^3.1.0"