@atlaskit/editor-plugin-loom 2.2.15 → 2.3.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,17 @@
1
1
  # @atlaskit/editor-plugin-loom
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#120426](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/120426)
8
+ [`1cb3869ab1a96`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1cb3869ab1a96) -
9
+ [ED-23436] Use editor primary toolbar plugin to structure the primary toolbar
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 2.2.15
4
16
 
5
17
  ### Patch Changes
@@ -18,6 +18,18 @@ var loomPlugin = exports.loomPlugin = function loomPlugin(_ref) {
18
18
  var config = _ref.config,
19
19
  api = _ref.api;
20
20
  var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
21
+ var primaryToolbarComponent = function primaryToolbarComponent(_ref2) {
22
+ var disabled = _ref2.disabled,
23
+ appearance = _ref2.appearance;
24
+ if (!config.shouldShowToolbarButton) {
25
+ return null;
26
+ }
27
+ return /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
28
+ disabled: disabled,
29
+ api: api,
30
+ appearance: appearance
31
+ });
32
+ };
21
33
  return {
22
34
  name: 'loom',
23
35
  actions: {
@@ -42,8 +54,8 @@ var loomPlugin = exports.loomPlugin = function loomPlugin(_ref) {
42
54
  },
43
55
  pluginsOptions: {
44
56
  // Enable inserting Loom recordings through the slash command
45
- quickInsert: function quickInsert(_ref2) {
46
- var formatMessage = _ref2.formatMessage;
57
+ quickInsert: function quickInsert(_ref3) {
58
+ var formatMessage = _ref3.formatMessage;
47
59
  return [{
48
60
  id: 'loom',
49
61
  title: formatMessage(_messages.toolbarInsertBlockMessages.recordVideo),
@@ -84,17 +96,13 @@ var loomPlugin = exports.loomPlugin = function loomPlugin(_ref) {
84
96
  }
85
97
  },
86
98
  // Enable inserting Loom recordings through main toolbar
87
- primaryToolbarComponent: function primaryToolbarComponent(_ref3) {
88
- var disabled = _ref3.disabled,
89
- appearance = _ref3.appearance;
90
- if (!config.shouldShowToolbarButton) {
91
- return null;
92
- }
93
- return /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
94
- disabled: disabled,
95
- api: api,
96
- appearance: appearance
97
- });
98
- }
99
+ usePluginHook: function usePluginHook() {
100
+ var _api$core, _api$primaryToolbar;
101
+ api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
102
+ name: 'loom',
103
+ component: primaryToolbarComponent
104
+ }));
105
+ },
106
+ primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
99
107
  };
100
108
  };
@@ -12,6 +12,19 @@ export const loomPlugin = ({
12
12
  }) => {
13
13
  var _api$analytics;
14
14
  const editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
15
+ const primaryToolbarComponent = ({
16
+ disabled,
17
+ appearance
18
+ }) => {
19
+ if (!config.shouldShowToolbarButton) {
20
+ return null;
21
+ }
22
+ return /*#__PURE__*/React.createElement(LoomToolbarButton, {
23
+ disabled: disabled,
24
+ api: api,
25
+ appearance: appearance
26
+ });
27
+ };
15
28
  return {
16
29
  name: 'loom',
17
30
  actions: {
@@ -71,18 +84,13 @@ export const loomPlugin = ({
71
84
  }]
72
85
  },
73
86
  // Enable inserting Loom recordings through main toolbar
74
- primaryToolbarComponent({
75
- disabled,
76
- appearance
77
- }) {
78
- if (!config.shouldShowToolbarButton) {
79
- return null;
80
- }
81
- return /*#__PURE__*/React.createElement(LoomToolbarButton, {
82
- disabled: disabled,
83
- api: api,
84
- appearance: appearance
85
- });
86
- }
87
+ usePluginHook: () => {
88
+ var _api$core, _api$primaryToolbar;
89
+ api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(api === null || api === void 0 ? void 0 : (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
90
+ name: 'loom',
91
+ component: primaryToolbarComponent
92
+ }));
93
+ },
94
+ primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
87
95
  };
88
96
  };
