@atlaskit/editor-plugin-loom 5.1.2 → 5.1.3

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-loom
2
2
 
3
+ ## 5.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
8
+ Sorted type and interface props to improve Atlaskit docs
9
+ - Updated dependencies
10
+
3
11
  ## 5.1.2
4
12
 
5
13
  ### Patch Changes
@@ -10,29 +10,7 @@ import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
10
10
  import type { LoomPluginState } from './pm-plugins/main';
11
11
  import type { LoomPluginOptions, LoomProviderOptions, PositionType, VideoMeta } from './types';
12
12
  export type LoomPlugin = NextEditorPlugin<'loom', {
13
- pluginConfiguration: LoomPluginOptions;
14
- dependencies: [
15
- OptionalPlugin<AnalyticsPlugin>,
16
- WidthPlugin,
17
- HyperlinkPlugin,
18
- OptionalPlugin<PrimaryToolbarPlugin>,
19
- OptionalPlugin<QuickInsertPlugin>,
20
- OptionalPlugin<ConnectivityPlugin>
21
- ];
22
- sharedState: LoomPluginState | undefined;
23
13
  actions: {
24
- recordVideo: ({ inputMethod, editorAnalyticsAPI, }: {
25
- inputMethod: INPUT_METHOD;
26
- editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
27
- }) => EditorCommand;
28
- /**
29
- * Insert loom into the document.
30
- *
31
- * @param video Video metadata (`sharedUrl` and `title`)
32
- * @param positionType {'start' | 'end' | 'current'} Where you want to insert the loom
33
- * @returns {boolean} If the loom was successfully inserted
34
- */
35
- insertLoom: (video: VideoMeta, positionType: PositionType) => boolean;
36
14
  /**
37
15
  * Given loom provider, initialise loom SDK
38
16
  * @returns error message if initialisation failed
@@ -42,5 +20,27 @@ export type LoomPlugin = NextEditorPlugin<'loom', {
42
20
  }) => Promise<{
43
21
  error?: string;
44
22
  }>;
23
+ /**
24
+ * Insert loom into the document.
25
+ *
26
+ * @param video Video metadata (`sharedUrl` and `title`)
27
+ * @param positionType {'start' | 'end' | 'current'} Where you want to insert the loom
28
+ * @returns {boolean} If the loom was successfully inserted
29
+ */
30
+ insertLoom: (video: VideoMeta, positionType: PositionType) => boolean;
31
+ recordVideo: ({ inputMethod, editorAnalyticsAPI, }: {
32
+ editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
33
+ inputMethod: INPUT_METHOD;
34
+ }) => EditorCommand;
45
35
  };
36
+ dependencies: [
37
+ OptionalPlugin<AnalyticsPlugin>,
38
+ WidthPlugin,
39
+ HyperlinkPlugin,
40
+ OptionalPlugin<PrimaryToolbarPlugin>,
41
+ OptionalPlugin<QuickInsertPlugin>,
42
+ OptionalPlugin<ConnectivityPlugin>
43
+ ];
44
+ pluginConfiguration: LoomPluginOptions;
45
+ sharedState: LoomPluginState | undefined;
46
46
  }>;
@@ -16,13 +16,13 @@ export declare const disableLoom: ({ error }: {
16
16
  error: string;
17
17
  }) => EditorCommand;
18
18
  export declare const recordVideo: ({ inputMethod, editorAnalyticsAPI, }: {
19
- inputMethod: INPUT_METHOD;
20
19
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
20
+ inputMethod: INPUT_METHOD;
21
21
  }) => EditorCommand;
22
22
  export declare const recordVideoFailed: ({ inputMethod, error, editorAnalyticsAPI, }: {
23
- inputMethod: INPUT_METHOD;
24
- error: SDKUnsupportedReasons | undefined;
25
23
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
24
+ error: SDKUnsupportedReasons | undefined;
25
+ inputMethod: INPUT_METHOD;
26
26
  }) => EditorCommand;
