@atlaskit/editor-plugin-extension 5.5.8 → 5.5.9

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,14 @@
1
1
  # @atlaskit/editor-plugin-extension
2
2
 
3
+ ## 5.5.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#172583](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/172583)
8
+ [`40f387a0c0962`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/40f387a0c0962) -
9
+ Clean up platform_editor_controls_patch_2
10
+ - Updated dependencies
11
+
3
12
  ## 5.5.8
4
13
 
5
14
  ### Patch Changes
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.getToolbarConfig = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
9
  var _react = _interopRequireDefault(require("react"));
11
10
  var _analytics = require("@atlaskit/editor-common/analytics");
@@ -14,10 +13,8 @@ var _messages = _interopRequireDefault(require("@atlaskit/editor-common/messages
14
13
  var _styles = require("@atlaskit/editor-common/styles");
15
14
  var _utils = require("@atlaskit/editor-common/utils");
16
15
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
17
- var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
18
16
  var _contentWidthNarrow = _interopRequireDefault(require("@atlaskit/icon/core/content-width-narrow"));
19
17
  var _contentWidthWide = _interopRequireDefault(require("@atlaskit/icon/core/content-width-wide"));
20
- var _copy = _interopRequireDefault(require("@atlaskit/icon/core/copy"));
21
18
  var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
22
19
  var _expandHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/expand-horizontal"));
23
20
  var _editEditorEdit = _interopRequireDefault(require("@atlaskit/icon/core/migration/edit--editor-edit"));
@@ -28,8 +25,6 @@ var _commands = require("../editor-commands/commands");
28
25
  var _pluginKey = require("./macro/plugin-key");
29
26
  var _pluginFactory = require("./plugin-factory");
30
27
  var _utils3 = require("./utils");
31
- 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; }
32
- 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; }
33
28
  // non-bodied extensions nested inside panels, blockquotes and lists do not support layouts
34
29
  var isNestedNBM = function isNestedNBM(state, selectedExtNode) {
35
30
  var _state$schema$nodes = state.schema.nodes,
@@ -301,18 +296,6 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
301
296
  };
302
297
  };
303
298
  }
304
- var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
305
- return {
306
- onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
307
- onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false, className),
308
- onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
309
- onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false, className)
310
- };
311
- };
312
-
313
- // testId is required to show focus on trigger button on ESC key press
314
- // see hideOnEsc in platform/packages/editor/editor-plugin-floating-toolbar/src/ui/Dropdown.tsx
315
- var testId = (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_8') ? 'extension-overflow-dropdown-trigger' : undefined;
316
299
  return {
317
300
  title: 'Extension floating controls',
318
301
  // Ignored via go/ees005
@@ -324,7 +307,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
324
307
  onPositionCalculated: function onPositionCalculated(editorView, nextPos) {
325
308
  return calculateToolbarPosition(editorView, nextPos, state, extensionObj);
326
309
  },
327
- items: [].concat((0, _toConsumableArray2.default)(editButtonItems), (0, _toConsumableArray2.default)(breakoutItems), (0, _toConsumableArray2.default)((0, _experiments.editorExperiment)('platform_editor_controls', 'control') || (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_2') ? [{
310
+ items: [].concat((0, _toConsumableArray2.default)(editButtonItems), (0, _toConsumableArray2.default)(breakoutItems), [{
328
311
  type: 'separator',
329
312
  hidden: editButtonItems.length === 0 && breakoutItems.length === 0
330
313
  }, {
@@ -359,34 +342,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
359
342
  title: formatMessage(_messages.default.remove),
360
343
  tabIndex: null,
361
344
  confirmDialog: confirmDialog
362
- }] : [breakoutItems.length > 0 && {
363
- type: 'separator',
364
- fullHeight: true
365
- }, {
366
- type: 'extensions-placeholder',
367
- separator: breakoutItems.length > 0 ? 'both' : 'end'
368
- }, {
369
- type: 'overflow-dropdown',
370
- testId: testId,
371
- options: [_objectSpread({
372
- title: formatMessage(_messages.default.copyToClipboard),
373
- onClick: function onClick() {
374
- var _extensionApi$core, _extensionApi$floatin;
375
- extensionApi === null || extensionApi === void 0 || (_extensionApi$core = extensionApi.core) === null || _extensionApi$core === void 0 || _extensionApi$core.actions.execute( // @ts-ignore
376
- extensionApi === null || extensionApi === void 0 || (_extensionApi$floatin = extensionApi.floatingToolbar) === null || _extensionApi$floatin === void 0 ? void 0 : _extensionApi$floatin.commands.copyNode(nodeType, _analytics.INPUT_METHOD.FLOATING_TB));
377
- return true;
378
- },
379
- icon: /*#__PURE__*/_react.default.createElement(_copy.default, {
380
- label: ""
381
- })
382
- }, hoverDecorationProps(nodeType, _editorSharedStyles.akEditorSelectedNodeClassName)), _objectSpread({
383
- title: formatMessage(_messages.default.delete),
384
- onClick: (0, _commands.removeExtension)(editorAnalyticsAPI, _analytics.INPUT_METHOD.FLOATING_TB),
385
- icon: /*#__PURE__*/_react.default.createElement(_delete.default, {
386
- label: ""
387
- })
388
- }, hoverDecorationProps(nodeType))]
389
- }])),
345
+ }]),
390
346
  scrollable: true
391
347
  };
