@atlaskit/editor-plugin-block-controls 9.0.1 → 9.0.3

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-block-controls
2
2
 
3
+ ## 9.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 9.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`da18116d80cad`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/da18116d80cad) -
14
+ Refactor to inline experiment checks
15
+ - [`d84e100ff2136`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d84e100ff2136) -
16
+ Update README.md and 0-intro.tsx
17
+ - Updated dependencies
18
+
3
19
  ## 9.0.1
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -1,10 +1,24 @@
1
- # Editor plugin block controls
1
+ # Editor Plugin Block Controls
2
2
 
3
3
  Block controls plugin for @atlaskit/editor-core
4
4
 
5
5
  **Note:** This component is designed for internal Atlassian development.
6
6
  External contributors will be able to use this component but will not be able to submit issues.
7
7
 
8
+ ## Overview
9
+
10
+ The Block Controls plugin provides comprehensive UI controls for managing blocks in the Atlassian Editor. It enables drag-and-drop functionality, block selection, quick insert capabilities, and visual decorations for interactive block management. This plugin integrates with the editor's core system to provide an intuitive interface for manipulating content blocks.
11
+
12
+ ## Key features
13
+
14
+ - **Drag and drop** - Move blocks around the editor with intuitive drag-and-drop gestures
15
+ - **Block selection** - Select and manage individual or multiple blocks
16
+ - **Quick insert** - Quick access to insert new content blocks
17
+ - **Visual decorations** - Hover states, drag handles, and drop target indicators
18
+ - **Block menu** - Context menu for block-level operations
19
+ - **Selection preservation** - Preserve text selection during block operations
20
+ - **Right-side controls** - Configurable right-edge button controls for block actions
21
+
8
22
  ## Install
9
23
 
10
24
  ---
@@ -73,7 +73,7 @@ var createInteractionTrackingPlugin = exports.createInteractionTrackingPlugin =
73
73
  view: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? function (view) {
74
74
  var editorContentArea = view.dom.closest('.ak-editor-content-area');
75
75
  // rightSideControlsEnabled is the single source of truth (confluence_remix_icon_right_side from preset)
76
- var remixRightSideEnabled = rightSideControlsEnabled;
76
+
77
77
  var unbindMouseEnter;
78
78
  var unbindMouseLeave;
79
79
  var unbindDocumentMouseMove;
@@ -111,7 +111,7 @@ var createInteractionTrackingPlugin = exports.createInteractionTrackingPlugin =
111
111
  }
112
112
  };
