@atlaskit/editor-plugin-insert-block 0.2.0 → 0.2.2

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,17 @@
1
1
  # @atlaskit/editor-plugin-insert-block
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 0.2.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 0.2.0
4
16
 
5
17
  ### Minor Changes
@@ -60,6 +60,9 @@ var InsertMenu = function InsertMenu(_ref) {
60
60
  var onInsertItem = (0, _react.useCallback)(function (item) {
61
61
  var _pluginInjectionApi$q;
62
62
  toggleVisiblity();
63
+ if (!editorView.hasFocus()) {
64
+ editorView.focus();
65
+ }
63
66
  pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q === void 0 || _pluginInjectionApi$q.actions.insertItem(item)(editorView.state, editorView.dispatch);
64
67
  }, [editorView, toggleVisiblity, pluginInjectionApi]);
65
68
  var getItems = (0, _react.useCallback)(function (query, category) {
@@ -43,6 +43,9 @@ const InsertMenu = ({
43
43
  const onInsertItem = useCallback(item => {
44
44
  var _pluginInjectionApi$q;
45
45
  toggleVisiblity();
46
+ if (!editorView.hasFocus()) {
47
+ editorView.focus();
48
+ }
46
49
  pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q === void 0 ? void 0 : _pluginInjectionApi$q.actions.insertItem(item)(editorView.state, editorView.dispatch);
47
50
  }, [editorView, toggleVisiblity, pluginInjectionApi]);
48
51
  const getItems = useCallback((query, category) => {
@@ -54,6 +54,9 @@ var InsertMenu = function InsertMenu(_ref) {
54
54
  var onInsertItem = useCallback(function (item) {
55
55
  var _pluginInjectionApi$q;
56
56
  toggleVisiblity();
57
+ if (!editorView.hasFocus()) {
58
+ editorView.focus();
59
+ }
57
60
  pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q === void 0 || _pluginInjectionApi$q.actions.insertItem(item)(editorView.state, editorView.dispatch);
58
61
  }, [editorView, toggleVisiblity, pluginInjectionApi]);
59
62
  var getItems = useCallback(function (query, category) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/editor-common": "^76.22.0",
34
+ "@atlaskit/editor-common": "^76.25.0",
35
35
  "@atlaskit/editor-plugin-analytics": "^0.3.0",
36
36
  "@atlaskit/editor-plugin-block-type": "^3.0.0",
37
37
  "@atlaskit/editor-plugin-code-block": "^0.1.0",
@@ -43,14 +43,14 @@
43
43
  "@atlaskit/editor-plugin-hyperlink": "^0.6.0",
44
44
  "@atlaskit/editor-plugin-image-upload": "^0.2.0",
45
45
  "@atlaskit/editor-plugin-layout": "^0.1.0",
46
- "@atlaskit/editor-plugin-media": "^0.4.0",
46
+ "@atlaskit/editor-plugin-media": "^0.6.0",
47
47
  "@atlaskit/editor-plugin-mentions": "^0.1.0",
48
48
  "@atlaskit/editor-plugin-panel": "^0.1.0",
49
49
  "@atlaskit/editor-plugin-placeholder-text": "^0.1.0",
50
50
  "@atlaskit/editor-plugin-quick-insert": "^0.2.0",
51
51
  "@atlaskit/editor-plugin-rule": "^0.1.0",
52
52
  "@atlaskit/editor-plugin-status": "^0.2.0",
53
- "@atlaskit/editor-plugin-table": "^5.3.0",
53
+ "@atlaskit/editor-plugin-table": "^5.4.0",
54
54
  "@atlaskit/editor-plugin-tasks-and-decisions": "^0.2.0",
55
55
  "@atlaskit/editor-plugin-type-ahead": "^0.7.0",
56
56
  "@atlaskit/editor-prosemirror": "1.1.0",
@@ -58,7 +58,7 @@
58
58
  "@atlaskit/emoji": "^67.6.0",
59
59
  "@atlaskit/icon": "^22.0.0",
60
60
  "@atlaskit/theme": "^12.6.0",
61
- "@atlaskit/tokens": "^1.28.0",
61
+ "@atlaskit/tokens": "^1.29.0",
62
62
  "@babel/runtime": "^7.0.0",
63
63
  "@emotion/react": "^11.7.1",
64
64
  "lodash": "^4.17.21",
@@ -1,85 +0,0 @@
1
- ## API Report File for "@atlaskit/editor-plugin-insert-block"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
8
- import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
9
- import type { CodeBlockPlugin } from '@atlaskit/editor-plugin-code-block';
10
- import type { DatePlugin } from '@atlaskit/editor-plugin-date';
11
- import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
12
- import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
13
- import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
14
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
15
- import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
16
- import type { ImageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
17
- import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
18
- import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
19
- import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
20
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
21
- import type { OptionalPlugin } from '@atlaskit/editor-common/types';
22
- import type { PanelPlugin } from '@atlaskit/editor-plugin-panel';
23
- import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
24
- import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
25
- import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
26
- import type { StatusPlugin } from '@atlaskit/editor-plugin-status';
27
- import type { TablePlugin } from '@atlaskit/editor-plugin-table';
28
- import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
29
- import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
30
-
31
- // @public (undocumented)
32
- interface InsertBlockOptions {
33
- // (undocumented)
34
- allowExpand?: boolean;
35
- // (undocumented)
36
- allowTables?: boolean;
37
- // (undocumented)
38
- horizontalRuleEnabled?: boolean;
39
- // (undocumented)
40
- insertMenuItems?: any;
41
- // (undocumented)
42
- nativeStatusSupported?: boolean;
43
- // (undocumented)
44
- replacePlusMenuWithElementBrowser?: boolean;
45
- // (undocumented)
46
- showElementBrowserLink?: boolean;
47
- }
48
-
49
- // @public (undocumented)
50
- export type InsertBlockPlugin = NextEditorPlugin<'insertBlock', {
51
- pluginConfiguration: InsertBlockOptions | undefined;
52
- dependencies: InsertBlockPluginDependencies;
53
- }>;
54
-
55
- // @public (undocumented)
56
- export const insertBlockPlugin: InsertBlockPlugin;
57
-
58
- // @public (undocumented)
59
- type InsertBlockPluginDependencies = [
60
- OptionalPlugin<FeatureFlagsPlugin>,
61
- TypeAheadPlugin,
62
- OptionalPlugin<TablePlugin>,
63
- OptionalPlugin<HyperlinkPlugin>,
64
- OptionalPlugin<DatePlugin>,
65
- OptionalPlugin<BlockTypePlugin>,
66
- OptionalPlugin<AnalyticsPlugin>,
67
- OptionalPlugin<ImageUploadPlugin>,
68
- OptionalPlugin<EmojiPlugin>,
69
- OptionalPlugin<QuickInsertPlugin>,
70
- OptionalPlugin<RulePlugin>,
71
- OptionalPlugin<CodeBlockPlugin>,
72
- OptionalPlugin<PanelPlugin>,
73
- OptionalPlugin<MediaPlugin>,
74
- OptionalPlugin<MentionsPlugin>,
75
- OptionalPlugin<StatusPlugin>,
76
- OptionalPlugin<LayoutPlugin>,
77
- OptionalPlugin<ExpandPlugin>,
78
- OptionalPlugin<PlaceholderTextPlugin>,
79
- OptionalPlugin<ExtensionPlugin>,
80
- OptionalPlugin<TasksAndDecisionsPlugin>
81
- ];
82
-
83
- // (No @packageDocumentation comment for this package)
84
-
85
- ```