@@ -11,6 +11,18 @@ export var loomPlugin = function loomPlugin(_ref) {
11
11
  var config = _ref.config,
12
12
  api = _ref.api;
13
13
  var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
14
+ var primaryToolbarComponent = function primaryToolbarComponent(_ref2) {
15
+ var disabled = _ref2.disabled,
16
+ appearance = _ref2.appearance;
17
+ if (!config.shouldShowToolbarButton) {
18
+ return null;
19
+ }
20
+ return /*#__PURE__*/React.createElement(LoomToolbarButton, {
21
+ disabled: disabled,
22
+ api: api,
23
+ appearance: appearance
24
+ });
25
+ };
14
26
  return {
15
27
  name: 'loom',
16
28
  actions: {
@@ -35,8 +47,8 @@ export var loomPlugin = function loomPlugin(_ref) {
35
47
  },
36
48
  pluginsOptions: {
37
49
  // Enable inserting Loom recordings through the slash command
38
- quickInsert: function quickInsert(_ref2) {
39
- var formatMessage = _ref2.formatMessage;
50
+ quickInsert: function quickInsert(_ref3) {
51
+ var formatMessage = _ref3.formatMessage;
40
52
  return [{
41
53
  id: 'loom',
42
54
  title: formatMessage(toolbarInsertBlockMessages.recordVideo),
@@ -77,17 +89,13 @@ export var loomPlugin = function loomPlugin(_ref) {
77
89
  }
78
90
  },
79
91
  // Enable inserting Loom recordings through main toolbar
80
- primaryToolbarComponent: function primaryToolbarComponent(_ref3) {
81
- var disabled = _ref3.disabled,
82
- appearance = _ref3.appearance;
83
- if (!config.shouldShowToolbarButton) {
84
- return null;
85
- }
86
- return /*#__PURE__*/React.createElement(LoomToolbarButton, {
87
- disabled: disabled,
88
- api: api,
89
- appearance: appearance
90
- });
91
- }
92
+ usePluginHook: function usePluginHook() {
93
+ var _api$core, _api$primaryToolbar;
94
+ api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
95
+ name: 'loom',
96
+ component: primaryToolbarComponent
97
+ }));
98
+ },
99
+ primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
92
100
  };
93
101
  };
@@ -3,6 +3,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
4
4
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
5
  import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
6
+ import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
6
7
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
7
8
  import type { LoomPluginState } from './pm-plugin';
8
9
  import type { LoomPluginOptions } from './types';
@@ -11,7 +12,8 @@ export type LoomPlugin = NextEditorPlugin<'loom', {
11
12
  dependencies: [
12
13
  OptionalPlugin<AnalyticsPlugin>,
13
14
  WidthPlugin,
14
- HyperlinkPlugin
15
+ HyperlinkPlugin,
16
+ OptionalPlugin<PrimaryToolbarPlugin>
15
17
  ];
16
18
  sharedState: LoomPluginState | undefined;
17
19
  actions: {
@@ -197,7 +197,7 @@ declare const _default: import("react").FC<import("react-intl-next").WithIntlPro
197
197
  sharedState: import("@atlaskit/editor-plugin-block-controls").BlockControlsSharedState;
198
198
  commands: {
199
199
  moveNode: (start: number, to: number) => import("@atlaskit/editor-common/types").EditorCommand;
200
- showDragHandleAt: (pos: number, anchorName: string, nodeType: string) => import("@atlaskit/editor-common/types").EditorCommand;
200
+ showDragHandleAt: (pos: number, anchorName: string, nodeType: string, handleOptions?: import("@atlaskit/editor-plugin-block-controls").HandleOptions) => import("@atlaskit/editor-common/types").EditorCommand;
201
201
  setNodeDragged: (posNumber: number, anchorName: string, nodeType: string) => import("@atlaskit/editor-common/types").EditorCommand;
202
202
  };
203
203
  }, undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
@@ -226,7 +226,15 @@ declare const _default: import("react").FC<import("react-intl-next").WithIntlPro
226
226
  showLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").ShowLinkToolbar;
227
227
  };
228
228
  sharedState: import("@atlaskit/editor-common/link").HyperlinkState | undefined;
229
- }, import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined>];
229
+ }, import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"primaryToolbar", {
230
+ sharedState: import("@atlaskit/editor-plugin-primary-toolbar").PrimaryToolbarPluginState | undefined;
231
+ commands: {
232
+ registerComponent: ({ name, component, }: {
233
+ name: import("@atlaskit/editor-plugin-primary-toolbar").ToolbarElementNames;
234
+ component: import("@atlaskit/editor-common/types").ToolbarUIComponentFactory;
235
+ }) => import("@atlaskit/editor-common/types").EditorCommand;
236
+ };
237
+ }, undefined>>];
230
238
  sharedState: import("..").LoomPluginState | undefined;