392
348
  };
@@ -5,10 +5,8 @@ import commonMessages from '@atlaskit/editor-common/messages';
5
5
  import { BODIED_EXT_MBE_MARGIN_TOP } from '@atlaskit/editor-common/styles';
6
6
  import { getChildrenInfo, getNodeName, isReferencedSource } from '@atlaskit/editor-common/utils';
7
7
  import { findParentNodeOfType, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
8
- import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
9
8
  import ContentWidthNarrowIcon from '@atlaskit/icon/core/content-width-narrow';
10
9
  import ContentWidthWideIcon from '@atlaskit/icon/core/content-width-wide';
11
- import CopyIcon from '@atlaskit/icon/core/copy';
12
10
  import DeleteIcon from '@atlaskit/icon/core/delete';
13
11
  import ExpandHorizontalIcon from '@atlaskit/icon/core/expand-horizontal';
14
12
  import EditIcon from '@atlaskit/icon/core/migration/edit--editor-edit';
@@ -296,16 +294,6 @@ export const getToolbarConfig = ({
296
294
  };
297
295
  };
298
296
  }
299
- const hoverDecorationProps = (nodeType, className) => ({
300
- onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
301
- onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false, className),
302
- onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
303
- onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false, className)
304
- });
305
-
306
- // testId is required to show focus on trigger button on ESC key press
307
- // see hideOnEsc in platform/packages/editor/editor-plugin-floating-toolbar/src/ui/Dropdown.tsx
308
- const testId = fg('platform_editor_controls_patch_8') ? 'extension-overflow-dropdown-trigger' : undefined;
309
297
  return {
310
298
  title: 'Extension floating controls',
311
299
  // Ignored via go/ees005
@@ -313,7 +301,7 @@ export const getToolbarConfig = ({
313
301
  getDomRef: () => extensionState.element.parentElement || undefined,
314
302
  nodeType,
315
303
  onPositionCalculated: (editorView, nextPos) => calculateToolbarPosition(editorView, nextPos, state, extensionObj),
316
- items: [...editButtonItems, ...breakoutItems, ...(editorExperiment('platform_editor_controls', 'control') || fg('platform_editor_controls_patch_2') ? [{
304
+ items: [...editButtonItems, ...breakoutItems, {
317
305
  type: 'separator',
318
306
  hidden: editButtonItems.length === 0 && breakoutItems.length === 0
319
307
  }, {
@@ -346,36 +334,7 @@ export const getToolbarConfig = ({
346
334
  title: formatMessage(commonMessages.remove),
347
335
  tabIndex: null,
348
336
  confirmDialog
349
- }] : [breakoutItems.length > 0 && {
350
- type: 'separator',
351
- fullHeight: true
352
- }, {
353
- type: 'extensions-placeholder',
354
- separator: breakoutItems.length > 0 ? 'both' : 'end'
355
- }, {
356
- type: 'overflow-dropdown',
357
- testId,
358
- options: [{
359
- title: formatMessage(commonMessages.copyToClipboard),
360
- onClick: () => {
361
- var _extensionApi$core, _extensionApi$floatin;
362
- extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$core = extensionApi.core) === null || _extensionApi$core === void 0 ? void 0 : _extensionApi$core.actions.execute( // @ts-ignore
363
- extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$floatin = extensionApi.floatingToolbar) === null || _extensionApi$floatin === void 0 ? void 0 : _extensionApi$floatin.commands.copyNode(nodeType, INPUT_METHOD.FLOATING_TB));
364
- return true;
365
- },
366
- icon: /*#__PURE__*/React.createElement(CopyIcon, {
367
- label: ""
368
- }),
369
- ...hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)
370
- }, {
371
- title: formatMessage(commonMessages.delete),
372
- onClick: removeExtension(editorAnalyticsAPI, INPUT_METHOD.FLOATING_TB),
373
- icon: /*#__PURE__*/React.createElement(DeleteIcon, {
374
- label: ""
375
- }),
376
- ...hoverDecorationProps(nodeType)
377
- }]
378
- }])],
337
+ }],
379
338
  scrollable: true
380
339
  };
381
340
  };