27
27
  export declare const insertVideo: ({ editorAnalyticsAPI, video, }: {
28
28
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
@@ -9,10 +9,10 @@ declare enum SDKUnsupportedReasons {
9
9
  NoMediaStreamsSupport = "no-media-streams-support"
10
10
  }
11
11
  export interface LoomPluginState {
12
+ error: SDKUnsupportedReasons | undefined;
12
13
  isEnabled: boolean;
13
- loomButton: HTMLButtonElement | null;
14
14
  isRecordingVideo: boolean;
15
- error: SDKUnsupportedReasons | undefined;
15
+ loomButton: HTMLButtonElement | null;
16
16
  }
17
17
  export declare enum LoomPluginAction {
18
18
  ENABLE = 0,
@@ -22,7 +22,7 @@ export declare enum LoomPluginAction {
22
22
  }
23
23
  export declare const loomPluginKey: PluginKey<LoomPluginState>;
24
24
  export declare const createPlugin: ({ config, api, }: {
25
- config: LoomPluginOptions;
26
25
  api: ExtractInjectionAPI<LoomPlugin> | undefined;
26
+ config: LoomPluginOptions;
27
27
  }) => SafePlugin<LoomPluginState>;
28
28
  export {};
@@ -1,9 +1,9 @@
1
1
  import type React from 'react';
2
2
  import { type ButtonProps as AKButtonProps } from '@atlaskit/button';
3
3
  export type VideoMeta = {
4
+ duration?: number;
4
5
  sharedUrl: string;
5
6
  title: string;
6
- duration?: number;
7
7
  };
8
8
  type LoomClient = {
9
9
  attachToButton: (options: {
@@ -15,11 +15,11 @@ export type PositionType = 'start' | 'end' | 'current';
15
15
  export type LoomPluginErrorMessages = 'is-supported-failure' | 'failed-to-initialise' | 'api-key-not-provided';
16
16
  export type LoomSDKErrorMessages = 'incompatible-browser' | 'third-party-cookies-disabled' | 'no-media-streams-support';
17
17
  export type GetClientResult = {
18
- status: 'loaded';
19
18
  client: LoomClient;
19
+ status: 'loaded';
20
20
  } | {
21
- status: 'error';
22
21
  message: LoomPluginErrorMessages | LoomSDKErrorMessages;
22
+ status: 'error';
23
23
  };
24
24
  export type GetClient = Promise<GetClientResult>;
25
25
  export type LoomProviderOptions = {
@@ -8,11 +8,11 @@ import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-com
8
8
  import type { LoomPlugin } from '../loomPluginType';
9
9
  import { type ButtonComponentProps } from '../types';
10
10
  interface Props extends Omit<ButtonComponentProps, 'onClickBeforeInit'> {
11
- disabled: boolean;
12
- appearance: EditorAppearance;
13
11
  api: ExtractInjectionAPI<LoomPlugin> | undefined;
14
- onClick: (event: React.MouseEvent<HTMLElement>) => void;
12
+ appearance: EditorAppearance;
13
+ disabled: boolean;
15
14
  hideTooltip?: boolean;
15
+ onClick: (event: React.MouseEvent<HTMLElement>) => void;
16
16
  }
17
17
  declare const _default: React.ForwardRefExoticComponent<Omit<import("react-intl-next").WithIntlProps<React.PropsWithChildren<Props & WrappedComponentProps & React.RefAttributes<HTMLElement>>>, "ref"> & React.RefAttributes<any>> & {
18
18
  WrappedComponent: React.ComponentType<Props & WrappedComponentProps & React.RefAttributes<HTMLElement>>;
@@ -10,29 +10,7 @@ import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
10
10
  import type { LoomPluginState } from './pm-plugins/main';
11
11
  import type { LoomPluginOptions, LoomProviderOptions, PositionType, VideoMeta } from './types';
12
12
  export type LoomPlugin = NextEditorPlugin<'loom', {
13
- pluginConfiguration: LoomPluginOptions;
14
- dependencies: [
15
- OptionalPlugin<AnalyticsPlugin>,
16
- WidthPlugin,
17
- HyperlinkPlugin,
18
- OptionalPlugin<PrimaryToolbarPlugin>,
19
- OptionalPlugin<QuickInsertPlugin>,
20
- OptionalPlugin<ConnectivityPlugin>
21
- ];
22
- sharedState: LoomPluginState | undefined;
23
13
  actions: {
24
- recordVideo: ({ inputMethod, editorAnalyticsAPI, }: {
25
- inputMethod: INPUT_METHOD;
26
- editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
27
- }) => EditorCommand;
28
- /**
29
- * Insert loom into the document.
30
- *
31
- * @param video Video metadata (`sharedUrl` and `title`)
32
- * @param positionType {'start' | 'end' | 'current'} Where you want to insert the loom
33
- * @returns {boolean} If the loom was successfully inserted
34
- */
35
- insertLoom: (video: VideoMeta, positionType: PositionType) => boolean;
36
14
  /**
37
15
  * Given loom provider, initialise loom SDK
38
16
  * @returns error message if initialisation failed
@@ -42,5 +20,27 @@ export type LoomPlugin = NextEditorPlugin<'loom', {
42
20
  }) => Promise<{
43
21
  error?: string;
44
22
  }>;
23
+ /**
24
+ * Insert loom into the document.
25
+ *
26
+ * @param video Video metadata (`sharedUrl` and `title`)
27
+ * @param positionType {'start' | 'end' | 'current'} Where you want to insert the loom
28
+ * @returns {boolean} If the loom was successfully inserted
29
+ */
30
+ insertLoom: (video: VideoMeta, positionType: PositionType) => boolean;
31
+ recordVideo: ({ inputMethod, editorAnalyticsAPI, }: {
32
+ editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
33
+ inputMethod: INPUT_METHOD;
34
+ }) => EditorCommand;
45
35
  };
36
+ dependencies: [
37
+ OptionalPlugin<AnalyticsPlugin>,
38
+ WidthPlugin,
39
+ HyperlinkPlugin,
40
+ OptionalPlugin<PrimaryToolbarPlugin>,
41
+ OptionalPlugin<QuickInsertPlugin>,
42
+ OptionalPlugin<ConnectivityPlugin>
43
+ ];
44
+ pluginConfiguration: LoomPluginOptions;
45
+ sharedState: LoomPluginState | undefined;
46
46
  }>;
@@ -16,13 +16,13 @@ export declare const disableLoom: ({ error }: {
16
16
  error: string;
17
17
  }) => EditorCommand;
18
18
  export declare const recordVideo: ({ inputMethod, editorAnalyticsAPI, }: {
19
- inputMethod: INPUT_METHOD;
20
19
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
20
+ inputMethod: INPUT_METHOD;
21
21
  }) => EditorCommand;
22
22
  export declare const recordVideoFailed: ({ inputMethod, error, editorAnalyticsAPI, }: {
23
- inputMethod: INPUT_METHOD;
24
- error: SDKUnsupportedReasons | undefined;
25
23
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
24
+ error: SDKUnsupportedReasons | undefined;
25
+ inputMethod: INPUT_METHOD;
26
26
  }) => EditorCommand;
27
27
  export declare const insertVideo: ({ editorAnalyticsAPI, video, }: {
28
28
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
@@ -9,10 +9,10 @@ declare enum SDKUnsupportedReasons {
9
9
  NoMediaStreamsSupport = "no-media-streams-support"
10
10
  }
11
11
  export interface LoomPluginState {
12
+ error: SDKUnsupportedReasons | undefined;
12
13
  isEnabled: boolean;
13
- loomButton: HTMLButtonElement | null;
14
14
  isRecordingVideo: boolean;
15
- error: SDKUnsupportedReasons | undefined;
15
+ loomButton: HTMLButtonElement | null;
16
16
  }
17
17
  export declare enum LoomPluginAction {
18
18
  ENABLE = 0,
@@ -22,7 +22,7 @@ export declare enum LoomPluginAction {
22
22
  }
23
23
  export declare const loomPluginKey: PluginKey<LoomPluginState>;
24
24
  export declare const createPlugin: ({ config, api, }: {
25
- config: LoomPluginOptions;
26
25
  api: ExtractInjectionAPI<LoomPlugin> | undefined;
26
+ config: LoomPluginOptions;
27
27
  }) => SafePlugin<LoomPluginState>;
28
28
  export {};
@@ -1,9 +1,9 @@
1
1
  import type React from 'react';
2
2
  import { type ButtonProps as AKButtonProps } from '@atlaskit/button';
3
3
  export type VideoMeta = {
4
+ duration?: number;
4
5
  sharedUrl: string;
5
6
  title: string;
6
- duration?: number;
7
7
  };
8
8
  type LoomClient = {
9
9
  attachToButton: (options: {
@@ -15,11 +15,11 @@ export type PositionType = 'start' | 'end' | 'current';
15
15
  export type LoomPluginErrorMessages = 'is-supported-failure' | 'failed-to-initialise' | 'api-key-not-provided';
16
16
  export type LoomSDKErrorMessages = 'incompatible-browser' | 'third-party-cookies-disabled' | 'no-media-streams-support';
17
17
  export type GetClientResult = {
18
- status: 'loaded';
19
18
  client: LoomClient;
19
+ status: 'loaded';
20
20
  } | {
21
- status: 'error';
22
21
  message: LoomPluginErrorMessages | LoomSDKErrorMessages;
22
+ status: 'error';
23
23
  };
24
24
  export type GetClient = Promise<GetClientResult>;
25
25
  export type LoomProviderOptions = {
@@ -8,11 +8,11 @@ import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-com
8
8
  import type { LoomPlugin } from '../loomPluginType';
9
9
  import { type ButtonComponentProps } from '../types';
10
10
  interface Props extends Omit<ButtonComponentProps, 'onClickBeforeInit'> {
11
- disabled: boolean;
12
- appearance: EditorAppearance;
13
11
  api: ExtractInjectionAPI<LoomPlugin> | undefined;
14
- onClick: (event: React.MouseEvent<HTMLElement>) => void;
12
+ appearance: EditorAppearance;
13
+ disabled: boolean;
15
14
  hideTooltip?: boolean;
15
+ onClick: (event: React.MouseEvent<HTMLElement>) => void;
16
16
  }
17
17
  declare const _default: React.ForwardRefExoticComponent<Omit<import("react-intl-next").WithIntlProps<React.PropsWithChildren<Props & WrappedComponentProps & React.RefAttributes<HTMLElement>>>, "ref"> & React.RefAttributes<any>> & {
18
18
  WrappedComponent: React.ComponentType<Props & WrappedComponentProps & React.RefAttributes<HTMLElement>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-loom",
3
- "version": "5.1.2",
3
+ "version": "5.1.3",
4
4
  "description": "Loom plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -50,7 +50,7 @@
50
50
  "@loomhq/record-sdk": "^2.36.18"
51
51
  },
52
52
  "peerDependencies": {
53
- "@atlaskit/editor-common": "^107.26.0",
53
+ "@atlaskit/editor-common": "^107.28.0",
54
54
  "react": "^18.2.0",
55
55
  "react-dom": "^18.2.0",
56
56
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -62,7 +62,7 @@
62
62
  "@atlaskit/editor-plugin-decorations": "^3.0.0",
63
63
  "@atlaskit/editor-plugin-editor-disabled": "^3.0.0",
64
64
  "@atlaskit/editor-plugin-feature-flags": "^2.0.0",
65
- "@atlaskit/editor-plugin-floating-toolbar": "^5.1.0",
65
+ "@atlaskit/editor-plugin-floating-toolbar": "^5.2.0",
66
66
  "@atlaskit/editor-plugin-grid": "^3.1.0",
67
67
  "@testing-library/react": "^13.4.0",
68
68
  "@testing-library/user-event": "^14.4.3",