231
239
  actions: {
232
240
  recordVideo: ({ inputMethod, editorAnalyticsAPI, }: {
@@ -431,7 +439,7 @@ declare const _default: import("react").FC<import("react-intl-next").WithIntlPro
431
439
  sharedState: import("@atlaskit/editor-plugin-block-controls").BlockControlsSharedState;
432
440
  commands: {
433
441
  moveNode: (start: number, to: number) => import("@atlaskit/editor-common/types").EditorCommand;
434
- showDragHandleAt: (pos: number, anchorName: string, nodeType: string) => import("@atlaskit/editor-common/types").EditorCommand;
442
+ showDragHandleAt: (pos: number, anchorName: string, nodeType: string, handleOptions?: import("@atlaskit/editor-plugin-block-controls").HandleOptions) => import("@atlaskit/editor-common/types").EditorCommand;
435
443
  setNodeDragged: (posNumber: number, anchorName: string, nodeType: string) => import("@atlaskit/editor-common/types").EditorCommand;
436
444
  };
437
445
  }, undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
@@ -460,7 +468,15 @@ declare const _default: import("react").FC<import("react-intl-next").WithIntlPro
460
468
  showLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").ShowLinkToolbar;
461
469
  };
462
470
  sharedState: import("@atlaskit/editor-common/link").HyperlinkState | undefined;
463
- }, import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined>];
471
+ }, import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"primaryToolbar", {
472
+ sharedState: import("@atlaskit/editor-plugin-primary-toolbar").PrimaryToolbarPluginState | undefined;
473
+ commands: {
474
+ registerComponent: ({ name, component, }: {
475
+ name: import("@atlaskit/editor-plugin-primary-toolbar").ToolbarElementNames;
476
+ component: import("@atlaskit/editor-common/types").ToolbarUIComponentFactory;
477
+ }) => import("@atlaskit/editor-common/types").EditorCommand;
478
+ };
479
+ }, undefined>>];
464
480
  sharedState: import("..").LoomPluginState | undefined;
465
481
  actions: {
466
482
  recordVideo: ({ inputMethod, editorAnalyticsAPI, }: {
@@ -3,6 +3,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
4
4
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
5
  import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
6
+ import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
6
7
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
7
8
  import type { LoomPluginState } from './pm-plugin';
8
9
  import type { LoomPluginOptions } from './types';
@@ -11,7 +12,8 @@ export type LoomPlugin = NextEditorPlugin<'loom', {
11
12
  dependencies: [
12
13
  OptionalPlugin<AnalyticsPlugin>,
13
14
  WidthPlugin,
14
- HyperlinkPlugin
15
+ HyperlinkPlugin,
16
+ OptionalPlugin<PrimaryToolbarPlugin>
15
17
  ];
16
18
  sharedState: LoomPluginState | undefined;
17
19
  actions: {
@@ -246,7 +246,7 @@ declare const _default: import("react").FC<import("react-intl-next").WithIntlPro
246
246
  sharedState: import("@atlaskit/editor-plugin-block-controls").BlockControlsSharedState;
247
247
  commands: {
248
248
  moveNode: (start: number, to: number) => import("@atlaskit/editor-common/types").EditorCommand;
249
- showDragHandleAt: (pos: number, anchorName: string, nodeType: string) => import("@atlaskit/editor-common/types").EditorCommand;
249
+ showDragHandleAt: (pos: number, anchorName: string, nodeType: string, handleOptions?: import("@atlaskit/editor-plugin-block-controls").HandleOptions) => import("@atlaskit/editor-common/types").EditorCommand;
250
250
  setNodeDragged: (posNumber: number, anchorName: string, nodeType: string) => import("@atlaskit/editor-common/types").EditorCommand;
251
251
  };
252
252
  }, undefined>>,
@@ -280,7 +280,16 @@ declare const _default: import("react").FC<import("react-intl-next").WithIntlPro
280
280
  showLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").ShowLinkToolbar;
281
281
  };
282
282
  sharedState: import("@atlaskit/editor-common/link").HyperlinkState | undefined;
283
- }, import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined>
283
+ }, import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined>,
284
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"primaryToolbar", {
285
+ sharedState: import("@atlaskit/editor-plugin-primary-toolbar").PrimaryToolbarPluginState | undefined;
286
+ commands: {
287
+ registerComponent: ({ name, component, }: {
288
+ name: import("@atlaskit/editor-plugin-primary-toolbar").ToolbarElementNames;
289
+ component: import("@atlaskit/editor-common/types").ToolbarUIComponentFactory;
290
+ }) => import("@atlaskit/editor-common/types").EditorCommand;
291
+ };
292
+ }, undefined>>
284
293
  ];
