@atlaskit/editor-plugin-loom 2.0.0 → 2.1.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-loom
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#90626](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90626) [`8efec4489602`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8efec4489602) - show/hide loom button in toolbar via editor plugin config
8
+
9
+ ### Patch Changes
10
+
11
+ - [#90878](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90878) [`962275ee0910`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/962275ee0910) - [ux] [ED-22852] Update loom quick insert title, description and logo
12
+ - Updated dependencies
13
+
14
+ ## 2.0.1
15
+
16
+ ### Patch Changes
17
+
18
+ - [#90526](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90526) [`2f75eb73984f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2f75eb73984f) - [ux] Update toolbar icon to Loom
19
+
3
20
  ## 2.0.0
4
21
 
5
22
  ### Major Changes
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _analytics = require("@atlaskit/editor-common/analytics");
10
10
  var _messages = require("@atlaskit/editor-common/messages");
11
11
  var _monitoring = require("@atlaskit/editor-common/monitoring");
12
- var _quickInsert = require("@atlaskit/editor-common/quick-insert");
12
+ var _logo = require("@atlaskit/logo");
13
13
  var _commands = require("./commands");
14
14
  var _pmPlugin = require("./pm-plugin");
15
15
  var _ToolbarButton = _interopRequireDefault(require("./ui/ToolbarButton"));
@@ -48,7 +48,9 @@ var loomPlugin = exports.loomPlugin = function loomPlugin(_ref) {
48
48
  keywords: ['loom', 'record', 'video'],
49
49
  priority: 800,
50
50
  icon: function icon() {
51
- return /*#__PURE__*/_react.default.createElement(_quickInsert.IconLoom, null);
51
+ return /*#__PURE__*/_react.default.createElement(_logo.LoomIcon, {
52
+ appearance: "brand"
53
+ });
52
54
  },
53
55
  action: function action(insert, editorState) {
54
56
  var _recordVideo;
@@ -81,6 +83,9 @@ var loomPlugin = exports.loomPlugin = function loomPlugin(_ref) {
81
83
  // Enable inserting Loom recordings through main toolbar
82
84
  primaryToolbarComponent: function primaryToolbarComponent(_ref3) {
83
85
  var disabled = _ref3.disabled;
86
+ if (!config.shouldShowToolbarButton) {
87
+ return null;
88
+ }
84
89
  return /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
85
90
  disabled: disabled,
86
91
  api: api
@@ -11,7 +11,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
11
11
  var _hooks = require("@atlaskit/editor-common/hooks");
12
12
  var _messages = require("@atlaskit/editor-common/messages");
13
13
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
14
- var _videoCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/video-circle"));
14
+ var _logo = require("@atlaskit/logo");
15
15
  var _commands = require("../commands");
16
16
  var LoomToolbarButton = function LoomToolbarButton(_ref) {
17
17
  var disabled = _ref.disabled,
@@ -22,7 +22,7 @@ var LoomToolbarButton = function LoomToolbarButton(_ref) {
22
22
  if (!loomState) {
23
23
  return null;
24
24
  }
25
- var label = formatMessage(_messages.toolbarInsertBlockMessages.recordVideo);
25
+ var label = formatMessage(_messages.toolbarInsertBlockMessages.addLoomVideo);
26
26
  return /*#__PURE__*/_react.default.createElement(_uiMenu.ToolbarButton, {
27
27
  buttonId: _uiMenu.TOOLBAR_BUTTON.RECORD_VIDEO,
28
28
  onClick: function onClick() {
@@ -36,8 +36,9 @@ var LoomToolbarButton = function LoomToolbarButton(_ref) {
36
36
  ,
37
37
  disabled: disabled || !(loomState !== null && loomState !== void 0 && loomState.isEnabled),
38
38
  title: label,
39
- iconBefore: /*#__PURE__*/_react.default.createElement(_videoCircle.default, {
40
- label: label
39
+ iconBefore: /*#__PURE__*/_react.default.createElement(_logo.LoomIcon, {
40
+ label: label,
41
+ size: "small"
41
42
  })
42
43
  });
43
44
  };
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages';
4
4
  import { logException } from '@atlaskit/editor-common/monitoring';
5
- import { IconLoom } from '@atlaskit/editor-common/quick-insert';
5
+ import { LoomIcon } from '@atlaskit/logo';
6
6
  import { recordVideo, recordVideoFailed } from './commands';
7
7
  import { createPlugin, loomPluginKey } from './pm-plugin';
8
8
  import LoomToolbarButton from './ui/ToolbarButton';
@@ -37,7 +37,9 @@ export const loomPlugin = ({
37
37
  description: formatMessage(toolbarInsertBlockMessages.recordVideoDescription),
38
38
  keywords: ['loom', 'record', 'video'],
39
39
  priority: 800,
40
- icon: () => /*#__PURE__*/React.createElement(IconLoom, null),
40
+ icon: () => /*#__PURE__*/React.createElement(LoomIcon, {
41
+ appearance: "brand"
42
+ }),
41
43
  action(insert, editorState) {
42
44
  var _recordVideo;
43
45
  const tr = insert(undefined);
@@ -69,6 +71,9 @@ export const loomPlugin = ({
69
71
  primaryToolbarComponent({
70
72
  disabled
71
73
  }) {
74
+ if (!config.shouldShowToolbarButton) {
75
+ return null;
76
+ }
72
77
  return /*#__PURE__*/React.createElement(LoomToolbarButton, {
73
78
  disabled: disabled,
74
79
  api: api
@@ -4,7 +4,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
5
5
  import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages';
6
6
  import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
7
- import VideoCircleIcon from '@atlaskit/icon/glyph/video-circle';
7
+ import { LoomIcon } from '@atlaskit/logo';
8
8
  import { recordVideo } from '../commands';
9
9
  const LoomToolbarButton = ({
10
10
  disabled,
@@ -19,7 +19,7 @@ const LoomToolbarButton = ({
19
19
  if (!loomState) {
20
20
  return null;
21
21
  }
22
- const label = formatMessage(toolbarInsertBlockMessages.recordVideo);
22
+ const label = formatMessage(toolbarInsertBlockMessages.addLoomVideo);
23
23
  return /*#__PURE__*/React.createElement(ToolbarButton, {
24
24
  buttonId: TOOLBAR_BUTTON.RECORD_VIDEO,
25
25
  onClick: () => {
@@ -33,8 +33,9 @@ const LoomToolbarButton = ({
33
33
  ,
34
34
  disabled: disabled || !(loomState !== null && loomState !== void 0 && loomState.isEnabled),
35
35
  title: label,
36
- iconBefore: /*#__PURE__*/React.createElement(VideoCircleIcon, {
37
- label: label
36
+ iconBefore: /*#__PURE__*/React.createElement(LoomIcon, {
37
+ label: label,
38
+ size: "small"
38
39
  })
39
40
  });
40
41
  };
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages';
4
4
  import { logException } from '@atlaskit/editor-common/monitoring';
5
- import { IconLoom } from '@atlaskit/editor-common/quick-insert';
5
+ import { LoomIcon } from '@atlaskit/logo';
6
6
  import { recordVideo, recordVideoFailed } from './commands';
7
7
  import { createPlugin, loomPluginKey } from './pm-plugin';
8
8
  import LoomToolbarButton from './ui/ToolbarButton';
@@ -41,7 +41,9 @@ export var loomPlugin = function loomPlugin(_ref) {
41
41
  keywords: ['loom', 'record', 'video'],
42
42
  priority: 800,
43
43
  icon: function icon() {
44
- return /*#__PURE__*/React.createElement(IconLoom, null);
44
+ return /*#__PURE__*/React.createElement(LoomIcon, {
45
+ appearance: "brand"
46
+ });
45
47
  },
46
48
  action: function action(insert, editorState) {
47
49
  var _recordVideo;
@@ -74,6 +76,9 @@ export var loomPlugin = function loomPlugin(_ref) {
74
76
  // Enable inserting Loom recordings through main toolbar
75
77
  primaryToolbarComponent: function primaryToolbarComponent(_ref3) {
76
78
  var disabled = _ref3.disabled;
79
+ if (!config.shouldShowToolbarButton) {
80
+ return null;
81
+ }
77
82
  return /*#__PURE__*/React.createElement(LoomToolbarButton, {
78
83
  disabled: disabled,
79
84
  api: api
@@ -4,7 +4,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
5
5
  import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages';
6
6
  import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
7
- import VideoCircleIcon from '@atlaskit/icon/glyph/video-circle';
7
+ import { LoomIcon } from '@atlaskit/logo';
8
8
  import { recordVideo } from '../commands';
9
9
  var LoomToolbarButton = function LoomToolbarButton(_ref) {
10
10
  var disabled = _ref.disabled,
@@ -15,7 +15,7 @@ var LoomToolbarButton = function LoomToolbarButton(_ref) {
15
15
  if (!loomState) {
16
16
  return null;
17
17
  }
18
- var label = formatMessage(toolbarInsertBlockMessages.recordVideo);
18
+ var label = formatMessage(toolbarInsertBlockMessages.addLoomVideo);
19
19
  return /*#__PURE__*/React.createElement(ToolbarButton, {
20
20
  buttonId: TOOLBAR_BUTTON.RECORD_VIDEO,
21
21
  onClick: function onClick() {
@@ -29,8 +29,9 @@ var LoomToolbarButton = function LoomToolbarButton(_ref) {
29
29
  ,
30
30
  disabled: disabled || !(loomState !== null && loomState !== void 0 && loomState.isEnabled),
31
31
  title: label,
32
- iconBefore: /*#__PURE__*/React.createElement(VideoCircleIcon, {
33
- label: label
32
+ iconBefore: /*#__PURE__*/React.createElement(LoomIcon, {
33
+ label: label,
34
+ size: "small"
34
35
  })
35
36
  });
36
37
  };
@@ -1,4 +1,4 @@
1
1
  export { loomPlugin } from './plugin';
2
2
  export type { LoomPlugin } from './plugin';
3
3
  export type { LoomPluginState } from './pm-plugin';
4
- export type { LoomPluginOptions, VideoMeta, GetClient, GetClientResult, LoomPluginErrorMessages, LoomSDKErrorMessages, } from './types';
4
+ export type { LoomPluginOptions, LoomProviderOptions, VideoMeta, GetClient, GetClientResult, LoomPluginErrorMessages, LoomSDKErrorMessages, } from './types';
@@ -19,9 +19,11 @@ export type GetClientResult = {
19
19
  message: LoomPluginErrorMessages | LoomSDKErrorMessages;
20
20
  };
21
21
  export type GetClient = Promise<GetClientResult>;
22
+ export type LoomProviderOptions = {
23
+ getClient: () => GetClient;
24
+ };
22
25
  export type LoomPluginOptions = {
23
- loomProvider: {
24
- getClient: () => GetClient;
25
- };
26
+ loomProvider: LoomProviderOptions;
27
+ shouldShowToolbarButton?: boolean;
26
28
  };
27
29
  export {};
@@ -33,6 +33,7 @@ declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
33
33
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
34
34
  actions: {
35
35
  prependToolbarButtons: import("@atlaskit/editor-plugin-hyperlink").PrependToolbarButtons;
36
+ addToolbarItems: import("@atlaskit/editor-plugin-hyperlink").AddToolbarItems;
36
37
  hideLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").HideLinkToolbar;
37
38
  insertLink: import("@atlaskit/editor-plugin-hyperlink").InsertLink;
38
39
  updateLink: import("@atlaskit/editor-plugin-hyperlink").UpdateLink;
@@ -72,6 +73,7 @@ declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
72
73
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
73
74
  actions: {
74
75
  prependToolbarButtons: import("@atlaskit/editor-plugin-hyperlink").PrependToolbarButtons;
76
+ addToolbarItems: import("@atlaskit/editor-plugin-hyperlink").AddToolbarItems;
75
77
  hideLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").HideLinkToolbar;
76
78
  insertLink: import("@atlaskit/editor-plugin-hyperlink").InsertLink;
77
79
  updateLink: import("@atlaskit/editor-plugin-hyperlink").UpdateLink;
@@ -115,6 +117,7 @@ declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
115
117
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
116
118
  actions: {
117
119
  prependToolbarButtons: import("@atlaskit/editor-plugin-hyperlink").PrependToolbarButtons;
120
+ addToolbarItems: import("@atlaskit/editor-plugin-hyperlink").AddToolbarItems;
118
121
  hideLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").HideLinkToolbar;
119
122
  insertLink: import("@atlaskit/editor-plugin-hyperlink").InsertLink;
120
123
  updateLink: import("@atlaskit/editor-plugin-hyperlink").UpdateLink;
@@ -154,6 +157,7 @@ declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
154
157
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
155
158
  actions: {
156
159
  prependToolbarButtons: import("@atlaskit/editor-plugin-hyperlink").PrependToolbarButtons;
160
+ addToolbarItems: import("@atlaskit/editor-plugin-hyperlink").AddToolbarItems;
157
161
  hideLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").HideLinkToolbar;
158
162
  insertLink: import("@atlaskit/editor-plugin-hyperlink").InsertLink;
159
163
  updateLink: import("@atlaskit/editor-plugin-hyperlink").UpdateLink;
@@ -1,4 +1,4 @@
1
1
  export { loomPlugin } from './plugin';
2
2
  export type { LoomPlugin } from './plugin';
3
3
  export type { LoomPluginState } from './pm-plugin';
4
- export type { LoomPluginOptions, VideoMeta, GetClient, GetClientResult, LoomPluginErrorMessages, LoomSDKErrorMessages, } from './types';
4
+ export type { LoomPluginOptions, LoomProviderOptions, VideoMeta, GetClient, GetClientResult, LoomPluginErrorMessages, LoomSDKErrorMessages, } from './types';
@@ -19,9 +19,11 @@ export type GetClientResult = {
19
19
  message: LoomPluginErrorMessages | LoomSDKErrorMessages;
20
20
  };
21
21
  export type GetClient = Promise<GetClientResult>;
22
+ export type LoomProviderOptions = {
23
+ getClient: () => GetClient;
24
+ };
22
25
  export type LoomPluginOptions = {
23
- loomProvider: {
24
- getClient: () => GetClient;
25
- };
26
+ loomProvider: LoomProviderOptions;
27
+ shouldShowToolbarButton?: boolean;
26
28
  };
27
29
  export {};
@@ -42,6 +42,7 @@ declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
42
42
  ];
43
43
  actions: {
44
44
  prependToolbarButtons: import("@atlaskit/editor-plugin-hyperlink").PrependToolbarButtons;
45
+ addToolbarItems: import("@atlaskit/editor-plugin-hyperlink").AddToolbarItems;
45
46
  hideLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").HideLinkToolbar;
46
47
  insertLink: import("@atlaskit/editor-plugin-hyperlink").InsertLink;
47
48
  updateLink: import("@atlaskit/editor-plugin-hyperlink").UpdateLink;
@@ -90,6 +91,7 @@ declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
90
91
  ];
91
92
  actions: {
92
93
  prependToolbarButtons: import("@atlaskit/editor-plugin-hyperlink").PrependToolbarButtons;
94
+ addToolbarItems: import("@atlaskit/editor-plugin-hyperlink").AddToolbarItems;
93
95
  hideLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").HideLinkToolbar;
94
96
  insertLink: import("@atlaskit/editor-plugin-hyperlink").InsertLink;
95
97
  updateLink: import("@atlaskit/editor-plugin-hyperlink").UpdateLink;
@@ -143,6 +145,7 @@ declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
143
145
  ];
144
146
  actions: {
145
147
  prependToolbarButtons: import("@atlaskit/editor-plugin-hyperlink").PrependToolbarButtons;
148
+ addToolbarItems: import("@atlaskit/editor-plugin-hyperlink").AddToolbarItems;
146
149
  hideLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").HideLinkToolbar;
147
150
  insertLink: import("@atlaskit/editor-plugin-hyperlink").InsertLink;
148
151
  updateLink: import("@atlaskit/editor-plugin-hyperlink").UpdateLink;
@@ -191,6 +194,7 @@ declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
191
194
  ];
192
195
  actions: {
193
196
  prependToolbarButtons: import("@atlaskit/editor-plugin-hyperlink").PrependToolbarButtons;
197
+ addToolbarItems: import("@atlaskit/editor-plugin-hyperlink").AddToolbarItems;
194
198
  hideLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").HideLinkToolbar;
195
199
  insertLink: import("@atlaskit/editor-plugin-hyperlink").InsertLink;
196
200
  updateLink: import("@atlaskit/editor-plugin-hyperlink").UpdateLink;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-loom",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Loom plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,11 +36,11 @@
36
36
  ".": "./src/index.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@atlaskit/editor-common": "^78.23.0",
39
+ "@atlaskit/editor-common": "^78.28.0",
40
40
  "@atlaskit/editor-plugin-analytics": "^1.0.0",
41
- "@atlaskit/editor-plugin-hyperlink": "^1.4.0",
41
+ "@atlaskit/editor-plugin-hyperlink": "^1.5.0",
42
42
  "@atlaskit/editor-prosemirror": "3.0.0",
43
- "@atlaskit/icon": "^22.1.0",
43
+ "@atlaskit/logo": "^13.15.1",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@loomhq/record-sdk": "^2.36.18"
46
46
  },
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@atlaskit/editor-plugin-base": "^1.0.0",
53
- "@atlaskit/editor-plugin-card": "^1.4.0",
53
+ "@atlaskit/editor-plugin-card": "^1.8.0",
54
54
  "@atlaskit/editor-plugin-copy-button": "^1.0.0",
55
55
  "@atlaskit/editor-plugin-decorations": "^1.0.0",
56
56
  "@atlaskit/editor-plugin-editor-disabled": "^1.0.0",