@atlaskit/editor-plugin-media 0.2.0 → 0.3.1
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 +17 -0
- package/dist/cjs/commands/captions.js +59 -0
- package/dist/cjs/commands/helpers.js +127 -0
- package/dist/cjs/commands/index.js +24 -0
- package/dist/cjs/commands/linking.js +181 -0
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/media-plugin-options.js +5 -0
- package/dist/cjs/next-plugin-type.js +5 -0
- package/dist/cjs/nodeviews/mediaGroup.js +376 -0
- package/dist/cjs/nodeviews/mediaInline.js +288 -0
- package/dist/cjs/nodeviews/mediaNodeUpdater.js +739 -0
- package/dist/cjs/nodeviews/mediaNodeView/index.js +177 -0
- package/dist/cjs/nodeviews/mediaNodeView/media.js +242 -0
- package/dist/cjs/nodeviews/mediaSingle.js +629 -0
- package/dist/cjs/nodeviews/messages.js +14 -0
- package/dist/cjs/nodeviews/styles.js +46 -0
- package/dist/cjs/nodeviews/types.js +5 -0
- package/dist/cjs/picker-facade.js +192 -0
- package/dist/cjs/plugin.js +293 -0
- package/dist/cjs/pm-plugins/alt-text/actions.js +5 -0
- package/dist/cjs/pm-plugins/alt-text/commands.js +59 -0
- package/dist/cjs/pm-plugins/alt-text/index.js +36 -0
- package/dist/cjs/pm-plugins/alt-text/keymap.js +15 -0
- package/dist/cjs/pm-plugins/alt-text/messages.js +44 -0
- package/dist/cjs/pm-plugins/alt-text/reducer.js +32 -0
- package/dist/cjs/pm-plugins/alt-text/types.js +5 -0
- package/dist/cjs/pm-plugins/alt-text/ui/AltTextEdit.js +209 -0
- package/dist/cjs/pm-plugins/keymap-media-single.js +163 -0
- package/dist/cjs/pm-plugins/keymap.js +88 -0
- package/dist/cjs/pm-plugins/linking/actions.js +13 -0
- package/dist/cjs/pm-plugins/linking/index.js +65 -0
- package/dist/cjs/pm-plugins/linking/keymap.js +14 -0
- package/dist/cjs/pm-plugins/linking/reducer.js +43 -0
- package/dist/cjs/pm-plugins/linking/types.js +5 -0
- package/dist/cjs/pm-plugins/main.js +813 -0
- package/dist/cjs/pm-plugins/media-editor-plugin-factory.js +8 -0
- package/dist/cjs/pm-plugins/mediaTaskManager.js +101 -0
- package/dist/cjs/pm-plugins/plugin-key.js +8 -0
- package/dist/cjs/pm-plugins/types.js +5 -0
- package/dist/cjs/toolbar/alt-text.js +80 -0
- package/dist/cjs/toolbar/commands.js +236 -0
- package/dist/cjs/toolbar/filePreviewItem.js +66 -0
- package/dist/cjs/toolbar/imageBorder.js +20 -0
- package/dist/cjs/toolbar/index.js +523 -0
- package/dist/cjs/toolbar/linking-toolbar-appearance.js +100 -0
- package/dist/cjs/toolbar/linking.js +96 -0
- package/dist/cjs/toolbar/utils.js +110 -0
- package/dist/cjs/ui/CaptionPlaceholder/index.js +27 -0
- package/dist/cjs/ui/CaptionPlaceholder/messages.js +14 -0
- package/dist/cjs/ui/ImageBorder/index.js +226 -0
- package/dist/cjs/ui/ImageBorder/messages.js +49 -0
- package/dist/cjs/ui/ImageBorder/styles.js +52 -0
- package/dist/cjs/ui/Media/DropPlaceholder.js +38 -0
- package/dist/cjs/ui/Media/drop-placeholder-messages.js +14 -0
- package/dist/cjs/ui/MediaLinkingToolbar.js +196 -0
- package/dist/cjs/ui/MediaPicker/BrowserWrapper.js +40 -0
- package/dist/cjs/ui/MediaPicker/ClipboardWrapper.js +39 -0
- package/dist/cjs/ui/MediaPicker/DropzoneWrapper.js +51 -0
- package/dist/cjs/ui/MediaPicker/PickerFacadeProvider.js +151 -0
- package/dist/cjs/ui/MediaPicker/index.js +103 -0
- package/dist/cjs/ui/PixelEntry/constants.js +7 -0
- package/dist/cjs/ui/PixelEntry/index.js +185 -0
- package/dist/cjs/ui/PixelEntry/messages.js +54 -0
- package/dist/cjs/ui/PixelEntry/styles.js +19 -0
- package/dist/cjs/ui/PixelEntry/types.js +5 -0
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +16 -0
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +541 -0
- package/dist/cjs/ui/ResizableMediaSingle/index.js +422 -0
- package/dist/cjs/ui/ResizableMediaSingle/styled.js +14 -0
- package/dist/cjs/ui/ResizableMediaSingle/styles.js +17 -0
- package/dist/cjs/ui/ResizableMediaSingle/types.js +5 -0
- package/dist/cjs/ui/ToolbarMedia/index.js +42 -0
- package/dist/cjs/ui/ToolbarMedia/toolbar-media-messages.js +14 -0
- package/dist/cjs/ui/media-linking-toolbar-messages.js +14 -0
- package/dist/cjs/utils/analytics.js +53 -0
- package/dist/cjs/utils/check-media-type.js +56 -0
- package/dist/cjs/utils/current-media-node.js +41 -0
- package/dist/cjs/utils/is-image.js +9 -0
- package/dist/cjs/utils/media-common.js +181 -0
- package/dist/cjs/utils/media-files.js +297 -0
- package/dist/cjs/utils/media-single.js +181 -0
- package/dist/es2019/commands/captions.js +47 -0
- package/dist/es2019/commands/helpers.js +113 -0
- package/dist/es2019/commands/index.js +1 -0
- package/dist/es2019/commands/linking.js +169 -0
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/media-plugin-options.js +1 -0
- package/dist/es2019/next-plugin-type.js +1 -0
- package/dist/es2019/nodeviews/mediaGroup.js +314 -0
- package/dist/es2019/nodeviews/mediaInline.js +201 -0
- package/dist/es2019/nodeviews/mediaNodeUpdater.js +384 -0
- package/dist/es2019/nodeviews/mediaNodeView/index.js +149 -0
- package/dist/es2019/nodeviews/mediaNodeView/media.js +182 -0
- package/dist/es2019/nodeviews/mediaSingle.js +511 -0
- package/dist/es2019/nodeviews/messages.js +8 -0
- package/dist/es2019/nodeviews/styles.js +46 -0
- package/dist/es2019/nodeviews/types.js +1 -0
- package/dist/es2019/picker-facade.js +146 -0
- package/dist/es2019/plugin.js +284 -0
- package/dist/es2019/pm-plugins/alt-text/actions.js +1 -0
- package/dist/es2019/pm-plugins/alt-text/commands.js +42 -0
- package/dist/es2019/pm-plugins/alt-text/index.js +33 -0
- package/dist/es2019/pm-plugins/alt-text/keymap.js +9 -0
- package/dist/es2019/pm-plugins/alt-text/messages.js +38 -0
- package/dist/es2019/pm-plugins/alt-text/reducer.js +26 -0
- package/dist/es2019/pm-plugins/alt-text/types.js +1 -0
- package/dist/es2019/pm-plugins/alt-text/ui/AltTextEdit.js +228 -0
- package/dist/es2019/pm-plugins/keymap-media-single.js +172 -0
- package/dist/es2019/pm-plugins/keymap.js +84 -0
- package/dist/es2019/pm-plugins/linking/actions.js +7 -0
- package/dist/es2019/pm-plugins/linking/index.js +56 -0
- package/dist/es2019/pm-plugins/linking/keymap.js +8 -0
- package/dist/es2019/pm-plugins/linking/reducer.js +37 -0
- package/dist/es2019/pm-plugins/linking/types.js +1 -0
- package/dist/es2019/pm-plugins/main.js +695 -0
- package/dist/es2019/pm-plugins/media-editor-plugin-factory.js +2 -0
- package/dist/es2019/pm-plugins/mediaTaskManager.js +64 -0
- package/dist/es2019/pm-plugins/plugin-key.js +2 -0
- package/dist/es2019/pm-plugins/types.js +1 -0
- package/dist/es2019/toolbar/alt-text.js +72 -0
- package/dist/es2019/toolbar/commands.js +212 -0
- package/dist/es2019/toolbar/filePreviewItem.js +54 -0
- package/dist/es2019/toolbar/imageBorder.js +15 -0
- package/dist/es2019/toolbar/index.js +538 -0
- package/dist/es2019/toolbar/linking-toolbar-appearance.js +90 -0
- package/dist/es2019/toolbar/linking.js +98 -0
- package/dist/es2019/toolbar/utils.js +86 -0
- package/dist/es2019/ui/CaptionPlaceholder/index.js +25 -0
- package/dist/es2019/ui/CaptionPlaceholder/messages.js +8 -0
- package/dist/es2019/ui/ImageBorder/index.js +213 -0
- package/dist/es2019/ui/ImageBorder/messages.js +43 -0
- package/dist/es2019/ui/ImageBorder/styles.js +126 -0
- package/dist/es2019/ui/Media/DropPlaceholder.js +47 -0
- package/dist/es2019/ui/Media/drop-placeholder-messages.js +8 -0
- package/dist/es2019/ui/MediaLinkingToolbar.js +190 -0
- package/dist/es2019/ui/MediaPicker/BrowserWrapper.js +31 -0
- package/dist/es2019/ui/MediaPicker/ClipboardWrapper.js +32 -0
- package/dist/es2019/ui/MediaPicker/DropzoneWrapper.js +42 -0
- package/dist/es2019/ui/MediaPicker/PickerFacadeProvider.js +85 -0
- package/dist/es2019/ui/MediaPicker/index.js +82 -0
- package/dist/es2019/ui/PixelEntry/constants.js +1 -0
- package/dist/es2019/ui/PixelEntry/index.js +170 -0
- package/dist/es2019/ui/PixelEntry/messages.js +48 -0
- package/dist/es2019/ui/PixelEntry/styles.js +51 -0
- package/dist/es2019/ui/PixelEntry/types.js +1 -0
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +9 -0
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +454 -0
- package/dist/es2019/ui/ResizableMediaSingle/index.js +344 -0
- package/dist/es2019/ui/ResizableMediaSingle/styled.js +9 -0
- package/dist/es2019/ui/ResizableMediaSingle/styles.js +14 -0
- package/dist/es2019/ui/ResizableMediaSingle/types.js +1 -0
- package/dist/es2019/ui/ToolbarMedia/index.js +37 -0
- package/dist/es2019/ui/ToolbarMedia/toolbar-media-messages.js +8 -0
- package/dist/es2019/ui/media-linking-toolbar-messages.js +8 -0
- package/dist/es2019/utils/analytics.js +51 -0
- package/dist/es2019/utils/check-media-type.js +19 -0
- package/dist/es2019/utils/current-media-node.js +35 -0
- package/dist/es2019/utils/is-image.js +3 -0
- package/dist/es2019/utils/media-common.js +189 -0
- package/dist/es2019/utils/media-files.js +321 -0
- package/dist/es2019/utils/media-single.js +176 -0
- package/dist/esm/commands/captions.js +53 -0
- package/dist/esm/commands/helpers.js +120 -0
- package/dist/esm/commands/index.js +1 -0
- package/dist/esm/commands/linking.js +174 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/media-plugin-options.js +1 -0
- package/dist/esm/next-plugin-type.js +1 -0
- package/dist/esm/nodeviews/mediaGroup.js +369 -0
- package/dist/esm/nodeviews/mediaInline.js +278 -0
- package/dist/esm/nodeviews/mediaNodeUpdater.js +732 -0
- package/dist/esm/nodeviews/mediaNodeView/index.js +170 -0
- package/dist/esm/nodeviews/mediaNodeView/media.js +233 -0
- package/dist/esm/nodeviews/mediaSingle.js +622 -0
- package/dist/esm/nodeviews/messages.js +8 -0
- package/dist/esm/nodeviews/styles.js +39 -0
- package/dist/esm/nodeviews/types.js +1 -0
- package/dist/esm/picker-facade.js +186 -0
- package/dist/esm/plugin.js +282 -0
- package/dist/esm/pm-plugins/alt-text/actions.js +1 -0
- package/dist/esm/pm-plugins/alt-text/commands.js +52 -0
- package/dist/esm/pm-plugins/alt-text/index.js +31 -0
- package/dist/esm/pm-plugins/alt-text/keymap.js +9 -0
- package/dist/esm/pm-plugins/alt-text/messages.js +38 -0
- package/dist/esm/pm-plugins/alt-text/reducer.js +25 -0
- package/dist/esm/pm-plugins/alt-text/types.js +1 -0
- package/dist/esm/pm-plugins/alt-text/ui/AltTextEdit.js +206 -0
- package/dist/esm/pm-plugins/keymap-media-single.js +158 -0
- package/dist/esm/pm-plugins/keymap.js +81 -0
- package/dist/esm/pm-plugins/linking/actions.js +7 -0
- package/dist/esm/pm-plugins/linking/index.js +59 -0
- package/dist/esm/pm-plugins/linking/keymap.js +8 -0
- package/dist/esm/pm-plugins/linking/reducer.js +36 -0
- package/dist/esm/pm-plugins/linking/types.js +1 -0
- package/dist/esm/pm-plugins/main.js +798 -0
- package/dist/esm/pm-plugins/media-editor-plugin-factory.js +2 -0
- package/dist/esm/pm-plugins/mediaTaskManager.js +94 -0
- package/dist/esm/pm-plugins/plugin-key.js +2 -0
- package/dist/esm/pm-plugins/types.js +1 -0
- package/dist/esm/toolbar/alt-text.js +70 -0
- package/dist/esm/toolbar/commands.js +229 -0
- package/dist/esm/toolbar/filePreviewItem.js +56 -0
- package/dist/esm/toolbar/imageBorder.js +14 -0
- package/dist/esm/toolbar/index.js +513 -0
- package/dist/esm/toolbar/linking-toolbar-appearance.js +91 -0
- package/dist/esm/toolbar/linking.js +88 -0
- package/dist/esm/toolbar/utils.js +103 -0
- package/dist/esm/ui/CaptionPlaceholder/index.js +20 -0
- package/dist/esm/ui/CaptionPlaceholder/messages.js +8 -0
- package/dist/esm/ui/ImageBorder/index.js +218 -0
- package/dist/esm/ui/ImageBorder/messages.js +43 -0
- package/dist/esm/ui/ImageBorder/styles.js +42 -0
- package/dist/esm/ui/Media/DropPlaceholder.js +31 -0
- package/dist/esm/ui/Media/drop-placeholder-messages.js +8 -0
- package/dist/esm/ui/MediaLinkingToolbar.js +188 -0
- package/dist/esm/ui/MediaPicker/BrowserWrapper.js +33 -0
- package/dist/esm/ui/MediaPicker/ClipboardWrapper.js +32 -0
- package/dist/esm/ui/MediaPicker/DropzoneWrapper.js +44 -0
- package/dist/esm/ui/MediaPicker/PickerFacadeProvider.js +145 -0
- package/dist/esm/ui/MediaPicker/index.js +96 -0
- package/dist/esm/ui/PixelEntry/constants.js +1 -0
- package/dist/esm/ui/PixelEntry/index.js +174 -0
- package/dist/esm/ui/PixelEntry/messages.js +48 -0
- package/dist/esm/ui/PixelEntry/styles.js +12 -0
- package/dist/esm/ui/PixelEntry/types.js +1 -0
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +9 -0
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +535 -0
- package/dist/esm/ui/ResizableMediaSingle/index.js +417 -0
- package/dist/esm/ui/ResizableMediaSingle/styled.js +7 -0
- package/dist/esm/ui/ResizableMediaSingle/styles.js +7 -0
- package/dist/esm/ui/ResizableMediaSingle/types.js +1 -0
- package/dist/esm/ui/ToolbarMedia/index.js +35 -0
- package/dist/esm/ui/ToolbarMedia/toolbar-media-messages.js +8 -0
- package/dist/esm/ui/media-linking-toolbar-messages.js +8 -0
- package/dist/esm/utils/analytics.js +47 -0
- package/dist/esm/utils/check-media-type.js +49 -0
- package/dist/esm/utils/current-media-node.js +35 -0
- package/dist/esm/utils/is-image.js +3 -0
- package/dist/esm/utils/media-common.js +175 -0
- package/dist/esm/utils/media-files.js +291 -0
- package/dist/esm/utils/media-single.js +172 -0
- package/dist/types/commands/captions.d.ts +5 -0
- package/dist/types/commands/helpers.d.ts +15 -0
- package/dist/types/commands/index.d.ts +1 -0
- package/dist/types/commands/linking.d.ts +9 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/media-plugin-options.d.ts +17 -0
- package/dist/types/next-plugin-type.d.ts +33 -0
- package/dist/types/nodeviews/__mocks__/mediaNodeUpdater.d.ts +24 -0
- package/dist/types/nodeviews/mediaGroup.d.ts +33 -0
- package/dist/types/nodeviews/mediaInline.d.ts +50 -0
- package/dist/types/nodeviews/mediaNodeUpdater.d.ts +45 -0
- package/dist/types/nodeviews/mediaNodeView/index.d.ts +28 -0
- package/dist/types/nodeviews/mediaNodeView/media.d.ts +44 -0
- package/dist/types/nodeviews/mediaSingle.d.ts +62 -0
- package/dist/types/nodeviews/messages.d.ts +7 -0
- package/dist/types/nodeviews/styles.d.ts +16 -0
- package/dist/types/nodeviews/types.d.ts +42 -0
- package/dist/types/picker-facade.d.ts +44 -0
- package/dist/types/plugin.d.ts +7 -0
- package/dist/types/pm-plugins/alt-text/actions.d.ts +10 -0
- package/dist/types/pm-plugins/alt-text/commands.d.ts +4 -0
- package/dist/types/pm-plugins/alt-text/index.d.ts +7 -0
- package/dist/types/pm-plugins/alt-text/keymap.d.ts +4 -0
- package/dist/types/pm-plugins/alt-text/messages.d.ts +37 -0
- package/dist/types/pm-plugins/alt-text/reducer.d.ts +4 -0
- package/dist/types/pm-plugins/alt-text/types.d.ts +3 -0
- package/dist/types/pm-plugins/alt-text/ui/AltTextEdit.d.ts +41 -0
- package/dist/types/pm-plugins/keymap-media-single.d.ts +3 -0
- package/dist/types/pm-plugins/keymap.d.ts +6 -0
- package/dist/types/pm-plugins/linking/actions.d.ts +20 -0
- package/dist/types/pm-plugins/linking/index.d.ts +10 -0
- package/dist/types/pm-plugins/linking/keymap.d.ts +3 -0
- package/dist/types/pm-plugins/linking/reducer.d.ts +4 -0
- package/dist/types/pm-plugins/linking/types.d.ts +12 -0
- package/dist/types/pm-plugins/main.d.ts +120 -0
- package/dist/types/pm-plugins/media-editor-plugin-factory.d.ts +3 -0
- package/dist/types/pm-plugins/mediaTaskManager.d.ts +9 -0
- package/dist/types/pm-plugins/plugin-key.d.ts +3 -0
- package/dist/types/pm-plugins/types.d.ts +65 -0
- package/dist/types/toolbar/alt-text.d.ts +13 -0
- package/dist/types/toolbar/commands.d.ts +12 -0
- package/dist/types/toolbar/filePreviewItem.d.ts +9 -0
- package/dist/types/toolbar/imageBorder.d.ts +2 -0
- package/dist/types/toolbar/index.d.ts +6 -0
- package/dist/types/toolbar/linking-toolbar-appearance.d.ts +14 -0
- package/dist/types/toolbar/linking.d.ts +10 -0
- package/dist/types/toolbar/utils.d.ts +11 -0
- package/dist/types/types.d.ts +2 -1
- package/dist/types/ui/CaptionPlaceholder/index.d.ts +6 -0
- package/dist/types/ui/CaptionPlaceholder/messages.d.ts +7 -0
- package/dist/types/ui/ImageBorder/index.d.ts +11 -0
- package/dist/types/ui/ImageBorder/messages.d.ts +42 -0
- package/dist/types/ui/ImageBorder/styles.d.ts +15 -0
- package/dist/types/ui/Media/DropPlaceholder.d.ts +8 -0
- package/dist/types/ui/Media/drop-placeholder-messages.d.ts +7 -0
- package/dist/types/ui/MediaLinkingToolbar.d.ts +35 -0
- package/dist/types/ui/MediaPicker/BrowserWrapper.d.ts +11 -0
- package/dist/types/ui/MediaPicker/ClipboardWrapper.d.ts +10 -0
- package/dist/types/ui/MediaPicker/DropzoneWrapper.d.ts +13 -0
- package/dist/types/ui/MediaPicker/PickerFacadeProvider.d.ts +28 -0
- package/dist/types/ui/MediaPicker/index.d.ts +23 -0
- package/dist/types/ui/PixelEntry/constants.d.ts +1 -0
- package/dist/types/ui/PixelEntry/index.d.ts +8 -0
- package/dist/types/ui/PixelEntry/messages.d.ts +47 -0
- package/dist/types/ui/PixelEntry/styles.d.ts +8 -0
- package/dist/types/ui/PixelEntry/types.d.ts +58 -0
- package/dist/types/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.d.ts +3 -0
- package/dist/types/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +59 -0
- package/dist/types/ui/ResizableMediaSingle/index.d.ts +45 -0
- package/dist/types/ui/ResizableMediaSingle/styled.d.ts +2 -0
- package/dist/types/ui/ResizableMediaSingle/styles.d.ts +1 -0
- package/dist/types/ui/ResizableMediaSingle/types.d.ts +27 -0
- package/dist/types/ui/ToolbarMedia/index.d.ts +13 -0
- package/dist/types/ui/ToolbarMedia/toolbar-media-messages.d.ts +7 -0
- package/dist/types/ui/media-linking-toolbar-messages.d.ts +7 -0
- package/dist/types/utils/analytics.d.ts +3 -0
- package/dist/types/utils/check-media-type.d.ts +4 -0
- package/dist/types/utils/current-media-node.d.ts +9 -0
- package/dist/types/utils/is-image.d.ts +1 -0
- package/dist/types/utils/media-common.d.ts +20 -0
- package/dist/types/utils/media-files.d.ts +30 -0
- package/dist/types/utils/media-single.d.ts +20 -0
- package/package.json +32 -20
- package/report.api.md +430 -0
- package/dist/types-ts4.5/index.d.ts +0 -1
- package/dist/types-ts4.5/types.d.ts +0 -118
- package/tmp/api-report-tmp.d.ts +0 -9
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
+
import type { ErrorReporter } from '@atlaskit/editor-common/utils';
|
|
3
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import type { CustomMediaPicker, getPosHandler, MediaState } from './types';
|
|
6
|
+
export type MediaPluginOptions = {
|
|
7
|
+
providerFactory: ProviderFactory;
|
|
8
|
+
nodeViews: {
|
|
9
|
+
[name: string]: (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
10
|
+
};
|
|
11
|
+
errorReporter?: ErrorReporter;
|
|
12
|
+
uploadErrorHandler?: (state: MediaState) => void;
|
|
13
|
+
waitForMediaUpload?: boolean;
|
|
14
|
+
customDropzoneContainer?: HTMLElement;
|
|
15
|
+
customMediaPicker?: CustomMediaPicker;
|
|
16
|
+
allowResizing: boolean;
|
|
17
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
+
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
4
|
+
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
5
|
+
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
6
|
+
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
7
|
+
import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
8
|
+
import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
9
|
+
import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
10
|
+
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
11
|
+
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
12
|
+
import type { MediaPluginState } from './pm-plugins/types';
|
|
13
|
+
import type { MediaOptions } from './types';
|
|
14
|
+
import type { InsertMediaAsMediaSingle } from './utils/media-single';
|
|
15
|
+
export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
|
|
16
|
+
pluginConfiguration: MediaOptions | undefined;
|
|
17
|
+
dependencies: [
|
|
18
|
+
FeatureFlagsPlugin,
|
|
19
|
+
OptionalPlugin<AnalyticsPlugin>,
|
|
20
|
+
GuidelinePlugin,
|
|
21
|
+
GridPlugin,
|
|
22
|
+
WidthPlugin,
|
|
23
|
+
DecorationsPlugin,
|
|
24
|
+
FloatingToolbarPlugin,
|
|
25
|
+
EditorDisabledPlugin,
|
|
26
|
+
FocusPlugin,
|
|
27
|
+
SelectionPlugin
|
|
28
|
+
];
|
|
29
|
+
sharedState: MediaPluginState | null;
|
|
30
|
+
actions: {
|
|
31
|
+
insertMediaAsMediaSingle: InsertMediaAsMediaSingle;
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare class MediaNodeUpdater {
|
|
2
|
+
static instances: MediaNodeUpdater[];
|
|
3
|
+
static mockOverrides: {};
|
|
4
|
+
static mockReset(): void;
|
|
5
|
+
constructor();
|
|
6
|
+
static setMock(thisKey: string, value: any): void;
|
|
7
|
+
updateContextId(): Promise<void>;
|
|
8
|
+
updateNodeContextId(): Promise<void>;
|
|
9
|
+
getAttrs(): void;
|
|
10
|
+
getObjectId(): Promise<void>;
|
|
11
|
+
getNodeContextId(): void;
|
|
12
|
+
updateDimensions(): void;
|
|
13
|
+
getRemoteDimensions(): Promise<void>;
|
|
14
|
+
isNodeFromDifferentCollection(): Promise<void>;
|
|
15
|
+
hasDifferentContextId(): Promise<void>;
|
|
16
|
+
copyNode(): Promise<void>;
|
|
17
|
+
copyNodeFromPos(): Promise<void>;
|
|
18
|
+
updateMediaSingleFileAttrs(): Promise<void>;
|
|
19
|
+
uploadExternalMedia(): Promise<void>;
|
|
20
|
+
isMediaBlobUrl(): void;
|
|
21
|
+
copyNodeFromBlobUrl(): void;
|
|
22
|
+
updateNodeAttrs(): void;
|
|
23
|
+
handleExternalMedia(): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
5
|
+
import type { ContextIdentifierProvider, MediaProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
6
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
+
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
+
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
10
|
+
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
11
|
+
import type { getPosHandler, MediaOptions } from '../types';
|
|
12
|
+
export type MediaGroupProps = {
|
|
13
|
+
forwardRef?: (ref: HTMLElement) => void;
|
|
14
|
+
node: PMNode;
|
|
15
|
+
view: EditorView;
|
|
16
|
+
getPos: () => number | undefined;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
allowLazyLoading?: boolean;
|
|
19
|
+
mediaProvider: Promise<MediaProvider>;
|
|
20
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
21
|
+
isCopyPasteEnabled?: boolean;
|
|
22
|
+
anchorPos: number;
|
|
23
|
+
headPos: number;
|
|
24
|
+
mediaOptions: MediaOptions;
|
|
25
|
+
} & WrappedComponentProps;
|
|
26
|
+
export interface MediaGroupState {
|
|
27
|
+
viewMediaClientConfig?: MediaClientConfig;
|
|
28
|
+
}
|
|
29
|
+
declare const IntlMediaGroup: React.FC<import("react-intl-next").WithIntlProps<MediaGroupProps>> & {
|
|
30
|
+
WrappedComponent: React.ComponentType<MediaGroupProps>;
|
|
31
|
+
};
|
|
32
|
+
export default IntlMediaGroup;
|
|
33
|
+
export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
5
|
+
import type { ContextIdentifierProvider, MediaProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
6
|
+
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
7
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
8
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
9
|
+
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
10
|
+
import type { FileIdentifier } from '@atlaskit/media-client';
|
|
11
|
+
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
12
|
+
import type { MediaPluginState } from '../pm-plugins/types';
|
|
13
|
+
import type { getPosHandler, getPosHandler as ProsemirrorGetPosHandler } from '../types';
|
|
14
|
+
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
15
|
+
export interface MediaInlineProps {
|
|
16
|
+
mediaProvider: Promise<MediaProvider>;
|
|
17
|
+
identifier: FileIdentifier;
|
|
18
|
+
node: PMNode;
|
|
19
|
+
isSelected: boolean;
|
|
20
|
+
view: EditorView;
|
|
21
|
+
getPos: ProsemirrorGetPosHandler;
|
|
22
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
23
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
24
|
+
mediaPluginState: MediaPluginState;
|
|
25
|
+
}
|
|
26
|
+
export declare const createMediaNodeUpdater: (props: MediaInlineProps) => MediaNodeUpdater;
|
|
27
|
+
/**
|
|
28
|
+
* Handles updating the media inline node attributes
|
|
29
|
+
* but also handling copy-paste for cross-editor of the same instance
|
|
30
|
+
* using the contextid
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
export declare const updateMediaNodeAttributes: (props: MediaInlineProps, mediaNodeUpdater: MediaNodeUpdater) => Promise<void>;
|
|
34
|
+
export declare const handleNewNode: (props: MediaInlineProps) => void;
|
|
35
|
+
export declare const MediaInline: React.FC<MediaInlineProps>;
|
|
36
|
+
export interface MediaInlineNodeViewProps {
|
|
37
|
+
providerFactory: ProviderFactory;
|
|
38
|
+
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
39
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
40
|
+
}
|
|
41
|
+
export declare class MediaInlineNodeView extends SelectionBasedNodeView<MediaInlineNodeViewProps> {
|
|
42
|
+
createDomRef(): HTMLSpanElement;
|
|
43
|
+
getContentDOM(): {
|
|
44
|
+
dom: HTMLSpanElement;
|
|
45
|
+
};
|
|
46
|
+
ignoreMutation(): boolean;
|
|
47
|
+
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
48
|
+
render(props: MediaInlineNodeViewProps): JSX.Element;
|
|
49
|
+
}
|
|
50
|
+
export declare const ReactMediaInlineNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { MediaADFAttrs } from '@atlaskit/adf-schema';
|
|
2
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import type { MediaTraceContext } from '@atlaskit/media-common';
|
|
7
|
+
import type { MediaOptions, getPosHandler as ProsemirrorGetPosHandler } from '../types';
|
|
8
|
+
export type RemoteDimensions = {
|
|
9
|
+
id: string;
|
|
10
|
+
height: number;
|
|
11
|
+
width: number;
|
|
12
|
+
};
|
|
13
|
+
export interface MediaNodeUpdaterProps {
|
|
14
|
+
view: EditorView;
|
|
15
|
+
node: PMNode;
|
|
16
|
+
mediaProvider?: Promise<MediaProvider>;
|
|
17
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
18
|
+
isMediaSingle: boolean;
|
|
19
|
+
mediaOptions?: MediaOptions;
|
|
20
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
21
|
+
}
|
|
22
|
+
export declare class MediaNodeUpdater {
|
|
23
|
+
props: MediaNodeUpdaterProps;
|
|
24
|
+
constructor(props: MediaNodeUpdaterProps);
|
|
25
|
+
isMediaBlobUrl(): boolean;
|
|
26
|
+
updateContextId: () => Promise<void>;
|
|
27
|
+
updateNodeContextId: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
|
|
28
|
+
private hasFileAttributesDefined;
|
|
29
|
+
private getNewFileAttrsForNode;
|
|
30
|
+
updateMediaSingleFileAttrs: () => Promise<void>;
|
|
31
|
+
updateNodeAttrs: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
|
|
32
|
+
getAttrs: () => MediaADFAttrs | undefined;
|
|
33
|
+
getObjectId: () => Promise<string | null>;
|
|
34
|
+
uploadExternalMedia: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
|
|
35
|
+
getNodeContextId: () => string | null;
|
|
36
|
+
updateDimensions: (dimensions: RemoteDimensions) => void;
|
|
37
|
+
getRemoteDimensions(): Promise<false | RemoteDimensions>;
|
|
38
|
+
hasDifferentContextId: () => Promise<boolean>;
|
|
39
|
+
isNodeFromDifferentCollection: () => Promise<boolean>;
|
|
40
|
+
handleExternalMedia(getPos: ProsemirrorGetPosHandler): Promise<void>;
|
|
41
|
+
copyNodeFromBlobUrl: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
|
|
42
|
+
copyNodeFromPos: (getPos: ProsemirrorGetPosHandler, traceContext?: MediaTraceContext) => Promise<void>;
|
|
43
|
+
copyNode: (traceContext?: MediaTraceContext) => Promise<void>;
|
|
44
|
+
private copyFile;
|
|
45
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { MediaADFAttrs } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
5
|
+
import type { ContextIdentifierProvider, MediaProvider, ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
|
|
6
|
+
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
7
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
8
|
+
import type { WidthPluginState } from '@atlaskit/editor-plugin-width';
|
|
9
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
10
|
+
import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
|
+
import type { MediaNextEditorPluginType } from '../../next-plugin-type';
|
|
12
|
+
import type { getPosHandler, MediaOptions } from '../../types';
|
|
13
|
+
import type { MediaNodeViewProps } from '../types';
|
|
14
|
+
declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
|
|
15
|
+
private isSelected;
|
|
16
|
+
createDomRef(): HTMLElement;
|
|
17
|
+
viewShouldUpdate(nextNode: PMNode, decorations: Decoration[]): boolean;
|
|
18
|
+
stopEvent(event: Event): boolean;
|
|
19
|
+
getAttrs(): MediaADFAttrs;
|
|
20
|
+
isMediaBlobUrl(): boolean;
|
|
21
|
+
renderMediaNodeWithState: (mediaProvider?: Promise<MediaProvider>, contextIdentifierProvider?: Promise<ContextIdentifierProvider>) => ({ width: editorWidth }: {
|
|
22
|
+
width?: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
23
|
+
}) => JSX.Element;
|
|
24
|
+
renderMediaNodeWithProviders: ({ mediaProvider, contextIdentifierProvider, }: Providers) => JSX.Element;
|
|
25
|
+
render(): JSX.Element;
|
|
26
|
+
}
|
|
27
|
+
export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaNodeView;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
+
import type { ImageLoaderProps } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import type { CardDimensions, CardOnClickCallback, NumericalCardDimensions } from '@atlaskit/media-card';
|
|
7
|
+
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
8
|
+
import type { MediaOptions, getPosHandler as ProsemirrorGetPosHandler, ReactNodeProps } from '../../types';
|
|
9
|
+
export declare const MEDIA_HEIGHT = 125;
|
|
10
|
+
export declare const FILE_WIDTH = 156;
|
|
11
|
+
export interface MediaNodeProps extends ReactNodeProps, ImageLoaderProps {
|
|
12
|
+
view: EditorView;
|
|
13
|
+
node: PMNode;
|
|
14
|
+
getPos: ProsemirrorGetPosHandler;
|
|
15
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
16
|
+
originalDimensions: NumericalCardDimensions;
|
|
17
|
+
maxDimensions: CardDimensions;
|
|
18
|
+
isMediaSingle?: boolean;
|
|
19
|
+
onClick?: CardOnClickCallback;
|
|
20
|
+
mediaProvider?: Promise<MediaProvider>;
|
|
21
|
+
isLoading?: boolean;
|
|
22
|
+
mediaOptions?: MediaOptions;
|
|
23
|
+
}
|
|
24
|
+
interface MediaNodeState {
|
|
25
|
+
viewMediaClientConfig?: MediaClientConfig;
|
|
26
|
+
contextIdentifierProvider?: ContextIdentifierProvider;
|
|
27
|
+
}
|
|
28
|
+
export declare class MediaNode extends Component<MediaNodeProps, MediaNodeState> {
|
|
29
|
+
private mediaPluginState;
|
|
30
|
+
state: MediaNodeState;
|
|
31
|
+
constructor(props: MediaNodeProps);
|
|
32
|
+
shouldComponentUpdate(nextProps: MediaNodeProps, nextState: MediaNodeState): boolean;
|
|
33
|
+
componentDidMount(): Promise<void>;
|
|
34
|
+
componentWillUnmount(): void;
|
|
35
|
+
componentDidUpdate(prevProps: Readonly<MediaNodeProps>): void;
|
|
36
|
+
private setViewMediaClientConfig;
|
|
37
|
+
private selectMediaSingleFromCard;
|
|
38
|
+
private selectMediaSingle;
|
|
39
|
+
render(): JSX.Element;
|
|
40
|
+
private onFullscreenChange;
|
|
41
|
+
private handleNewNode;
|
|
42
|
+
}
|
|
43
|
+
declare const _default: React.ComponentClass<MediaNodeProps & ImageLoaderProps, any>;
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import type { MouseEvent } from 'react';
|
|
3
|
+
import React, { Component } from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
6
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
8
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
9
|
+
import type { ContextIdentifierProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
10
|
+
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
11
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
12
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
13
|
+
import type { Decoration, DecorationSource, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
14
|
+
import type { CardEvent } from '@atlaskit/media-card';
|
|
15
|
+
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
16
|
+
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
17
|
+
import type { ForwardRef, getPosHandler } from '../types';
|
|
18
|
+
import type { MediaOptions } from '../types';
|
|
19
|
+
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
20
|
+
import type { MediaSingleNodeProps, MediaSingleNodeViewProps } from './types';
|
|
21
|
+
export interface MediaSingleNodeState {
|
|
22
|
+
width?: number;
|
|
23
|
+
height?: number;
|
|
24
|
+
viewMediaClientConfig?: MediaClientConfig;
|
|
25
|
+
contextIdentifierProvider?: ContextIdentifierProvider;
|
|
26
|
+
isCopying: boolean;
|
|
27
|
+
}
|
|
28
|
+
export default class MediaSingleNode extends Component<MediaSingleNodeProps, MediaSingleNodeState> {
|
|
29
|
+
static defaultProps: Partial<MediaSingleNodeProps>;
|
|
30
|
+
static displayName: string;
|
|
31
|
+
state: MediaSingleNodeState;
|
|
32
|
+
mediaSingleWrapperRef: React.RefObject<HTMLDivElement>;
|
|
33
|
+
captionPlaceHolderRef: React.RefObject<HTMLSpanElement>;
|
|
34
|
+
createMediaNodeUpdater: (props: MediaSingleNodeProps) => MediaNodeUpdater;
|
|
35
|
+
UNSAFE_componentWillReceiveProps(nextProps: MediaSingleNodeProps): void;
|
|
36
|
+
setViewMediaClientConfig: (props: MediaSingleNodeProps) => Promise<void>;
|
|
37
|
+
updateMediaNodeAttributes: (props: MediaSingleNodeProps) => Promise<void>;
|
|
38
|
+
componentDidMount(): Promise<void>;
|
|
39
|
+
selectMediaSingle: ({ event }: CardEvent) => void;
|
|
40
|
+
updateSize: (width: number | null, layout: MediaSingleLayout) => void;
|
|
41
|
+
onMediaSingleClicked: (event: MouseEvent) => void;
|
|
42
|
+
render(): jsx.JSX.Element;
|
|
43
|
+
private clickPlaceholder;
|
|
44
|
+
}
|
|
45
|
+
declare class MediaSingleNodeView extends ReactNodeView<MediaSingleNodeViewProps> {
|
|
46
|
+
lastOffsetLeft: number;
|
|
47
|
+
forceViewUpdate: boolean;
|
|
48
|
+
selectionType: number | null;
|
|
49
|
+
createDomRef(): HTMLElement;
|
|
50
|
+
getContentDOM(): {
|
|
51
|
+
dom: HTMLDivElement;
|
|
52
|
+
};
|
|
53
|
+
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
54
|
+
checkAndUpdateSelectionType: () => import("@atlaskit/editor-common/utils").SelectedState | null;
|
|
55
|
+
isNodeSelected: () => boolean;
|
|
56
|
+
getNodeMediaId(node: PMNode): string | undefined;
|
|
57
|
+
update(node: PMNode, decorations: readonly Decoration[], _innerDecorations?: DecorationSource, isValidUpdate?: (currentNode: PMNode, newNode: PMNode) => boolean): boolean;
|
|
58
|
+
render(props: MediaSingleNodeViewProps, forwardRef?: ForwardRef): jsx.JSX.Element;
|
|
59
|
+
ignoreMutation(): boolean;
|
|
60
|
+
}
|
|
61
|
+
export declare const ReactMediaSingleNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, mediaOptions?: MediaOptions) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaSingleNodeView;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import type { NumericalCardDimensions } from '@atlaskit/media-card';
|
|
5
|
+
export declare const MediaInlineNodeSelector = "media-inline-node";
|
|
6
|
+
export declare const MediaSingleNodeSelector = "media-single-node";
|
|
7
|
+
export declare const figureWrapper: import("@emotion/react").SerializedStyles;
|
|
8
|
+
type MediaCardWrapperProps = {
|
|
9
|
+
dimensions: NumericalCardDimensions;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
selected?: boolean;
|
|
12
|
+
borderWidth?: number;
|
|
13
|
+
onContextMenu?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const MediaCardWrapper: ({ dimensions, children, selected, borderWidth, onContextMenu, }: MediaCardWrapperProps) => jsx.JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
+
import type { ContextIdentifierProvider, MediaProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
8
|
+
import type { MediaPluginState } from '../pm-plugins/types';
|
|
9
|
+
import type { ForwardRef, MediaOptions, getPosHandler as ProsemirrorGetPosHandler } from '../types';
|
|
10
|
+
export interface MediaSingleNodeProps {
|
|
11
|
+
view: EditorView;
|
|
12
|
+
node: PMNode;
|
|
13
|
+
getPos: ProsemirrorGetPosHandler;
|
|
14
|
+
eventDispatcher: EventDispatcher;
|
|
15
|
+
width: number;
|
|
16
|
+
selected: Function;
|
|
17
|
+
lineLength: number;
|
|
18
|
+
mediaOptions: MediaOptions;
|
|
19
|
+
mediaProvider?: Promise<MediaProvider>;
|
|
20
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
21
|
+
fullWidthMode?: boolean;
|
|
22
|
+
mediaPluginState: MediaPluginState;
|
|
23
|
+
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
24
|
+
isCopyPasteEnabled?: boolean;
|
|
25
|
+
forwardRef: ForwardRef;
|
|
26
|
+
pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
27
|
+
}
|
|
28
|
+
export interface MediaSingleNodeViewProps {
|
|
29
|
+
eventDispatcher: EventDispatcher;
|
|
30
|
+
providerFactory: ProviderFactory;
|
|
31
|
+
mediaOptions: MediaOptions;
|
|
32
|
+
fullWidthMode?: boolean;
|
|
33
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
34
|
+
isCopyPasteEnabled?: boolean;
|
|
35
|
+
pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
36
|
+
}
|
|
37
|
+
export interface MediaNodeViewProps {
|
|
38
|
+
eventDispatcher: EventDispatcher;
|
|
39
|
+
providerFactory: ProviderFactory;
|
|
40
|
+
mediaOptions: MediaOptions;
|
|
41
|
+
pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
42
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ErrorReportingHandler } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
3
|
+
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
4
|
+
import type { UploadEndEventPayload, UploadErrorEventPayload, UploadParams, UploadPreviewUpdateEventPayload } from '@atlaskit/media-picker/types';
|
|
5
|
+
import type { CustomMediaPicker, MediaState, MobileUploadEndEventPayload } from './types';
|
|
6
|
+
export type PickerType = 'clipboard' | 'dropzone' | 'customMediaPicker';
|
|
7
|
+
export type ExtendedComponentConfigs = {
|
|
8
|
+
customMediaPicker: CustomMediaPicker;
|
|
9
|
+
dropzone: null;
|
|
10
|
+
clipboard: null;
|
|
11
|
+
};
|
|
12
|
+
export type PickerFacadeConfig = {
|
|
13
|
+
mediaClientConfig: MediaClientConfig;
|
|
14
|
+
errorReporter: ErrorReportingHandler;
|
|
15
|
+
featureFlags?: MediaFeatureFlags;
|
|
16
|
+
};
|
|
17
|
+
export type MediaStateEvent = MediaState;
|
|
18
|
+
export type MediaStateEventListener = (evt: MediaStateEvent) => void;
|
|
19
|
+
export type MediaStateEventSubscriber = (listener: MediaStateEventListener) => void;
|
|
20
|
+
export type NewMediaEvent = (state: MediaState, onStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
|
|
21
|
+
export default class PickerFacade {
|
|
22
|
+
readonly config: PickerFacadeConfig;
|
|
23
|
+
readonly pickerConfig?: CustomMediaPicker | null | undefined;
|
|
24
|
+
private picker?;
|
|
25
|
+
private onDragListeners;
|
|
26
|
+
private pickerType;
|
|
27
|
+
private onStartListeners;
|
|
28
|
+
private eventListeners;
|
|
29
|
+
private analyticsName;
|
|
30
|
+
erroredFiles: Set<string>;
|
|
31
|
+
constructor(pickerType: PickerType, config: PickerFacadeConfig, pickerConfig?: CustomMediaPicker | null | undefined, analyticsName?: string);
|
|
32
|
+
init(): Promise<PickerFacade>;
|
|
33
|
+
get type(): PickerType;
|
|
34
|
+
get mediaPicker(): CustomMediaPicker | undefined;
|
|
35
|
+
destroy(): void;
|
|
36
|
+
setUploadParams(params: UploadParams): void;
|
|
37
|
+
onNewMedia(cb: NewMediaEvent): void;
|
|
38
|
+
onDrag(cb: (state: 'enter' | 'leave') => any): void;
|
|
39
|
+
handleUploadPreviewUpdate: (event: UploadPreviewUpdateEventPayload) => void;
|
|
40
|
+
private subscribeStateChanged;
|
|
41
|
+
handleUploadError: ({ error, fileId }: UploadErrorEventPayload) => void;
|
|
42
|
+
handleMobileUploadEnd: (event: MobileUploadEndEventPayload) => void;
|
|
43
|
+
handleReady: (event: UploadEndEventPayload) => void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
+
import type { MediaNextEditorPluginType } from './next-plugin-type';
|
|
3
|
+
import type { MediaState } from './pm-plugins/main';
|
|
4
|
+
import type { CustomMediaPicker } from './types';
|
|
5
|
+
export type { MediaState, MediaProvider, CustomMediaPicker };
|
|
6
|
+
export { insertMediaSingleNode } from './utils/media-single';
|
|
7
|
+
export declare const mediaPlugin: MediaNextEditorPluginType;
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
export declare const closeMediaAltTextMenu: import("@atlaskit/editor-common/types").Command;
|
|
3
|
+
export declare const openMediaAltTextMenu: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
4
|
+
export declare const updateAltText: (newAltText: string) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
export declare const pluginKey: PluginKey<any>;
|
|
5
|
+
declare const createCommand: <A = import("./actions").MediaAltTextAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").MediaAltTextState;
|
|
6
|
+
export declare const createPlugin: ({ dispatch, providerFactory, }: PMPluginFactoryParams) => SafePlugin<import("./types").MediaAltTextState>;
|
|
7
|
+
export { createCommand, getPluginState };
|
|
@@ -0,0 +1,4 @@
|
|
|
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;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
altText: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
editAltText: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
back: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
clear: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
placeholder: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
supportText: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
validationMessage: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
5
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
export declare const CONTAINER_WIDTH_IN_PX = 420;
|
|
7
|
+
export declare const MAX_ALT_TEXT_LENGTH = 510;
|
|
8
|
+
type Props = {
|
|
9
|
+
view: EditorView;
|
|
10
|
+
value?: string;
|
|
11
|
+
altTextValidator?: (value: string) => string[];
|
|
12
|
+
onEscape?: () => void;
|
|
13
|
+
} & WrappedComponentProps & WithAnalyticsEventsProps;
|
|
14
|
+
export type AltTextEditComponentState = {
|
|
15
|
+
showClearTextButton: boolean;
|
|
16
|
+
validationErrors: string[] | undefined;
|
|
17
|
+
lastValue: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
export declare class AltTextEditComponent extends React.Component<Props, AltTextEditComponentState> {
|
|
20
|
+
private fireCustomAnalytics?;
|
|
21
|
+
state: {
|
|
22
|
+
showClearTextButton: boolean;
|
|
23
|
+
validationErrors: string[];
|
|
24
|
+
lastValue: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
constructor(props: Props);
|
|
27
|
+
prevValue: string | undefined;
|
|
28
|
+
componentDidMount(): void;
|
|
29
|
+
componentWillUnmount(): void;
|
|
30
|
+
private getValidationErrors;
|
|
31
|
+
render(): jsx.JSX.Element;
|
|
32
|
+
private closeMediaAltTextMenu;
|
|
33
|
+
private fireAnalytics;
|
|
34
|
+
private dispatchCancelEvent;
|
|
35
|
+
private updateAltText;
|
|
36
|
+
private handleOnChange;
|
|
37
|
+
private handleOnBlur;
|
|
38
|
+
private handleClearText;
|
|
39
|
+
}
|
|
40
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<Props>>, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import type { EditorSelectionAPI } from '@atlaskit/editor-plugin-selection';
|
|
4
|
+
import type { MediaOptions } from '../types';
|
|
5
|
+
export declare function keymapPlugin(options: MediaOptions | undefined, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, editorSelectionAPI: EditorSelectionAPI | undefined): SafePlugin;
|
|
6
|
+
export default keymapPlugin;
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
export interface VisibleAction {
|
|
8
|
+
type: MediaLinkingActionsTypes.showToolbar;
|
|
9
|
+
}
|
|
10
|
+
export interface HideAction {
|
|
11
|
+
type: MediaLinkingActionsTypes.hideToolbar;
|
|
12
|
+
}
|
|
13
|
+
export interface SetLinkToMedia {
|
|
14
|
+
type: MediaLinkingActionsTypes.setUrl;
|
|
15
|
+
payload: string;
|
|
16
|
+
}
|
|
17
|
+
export interface Unlink {
|
|
18
|
+
type: MediaLinkingActionsTypes.unlink;
|
|
19
|
+
}
|
|
20
|
+
export type MediaLinkingActions = VisibleAction | SetLinkToMedia | HideAction | Unlink;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { MediaLinkingActions } from './actions';
|
|
5
|
+
import type { MediaLinkingState } from './types';
|
|
6
|
+
export declare const mediaLinkingPluginKey: PluginKey<MediaLinkingState>;
|
|
7
|
+
export declare const createMediaLinkingCommand: <A = MediaLinkingActions>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getMediaLinkingState: (state: import("prosemirror-state").EditorState) => MediaLinkingState;
|
|
8
|
+
export type { MediaLinkingState } from './types';
|
|
9
|
+
declare const _default: (dispatch: Dispatch) => SafePlugin<MediaLinkingState>;
|
|
10
|
+
export default _default;
|