@atlaskit/editor-plugin-block-controls 9.0.11 → 9.0.13

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-block-controls
2
2
 
3
+ ## 9.0.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3d01a5983dae9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3d01a5983dae9) -
8
+ [ux] Make quick insert button optional (backward compatible, enabled by default)
9
+ - Updated dependencies
10
+
11
+ ## 9.0.12
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 9.0.11
4
18
 
5
19
  ### Patch Changes
@@ -30,11 +30,12 @@ var _globalStyles = require("./ui/global-styles");
30
30
  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; }
31
31
  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; }
32
32
  var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPlugin(_ref) {
33
- var _config$rightSideCont;
33
+ var _config$rightSideCont, _config$quickInsertBu;
34
34
  var api = _ref.api,
35
35
  config = _ref.config;
36
36
  var nodeDecorationRegistry = [];
37
37
  var rightSideControlsEnabled = (_config$rightSideCont = config === null || config === void 0 ? void 0 : config.rightSideControlsEnabled) !== null && _config$rightSideCont !== void 0 ? _config$rightSideCont : false;
38
+ var quickInsertButtonEnabled = (_config$quickInsertBu = config === null || config === void 0 ? void 0 : config.quickInsertButtonEnabled) !== null && _config$quickInsertBu !== void 0 ? _config$quickInsertBu : true;
38
39
  return {
39
40
  name: 'blockControls',
40
41
  actions: {
@@ -56,7 +57,7 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
56
57
  plugin: function plugin(_ref2) {
57
58
  var getIntl = _ref2.getIntl,
58
59
  nodeViewPortalProviderAPI = _ref2.nodeViewPortalProviderAPI;
59
- return (0, _main.createPlugin)(api, getIntl, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled);
60
+ return (0, _main.createPlugin)(api, getIntl, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled, quickInsertButtonEnabled);
60
61
  }
61
62
  }];
62
63
  if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
@@ -246,9 +246,10 @@ var getDecorationAtPos = function getDecorationAtPos(state, decorations, pos, to
246
246
  var _apply = exports.apply = function apply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, nodeDecorationRegistry) {
247
247
  var _api$limitedMode, _meta$multiSelectDnD, _api$editorViewMode, _activeNode, _activeNode2, _meta$activeNode$hand, _activeNode3, _activeNode4, _meta$isDragging2, _meta$isDragging3, _meta$toggleMenu, _meta$toggleMenu2, _meta$toggleMenu3, _meta$toggleMenu4, _meta$toggleMenu5, _meta$toggleMenu6, _meta$toggleMenu7, _meta$toggleMenu8, _meta$editorHeight, _meta$editorWidthLeft, _meta$editorWidthRigh, _meta$isPMDragging, _meta$isShiftDown, _meta$lastDragCancell;
248
248
  var rightSideControlsEnabled = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : false;
249
- var anchorRectCache = arguments.length > 9 ? arguments[9] : undefined;
250
- var resizeObserverWidth = arguments.length > 10 ? arguments[10] : undefined;
251
- var pragmaticCleanup = arguments.length > 11 ? arguments[11] : undefined;
249
+ var quickInsertButtonEnabled = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : true;
250
+ var anchorRectCache = arguments.length > 10 ? arguments[10] : undefined;
251
+ var resizeObserverWidth = arguments.length > 11 ? arguments[11] : undefined;
252
+ var pragmaticCleanup = arguments.length > 12 ? arguments[12] : undefined;
252
253
  var activeNode = currentState.activeNode,
253
254
  decorations = currentState.decorations,
254
255
  isResizerResizing = currentState.isResizerResizing,
@@ -443,7 +444,7 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
443
444
  var oldHandle = (0, _decorationsDragHandle.findHandleDec)(decorations, (_activeNode5 = activeNode) === null || _activeNode5 === void 0 ? void 0 : _activeNode5.pos, (_activeNode6 = activeNode) === null || _activeNode6 === void 0 ? void 0 : _activeNode6.pos);
444
445
  decorations = decorations.remove(oldHandle);
445
446
  // platform_editor_controls note: enables quick insert
446
- if (flags.toolbarFlagsEnabled) {
447
+ if (flags.toolbarFlagsEnabled && quickInsertButtonEnabled) {
447
448
  var _activeNode7, _activeNode8;
448
449
  var oldQuickInsertButton = (0, _decorationsQuickInsertButton.findQuickInsertInsertButtonDecoration)(decorations, (_activeNode7 = activeNode) === null || _activeNode7 === void 0 ? void 0 : _activeNode7.rootPos, (_activeNode8 = activeNode) === null || _activeNode8 === void 0 ? void 0 : _activeNode8.rootPos);
449
450
  decorations = decorations.remove(oldQuickInsertButton);
@@ -513,7 +514,7 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
513
514
  }
514
515
  if (shouldRecreateQuickInsertButton && ((_latestActiveNode5 = latestActiveNode) === null || _latestActiveNode5 === void 0 ? void 0 : _latestActiveNode5.rootPos) !== undefined &&
515
516
  // platform_editor_controls note: enables quick insert
516
- flags.toolbarFlagsEnabled && (!rightSideControlsEnabled || !isViewMode)) {
517
+ flags.toolbarFlagsEnabled && quickInsertButtonEnabled && (!rightSideControlsEnabled || !isViewMode)) {
517
518
  var _activeNode13, _activeNode14, _latestActiveNode6, _latestActiveNode7, _latestActiveNode8, _latestActiveNode9, _latestActiveNode0;
518
519
  var _oldQuickInsertButton = (0, _decorationsQuickInsertButton.findQuickInsertInsertButtonDecoration)(decorations, (_activeNode13 = activeNode) === null || _activeNode13 === void 0 ? void 0 : _activeNode13.rootPos, (_activeNode14 = activeNode) === null || _activeNode14 === void 0 ? void 0 : _activeNode14.rootPos);
519
520
  decorations = decorations.remove(_oldQuickInsertButton);
@@ -773,6 +774,7 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
773
774
  };
774
775
  var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, nodeViewPortalProviderAPI, nodeDecorationRegistry) {
775
776
  var rightSideControlsEnabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
777
+ var quickInsertButtonEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
776
778
  var _getIntl = getIntl(),
777
779
  formatMessage = _getIntl.formatMessage;
778
780
  var isAdvancedLayoutEnabled = (0, _experiments.editorExperiment)('advanced_layouts', true, {
@@ -799,7 +801,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, no
799
801
  return initialState;
800
802
  },
801
803
  apply: function apply(tr, currentState, _, newState) {
802
- return _apply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled, anchorRectCache, resizeObserverWidth, pragmaticCleanup);
804
+ return _apply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled, quickInsertButtonEnabled, anchorRectCache, resizeObserverWidth, pragmaticCleanup);
803
805
  }
804
806
  },
805
807
  props: {
@@ -23,9 +23,10 @@ export const blockControlsPlugin = ({
23
23
  api,
24
24
  config
25
25
  }) => {
26
- var _config$rightSideCont;
26
+ var _config$rightSideCont, _config$quickInsertBu;
27
27
  const nodeDecorationRegistry = [];
28
28
  const rightSideControlsEnabled = (_config$rightSideCont = config === null || config === void 0 ? void 0 : config.rightSideControlsEnabled) !== null && _config$rightSideCont !== void 0 ? _config$rightSideCont : false;
29
+ const quickInsertButtonEnabled = (_config$quickInsertBu = config === null || config === void 0 ? void 0 : config.quickInsertButtonEnabled) !== null && _config$quickInsertBu !== void 0 ? _config$quickInsertBu : true;
29
30
  return {
30
31
  name: 'blockControls',
31
32
  actions: {
@@ -45,7 +46,7 @@ export const blockControlsPlugin = ({
45
46
  plugin: ({
46
47
  getIntl,
47
48
  nodeViewPortalProviderAPI
48
- }) => createPlugin(api, getIntl, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled)
49
+ }) => createPlugin(api, getIntl, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled, quickInsertButtonEnabled)
49
50
  }];
50
51
  if (editorExperiment('platform_editor_controls', 'variant1')) {
51
52
  pmPlugins.push({
@@ -234,7 +234,7 @@ const getDecorationAtPos = (state, decorations, pos, to) => {
234
234
  const nodeDecAtActivePos = nodeDecsAtActivePos.pop();
235
235
  return nodeDecAtActivePos;
236
236
  };
237
- export const apply = (api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled = false, anchorRectCache, resizeObserverWidth, pragmaticCleanup) => {
237
+ export const apply = (api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled = false, quickInsertButtonEnabled = true, anchorRectCache, resizeObserverWidth, pragmaticCleanup) => {
238
238
  var _api$limitedMode, _api$limitedMode$shar, _api$limitedMode$shar2, _meta$multiSelectDnD, _api$editorViewMode, _api$editorViewMode$s, _activeNode, _activeNode2, _meta$activeNode$hand, _activeNode3, _activeNode4, _meta$isDragging2, _meta$isDragging3, _meta$toggleMenu, _meta$toggleMenu2, _meta$toggleMenu3, _meta$toggleMenu4, _meta$toggleMenu5, _meta$toggleMenu6, _meta$toggleMenu7, _meta$toggleMenu8, _meta$editorHeight, _meta$editorWidthLeft, _meta$editorWidthRigh, _meta$isPMDragging, _meta$isShiftDown, _meta$lastDragCancell;
239
239
  let {
240
240
  activeNode,
@@ -433,7 +433,7 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
433
433
  const oldHandle = findHandleDec(decorations, (_activeNode5 = activeNode) === null || _activeNode5 === void 0 ? void 0 : _activeNode5.pos, (_activeNode6 = activeNode) === null || _activeNode6 === void 0 ? void 0 : _activeNode6.pos);
434
434
  decorations = decorations.remove(oldHandle);
435
435
  // platform_editor_controls note: enables quick insert
436
- if (flags.toolbarFlagsEnabled) {
436
+ if (flags.toolbarFlagsEnabled && quickInsertButtonEnabled) {
437
437
  var _activeNode7, _activeNode8;
438
438
  const oldQuickInsertButton = findQuickInsertInsertButtonDecoration(decorations, (_activeNode7 = activeNode) === null || _activeNode7 === void 0 ? void 0 : _activeNode7.rootPos, (_activeNode8 = activeNode) === null || _activeNode8 === void 0 ? void 0 : _activeNode8.rootPos);
439
439
  decorations = decorations.remove(oldQuickInsertButton);
@@ -475,7 +475,7 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
475
475
  }
476
476
  if (shouldRecreateQuickInsertButton && ((_latestActiveNode5 = latestActiveNode) === null || _latestActiveNode5 === void 0 ? void 0 : _latestActiveNode5.rootPos) !== undefined &&
477
477
  // platform_editor_controls note: enables quick insert
478
- flags.toolbarFlagsEnabled && (!rightSideControlsEnabled || !isViewMode)) {
478
+ flags.toolbarFlagsEnabled && quickInsertButtonEnabled && (!rightSideControlsEnabled || !isViewMode)) {
479
479
  var _activeNode13, _activeNode14, _latestActiveNode6, _latestActiveNode7, _latestActiveNode8, _latestActiveNode9, _latestActiveNode0;
480
480
  const oldQuickInsertButton = findQuickInsertInsertButtonDecoration(decorations, (_activeNode13 = activeNode) === null || _activeNode13 === void 0 ? void 0 : _activeNode13.rootPos, (_activeNode14 = activeNode) === null || _activeNode14 === void 0 ? void 0 : _activeNode14.rootPos);
481
481
  decorations = decorations.remove(oldQuickInsertButton);
@@ -672,7 +672,7 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
672
672
  isSelectedViaDragHandle: isSelectedViaDragHandleNew
673
673
  };
674
674
  };
675
- export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled = false) => {
675
+ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled = false, quickInsertButtonEnabled = true) => {
676
676
  const {
677
677
  formatMessage
678
678
  } = getIntl();
@@ -699,7 +699,7 @@ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI, nodeDecora
699
699
  init() {
700
700
  return initialState;
701
701
  },
702
- apply: (tr, currentState, _, newState) => apply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled, anchorRectCache, resizeObserverWidth, pragmaticCleanup)
702
+ apply: (tr, currentState, _, newState) => apply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled, quickInsertButtonEnabled, anchorRectCache, resizeObserverWidth, pragmaticCleanup)
703
703
  },
704
704
  props: {
705
705
  decorations: state => {
@@ -23,11 +23,12 @@ import { createSelectionPreservationPlugin } from './pm-plugins/selection-preser
23
23
  import { selectNode } from './pm-plugins/utils/getSelection';
24
24
  import { GlobalStylesWrapper } from './ui/global-styles';
25
25
  export var blockControlsPlugin = function blockControlsPlugin(_ref) {
26
- var _config$rightSideCont;
26
+ var _config$rightSideCont, _config$quickInsertBu;
27
27
  var api = _ref.api,
28
28
  config = _ref.config;
29
29
  var nodeDecorationRegistry = [];
30
30
  var rightSideControlsEnabled = (_config$rightSideCont = config === null || config === void 0 ? void 0 : config.rightSideControlsEnabled) !== null && _config$rightSideCont !== void 0 ? _config$rightSideCont : false;
31
+ var quickInsertButtonEnabled = (_config$quickInsertBu = config === null || config === void 0 ? void 0 : config.quickInsertButtonEnabled) !== null && _config$quickInsertBu !== void 0 ? _config$quickInsertBu : true;
31
32
  return {
32
33
  name: 'blockControls',
33
34
  actions: {
@@ -49,7 +50,7 @@ export var blockControlsPlugin = function blockControlsPlugin(_ref) {
49
50
  plugin: function plugin(_ref2) {
50
51
  var getIntl = _ref2.getIntl,
51
52
  nodeViewPortalProviderAPI = _ref2.nodeViewPortalProviderAPI;
52
- return createPlugin(api, getIntl, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled);
53
+ return createPlugin(api, getIntl, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled, quickInsertButtonEnabled);
53
54
  }
54
55
  }];
55
56
  if (editorExperiment('platform_editor_controls', 'variant1')) {
@@ -239,9 +239,10 @@ var getDecorationAtPos = function getDecorationAtPos(state, decorations, pos, to
239
239
  var _apply = function apply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, nodeDecorationRegistry) {
240
240
  var _api$limitedMode, _meta$multiSelectDnD, _api$editorViewMode, _activeNode, _activeNode2, _meta$activeNode$hand, _activeNode3, _activeNode4, _meta$isDragging2, _meta$isDragging3, _meta$toggleMenu, _meta$toggleMenu2, _meta$toggleMenu3, _meta$toggleMenu4, _meta$toggleMenu5, _meta$toggleMenu6, _meta$toggleMenu7, _meta$toggleMenu8, _meta$editorHeight, _meta$editorWidthLeft, _meta$editorWidthRigh, _meta$isPMDragging, _meta$isShiftDown, _meta$lastDragCancell;
241
241
  var rightSideControlsEnabled = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : false;
242
- var anchorRectCache = arguments.length > 9 ? arguments[9] : undefined;
243
- var resizeObserverWidth = arguments.length > 10 ? arguments[10] : undefined;
244
- var pragmaticCleanup = arguments.length > 11 ? arguments[11] : undefined;
242
+ var quickInsertButtonEnabled = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : true;
243
+ var anchorRectCache = arguments.length > 10 ? arguments[10] : undefined;
244
+ var resizeObserverWidth = arguments.length > 11 ? arguments[11] : undefined;
245
+ var pragmaticCleanup = arguments.length > 12 ? arguments[12] : undefined;
245
246
  var activeNode = currentState.activeNode,
246
247
  decorations = currentState.decorations,
247
248
  isResizerResizing = currentState.isResizerResizing,
@@ -436,7 +437,7 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
436
437
  var oldHandle = findHandleDec(decorations, (_activeNode5 = activeNode) === null || _activeNode5 === void 0 ? void 0 : _activeNode5.pos, (_activeNode6 = activeNode) === null || _activeNode6 === void 0 ? void 0 : _activeNode6.pos);
437
438
  decorations = decorations.remove(oldHandle);
438
439
  // platform_editor_controls note: enables quick insert
439
- if (flags.toolbarFlagsEnabled) {
440
+ if (flags.toolbarFlagsEnabled && quickInsertButtonEnabled) {
440
441
  var _activeNode7, _activeNode8;
441
442
  var oldQuickInsertButton = findQuickInsertInsertButtonDecoration(decorations, (_activeNode7 = activeNode) === null || _activeNode7 === void 0 ? void 0 : _activeNode7.rootPos, (_activeNode8 = activeNode) === null || _activeNode8 === void 0 ? void 0 : _activeNode8.rootPos);
442
443
  decorations = decorations.remove(oldQuickInsertButton);
@@ -506,7 +507,7 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
506
507
  }
507
508
  if (shouldRecreateQuickInsertButton && ((_latestActiveNode5 = latestActiveNode) === null || _latestActiveNode5 === void 0 ? void 0 : _latestActiveNode5.rootPos) !== undefined &&
508
509
  // platform_editor_controls note: enables quick insert
509
- flags.toolbarFlagsEnabled && (!rightSideControlsEnabled || !isViewMode)) {
510
+ flags.toolbarFlagsEnabled && quickInsertButtonEnabled && (!rightSideControlsEnabled || !isViewMode)) {
510
511
  var _activeNode13, _activeNode14, _latestActiveNode6, _latestActiveNode7, _latestActiveNode8, _latestActiveNode9, _latestActiveNode0;
511
512
  var _oldQuickInsertButton = findQuickInsertInsertButtonDecoration(decorations, (_activeNode13 = activeNode) === null || _activeNode13 === void 0 ? void 0 : _activeNode13.rootPos, (_activeNode14 = activeNode) === null || _activeNode14 === void 0 ? void 0 : _activeNode14.rootPos);
512
513
  decorations = decorations.remove(_oldQuickInsertButton);
@@ -767,6 +768,7 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
767
768
  export { _apply as apply };
768
769
  export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProviderAPI, nodeDecorationRegistry) {
769
770
  var rightSideControlsEnabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
771
+ var quickInsertButtonEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
770
772
  var _getIntl = getIntl(),
771
773
  formatMessage = _getIntl.formatMessage;
772
774
  var isAdvancedLayoutEnabled = editorExperiment('advanced_layouts', true, {
@@ -793,7 +795,7 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
793
795
  return initialState;
794
796
  },
795
797
  apply: function apply(tr, currentState, _, newState) {
796
- return _apply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled, anchorRectCache, resizeObserverWidth, pragmaticCleanup);
798
+ return _apply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled, quickInsertButtonEnabled, anchorRectCache, resizeObserverWidth, pragmaticCleanup);
797
799
  }
798
800
  },
799
801
  props: {
@@ -79,6 +79,8 @@ export interface PluginState {
79
79
  }
80
80
  export type ReleaseHiddenDecoration = () => boolean | undefined;
81
81
  export type BlockControlsPluginConfig = {
82
+ /** Enable the quick insert plus button icon on the left of the drag handle */
83
+ quickInsertButtonEnabled?: boolean;
82
84
  /** Enable left/right hover split: show left controls when hovering left, right controls when hovering right */
83
85
  rightSideControlsEnabled?: boolean;
84
86
  };
@@ -13,7 +13,7 @@ export interface FlagType {
13
13
  toolbarFlagsEnabled: boolean;
14
14
  }
15
15
  export declare const getDecorations: (state: EditorState) => DecorationSet | undefined;
16
- export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape["formatMessage"], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean, anchorRectCache?: AnchorRectCache, resizeObserverWidth?: ResizeObserver, pragmaticCleanup?: (() => void) | null) => PluginState | {
16
+ export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape["formatMessage"], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean, quickInsertButtonEnabled?: boolean, anchorRectCache?: AnchorRectCache, resizeObserverWidth?: ResizeObserver, pragmaticCleanup?: (() => void) | null) => PluginState | {
17
17
  activeDropTargetNode: ActiveDropTargetNode | undefined;
18
18
  activeNode: any;
19
19
  blockMenuOptions: {
@@ -37,7 +37,7 @@ export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | und
37
37
  menuTriggerByNode: any;
38
38
  multiSelectDnD: MultiSelectDnD | undefined;
39
39
  };
40
- export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean) => SafePlugin<PluginState | {
40
+ export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean, quickInsertButtonEnabled?: boolean) => SafePlugin<PluginState | {
41
41
  activeDropTargetNode: ActiveDropTargetNode | undefined;
42
42
  activeNode: any;
43
43
  blockMenuOptions: {
@@ -79,6 +79,8 @@ export interface PluginState {
79
79
  }
80
80
  export type ReleaseHiddenDecoration = () => boolean | undefined;
81
81
  export type BlockControlsPluginConfig = {
82
+ /** Enable the quick insert plus button icon on the left of the drag handle */
83
+ quickInsertButtonEnabled?: boolean;
82
84
  /** Enable left/right hover split: show left controls when hovering left, right controls when hovering right */
83
85
  rightSideControlsEnabled?: boolean;
84
86
  };
@@ -13,7 +13,7 @@ export interface FlagType {
13
13
  toolbarFlagsEnabled: boolean;
14
14
  }
15
15
  export declare const getDecorations: (state: EditorState) => DecorationSet | undefined;
16
- export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape["formatMessage"], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean, anchorRectCache?: AnchorRectCache, resizeObserverWidth?: ResizeObserver, pragmaticCleanup?: (() => void) | null) => PluginState | {
16
+ export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape["formatMessage"], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean, quickInsertButtonEnabled?: boolean, anchorRectCache?: AnchorRectCache, resizeObserverWidth?: ResizeObserver, pragmaticCleanup?: (() => void) | null) => PluginState | {
17
17
  activeDropTargetNode: ActiveDropTargetNode | undefined;
18
18
  activeNode: any;
19
19
  blockMenuOptions: {
@@ -37,7 +37,7 @@ export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | und
37
37
  menuTriggerByNode: any;
38
38
  multiSelectDnD: MultiSelectDnD | undefined;
39
39
  };
40
- export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean) => SafePlugin<PluginState | {
40
+ export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean, quickInsertButtonEnabled?: boolean) => SafePlugin<PluginState | {
41
41
  activeDropTargetNode: ActiveDropTargetNode | undefined;
42
42
  activeNode: any;
43
43
  blockMenuOptions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "9.0.11",
3
+ "version": "9.0.13",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -56,9 +56,9 @@
56
56
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
57
57
  "@atlaskit/primitives": "^18.0.0",
58
58
  "@atlaskit/theme": "^22.0.0",
59
- "@atlaskit/tmp-editor-statsig": "^40.6.0",
59
+ "@atlaskit/tmp-editor-statsig": "^41.0.0",
60
60
  "@atlaskit/tokens": "^11.1.0",
61
- "@atlaskit/tooltip": "^20.14.0",
61
+ "@atlaskit/tooltip": "^21.0.0",
62
62
  "@babel/runtime": "^7.0.0",
63
63
  "@emotion/react": "^11.7.1",
64
64
  "bind-event-listener": "^3.0.0",
@@ -67,7 +67,7 @@
67
67
  "uuid": "^3.1.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@atlaskit/editor-common": "^112.5.0",
70
+ "@atlaskit/editor-common": "^112.6.0",
71
71
  "react": "^18.2.0",
72
72
  "react-dom": "^18.2.0",
73
73
  "react-intl-next": "npm:react-intl@^5.18.1"