@atlaskit/editor-plugin-media 13.5.0 → 13.5.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/media-plugin/package.json +1 -8
  3. package/media-plugin-type/package.json +1 -8
  4. package/nodeviewHelpers/package.json +1 -8
  5. package/package.json +3 -3
  6. package/types/package.json +1 -8
  7. package/dist/types-ts4.5/entry-points/media-plugin-type.d.ts +0 -1
  8. package/dist/types-ts4.5/entry-points/media-plugin.d.ts +0 -1
  9. package/dist/types-ts4.5/entry-points/nodeview-helpers.d.ts +0 -1
  10. package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
  11. package/dist/types-ts4.5/index.d.ts +0 -3
  12. package/dist/types-ts4.5/mediaPlugin.d.ts +0 -2
  13. package/dist/types-ts4.5/mediaPluginType.d.ts +0 -107
  14. package/dist/types-ts4.5/nodeviews/__mocks__/mediaNodeUpdater.d.ts +0 -27
  15. package/dist/types-ts4.5/nodeviews/helpers.d.ts +0 -2
  16. package/dist/types-ts4.5/nodeviews/lazy-media-group.d.ts +0 -9
  17. package/dist/types-ts4.5/nodeviews/lazy-media-inline.d.ts +0 -9
  18. package/dist/types-ts4.5/nodeviews/mediaGroup.d.ts +0 -10
  19. package/dist/types-ts4.5/nodeviews/mediaGroupNext.d.ts +0 -37
  20. package/dist/types-ts4.5/nodeviews/mediaInline.d.ts +0 -49
  21. package/dist/types-ts4.5/nodeviews/mediaNodeUpdater.d.ts +0 -52
  22. package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +0 -48
  23. package/dist/types-ts4.5/nodeviews/mediaNodeView/media.d.ts +0 -65
  24. package/dist/types-ts4.5/nodeviews/mediaSingle.d.ts +0 -38
  25. package/dist/types-ts4.5/nodeviews/mediaSingleNext.d.ts +0 -33
  26. package/dist/types-ts4.5/nodeviews/nodeviewHelpers.d.ts +0 -11
  27. package/dist/types-ts4.5/nodeviews/styles.d.ts +0 -17
  28. package/dist/types-ts4.5/nodeviews/toDOM-fixes/media.d.ts +0 -44
  29. package/dist/types-ts4.5/nodeviews/toDOM-fixes/mediaGroup.d.ts +0 -64
  30. package/dist/types-ts4.5/nodeviews/toDOM-fixes/mediaInline.d.ts +0 -29
  31. package/dist/types-ts4.5/nodeviews/toDOM-fixes/mediaSingle.d.ts +0 -45
  32. package/dist/types-ts4.5/nodeviews/toDOM-fixes/toDOMAttrs.d.ts +0 -29
  33. package/dist/types-ts4.5/nodeviews/types.d.ts +0 -50
  34. package/dist/types-ts4.5/pm-plugins/actions.d.ts +0 -7
  35. package/dist/types-ts4.5/pm-plugins/ai-generating-decoration.d.ts +0 -49
  36. package/dist/types-ts4.5/pm-plugins/alt-text/actions.d.ts +0 -10
  37. package/dist/types-ts4.5/pm-plugins/alt-text/commands.d.ts +0 -6
  38. package/dist/types-ts4.5/pm-plugins/alt-text/index.d.ts +0 -9
  39. package/dist/types-ts4.5/pm-plugins/alt-text/keymap.d.ts +0 -4
  40. package/dist/types-ts4.5/pm-plugins/alt-text/reducer.d.ts +0 -4
  41. package/dist/types-ts4.5/pm-plugins/alt-text/types.d.ts +0 -3
  42. package/dist/types-ts4.5/pm-plugins/alt-text/ui/AltTextEdit.d.ts +0 -47
  43. package/dist/types-ts4.5/pm-plugins/commands/captions.d.ts +0 -5
  44. package/dist/types-ts4.5/pm-plugins/commands/helpers.d.ts +0 -15
  45. package/dist/types-ts4.5/pm-plugins/commands/linking.d.ts +0 -9
  46. package/dist/types-ts4.5/pm-plugins/commands.d.ts +0 -24
  47. package/dist/types-ts4.5/pm-plugins/keymap-media.d.ts +0 -3
  48. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +0 -10
  49. package/dist/types-ts4.5/pm-plugins/linking/actions.d.ts +0 -21
  50. package/dist/types-ts4.5/pm-plugins/linking/index.d.ts +0 -12
  51. package/dist/types-ts4.5/pm-plugins/linking/keymap.d.ts +0 -3
  52. package/dist/types-ts4.5/pm-plugins/linking/reducer.d.ts +0 -4
  53. package/dist/types-ts4.5/pm-plugins/linking/types.d.ts +0 -12
  54. package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -154
  55. package/dist/types-ts4.5/pm-plugins/media-editor-plugin-factory.d.ts +0 -3
  56. package/dist/types-ts4.5/pm-plugins/mediaTaskManager.d.ts +0 -9
  57. package/dist/types-ts4.5/pm-plugins/picker-facade.d.ts +0 -37
  58. package/dist/types-ts4.5/pm-plugins/pixel-resizing/commands.d.ts +0 -5
  59. package/dist/types-ts4.5/pm-plugins/pixel-resizing/index.d.ts +0 -15
  60. package/dist/types-ts4.5/pm-plugins/pixel-resizing/reducer.d.ts +0 -12
  61. package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/constants.d.ts +0 -3
  62. package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/index.d.ts +0 -22
  63. package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/pixel-entry.d.ts +0 -4
  64. package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/styles.d.ts +0 -8
  65. package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/types.d.ts +0 -86
  66. package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +0 -3
  67. package/dist/types-ts4.5/pm-plugins/types.d.ts +0 -82
  68. package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +0 -6
  69. package/dist/types-ts4.5/pm-plugins/utils/batchMediaNodeAttrs.d.ts +0 -54
  70. package/dist/types-ts4.5/pm-plugins/utils/batchSteps.d.ts +0 -19
  71. package/dist/types-ts4.5/pm-plugins/utils/check-media-type.d.ts +0 -4
  72. package/dist/types-ts4.5/pm-plugins/utils/current-media-node.d.ts +0 -10
  73. package/dist/types-ts4.5/pm-plugins/utils/is-type.d.ts +0 -2
  74. package/dist/types-ts4.5/pm-plugins/utils/media-common.d.ts +0 -29
  75. package/dist/types-ts4.5/pm-plugins/utils/media-files.d.ts +0 -29
  76. package/dist/types-ts4.5/pm-plugins/utils/media-inline.d.ts +0 -6
  77. package/dist/types-ts4.5/pm-plugins/utils/media-single.d.ts +0 -18
  78. package/dist/types-ts4.5/types/index.d.ts +0 -212
  79. package/dist/types-ts4.5/types/media-plugin-options.d.ts +0 -16
  80. package/dist/types-ts4.5/ui/CaptionPlaceholder/index.d.ts +0 -16
  81. package/dist/types-ts4.5/ui/CommentBadge/index.d.ts +0 -18
  82. package/dist/types-ts4.5/ui/ImageBorder/index.d.ts +0 -11
  83. package/dist/types-ts4.5/ui/ImageBorder/styles.d.ts +0 -18
  84. package/dist/types-ts4.5/ui/Media/DropPlaceholder.d.ts +0 -11
  85. package/dist/types-ts4.5/ui/MediaLinkingToolbar.d.ts +0 -39
  86. package/dist/types-ts4.5/ui/MediaPicker/BrowserWrapper.d.ts +0 -12
  87. package/dist/types-ts4.5/ui/MediaPicker/ClipboardWrapper.d.ts +0 -11
  88. package/dist/types-ts4.5/ui/MediaPicker/DropzoneWrapper.d.ts +0 -13
  89. package/dist/types-ts4.5/ui/MediaPicker/PickerFacadeProvider.d.ts +0 -18
  90. package/dist/types-ts4.5/ui/MediaPicker/index.d.ts +0 -23
  91. package/dist/types-ts4.5/ui/MediaSSRReactContextsProvider.d.ts +0 -8
  92. package/dist/types-ts4.5/ui/MediaViewer/MediaViewerContainer.d.ts +0 -21
  93. package/dist/types-ts4.5/ui/MediaViewer/PortalWrapper.d.ts +0 -13
  94. package/dist/types-ts4.5/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.d.ts +0 -6
  95. package/dist/types-ts4.5/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +0 -9
  96. package/dist/types-ts4.5/ui/ResizableMediaSingle/index.d.ts +0 -50
  97. package/dist/types-ts4.5/ui/ResizableMediaSingle/styled.d.ts +0 -3
  98. package/dist/types-ts4.5/ui/ResizableMediaSingle/styles.d.ts +0 -2
  99. package/dist/types-ts4.5/ui/ResizableMediaSingle/types.d.ts +0 -30
  100. package/dist/types-ts4.5/ui/ToolbarMedia/index.d.ts +0 -13
  101. package/dist/types-ts4.5/ui/hooks/useMediaProvider.d.ts +0 -4
  102. package/dist/types-ts4.5/ui/toolbar/alt-text.d.ts +0 -17
  103. package/dist/types-ts4.5/ui/toolbar/commands.d.ts +0 -20
  104. package/dist/types-ts4.5/ui/toolbar/comments.d.ts +0 -6
  105. package/dist/types-ts4.5/ui/toolbar/imageBorder.d.ts +0 -2
  106. package/dist/types-ts4.5/ui/toolbar/index.d.ts +0 -16
  107. package/dist/types-ts4.5/ui/toolbar/layout-group.d.ts +0 -14
  108. package/dist/types-ts4.5/ui/toolbar/linking-toolbar-appearance.d.ts +0 -21
  109. package/dist/types-ts4.5/ui/toolbar/linking.d.ts +0 -11
  110. package/dist/types-ts4.5/ui/toolbar/mediaInline.d.ts +0 -8
  111. package/dist/types-ts4.5/ui/toolbar/pixel-resizing.d.ts +0 -8
  112. package/dist/types-ts4.5/ui/toolbar/utils.d.ts +0 -29
