@atlaskit/editor-plugin-quick-insert 7.3.3 → 7.4.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,22 @@
1
1
  # @atlaskit/editor-plugin-quick-insert
2
2
 
3
+ ## 7.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`8fb68ee0471cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8fb68ee0471cc) -
8
+ Add analytic event input method when selecting from Insert Element Browser.
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 7.3.4
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 7.3.3
4
21
 
5
22
  ### Patch Changes
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _react = _interopRequireWildcard(require("react"));
11
+ var _analytics = require("@atlaskit/editor-common/analytics");
11
12
  var _hooks = require("@atlaskit/editor-common/hooks");
12
13
  var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
13
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
@@ -72,7 +73,7 @@ var Modal = function Modal(_ref) {
72
73
  var item = insertableItem.current;
73
74
  insertableItem.current = null;
74
75
  focusInEditor();
75
- insertItem === null || insertItem === void 0 || insertItem(item)(editorView.state, editorView.dispatch);
76
+ insertItem === null || insertItem === void 0 || insertItem(item, _analytics.INPUT_METHOD.ELEMENT_BROWSER)(editorView.state, editorView.dispatch);
76
77
  }, [editorView, focusInEditor, insertItem]);
77
78
  return /*#__PURE__*/_react.default.createElement(_ModalElementBrowser.default, {
78
79
  getItems: getItems,
@@ -1,4 +1,5 @@
1
1
  import React, { useCallback } from 'react';
2
+ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
3
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
4
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
4
5
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -62,7 +63,7 @@ const Modal = ({
62
63
  const item = insertableItem.current;
63
64
  insertableItem.current = null;
64
65
  focusInEditor();
65
- insertItem === null || insertItem === void 0 ? void 0 : insertItem(item)(editorView.state, editorView.dispatch);
66
+ insertItem === null || insertItem === void 0 ? void 0 : insertItem(item, INPUT_METHOD.ELEMENT_BROWSER)(editorView.state, editorView.dispatch);
66
67
  }, [editorView, focusInEditor, insertItem]);
67
68
  return /*#__PURE__*/React.createElement(ModalElementBrowser, {
68
69
  getItems: getItems,
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  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; }
3
3
  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; }
4
4
  import React, { useCallback } from 'react';
5
+ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
5
6
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
6
7
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
7
8
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -63,7 +64,7 @@ var Modal = function Modal(_ref) {
63
64
  var item = insertableItem.current;
64
65
  insertableItem.current = null;
65
66
  focusInEditor();
66
- insertItem === null || insertItem === void 0 || insertItem(item)(editorView.state, editorView.dispatch);
67
+ insertItem === null || insertItem === void 0 || insertItem(item, INPUT_METHOD.ELEMENT_BROWSER)(editorView.state, editorView.dispatch);
67
68
  }, [editorView, focusInEditor, insertItem]);
68
69
  return /*#__PURE__*/React.createElement(ModalElementBrowser, {
69
70
  getItems: getItems,
@@ -3,4 +3,4 @@ import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
3
3
  import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
4
4
  export declare const openElementBrowserModal: EditorCommand;
5
5
  export declare const closeElementBrowserModal: () => Command;
6
- export declare const createInsertItem: (onInsert?: (item: QuickInsertItem) => void) => (item: QuickInsertItem, source?: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR) => Command;
6
+ export declare const createInsertItem: (onInsert?: (item: QuickInsertItem) => void) => (item: QuickInsertItem, source?: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.ELEMENT_BROWSER) => Command;
@@ -12,7 +12,7 @@ export type QuickInsertPluginOptions = CommonQuickInsertPluginOptions;
12
12
  export type QuickInsertPlugin = NextEditorPlugin<'quickInsert', {
13
13
  actions: {
14
14
  getSuggestions: (searchOptions: QuickInsertSearchOptions) => QuickInsertItem[];
15
- insertItem: (item: QuickInsertItem, source?: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR) => Command;
15
+ insertItem: (item: QuickInsertItem, source?: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.ELEMENT_BROWSER) => Command;
16
16
  openTypeAhead: (inputMethod: TypeAheadInputMethod, removePrefixTriggerOnCancel?: boolean) => boolean;
17
17
  };
18
18
  commands: {
@@ -3,4 +3,4 @@ import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
3
3
  import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
4
4
  export declare const openElementBrowserModal: EditorCommand;
5
5
  export declare const closeElementBrowserModal: () => Command;
6
- export declare const createInsertItem: (onInsert?: (item: QuickInsertItem) => void) => (item: QuickInsertItem, source?: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR) => Command;
6
+ export declare const createInsertItem: (onInsert?: (item: QuickInsertItem) => void) => (item: QuickInsertItem, source?: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.ELEMENT_BROWSER) => Command;
@@ -12,7 +12,7 @@ export type QuickInsertPluginOptions = CommonQuickInsertPluginOptions;
12
12
  export type QuickInsertPlugin = NextEditorPlugin<'quickInsert', {
13
13
  actions: {
14
14
  getSuggestions: (searchOptions: QuickInsertSearchOptions) => QuickInsertItem[];
15
- insertItem: (item: QuickInsertItem, source?: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR) => Command;
15
+ insertItem: (item: QuickInsertItem, source?: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.ELEMENT_BROWSER) => Command;
16
16
  openTypeAhead: (inputMethod: TypeAheadInputMethod, removePrefixTriggerOnCancel?: boolean) => boolean;
17
17
  };
18
18
  commands: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-quick-insert",
3
- "version": "7.3.3",
3
+ "version": "7.4.0",
4
4
  "description": "Quick insert plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,13 +39,13 @@
39
39
  "@atlaskit/modal-dialog": "^14.10.0",
40
40
  "@atlaskit/platform-feature-flags": "^1.1.0",
41
41
  "@atlaskit/theme": "^21.0.0",
42
- "@atlaskit/tmp-editor-statsig": "^24.1.0",
42
+ "@atlaskit/tmp-editor-statsig": "^25.7.0",
43
43
  "@atlaskit/tokens": "^11.0.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@emotion/react": "^11.7.1"
46
46
  },
47
47
  "peerDependencies": {
48
- "@atlaskit/editor-common": "^111.12.0",
48
+ "@atlaskit/editor-common": "^111.16.0",
49
49
  "react": "^18.2.0",
50
50
  "react-dom": "^18.2.0",
51
51
  "react-intl-next": "npm:react-intl@^5.18.1"