@atlaskit/editor-plugin-type-ahead 2.7.20 → 3.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,45 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 3.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
+
3
43
  ## 2.7.20
4
44
 
5
45
  ### Patch Changes
@@ -310,7 +310,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
310
310
  var onMoreOptionsClicked = (0, _react.useCallback)(function () {
311
311
  if (
312
312
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning
313
- openElementBrowserModal && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4') && triggerHandler.id === _typeAhead.TypeAheadAvailableNodes.QUICK_INSERT) {
313
+ openElementBrowserModal && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && triggerHandler.id === _typeAhead.TypeAheadAvailableNodes.QUICK_INSERT) {
314
314
  activityStateRef.current = {
315
315
  inputMethod: _analytics.INPUT_METHOD.MOUSE,
316
316
  closeAction: _analytics.ACTION.VIEW_MORE,
@@ -330,7 +330,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
330
330
  ariaLabel: null,
331
331
  preventOverflow: true,
332
332
  onUnmount: function onUnmount() {
333
- if (selectedIndex > -1 && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4')) {
333
+ if (selectedIndex > -1 && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
334
334
  // if selectedIndex is -1, it means that the user has not selected any item
335
335
  // will be handled by WrapperTypeAhead
336
336
  (0, _analytics2.fireTypeAheadClosedAnalyticsEvent)(api, activityStateRef.current.closeAction || _analytics.ACTION.CANCELLED, !isEmptyQuery, activityStateRef.current.inputMethod || _analytics.INPUT_METHOD.MOUSE, activityStateRef.current.invocationMethod);
@@ -359,7 +359,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
359
359
  items: items,
360
360
  selectedIndex: selectedIndex,
361
361
  onItemClick: function onItemClick(mode, index, inputMethod) {
362
- if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4')) {
362
+ if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
363
363
  activityStateRef.current = {
364
364
  inputMethod: inputMethod || null,
365
365
  closeAction: _analytics.ACTION.INSERTED,
@@ -86,7 +86,7 @@ var WrapperTypeAhead = exports.WrapperTypeAhead = /*#__PURE__*/_react.default.me
86
86
  addPrefixTrigger = _ref2.addPrefixTrigger,
87
87
  text = _ref2.text,
88
88
  forceFocusOnEditor = _ref2.forceFocusOnEditor;
89
- if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4')) {
89
+ if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
90
90
  var _getPluginState;
91
91
  (0, _analytics2.fireTypeAheadClosedAnalyticsEvent)(api, _analytics.ACTION.CANCELLED, !!queryRef.current, _analytics.INPUT_METHOD.KEYBOARD, (_getPluginState = (0, _utils.getPluginState)(editorView.state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.inputMethod);
92
92
  }
@@ -118,7 +118,7 @@ var WrapperTypeAhead = exports.WrapperTypeAhead = /*#__PURE__*/_react.default.me
118
118
  if (safeSelectedIndex === -1) {
119
119
  return;
120
120
  }
121
- if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4')) {
121
+ if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
122
122
  var _getPluginState2;
123
123
  (0, _analytics2.fireTypeAheadClosedAnalyticsEvent)(api, _analytics.ACTION.INSERTED, !!queryRef.current, _analytics.INPUT_METHOD.KEYBOARD, (_getPluginState2 = (0, _utils.getPluginState)(editorView.state)) === null || _getPluginState2 === void 0 ? void 0 : _getPluginState2.inputMethod);
124
124
  }
@@ -307,7 +307,7 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
307
307
  const onMoreOptionsClicked = useCallback(() => {
308
308
  if (
309
309
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning
310
- openElementBrowserModal && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4') && triggerHandler.id === TypeAheadAvailableNodes.QUICK_INSERT) {
310
+ openElementBrowserModal && editorExperiment('platform_editor_controls', 'variant1') && triggerHandler.id === TypeAheadAvailableNodes.QUICK_INSERT) {
311
311
  activityStateRef.current = {
312
312
  inputMethod: INPUT_METHOD.MOUSE,
313
313
  closeAction: ACTION.VIEW_MORE,
@@ -327,7 +327,7 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
327
327
  ariaLabel: null,
328
328
  preventOverflow: true,
329
329
  onUnmount: () => {
330
- if (selectedIndex > -1 && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4')) {
330
+ if (selectedIndex > -1 && editorExperiment('platform_editor_controls', 'variant1')) {
331
331
  // if selectedIndex is -1, it means that the user has not selected any item
332
332
  // will be handled by WrapperTypeAhead
333
333
  fireTypeAheadClosedAnalyticsEvent(api, activityStateRef.current.closeAction || ACTION.CANCELLED, !isEmptyQuery, activityStateRef.current.inputMethod || INPUT_METHOD.MOUSE, activityStateRef.current.invocationMethod);
@@ -356,7 +356,7 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
356
356
  items: items,
357
357
  selectedIndex: selectedIndex,
358
358
  onItemClick: (mode, index, inputMethod) => {
359
- if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4')) {
359
+ if (editorExperiment('platform_editor_controls', 'variant1')) {
360
360
  activityStateRef.current = {
361
361
  inputMethod: inputMethod || null,
362
362
  closeAction: ACTION.INSERTED,
@@ -65,7 +65,7 @@ export const WrapperTypeAhead = /*#__PURE__*/React.memo(({
65
65
  text,
66
66
  forceFocusOnEditor
67
67
  }) => {
68
- if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4')) {
68
+ if (editorExperiment('platform_editor_controls', 'variant1')) {
69
69
  var _getPluginState;
70
70
  fireTypeAheadClosedAnalyticsEvent(api, ACTION.CANCELLED, !!queryRef.current, INPUT_METHOD.KEYBOARD, (_getPluginState = getPluginState(editorView.state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.inputMethod);
71
71
  }
@@ -97,7 +97,7 @@ export const WrapperTypeAhead = /*#__PURE__*/React.memo(({
97
97
  if (safeSelectedIndex === -1) {
98
98
  return;
99
99
  }
100
- if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4')) {
100
+ if (editorExperiment('platform_editor_controls', 'variant1')) {
101
101
  var _getPluginState2;
102
102
  fireTypeAheadClosedAnalyticsEvent(api, ACTION.INSERTED, !!queryRef.current, INPUT_METHOD.KEYBOARD, (_getPluginState2 = getPluginState(editorView.state)) === null || _getPluginState2 === void 0 ? void 0 : _getPluginState2.inputMethod);
103
103
  }
@@ -300,7 +300,7 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
300
300
  var onMoreOptionsClicked = useCallback(function () {
301
301
  if (
302
302
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning
303
- openElementBrowserModal && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4') && triggerHandler.id === TypeAheadAvailableNodes.QUICK_INSERT) {
303
+ openElementBrowserModal && editorExperiment('platform_editor_controls', 'variant1') && triggerHandler.id === TypeAheadAvailableNodes.QUICK_INSERT) {
304
304
  activityStateRef.current = {
305
305
  inputMethod: INPUT_METHOD.MOUSE,
306
306
  closeAction: ACTION.VIEW_MORE,
@@ -320,7 +320,7 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
320
320
  ariaLabel: null,
321
321
  preventOverflow: true,
322
322
  onUnmount: function onUnmount() {
323
- if (selectedIndex > -1 && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4')) {
323
+ if (selectedIndex > -1 && editorExperiment('platform_editor_controls', 'variant1')) {
324
324
  // if selectedIndex is -1, it means that the user has not selected any item
325
325
  // will be handled by WrapperTypeAhead
326
326
  fireTypeAheadClosedAnalyticsEvent(api, activityStateRef.current.closeAction || ACTION.CANCELLED, !isEmptyQuery, activityStateRef.current.inputMethod || INPUT_METHOD.MOUSE, activityStateRef.current.invocationMethod);
@@ -349,7 +349,7 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
349
349
  items: items,
350
350
  selectedIndex: selectedIndex,
351
351
  onItemClick: function onItemClick(mode, index, inputMethod) {
352
- if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4')) {
352
+ if (editorExperiment('platform_editor_controls', 'variant1')) {
353
353
  activityStateRef.current = {
354
354
  inputMethod: inputMethod || null,
355
355
  closeAction: ACTION.INSERTED,
@@ -77,7 +77,7 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
77
77
  addPrefixTrigger = _ref2.addPrefixTrigger,
78
78
  text = _ref2.text,
79
79
  forceFocusOnEditor = _ref2.forceFocusOnEditor;
80
- if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4')) {
80
+ if (editorExperiment('platform_editor_controls', 'variant1')) {
81
81
  var _getPluginState;
82
82
  fireTypeAheadClosedAnalyticsEvent(api, ACTION.CANCELLED, !!queryRef.current, INPUT_METHOD.KEYBOARD, (_getPluginState = getPluginState(editorView.state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.inputMethod);
83
83
  }
@@ -109,7 +109,7 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
109
109
  if (safeSelectedIndex === -1) {
110
110
  return;
111
111
  }
112
- if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4')) {
112
+ if (editorExperiment('platform_editor_controls', 'variant1')) {
113
113
  var _getPluginState2;
114
114
  fireTypeAheadClosedAnalyticsEvent(api, ACTION.INSERTED, !!queryRef.current, INPUT_METHOD.KEYBOARD, (_getPluginState2 = getPluginState(editorView.state)) === null || _getPluginState2 === void 0 ? void 0 : _getPluginState2.inputMethod);
115
115
  }
@@ -1,4 +1,4 @@
1
- import { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
1
+ import { ACTION, type INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { TypeAheadPlugin } from '../typeAheadPluginType';
4
4
  import type { TypeAheadInputMethod } from '../types';
@@ -1,4 +1,4 @@
1
- import { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
1
+ import { ACTION, type INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { TypeAheadPlugin } from '../typeAheadPluginType';
4
4
  import type { TypeAheadInputMethod } from '../types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "2.7.20",
3
+ "version": "3.0.0",
4
4
  "description": "Type-ahead plugin 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: Lego",
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,22 +33,21 @@
34
33
  },
35
34
  "dependencies": {
36
35
  "@atlaskit/adf-schema": "^47.6.0",
37
- "@atlaskit/editor-common": "^107.2.0",
38
- "@atlaskit/editor-element-browser": "^0.1.0",
39
- "@atlaskit/editor-plugin-analytics": "^2.3.0",
40
- "@atlaskit/editor-plugin-connectivity": "^2.0.0",
41
- "@atlaskit/editor-plugin-context-panel": "^4.1.0",
42
- "@atlaskit/editor-plugin-metrics": "^3.5.0",
36
+ "@atlaskit/editor-element-browser": "^1.0.0",
37
+ "@atlaskit/editor-plugin-analytics": "^3.0.0",
38
+ "@atlaskit/editor-plugin-connectivity": "^3.0.0",
39
+ "@atlaskit/editor-plugin-context-panel": "^5.0.0",
40
+ "@atlaskit/editor-plugin-metrics": "^4.0.0",
43
41
  "@atlaskit/editor-prosemirror": "7.0.0",
44
42
  "@atlaskit/editor-shared-styles": "^3.4.0",
45
43
  "@atlaskit/heading": "^5.2.0",
46
44
  "@atlaskit/icon": "^27.2.0",
47
45
  "@atlaskit/menu": "^8.0.0",
48
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
- "@atlaskit/primitives": "^14.9.0",
47
+ "@atlaskit/primitives": "^14.10.0",
50
48
  "@atlaskit/prosemirror-input-rules": "^3.3.0",
51
49
  "@atlaskit/theme": "^18.0.0",
52
- "@atlaskit/tmp-editor-statsig": "^8.2.0",
50
+ "@atlaskit/tmp-editor-statsig": "^8.7.0",
53
51
  "@atlaskit/tokens": "^5.4.0",
54
52
  "@babel/runtime": "^7.0.0",
55
53
  "@emotion/react": "^11.7.1",
@@ -60,6 +58,7 @@
60
58
  "w3c-keyname": "^2.1.8"
61
59
  },
62
60
  "peerDependencies": {
61
+ "@atlaskit/editor-common": "^107.6.0",
63
62
  "react": "^18.2.0",
64
63
  "react-dom": "^18.2.0",
65
64
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -105,9 +104,6 @@
105
104
  "platform_editor_quick_insert_placeholder": {
106
105
  "type": "boolean"
107
106
  },
108
- "platform_editor_controls_patch_4": {
109
- "type": "boolean"
110
- },
111
107
  "platform_editor_controls_patch_analytics_3": {
112
108
  "type": "boolean"
113
109
  },