@atlaskit/editor-plugin-selection-toolbar 1.1.13 → 1.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,20 @@
1
1
  # @atlaskit/editor-plugin-selection-toolbar
2
2
 
3
+ ## 1.1.15
4
+
5
+ ### Patch Changes
6
+
7
+ - [#122243](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122243)
8
+ [`b1d7c5ade9b3a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b1d7c5ade9b3a) -
9
+ [ux] EDF-91 Removed platform.editor.enable-selection-toolbar_ucdwd feature flag and enabled
10
+ bydefault.
11
+
12
+ ## 1.1.14
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 1.1.13
4
19
 
5
20
  ### Patch Changes
@@ -4,6 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.calculateToolbarPositionTrackHead = void 0;
7
+ /**
8
+ * These functions are currently not used. They were added to provide more control
9
+ * of the toolbar in different products, i.e confluence comments and annotations.
10
+ * Work to add the toolbar to more products has been paused at the time of writing.
11
+ */
12
+
7
13
  var getScrollParent = function getScrollParent(editorView) {
8
14
  var _editorContentArea$pa;
9
15
  // Find the nearest Editor
@@ -9,8 +9,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
10
  var _bindEventListener = require("bind-event-listener");
11
11
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
12
+ var _utils = require("@atlaskit/editor-common/utils");
12
13
  var _state = require("@atlaskit/editor-prosemirror/state");
13
- var _calculateToolbarPosition = require("./calculate-toolbar-position");
14
14
  var _pluginKey = require("./plugin-key");
15
15
  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; }
16
16
  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; }
@@ -132,7 +132,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
132
132
  });
133
133
  }
134
134
  }
135
- var calcToolbarPosition = _calculateToolbarPosition.calculateToolbarPositionTrackHead;
135
+ var calcToolbarPosition = options.config.preferenceToolbarAboveSelection ? _utils.calculateToolbarPositionAboveSelection : _utils.calculateToolbarPositionTrackHead;
136
136
  var toolbarTitle = 'Selection toolbar';
137
137
  var onPositionCalculated = calcToolbarPosition(toolbarTitle);
138
138
  var nodeType = getSelectionNodeTypes(state);
@@ -1,3 +1,9 @@
1
+ /**
2
+ * These functions are currently not used. They were added to provide more control
3
+ * of the toolbar in different products, i.e confluence comments and annotations.
4
+ * Work to add the toolbar to more products has been paused at the time of writing.
5
+ */
6
+
1
7
  const getScrollParent = editorView => {
2
8
  var _editorContentArea$pa;
3
9
  // Find the nearest Editor
@@ -1,7 +1,7 @@
1
1
  import { bind } from 'bind-event-listener';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
+ import { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead } from '@atlaskit/editor-common/utils';
3
4
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
4
- import { calculateToolbarPositionTrackHead } from './calculate-toolbar-position';
5
5
  import { selectionToolbarPluginKey } from './plugin-key';
6
6
  export const selectionToolbarPlugin = options => {
7
7
  let __selectionToolbarHandlers = [];
@@ -121,7 +121,7 @@ export const selectionToolbarPlugin = options => {
121
121
  });
122
122
  }
123
123
  }
124
- const calcToolbarPosition = calculateToolbarPositionTrackHead;
124
+ const calcToolbarPosition = options.config.preferenceToolbarAboveSelection ? calculateToolbarPositionAboveSelection : calculateToolbarPositionTrackHead;
125
125
  const toolbarTitle = 'Selection toolbar';
126
126
  const onPositionCalculated = calcToolbarPosition(toolbarTitle);
127
127
  const nodeType = getSelectionNodeTypes(state);
@@ -1,3 +1,9 @@
1
+ /**
2
+ * These functions are currently not used. They were added to provide more control
3
+ * of the toolbar in different products, i.e confluence comments and annotations.
4
+ * Work to add the toolbar to more products has been paused at the time of writing.
5
+ */
6
+
1
7
  var getScrollParent = function getScrollParent(editorView) {
2
8
  var _editorContentArea$pa;
3
9
  // Find the nearest Editor
@@ -4,8 +4,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
4
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
5
  import { bind } from 'bind-event-listener';
6
6
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
7
+ import { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead } from '@atlaskit/editor-common/utils';
7
8
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
8
- import { calculateToolbarPositionTrackHead } from './calculate-toolbar-position';
9
9
  import { selectionToolbarPluginKey } from './plugin-key';
10
10
  export var selectionToolbarPlugin = function selectionToolbarPlugin(options) {
11
11
  var __selectionToolbarHandlers = [];
@@ -125,7 +125,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(options) {
125
125
  });
126
126
  }
127
127
  }
128
- var calcToolbarPosition = calculateToolbarPositionTrackHead;
128
+ var calcToolbarPosition = options.config.preferenceToolbarAboveSelection ? calculateToolbarPositionAboveSelection : calculateToolbarPositionTrackHead;
129
129
  var toolbarTitle = 'Selection toolbar';
130
130
  var onPositionCalculated = calcToolbarPosition(toolbarTitle);
131
131
  var nodeType = getSelectionNodeTypes(state);
@@ -1,3 +1,8 @@
1
+ /**
2
+ * These functions are currently not used. They were added to provide more control
3
+ * of the toolbar in different products, i.e confluence comments and annotations.
4
+ * Work to add the toolbar to more products has been paused at the time of writing.
5
+ */
1
6
  import type { PopupPosition as Position } from '@atlaskit/editor-common/ui';
2
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
8
  export declare const calculateToolbarPositionTrackHead: (toolbarTitle: string) => (editorView: EditorView, nextPos: Position) => Position;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * These functions are currently not used. They were added to provide more control
3
+ * of the toolbar in different products, i.e confluence comments and annotations.
4
+ * Work to add the toolbar to more products has been paused at the time of writing.
5
+ */
1
6
  import type { PopupPosition as Position } from '@atlaskit/editor-common/ui';
2
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
8
  export declare const calculateToolbarPositionTrackHead: (toolbarTitle: string) => (editorView: EditorView, nextPos: Position) => Position;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-toolbar",
3
- "version": "1.1.13",
3
+ "version": "1.1.15",
4
4
  "description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  ".": "./src/index.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/editor-common": "^85.0.0",
36
+ "@atlaskit/editor-common": "^86.3.0",
37
37
  "@atlaskit/editor-plugin-editor-viewmode": "^2.0.0",
38
38
  "@atlaskit/editor-prosemirror": "4.0.1",
39
39
  "@babel/runtime": "^7.0.0",