@@ -1,17 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React from 'react';
6
- import { jsx } from '@emotion/react';
7
- import type { NumericalCardDimensions } from '@atlaskit/media-card';
8
- export declare const MediaSingleNodeSelector = "media-single-node";
9
- type MediaCardWrapperProps = {
10
- borderWidth?: number;
11
- children: React.ReactNode;
12
- dimensions: NumericalCardDimensions;
13
- onContextMenu?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
14
- selected?: boolean;
15
- };
16
- export declare const MediaCardWrapper: ({ dimensions, children, selected, borderWidth, onContextMenu, }: MediaCardWrapperProps) => jsx.JSX.Element;
17
- export {};
@@ -1,44 +0,0 @@
1
- import type { AttributeSpec, DOMOutputSpec, Node as PMNode, TagParseRule } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- /**
4
- * Duplicate consts from `media-card`.
5
- * `packages/media/media-card/src/utils/cardDimensions.ts`
6
- *
7
- * WHY?
8
- * This will eventually move to `@atlaskit/adf-schema` and we cannot reference
9
- * `media-card` from here or it will cause dependency issues.
10
- *
11
- * In the long term likely `toDOM` will move back out of `adf-schema` in which
12
- * case we can consolidate them.
13
- */
14
- export declare const defaultImageCardDimensions: {
15
- width: number;
16
- height: number;
17
- };
18
- export declare const mediaSpecWithFixedToDOM: () => {
19
- atom?: boolean;
20
- attrs?: {
21
- [name: string]: AttributeSpec;
22
- };
23
- code?: boolean;
24
- content?: string;
25
- defining?: boolean;
26
- definingAsContext?: boolean;
27
- definingForContent?: boolean;
28
- disableDropCursor?: boolean | ((view: EditorView, pos: {
29
- inside: number;
30
- pos: number;
31
- }, event: DragEvent) => boolean);
32
- draggable?: boolean;
33
- group?: string;
34
- inline?: boolean;
35
- isolating?: boolean;
36
- leafText?: (node: PMNode) => string;
37
- linebreakReplacement?: boolean;
38
- marks?: string;
39
- parseDOM?: readonly TagParseRule[];
40
- selectable?: boolean;
41
- toDebugString?: (node: PMNode) => string;
42
- toDOM: (node: PMNode) => DOMOutputSpec;
43
- whitespace?: "pre" | "normal";
44
- };
@@ -1,64 +0,0 @@
1
- import type { AttributeSpec, DOMOutputSpec, Node, TagParseRule } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- /**
4
- * Duplicate consts from `media-card`.
5
- * `packages/media/media-card/src/utils/cardDimensions.ts`
6
- *
7
- * WHY?
8
- * This will eventually move to `@atlaskit/adf-schema` and we cannot reference
9
- * `media-card` from here or it will cause dependency issues.
10
- *
11
- * In the long term likely `toDOM` will move back out of `adf-schema` in which
12
- * case we can consolidate them.
13
- */
14
- export declare const defaultImageCardDimensions: {
15
- width: number;
16
- height: number;
17
- };
18
- export declare const defaultHorizontalCardDimensions: {
19
- width: number;
20
- height: number;
21
- };
22
- export declare const defaultSquareCardDimensions: {
23
- width: number;
24
- height: number;
25
- };
26
- /**
27
- * Duplicate logic from `@atlaskit/media-card` for computing the dimensions of a media group card.
28
- * From: `packages/media/media-card/src/utils/cardDimensions.ts`
29
- *
30
- * WHY?
31
- * This will eventually move to `@atlaskit/adf-schema` and we cannot reference
32
- * `@atlaskit/media-card` from here or it will cause dependency issues.
33
- *
34
- * In the long term likely `toDOM` will move back out of `adf-schema` in which
35
- * case we can consolidate them.
36
- */
37
- export declare const getDefaultCardDimensions: (appearance?: "image" | "square" | "horizontal" | "auto") => Required<typeof defaultImageCardDimensions>;
38
- export declare const mediaGroupSpecWithFixedToDOM: () => {
39
- toDOM: () => DOMOutputSpec;
40
- content?: string;
41
- marks?: string;
42
- group?: string;
43
- inline?: boolean;
44
- atom?: boolean;
45
- attrs?: {
46
- [name: string]: AttributeSpec;
47
- };
48
- selectable?: boolean;
49
- draggable?: boolean;
50
- code?: boolean;
51
- whitespace?: "pre" | "normal";
52
- definingAsContext?: boolean;
53
- definingForContent?: boolean;
54
- defining?: boolean;
55
- isolating?: boolean;
56
- parseDOM?: readonly TagParseRule[];
57
- toDebugString?: (node: Node) => string;
58
- leafText?: (node: Node) => string;
59
- linebreakReplacement?: boolean;
60
- disableDropCursor?: boolean | ((view: EditorView, pos: {
61
- pos: number;
62
- inside: number;
63
- }, event: DragEvent) => boolean);
64
- };
@@ -1,29 +0,0 @@
1
- import type { AttributeSpec, DOMOutputSpec, Node as PMNode, TagParseRule } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- export declare const mediaInlineSpecWithFixedToDOM: () => {
4
- atom?: boolean;
5
- attrs?: {
6
- [name: string]: AttributeSpec;
7
- };
8
- code?: boolean;
9
- content?: string;
10
- defining?: boolean;
11
- definingAsContext?: boolean;
12
- definingForContent?: boolean;
13
- disableDropCursor?: boolean | ((view: EditorView, pos: {
14
- inside: number;
15
- pos: number;
16
- }, event: DragEvent) => boolean);
17
- draggable?: boolean;
18
- group?: string;
19
- inline?: boolean;
20
- isolating?: boolean;
21
- leafText?: (node: PMNode) => string;
22
- linebreakReplacement?: boolean;
23
- marks?: string;
24
- parseDOM?: readonly TagParseRule[];
25
- selectable?: boolean;
26
- toDebugString?: (node: PMNode) => string;
27
- toDOM: (node: PMNode) => DOMOutputSpec;
28
- whitespace?: "pre" | "normal";
29
- };
@@ -1,45 +0,0 @@
1
- import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema/schema';
2
- import type { DOMOutputSpec, NodeSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
- type MediaWidthCSSCalcProps = {
4
- baseWidth: number | undefined;
5
- isExtendedResizeExperience: boolean;
6
- isPixelWidth: boolean;
7
- layout: MediaSingleLayout;
8
- mediaSingleDimensionWidth: number | undefined;
9
- };
10
- export declare const mediaWidthCSSCalc: ({ mediaSingleDimensionWidth, layout, baseWidth, isPixelWidth, isExtendedResizeExperience, }: MediaWidthCSSCalcProps) => string;
11
- type MediaContentWrapperWidthCSSCalcProps = {
12
- childMediaWidth: number | undefined;
13
- isExternalMedia: boolean;
14
- isMediaWrapped: boolean;
15
- isPixelWidth: boolean;
16
- mediaSingleDimensionWidth: number | undefined;
17
- };
18
- export declare const mediaContentWrapperWidthCSSCalc: ({ isMediaWrapped, isExternalMedia, isPixelWidth, childMediaWidth, mediaSingleDimensionWidth, }: MediaContentWrapperWidthCSSCalcProps) => string;
19
- type MediaProportionalWidthCSSCalcProps = {
20
- isExtendedResizeExperience: boolean;
21
- isMediaWrapped: boolean;
22
- isPixelWidth: boolean;
23
- mediaSingleDimensionWidth: number | undefined;
24
- };
25
- export declare const mediaProportionalWidthCSSCalc: ({ isPixelWidth, isExtendedResizeExperience, mediaSingleDimensionWidth, isMediaWrapped, }: MediaProportionalWidthCSSCalcProps) => string;
26
- type MediaJustifyContentCSSProps = {
27
- layout: MediaSingleLayout;
28
- };
29
- export declare const mediaJustifyContentCSS: ({ layout }: MediaJustifyContentCSSProps) => string;
30
- type PrepareWrapperContentDOMProps = {
31
- childMediaHeight: number;
32
- childMediaWidth: number;
33
- dataAttrs: Record<string, unknown>;
34
- isExtendedResizeExperience: boolean;
35
- isPixelWidth: boolean;
36
- layout: MediaSingleLayout;
37
- mediaSingleDimensionWidth: number;
38
- };
39
- export declare const prepareWrapperContentDOM: ({ layout, dataAttrs, childMediaWidth, childMediaHeight, mediaSingleDimensionWidth, isPixelWidth, isExtendedResizeExperience, }: PrepareWrapperContentDOMProps) => DOMOutputSpec;
40
- export declare const getToDom: (allowPixelResizing: boolean) => (node: PMNode) => DOMOutputSpec;
41
- export declare const mediaSingleSpecWithFixedToDOM: (mediaSingleOption: {
42
- withCaption?: boolean;
43
- withExtendedWidthTypes: boolean;
44
- }) => NodeSpec;
45
- export {};
@@ -1,29 +0,0 @@
1
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- /**
3
- * Copied from `packages/adf-schema/src/schema/nodes/media.ts`
4
- *
5
- * When we patch adf-schema with media `toDOM` fixes we can remove this.
6
- */
7
- export declare const getMediaAttrs: (nodeName: string, node: PMNode) => {
8
- "data-alt": any;
9
- "data-collection": any;
10
- "data-height": any;
11
- "data-id": any;
12
- "data-node-type": string;
13
- "data-occurrence-key": any;
14
- "data-type": any;
15
- "data-url": any;
16
- "data-width": any;
17
- style: string;
18
- title: string;
19
- };
20
- export declare const camelCaseToKebabCase: (str: string) => string;
21
- /**
22
- * Copied from `packages/adf-schema/src/schema/nodes/media-single.ts`
23
- *
24
- * When we patch adf-schema with media `toDOM` fixes we can remove this.
25
- */
26
- export declare const getAttrsFromNodeMediaSingle: (withExtendedWidthTypes: boolean, node: PMNode) => {
27
- "data-media-vc-wrapper": string;
28
- "data-width-type": any;
29
- };
@@ -1,50 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
- import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
- import type { ContextIdentifierProvider, MediaProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
- import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
- import type { MediaNextEditorPluginType } from '../mediaPluginType';
9
- import type { ForwardRef, MediaOptions, getPosHandler as ProsemirrorGetPosHandler } from '../types';
10
- export interface MediaSingleNodeProps {
11
- addPendingTask?: (promise: Promise<any>) => void;
12
- contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
13
- dispatchAnalyticsEvent: DispatchAnalyticsEvent;
14
- editorAppearance?: EditorAppearance;
15
- editorDisabled?: boolean;
16
- editorViewMode?: boolean;
17
- eventDispatcher: EventDispatcher;
18
- forwardRef: ForwardRef;
19
- fullWidthMode?: boolean;
20
- getPos: ProsemirrorGetPosHandler;
21
- isCopyPasteEnabled?: boolean;
22
- isDrafting?: boolean;
23
- lineLength: number;
24
- mediaOptions: MediaOptions;
25
- mediaProvider?: Promise<MediaProvider>;
26
- node: PMNode;
27
- pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
28
- selected: () => boolean;
29
- targetNodeId?: string;
30
- view: EditorView;
31
- width: number;
32
- }
33
- export interface MediaSingleNodeViewProps {
34
- dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
35
- editorAppearance?: EditorAppearance;
36
- eventDispatcher: EventDispatcher;
37
- fullWidthMode?: boolean;
38
- intl?: IntlShape;
39
- isCopyPasteEnabled?: boolean;
40
- mediaOptions: MediaOptions;
41
- pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
42
- providerFactory: ProviderFactory;
43
- }
44
- export interface MediaNodeViewProps {
45
- eventDispatcher: EventDispatcher;
46
- intl?: IntlShape;
47
- mediaOptions: MediaOptions;
48
- pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
49
- providerFactory: ProviderFactory;
50
- }
@@ -1,7 +0,0 @@
1
- export declare const ACTIONS: {
2
- SHOW_MEDIA_VIEWER: string;
3
- HIDE_MEDIA_VIEWER: string;
4
- TRACK_MEDIA_PASTE: string;
5
- SHOW_IMAGE_EDITOR: string;
6
- HIDE_IMAGE_EDITOR: string;
7
- };
@@ -1,49 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
4
- import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
- /**
6
- * ProseMirror plugin that manages AI-generating decorations on media nodes.
7
- *
8
- * Instead of storing transient `__isAIGenerating` attributes in the ADF schema
9
- * (which pollutes the document model and undo history), this plugin uses
10
- * ProseMirror decorations — a view-layer-only mechanism that never affects the
11
- * document content, serialization, or undo/redo stack.
12
- */
13
- export declare const aiGeneratingDecorationPluginKey: PluginKey;
14
- export type AIGeneratingSource = 'cwr' | 'maui';
15
- export type AIGeneratingAction = {
16
- mediaId: string;
17
- source?: AIGeneratingSource;
18
- type: 'SET_GENERATING';
19
- } | {
20
- mediaId: string;
21
- type: 'CLEAR_GENERATING';
22
- } | {
23
- type: 'CLEAR_ALL';
24
- };
25
- /**
26
- * Returns `true` if the given decorations array contains an AI-generating
27
- * decoration. Call this from a NodeView's `update()` / `viewShouldUpdate()`
28
- * to determine whether to render the AI border.
29
- */
30
- export declare function hasAIGeneratingDecoration(decorations: readonly Decoration[]): boolean;
31
- /**
32
- * Dispatch a transaction that sets the AI-generating decoration on a media
33
- * node identified by `mediaId`.
34
- *
35
- * Usage from the editor bridge:
36
- * ```
37
- * editorAPI.core.actions.execute(({ tr }) =>
38
- * setAIGeneratingMeta(tr, mediaId),
39
- * );
40
- * ```
41
- */
42
- export declare function setAIGeneratingMeta(tr: Transaction, mediaId: string, source?: AIGeneratingSource): Transaction;
43
- /**
44
- * Dispatch a transaction that clears the AI-generating decoration for a
45
- * specific media node.
46
- */
47
- export declare function clearAIGeneratingMeta(tr: Transaction, mediaId: string): Transaction;
48
- /** Creates the ProseMirror plugin that manages AI-generating decorations on media nodes. */
49
- export declare function createAIGeneratingDecorationPlugin(): SafePlugin;
@@ -1,10 +0,0 @@
1
- export type CloseMediaAltTextMenu = {
2
- type: 'closeMediaAltTextMenu';
3
- };
4
- export type OpenMediaAltTextMenu = {
5
- type: 'openMediaAltTextMenu';
6
- };
7
- export type UpdateAltText = {
8
- type: 'updateAltText';
9
- };
10
- export type MediaAltTextAction = OpenMediaAltTextMenu | CloseMediaAltTextMenu | UpdateAltText;
@@ -1,6 +0,0 @@
1
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
- import type { Command } from '@atlaskit/editor-common/types';
3
- export declare const closeMediaAltTextMenuAndSave: (altText?: string) => Command;
4
- export declare const closeMediaAltTextMenu: Command;
5
- export declare const openMediaAltTextMenu: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
6
- export declare const updateAltText: (newAltText: string) => Command;
@@ -1,9 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { Command, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
3
- import { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
4
- import type { MediaAltTextAction } from './actions';
5
- import type { MediaAltTextState } from './types';
6
- declare const createCommand: <A = MediaAltTextAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
7
- declare const getPluginState: (state: EditorState) => MediaAltTextState;
8
- export declare const createPlugin: ({ dispatch, providerFactory, }: PMPluginFactoryParams) => SafePlugin<MediaAltTextState>;
9
- export { createCommand, getPluginState };
@@ -1,4 +0,0 @@
1
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import type { Schema } from '@atlaskit/editor-prosemirror/model';
4
- export default function keymapPlugin(schema: Schema, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): SafePlugin;
@@ -1,4 +0,0 @@
1
- import type { MediaAltTextAction } from './actions';
2
- import type { MediaAltTextState } from './types';
3
- declare const _default: (state: MediaAltTextState, action: MediaAltTextAction) => MediaAltTextState;
4
- export default _default;
@@ -1,3 +0,0 @@
1
- export type MediaAltTextState = {
2
- isAltTextEditorOpen: boolean;
3
- };
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- import { jsx } from '@emotion/react';
3
- import type { WrappedComponentProps } from 'react-intl';
4
- import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
5
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- export declare const MAX_ALT_TEXT_LENGTH = 510;
7
- type Props = {
8
- altTextValidator?: (value: string) => string[];
9
- areAnyNewToolbarFlagsEnabled?: boolean;
10
- mediaType: 'file' | 'image' | 'external';
11
- nodeType: 'mediaSingle' | 'mediaInline';
12
- onEnter?: () => void;
13
- onEscape?: () => void;
14
- value?: string;
15
- view: EditorView;
16
- } & WrappedComponentProps & WithAnalyticsEventsProps;
17
- export type AltTextEditComponentState = {
18
- lastValue: string | undefined;
19
- showClearTextButton: boolean;
20
- validationErrors: string[] | undefined;
21
- };
22
- export declare class AltTextEditComponent extends React.Component<Props, AltTextEditComponentState> {
23
- private fireCustomAnalytics?;
24
- private errorsListRef;
25
- state: {
26
- lastValue: string | undefined;
27
- showClearTextButton: boolean;
28
- validationErrors: string[];
29
- };
30
- constructor(props: Props);
31
- prevValue: string | undefined;
32
- componentDidMount(): void;
33
- componentWillUnmount(): void;
34
- private getValidationErrors;
35
- render(): jsx.JSX.Element;
36
- private closeMediaAltTextMenu;
37
- private closeMediaAltTextMenuAndSetFocus;
38
- private fireAnalytics;
39
- private dispatchCancelEvent;
40
- private handleOnChange;
41
- private handleOnBlur;
42
- private handleClearText;
43
- }
44
- declare const _default_1: React.ForwardRefExoticComponent<Omit<Omit<Props, 'intl'> & {
45
- forwardedRef?: React.Ref<any>;
46
- }, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
47
- export default _default_1;
@@ -1,5 +0,0 @@
1
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
- import type { Command } from '@atlaskit/editor-common/types';
3
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
- export declare const selectCaptionFromMediaSinglePos: (mediaSingleNodePos: number, mediaSingleNode: PMNode) => Command;
5
- export declare const insertAndSelectCaptionFromMediaSinglePos: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (mediaSingleNodePos: number | undefined, mediaSingleNode: PMNode) => Command;
@@ -1,15 +0,0 @@
1
- import type { Command } from '@atlaskit/editor-common/types';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
- import type { MediaNodeWithPosHandler, MediaPluginState } from '../types';
4
- /**
5
- * Note that Media Inline is inserted like a media single node into the media plugin state.
6
- * Though it is not of type mediaSingle, it shares the same `findMediaSingleNode` method
7
- *
8
- */
9
- export declare const findMediaNode: (mediaPluginState: MediaPluginState, id: string) => MediaNodeWithPosHandler | null;
10
- export declare const findAllMediaNodes: (mediaPluginState: MediaPluginState, id: string) => MediaNodeWithPosHandler[];
11
- export declare const isMediaNode: (pos: number, state: EditorState) => boolean | null;
12
- export declare const updateAllMediaNodesAttrs: (id: string, attrs: object) => Command;
13
- export declare const updateCurrentMediaNodeAttrs: (attrs: object, mediaNode: MediaNodeWithPosHandler, tintDirtyTr?: boolean) => Command;
14
- export declare const updateMediaNodeAttrs: (id: string, attrs: object) => Command;
15
- export declare const replaceExternalMedia: (pos: number, attrs: object) => Command;
@@ -1,9 +0,0 @@
1
- import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import type { Command, CommandDispatch } from '@atlaskit/editor-common/types';
3
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
- export declare const showLinkingToolbar: Command;
6
- export declare const showLinkingToolbarWithMediaTypeCheck: Command;
7
- export declare const hideLinkingToolbar: (state: EditorState, dispatch?: CommandDispatch, view?: EditorView, focusFloatingToolbar?: boolean) => void;
8
- export declare const unlink: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
9
- export declare const setUrlToMedia: (url: string, inputMethod: INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.MANUAL, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
@@ -1,24 +0,0 @@
1
- import type { MediaADFAttrs } from '@atlaskit/adf-schema';
2
- import type { EditorAnalyticsAPI, InputMethodInsertMedia, InsertMediaVia } from '@atlaskit/editor-common/analytics';
3
- import type { EditorCommand } from '@atlaskit/editor-common/types';
4
- import { type AIGeneratingSource } from '../pm-plugins/ai-generating-decoration';
5
- export declare const showMediaViewer: (media: MediaADFAttrs) => EditorCommand;
6
- export declare const hideMediaViewer: EditorCommand;
7
- export declare const trackMediaPaste: (attrs: MediaADFAttrs) => EditorCommand;
8
- /**
9
- * Sets the AI-generating decoration on a media node identified by `mediaId`.
10
- * The decoration triggers the AI border visual on the media's NodeView.
11
- *
12
- * Decorations live in the view layer only and never affect the document model
13
- * or undo/redo history.
14
- */
15
- export declare const setAIGenerating: (mediaId: string, source?: AIGeneratingSource) => EditorCommand;
16
- /**
17
- * Clears the AI-generating decoration for a specific media node identified by
18
- * `mediaId`. Removes the AI border visual from that media's NodeView.
19
- */
20
- export declare const clearAIGenerating: (mediaId: string) => EditorCommand;
21
- export declare const insertMediaAsMediaSingleCommand: (editorAnalyticsAPI?: EditorAnalyticsAPI, allowPixelResizing?: boolean) => (mediaAttrs: MediaADFAttrs, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, positions?: [
22
- number,
23
- number
24
- ], dataConsumerSource?: string) => EditorCommand;
@@ -1,3 +0,0 @@
1
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { Schema } from '@atlaskit/editor-prosemirror/model';
3
- export default function keymapPlugin(schema: Schema): SafePlugin;
@@ -1,10 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
- import type { EditorSelectionAPI } from '@atlaskit/editor-plugin-selection';
6
- import type { MediaNextEditorPluginType } from '../mediaPluginType';
7
- import type { MediaOptions } from '../types';
8
- type WidthPlugin = ExtractInjectionAPI<MediaNextEditorPluginType>['width'];
9
- declare function keymapPlugin(options: MediaOptions | undefined, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, editorSelectionAPI: EditorSelectionAPI | undefined, widthPlugin: WidthPlugin | undefined, getIntl: () => IntlShape): SafePlugin;
10
- export default keymapPlugin;
@@ -1,21 +0,0 @@
1
- export declare enum MediaLinkingActionsTypes {
2
- showToolbar = "MEDIA_SHOW_TOOLBAR",
3
- hideToolbar = "MEDIA_HIDE_TOOLBAR",
4
- setUrl = "MEDIA_SET_LINK_TO",
5
- unlink = "MEDIA_LINKING_UNLINK"
6
- }
7
- interface VisibleAction {
8
- type: MediaLinkingActionsTypes.showToolbar;
9
- }
10
- interface HideAction {
11
- type: MediaLinkingActionsTypes.hideToolbar;
12
- }
13
- interface SetLinkToMedia {
14
- payload: string;
15
- type: MediaLinkingActionsTypes.setUrl;
16
- }
17
- interface Unlink {
18
- type: MediaLinkingActionsTypes.unlink;
19
- }
20
- export type MediaLinkingActions = VisibleAction | SetLinkToMedia | HideAction | Unlink;
21
- export {};
@@ -1,12 +0,0 @@
1
- import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
2
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import type { Command } from '@atlaskit/editor-common/types';
4
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
5
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
- import type { MediaLinkingActions } from './actions';
7
- import type { MediaLinkingState } from './types';
8
- export declare const mediaLinkingPluginKey: PluginKey<MediaLinkingState>;
9
- export declare const createMediaLinkingCommand: <A = MediaLinkingActions>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
10
- export declare const getMediaLinkingState: (state: EditorState) => MediaLinkingState;
11
- declare const _default: (dispatch: Dispatch) => SafePlugin<MediaLinkingState>;
12
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { Schema } from '@atlaskit/editor-prosemirror/model';
3
- export default function keymapPlugin(schema: Schema): SafePlugin;
@@ -1,4 +0,0 @@
1
- import type { MediaLinkingActions } from './actions';
2
- import type { MediaLinkingState } from './types';
3
- declare const _default: (state: MediaLinkingState, action: MediaLinkingActions) => MediaLinkingState;
4
- export default _default;
@@ -1,12 +0,0 @@
1
- export type InitialState = {
2
- editable: false;
3
- link: '';
4
- mediaPos: null;
5
- visible: false;
6
- };
7
- export type MediaLinkingState = {
8
- editable: boolean;
9
- link: string;
10
- mediaPos: number | null;
11
- visible: boolean;
12
- };