@@ -1,7 +1,4 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
- 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; }
4
- 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) { _defineProperty(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; }
5
2
  import React from 'react';
6
3
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
7
4
  import { messages } from '@atlaskit/editor-common/extensions';
@@ -9,10 +6,8 @@ import commonMessages from '@atlaskit/editor-common/messages';
9
6
  import { BODIED_EXT_MBE_MARGIN_TOP } from '@atlaskit/editor-common/styles';
10
7
  import { getChildrenInfo as _getChildrenInfo, getNodeName, isReferencedSource } from '@atlaskit/editor-common/utils';
11
8
  import { findParentNodeOfType, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
12
- import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
13
9
  import ContentWidthNarrowIcon from '@atlaskit/icon/core/content-width-narrow';
14
10
  import ContentWidthWideIcon from '@atlaskit/icon/core/content-width-wide';
15
- import CopyIcon from '@atlaskit/icon/core/copy';
16
11
  import DeleteIcon from '@atlaskit/icon/core/delete';
17
12
  import ExpandHorizontalIcon from '@atlaskit/icon/core/expand-horizontal';
18
13
  import EditIcon from '@atlaskit/icon/core/migration/edit--editor-edit';
@@ -295,18 +290,6 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
295
290
  };
296
291
  };
297
292
  }
