@atlaskit/editor-plugin-media-insert 1.1.1 → 1.1.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,13 @@
1
1
  # @atlaskit/editor-plugin-media-insert
2
2
 
3
+ ## 1.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#126568](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/126568)
8
+ [`ce40c0ff7852f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ce40c0ff7852f) -
9
+ Add menu item and typeahead for Upload image from URL
10
+
3
11
  ## 1.1.1
4
12
 
5
13
  ### Patch Changes
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.mediaInsertPlugin = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _messages = require("@atlaskit/editor-common/messages");
10
+ var _quickInsert = require("@atlaskit/editor-common/quick-insert");
7
11
  var mediaInsertPlugin = exports.mediaInsertPlugin = function mediaInsertPlugin() {
8
12
  return {
9
13
  name: 'mediaInsert',
@@ -11,9 +15,32 @@ var mediaInsertPlugin = exports.mediaInsertPlugin = function mediaInsertPlugin()
11
15
  return [{
12
16
  name: 'mediaInsert',
13
17
  plugin: function plugin() {
18
+ // eslint-disable-next-line no-console
19
+ console.log('mediaInsert plugin');
14
20
  return undefined;
15
21
  }
16
22
  }];
23
+ },
24
+ pluginsOptions: {
25
+ quickInsert: function quickInsert(_ref) {
26
+ var formatMessage = _ref.formatMessage;
27
+ return [{
28
+ id: 'media-insert',
29
+ title: formatMessage(_messages.toolbarInsertBlockMessages.insertMediaFromUrl),
30
+ description: formatMessage(_messages.toolbarInsertBlockMessages.insertMediaFromUrlDescription),
31
+ priority: 400,
32
+ keywords: ['attachment', 'gif', 'media', 'picture', 'image', 'video'],
33
+ icon: function icon() {
34
+ return /*#__PURE__*/_react.default.createElement(_quickInsert.IconImages, null);
35
+ },
36
+ action: function action(insert) {
37
+ return insert({
38
+ type: 'paragraph',
39
+ content: []
40
+ });
41
+ }
42
+ }];
43
+ }
17
44
  }
18
45
  };
19
46
  };
@@ -1,11 +1,34 @@
1
+ import React from 'react';
2
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
3
+ import { IconImages } from '@atlaskit/editor-common/quick-insert';
1
4
  export const mediaInsertPlugin = () => {
2
5
  return {
3
6
  name: 'mediaInsert',
4
7
  pmPlugins: () => [{
5
8
  name: 'mediaInsert',
6
9
  plugin: () => {
10
+ // eslint-disable-next-line no-console
11
+ console.log('mediaInsert plugin');
7
12
  return undefined;
8
13
  }
9
- }]
14
+ }],
15
+ pluginsOptions: {
16
+ quickInsert: ({
17
+ formatMessage
18
+ }) => [{
19
+ id: 'media-insert',
20
+ title: formatMessage(messages.insertMediaFromUrl),
21
+ description: formatMessage(messages.insertMediaFromUrlDescription),
22
+ priority: 400,
23
+ keywords: ['attachment', 'gif', 'media', 'picture', 'image', 'video'],
24
+ icon: () => /*#__PURE__*/React.createElement(IconImages, null),
25
+ action(insert) {
26
+ return insert({
27
+ type: 'paragraph',
28
+ content: []
29
+ });
30
+ }
31
+ }]
32
+ }
10
33
  };
11
34
  };
@@ -1,3 +1,6 @@
1
+ import React from 'react';
2
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
3
+ import { IconImages } from '@atlaskit/editor-common/quick-insert';
1
4
  export var mediaInsertPlugin = function mediaInsertPlugin() {
2
5
  return {
3
6
  name: 'mediaInsert',
@@ -5,9 +8,32 @@ export var mediaInsertPlugin = function mediaInsertPlugin() {
5
8
  return [{
6
9
  name: 'mediaInsert',
7
10
  plugin: function plugin() {
11
+ // eslint-disable-next-line no-console
12
+ console.log('mediaInsert plugin');
8
13
  return undefined;
9
14
  }
10
15
  }];
16
+ },
17
+ pluginsOptions: {
18
+ quickInsert: function quickInsert(_ref) {
19
+ var formatMessage = _ref.formatMessage;
20
+ return [{
21
+ id: 'media-insert',
22
+ title: formatMessage(messages.insertMediaFromUrl),
23
+ description: formatMessage(messages.insertMediaFromUrlDescription),
24
+ priority: 400,
25
+ keywords: ['attachment', 'gif', 'media', 'picture', 'image', 'video'],
26
+ icon: function icon() {
27
+ return /*#__PURE__*/React.createElement(IconImages, null);
28
+ },
29
+ action: function action(insert) {
30
+ return insert({
31
+ type: 'paragraph',
32
+ content: []
33
+ });
34
+ }
35
+ }];
36
+ }
11
37
  }
12
38
  };
13
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media-insert",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Media Insert plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -24,7 +24,7 @@
24
24
  ".": "./src/index.ts"
25
25
  },
26
26
  "dependencies": {
27
- "@atlaskit/editor-common": "^87.0.0",
27
+ "@atlaskit/editor-common": "^87.3.0",
28
28
  "@babel/runtime": "^7.0.0"
29
29
  },
30
30
  "peerDependencies": {