113
113
  if (editorContentArea) {
114
- if (remixRightSideEnabled && typeof document !== 'undefined') {
114
+ if (rightSideControlsEnabled && typeof document !== 'undefined') {
115
115
  unbindDocumentMouseMove = (0, _bindEventListener.bind)(document, {
116
116
  type: 'mousemove',
117
117
  listener: function listener(event) {
@@ -134,7 +134,7 @@ var createInteractionTrackingPlugin = exports.createInteractionTrackingPlugin =
134
134
  unbindMouseEnter = (0, _bindEventListener.bind)(editorContentArea, {
135
135
  type: 'mouseenter',
136
136
  listener: function listener() {
137
- if (remixRightSideEnabled) {
137
+ if (rightSideControlsEnabled) {
138
138
  cancelScheduledMouseLeave();
139
139
  }
140
140
  (0, _handleMouseMove.handleMouseEnter)(view);
@@ -148,7 +148,7 @@ var createInteractionTrackingPlugin = exports.createInteractionTrackingPlugin =
148
148
  x: e.clientX,
149
149
  y: e.clientY
150
150
  };
151
- if (remixRightSideEnabled) {
151
+ if (rightSideControlsEnabled) {
152
152
  scheduleMouseLeave(e);
153
153
  } else {
154
154
  (0, _handleMouseMove.handleMouseLeave)(view, false);
@@ -159,7 +159,7 @@ var createInteractionTrackingPlugin = exports.createInteractionTrackingPlugin =
159
159
  return {
160
160
  destroy: function destroy() {
161
161
  var _unbindMouseEnter, _unbindMouseLeave;
162
- if (remixRightSideEnabled) {
162
+ if (rightSideControlsEnabled) {
163
163
  var _unbindDocumentMouseM;
164
164
  cancelScheduledMouseLeave();
165
165
  (_unbindDocumentMouseM = unbindDocumentMouseMove) === null || _unbindDocumentMouseM === void 0 || _unbindDocumentMouseM();
@@ -811,9 +811,8 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, no
811
811
  var isDisabled = api === null || api === void 0 || (_api$editorDisabled = api.editorDisabled) === null || _api$editorDisabled === void 0 || (_api$editorDisabled = _api$editorDisabled.sharedState.currentState()) === null || _api$editorDisabled === void 0 ? void 0 : _api$editorDisabled.editorDisabled;
812
812
  if (isDisabled) {
813
813
  var _api$editorViewMode2;
814
- var remixRightSideEnabled = rightSideControlsEnabled && (0, _expValEquals.expValEquals)('confluence_remix_icon_right_side', 'isEnabled', true);
815
814
  // Hide decorations when disabled, except in view mode when right-side controls are enabled
816
- if (!remixRightSideEnabled || (api === null || api === void 0 || (_api$editorViewMode2 = api.editorViewMode) === null || _api$editorViewMode2 === void 0 || (_api$editorViewMode2 = _api$editorViewMode2.sharedState.currentState()) === null || _api$editorViewMode2 === void 0 ? void 0 : _api$editorViewMode2.mode) !== 'view') {
815
+ if (!(rightSideControlsEnabled && (0, _expValEquals.expValEquals)('confluence_remix_icon_right_side', 'isEnabled', true)) || (api === null || api === void 0 || (_api$editorViewMode2 = api.editorViewMode) === null || _api$editorViewMode2 === void 0 || (_api$editorViewMode2 = _api$editorViewMode2.sharedState.currentState()) === null || _api$editorViewMode2 === void 0 ? void 0 : _api$editorViewMode2.mode) !== 'view') {
817
816
  return;
818
817
  }
819
818
  }
@@ -62,7 +62,7 @@ export const createInteractionTrackingPlugin = (rightSideControlsEnabled = false
62
62
  view: editorExperiment('platform_editor_controls', 'variant1') ? view => {
63
63
  const editorContentArea = view.dom.closest('.ak-editor-content-area');
64
64
  // rightSideControlsEnabled is the single source of truth (confluence_remix_icon_right_side from preset)
65
- const remixRightSideEnabled = rightSideControlsEnabled;
65
+
66
66
  let unbindMouseEnter;
67
67
  let unbindMouseLeave;
68
68
  let unbindDocumentMouseMove;
@@ -100,7 +100,7 @@ export const createInteractionTrackingPlugin = (rightSideControlsEnabled = false
100
100
  }
101
101
  };
102
102
  if (editorContentArea) {
103
- if (remixRightSideEnabled && typeof document !== 'undefined') {
103
+ if (rightSideControlsEnabled && typeof document !== 'undefined') {
104
104
  unbindDocumentMouseMove = bind(document, {
105
105
  type: 'mousemove',
106
106
  listener: event => {
@@ -123,7 +123,7 @@ export const createInteractionTrackingPlugin = (rightSideControlsEnabled = false
123
123
  unbindMouseEnter = bind(editorContentArea, {
124
124
  type: 'mouseenter',
125
125
  listener: () => {
126
- if (remixRightSideEnabled) {
126
+ if (rightSideControlsEnabled) {
127
127
  cancelScheduledMouseLeave();
128
128
  }
129
129
  handleMouseEnter(view);
@@ -137,7 +137,7 @@ export const createInteractionTrackingPlugin = (rightSideControlsEnabled = false
137
137
  x: e.clientX,
138
138
  y: e.clientY
139
139
  };
140
- if (remixRightSideEnabled) {
140
+ if (rightSideControlsEnabled) {
141
141
  scheduleMouseLeave(e);
142
142
  } else {
143
143
  handleMouseLeave(view, false);
@@ -148,7 +148,7 @@ export const createInteractionTrackingPlugin = (rightSideControlsEnabled = false
148
148
  return {
149
149
  destroy: () => {
150
150
  var _unbindMouseEnter, _unbindMouseLeave;
151
- if (remixRightSideEnabled) {
151
+ if (rightSideControlsEnabled) {
152
152
  var _unbindDocumentMouseM;
153
153
  cancelScheduledMouseLeave();
154
154
  (_unbindDocumentMouseM = unbindDocumentMouseMove) === null || _unbindDocumentMouseM === void 0 ? void 0 : _unbindDocumentMouseM();
@@ -710,9 +710,8 @@ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI, nodeDecora
710
710
  const isDisabled = api === null || api === void 0 ? void 0 : (_api$editorDisabled = api.editorDisabled) === null || _api$editorDisabled === void 0 ? void 0 : (_api$editorDisabled$s = _api$editorDisabled.sharedState.currentState()) === null || _api$editorDisabled$s === void 0 ? void 0 : _api$editorDisabled$s.editorDisabled;
711
711
  if (isDisabled) {
712
712
  var _api$editorViewMode2, _api$editorViewMode2$;
713
- const remixRightSideEnabled = rightSideControlsEnabled && expValEquals('confluence_remix_icon_right_side', 'isEnabled', true);
714
713
  // Hide decorations when disabled, except in view mode when right-side controls are enabled
715
- if (!remixRightSideEnabled || (api === null || api === void 0 ? void 0 : (_api$editorViewMode2 = api.editorViewMode) === null || _api$editorViewMode2 === void 0 ? void 0 : (_api$editorViewMode2$ = _api$editorViewMode2.sharedState.currentState()) === null || _api$editorViewMode2$ === void 0 ? void 0 : _api$editorViewMode2$.mode) !== 'view') {
714
+ if (!(rightSideControlsEnabled && expValEquals('confluence_remix_icon_right_side', 'isEnabled', true)) || (api === null || api === void 0 ? void 0 : (_api$editorViewMode2 = api.editorViewMode) === null || _api$editorViewMode2 === void 0 ? void 0 : (_api$editorViewMode2$ = _api$editorViewMode2.sharedState.currentState()) === null || _api$editorViewMode2$ === void 0 ? void 0 : _api$editorViewMode2$.mode) !== 'view') {
716
715
  return;
717
716
  }
718
717
  }
@@ -67,7 +67,7 @@ export var createInteractionTrackingPlugin = function createInteractionTrackingP
67
67
  view: editorExperiment('platform_editor_controls', 'variant1') ? function (view) {
68
68
  var editorContentArea = view.dom.closest('.ak-editor-content-area');
69
69
  // rightSideControlsEnabled is the single source of truth (confluence_remix_icon_right_side from preset)
70
- var remixRightSideEnabled = rightSideControlsEnabled;
70
+
71
71
  var unbindMouseEnter;
72
72
  var unbindMouseLeave;
73
73
  var unbindDocumentMouseMove;
@@ -105,7 +105,7 @@ export var createInteractionTrackingPlugin = function createInteractionTrackingP
105
105
  }
106
106
  };
107
107
  if (editorContentArea) {
108
- if (remixRightSideEnabled && typeof document !== 'undefined') {
108
+ if (rightSideControlsEnabled && typeof document !== 'undefined') {
109
109
  unbindDocumentMouseMove = bind(document, {
110
110
  type: 'mousemove',
111
111
  listener: function listener(event) {
@@ -128,7 +128,7 @@ export var createInteractionTrackingPlugin = function createInteractionTrackingP
128
128
  unbindMouseEnter = bind(editorContentArea, {
129
129
  type: 'mouseenter',
130
130
  listener: function listener() {
131
- if (remixRightSideEnabled) {
131
+ if (rightSideControlsEnabled) {
132
132
  cancelScheduledMouseLeave();
133
133
  }
134
134
  handleMouseEnter(view);
@@ -142,7 +142,7 @@ export var createInteractionTrackingPlugin = function createInteractionTrackingP
142
142
  x: e.clientX,
143
143
  y: e.clientY
144
144
  };
145
- if (remixRightSideEnabled) {
145
+ if (rightSideControlsEnabled) {
146
146
  scheduleMouseLeave(e);
147
147
  } else {
148
148
  handleMouseLeave(view, false);
@@ -153,7 +153,7 @@ export var createInteractionTrackingPlugin = function createInteractionTrackingP
153
153
  return {
154
154
  destroy: function destroy() {
155
155
  var _unbindMouseEnter, _unbindMouseLeave;
156
- if (remixRightSideEnabled) {
156
+ if (rightSideControlsEnabled) {
157
157
  var _unbindDocumentMouseM;
158
158
  cancelScheduledMouseLeave();
159
159
  (_unbindDocumentMouseM = unbindDocumentMouseMove) === null || _unbindDocumentMouseM === void 0 || _unbindDocumentMouseM();
@@ -805,9 +805,8 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
805
805
  var isDisabled = api === null || api === void 0 || (_api$editorDisabled = api.editorDisabled) === null || _api$editorDisabled === void 0 || (_api$editorDisabled = _api$editorDisabled.sharedState.currentState()) === null || _api$editorDisabled === void 0 ? void 0 : _api$editorDisabled.editorDisabled;
806
806
  if (isDisabled) {
807
807
  var _api$editorViewMode2;
808
- var remixRightSideEnabled = rightSideControlsEnabled && expValEquals('confluence_remix_icon_right_side', 'isEnabled', true);
809
808
  // Hide decorations when disabled, except in view mode when right-side controls are enabled
810
- if (!remixRightSideEnabled || (api === null || api === void 0 || (_api$editorViewMode2 = api.editorViewMode) === null || _api$editorViewMode2 === void 0 || (_api$editorViewMode2 = _api$editorViewMode2.sharedState.currentState()) === null || _api$editorViewMode2 === void 0 ? void 0 : _api$editorViewMode2.mode) !== 'view') {
809
+ if (!(rightSideControlsEnabled && expValEquals('confluence_remix_icon_right_side', 'isEnabled', true)) || (api === null || api === void 0 || (_api$editorViewMode2 = api.editorViewMode) === null || _api$editorViewMode2 === void 0 || (_api$editorViewMode2 = _api$editorViewMode2.sharedState.currentState()) === null || _api$editorViewMode2 === void 0 ? void 0 : _api$editorViewMode2.mode) !== 'view') {
811
810
  return;
812
811
  }
813
812
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "9.0.1",
3
+ "version": "9.0.3",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -56,7 +56,7 @@
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": "^36.0.0",
59
+ "@atlaskit/tmp-editor-statsig": "^37.0.0",
60
60
  "@atlaskit/tokens": "^11.1.0",
61
61
  "@atlaskit/tooltip": "^20.14.0",
62
62
  "@babel/runtime": "^7.0.0",
@@ -67,7 +67,7 @@
67
67
  "uuid": "^3.1.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@atlaskit/editor-common": "^112.0.0",
70
+ "@atlaskit/editor-common": "^112.2.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"