298
- var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
299
- return {
300
- onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
301
- onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false, className),
302
- onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
303
- onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false, className)
304
- };
305
- };
306
-
307
- // testId is required to show focus on trigger button on ESC key press
308
- // see hideOnEsc in platform/packages/editor/editor-plugin-floating-toolbar/src/ui/Dropdown.tsx
309
- var testId = fg('platform_editor_controls_patch_8') ? 'extension-overflow-dropdown-trigger' : undefined;
310
293
  return {
311
294
  title: 'Extension floating controls',
312
295
  // Ignored via go/ees005
@@ -318,7 +301,7 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
318
301
  onPositionCalculated: function onPositionCalculated(editorView, nextPos) {
319
302
  return calculateToolbarPosition(editorView, nextPos, state, extensionObj);
320
303
  },
321
- items: [].concat(_toConsumableArray(editButtonItems), _toConsumableArray(breakoutItems), _toConsumableArray(editorExperiment('platform_editor_controls', 'control') || fg('platform_editor_controls_patch_2') ? [{
304
+ items: [].concat(_toConsumableArray(editButtonItems), _toConsumableArray(breakoutItems), [{
322
305
  type: 'separator',
323
306
  hidden: editButtonItems.length === 0 && breakoutItems.length === 0
324
307
  }, {
@@ -353,34 +336,7 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
353
336
  title: formatMessage(commonMessages.remove),
354
337
  tabIndex: null,
355
338
  confirmDialog: confirmDialog
356
- }] : [breakoutItems.length > 0 && {
357
- type: 'separator',
358
- fullHeight: true
359
- }, {
360
- type: 'extensions-placeholder',
361
- separator: breakoutItems.length > 0 ? 'both' : 'end'
362
- }, {
363
- type: 'overflow-dropdown',
364
- testId: testId,
365
- options: [_objectSpread({
366
- title: formatMessage(commonMessages.copyToClipboard),
367
- onClick: function onClick() {
368
- var _extensionApi$core, _extensionApi$floatin;
369
- extensionApi === null || extensionApi === void 0 || (_extensionApi$core = extensionApi.core) === null || _extensionApi$core === void 0 || _extensionApi$core.actions.execute( // @ts-ignore
370
- extensionApi === null || extensionApi === void 0 || (_extensionApi$floatin = extensionApi.floatingToolbar) === null || _extensionApi$floatin === void 0 ? void 0 : _extensionApi$floatin.commands.copyNode(nodeType, INPUT_METHOD.FLOATING_TB));
371
- return true;
372
- },
373
- icon: /*#__PURE__*/React.createElement(CopyIcon, {
374
- label: ""
375
- })
376
- }, hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)), _objectSpread({
377
- title: formatMessage(commonMessages.delete),
378
- onClick: removeExtension(editorAnalyticsAPI, INPUT_METHOD.FLOATING_TB),
379
- icon: /*#__PURE__*/React.createElement(DeleteIcon, {
380
- label: ""
381
- })
382
- }, hoverDecorationProps(nodeType))]
383
- }])),
339
+ }]),
384
340
  scrollable: true
385
341
  };
386
342
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-extension",
3
- "version": "5.5.8",
3
+ "version": "5.5.9",
4
4
  "description": "editor-plugin-extension plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -50,7 +50,7 @@
50
50
  "@atlaskit/icon": "^27.0.0",
51
51
  "@atlaskit/link": "^3.2.0",
52
52
  "@atlaskit/platform-feature-flags": "^1.1.0",
53
- "@atlaskit/primitives": "^14.8.0",
53
+ "@atlaskit/primitives": "^14.9.0",
54
54
  "@atlaskit/radio": "^8.1.0",
55
55
  "@atlaskit/section-message": "^8.2.0",
56
56
  "@atlaskit/select": "^20.7.0",
@@ -60,9 +60,9 @@
60
60
  "@atlaskit/textarea": "^8.0.0",
61
61
  "@atlaskit/textfield": "^8.0.0",
62
62
  "@atlaskit/theme": "^18.0.0",
63
- "@atlaskit/tmp-editor-statsig": "^7.1.0",
63
+ "@atlaskit/tmp-editor-statsig": "^7.2.0",
64
64
  "@atlaskit/toggle": "^15.0.0",
65
- "@atlaskit/tokens": "^5.2.0",
65
+ "@atlaskit/tokens": "^5.3.0",
66
66
  "@atlaskit/tooltip": "^20.3.0",
67
67
  "@babel/runtime": "^7.0.0",
68
68
  "@emotion/react": "^11.7.1",
@@ -124,9 +124,6 @@
124
124
  "platform_editor_update_extension_local_id_on_reset": {
125
125
  "type": "boolean"
126
126
  },
127
- "platform_editor_controls_patch_2": {
128
- "type": "boolean"
129
- },
130
127
  "platform_editor_controls_patch_8": {
131
128
  "type": "boolean"
132
129
  },