@atlaskit/editor-plugin-selection-toolbar 3.7.6 → 4.0.0

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,57 @@
1
1
  # @atlaskit/editor-plugin-selection-toolbar
2
2
 
3
+ ## 4.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#181024](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/181024)
8
+ [`8e80c487ca307`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e80c487ca307) - ##
9
+ Make `@atlaskit/editor-common` a peer dependency
10
+
11
+ **WHAT:** `@atlaskit/editor-common` has been moved from `dependencies` to `peerDependencies` in
12
+ all editor plugin packages.
13
+
14
+ **WHY:** This change ensures that only a single version of `@atlaskit/editor-common` is used in
15
+ consuming applications, preventing issues caused by multiple versions of singleton libraries (such
16
+ as context mismatches or duplicated state). This is especially important for packages that rely on
17
+ shared context or singletons.
18
+
19
+ **HOW TO ADJUST:**
20
+
21
+ - Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
22
+ any of these editor plugins.
23
+ - Ensure the version you install matches the version required by the plugins.
24
+ - You can use the
25
+ [`check-peer-dependencies`](https://www.npmjs.com/package/check-peer-dependencies) package to
26
+ verify that all required peer dependencies are installed and compatible.
27
+ - Example install command:
28
+ ```
29
+ npm install @atlaskit/editor-common
30
+ ```
31
+ or
32
+ ```
33
+ yarn add @atlaskit/editor-common
34
+ ```
35
+
36
+ **Note:** This is a breaking change. If `@atlaskit/editor-common` is not installed at the
37
+ application level, you may see errors or unexpected behavior.
38
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies
42
+
43
+ ## 3.8.0
44
+
45
+ ### Minor Changes
46
+
47
+ - [#177157](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/177157)
48
+ [`6bcf8912217df`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6bcf8912217df) -
49
+ ED-27284 additional integration with user preference plugin
50
+
51
+ ### Patch Changes
52
+
53
+ - Updated dependencies
54
+
3
55
  ## 3.7.6
4
56
 
5
57
  ### Patch Changes
@@ -22,6 +22,7 @@ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-
22
22
  var _pin = _interopRequireDefault(require("@atlaskit/icon/core/pin"));
23
23
  var _pinFilled = _interopRequireDefault(require("@atlaskit/icon/core/pin-filled"));
24
24
  var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
25
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
25
26
  var _overflowToolbarConfig = require("./overflow-toolbar-config");
26
27
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
27
28
  var DROPDOWN_WIDTH = 240;
@@ -101,13 +102,13 @@ function PrimaryToolbarComponent(_ref) {
101
102
  * button to the toolbar to the or make it in-line.
102
103
  */
103
104
  var PrimaryToolbarComponentNew = exports.PrimaryToolbarComponentNew = function PrimaryToolbarComponentNew(_ref3) {
104
- var _api$selectionToolbar;
105
+ var _api$userPreferences, _api$selectionToolbar;
105
106
  var api = _ref3.api,
106
107
  disabled = _ref3.disabled;
107
108
  var intl = (0, _reactIntlNext.useIntl)();
108
109
  var mode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'connectivity.mode');
109
110
  var isOffline = mode === 'offline' || false;
110
- var isDockedToTop = (api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar.sharedState.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top';
111
+ var isDockedToTop = (0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin') ? (api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.preferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.toolbarDockingPosition) === 'top' : (api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar.sharedState.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top';
111
112
  if (isDockedToTop) {
112
113
  return /*#__PURE__*/React.createElement(_uiMenu.ToolbarButton, {
113
114
  "aria-label": intl.formatMessage(_messages.selectionToolbarMessages.toolbarPositionPinedAtTop)
@@ -12,6 +12,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
12
12
  import PinIcon from '@atlaskit/icon/core/pin';
13
13
  import PinFilledIcon from '@atlaskit/icon/core/pin-filled';
14
14
  import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
15
+ import { fg } from '@atlaskit/platform-feature-flags';
15
16
  import { getOverflowPrimaryToolbarConfig } from './overflow-toolbar-config';
16
17
  const DROPDOWN_WIDTH = 240;
17
18
  const buttonStyles = null;
@@ -88,11 +89,11 @@ export const PrimaryToolbarComponentNew = ({
88
89
  api,
89
90
  disabled
90
91
  }) => {
91
- var _api$selectionToolbar;
92
+ var _api$userPreferences, _api$userPreferences$, _api$userPreferences$2, _api$selectionToolbar;
92
93
  const intl = useIntl();
93
94
  const mode = useSharedPluginStateSelector(api, 'connectivity.mode');
94
95
  const isOffline = mode === 'offline' || false;
95
- const isDockedToTop = (api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar.sharedState.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top';
96
+ const isDockedToTop = fg('platform_editor_use_preferences_plugin') ? (api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : (_api$userPreferences$ = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences$ === void 0 ? void 0 : (_api$userPreferences$2 = _api$userPreferences$.preferences) === null || _api$userPreferences$2 === void 0 ? void 0 : _api$userPreferences$2.toolbarDockingPosition) === 'top' : (api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar.sharedState.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top';
96
97
  if (isDockedToTop) {
97
98
  return /*#__PURE__*/React.createElement(ToolbarButton, {
98
99
  "aria-label": intl.formatMessage(selectionToolbarMessages.toolbarPositionPinedAtTop)
@@ -13,6 +13,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
13
13
  import PinIcon from '@atlaskit/icon/core/pin';
14
14
  import PinFilledIcon from '@atlaskit/icon/core/pin-filled';
15
15
  import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
16
17
  import { getOverflowPrimaryToolbarConfig } from './overflow-toolbar-config';
17
18
  var DROPDOWN_WIDTH = 240;
18
19
  var buttonStyles = null;
@@ -91,13 +92,13 @@ export function PrimaryToolbarComponent(_ref) {
91
92
  * button to the toolbar to the or make it in-line.
92
93
  */
93
94
  export var PrimaryToolbarComponentNew = function PrimaryToolbarComponentNew(_ref3) {
94
- var _api$selectionToolbar;
95
+ var _api$userPreferences, _api$selectionToolbar;
95
96
  var api = _ref3.api,
96
97
  disabled = _ref3.disabled;
97
98
  var intl = useIntl();
98
99
  var mode = useSharedPluginStateSelector(api, 'connectivity.mode');
99
100
  var isOffline = mode === 'offline' || false;
100
- var isDockedToTop = (api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar.sharedState.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top';
101
+ var isDockedToTop = fg('platform_editor_use_preferences_plugin') ? (api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.preferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.toolbarDockingPosition) === 'top' : (api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar.sharedState.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top';
101
102
  if (isDockedToTop) {
102
103
  return /*#__PURE__*/React.createElement(ToolbarButton, {
103
104
  "aria-label": intl.formatMessage(selectionToolbarMessages.toolbarPositionPinedAtTop)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-toolbar",
3
- "version": "3.7.6",
3
+ "version": "4.0.0",
4
4
  "description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -9,8 +9,7 @@
9
9
  },
10
10
  "atlassian": {
11
11
  "team": "Editor: AI",
12
- "singleton": true,
13
- "runReact18": true
12
+ "singleton": true
14
13
  },
15
14
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
16
15
  "main": "dist/cjs/index.js",
@@ -34,24 +33,24 @@
34
33
  },
35
34
  "dependencies": {
36
35
  "@atlaskit/css": "^0.12.0",
37
- "@atlaskit/editor-common": "^107.3.0",
38
- "@atlaskit/editor-plugin-analytics": "^2.3.0",
39
- "@atlaskit/editor-plugin-block-controls": "^3.19.0",
40
- "@atlaskit/editor-plugin-connectivity": "^2.0.0",
41
- "@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
42
- "@atlaskit/editor-plugin-primary-toolbar": "^3.2.0",
43
- "@atlaskit/editor-plugin-user-preferences": "^0.2.0",
36
+ "@atlaskit/editor-plugin-analytics": "^3.0.0",
37
+ "@atlaskit/editor-plugin-block-controls": "^4.0.0",
38
+ "@atlaskit/editor-plugin-connectivity": "^3.0.0",
39
+ "@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
40
+ "@atlaskit/editor-plugin-primary-toolbar": "^4.0.0",
41
+ "@atlaskit/editor-plugin-user-preferences": "^1.0.0",
44
42
  "@atlaskit/editor-prosemirror": "7.0.0",
45
43
  "@atlaskit/icon": "^27.2.0",
46
44
  "@atlaskit/icon-lab": "^5.1.0",
47
45
  "@atlaskit/menu": "^8.0.0",
48
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
- "@atlaskit/tmp-editor-statsig": "^8.4.0",
47
+ "@atlaskit/tmp-editor-statsig": "^8.7.0",
50
48
  "@atlaskit/tokens": "^5.4.0",
51
49
  "@babel/runtime": "^7.0.0",
52
50
  "bind-event-listener": "^3.0.0"
53
51
  },
54
52
  "peerDependencies": {
53
+ "@atlaskit/editor-common": "^107.6.0",
55
54
  "react": "^18.2.0",
56
55
  "react-dom": "^18.2.0",
57
56
  "react-intl-next": "npm:react-intl@^5.18.1"