285
294
  sharedState: import("..").LoomPluginState | undefined;
286
295
  actions: {
@@ -535,7 +544,7 @@ declare const _default: import("react").FC<import("react-intl-next").WithIntlPro
535
544
  sharedState: import("@atlaskit/editor-plugin-block-controls").BlockControlsSharedState;
536
545
  commands: {
537
546
  moveNode: (start: number, to: number) => import("@atlaskit/editor-common/types").EditorCommand;
538
- showDragHandleAt: (pos: number, anchorName: string, nodeType: string) => import("@atlaskit/editor-common/types").EditorCommand;
547
+ showDragHandleAt: (pos: number, anchorName: string, nodeType: string, handleOptions?: import("@atlaskit/editor-plugin-block-controls").HandleOptions) => import("@atlaskit/editor-common/types").EditorCommand;
539
548
  setNodeDragged: (posNumber: number, anchorName: string, nodeType: string) => import("@atlaskit/editor-common/types").EditorCommand;
540
549
  };
541
550
  }, undefined>>,
@@ -569,7 +578,16 @@ declare const _default: import("react").FC<import("react-intl-next").WithIntlPro
569
578
  showLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").ShowLinkToolbar;
570
579
  };
571
580
  sharedState: import("@atlaskit/editor-common/link").HyperlinkState | undefined;
572
- }, import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined>
581
+ }, import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined>,
582
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"primaryToolbar", {
583
+ sharedState: import("@atlaskit/editor-plugin-primary-toolbar").PrimaryToolbarPluginState | undefined;
584
+ commands: {
585
+ registerComponent: ({ name, component, }: {
586
+ name: import("@atlaskit/editor-plugin-primary-toolbar").ToolbarElementNames;
587
+ component: import("@atlaskit/editor-common/types").ToolbarUIComponentFactory;
588
+ }) => import("@atlaskit/editor-common/types").EditorCommand;
589
+ };
590
+ }, undefined>>
573
591
  ];
574
592
  sharedState: import("..").LoomPluginState | undefined;
575
593
  actions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-loom",
3
- "version": "2.2.15",
3
+ "version": "2.3.0",
4
4
  "description": "Loom plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,9 +36,10 @@
36
36
  ".": "./src/index.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@atlaskit/editor-common": "^85.0.0",
39
+ "@atlaskit/editor-common": "^85.1.0",
40
40
  "@atlaskit/editor-plugin-analytics": "^1.4.0",
41
41
  "@atlaskit/editor-plugin-hyperlink": "^2.3.0",
42
+ "@atlaskit/editor-plugin-primary-toolbar": "^1.2.0",
42
43
  "@atlaskit/editor-plugin-width": "^1.1.0",
43
44
  "@atlaskit/editor-prosemirror": "4.0.1",
44
45
  "@atlaskit/logo": "^14.1.0",