@atlaskit/editor-plugin-media 1.27.0 → 1.27.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.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/nodeviews/lazy-media-group.js +36 -0
- package/dist/cjs/nodeviews/lazy-media-inline.js +34 -0
- package/dist/cjs/nodeviews/lazy-media-single.js +35 -0
- package/dist/cjs/nodeviews/lazy-media.js +36 -0
- package/dist/cjs/plugin.js +17 -15
- package/dist/cjs/toDOM-fixes/media.js +25 -0
- package/dist/cjs/toDOM-fixes/mediaGroup.js +94 -0
- package/dist/cjs/toDOM-fixes/mediaInline.js +48 -0
- package/dist/cjs/toDOM-fixes/mediaSingle.js +160 -0
- package/dist/cjs/toDOM-fixes/toDOMAttrs.js +80 -0
- package/dist/es2019/nodeviews/lazy-media-group.js +23 -0
- package/dist/es2019/nodeviews/lazy-media-inline.js +23 -0
- package/dist/es2019/nodeviews/lazy-media-single.js +23 -0
- package/dist/es2019/nodeviews/lazy-media.js +23 -0
- package/dist/es2019/plugin.js +20 -19
- package/dist/es2019/toDOM-fixes/media.js +17 -0
- package/dist/es2019/toDOM-fixes/mediaGroup.js +85 -0
- package/dist/es2019/toDOM-fixes/mediaInline.js +41 -0
- package/dist/es2019/toDOM-fixes/mediaSingle.js +152 -0
- package/dist/es2019/toDOM-fixes/toDOMAttrs.js +69 -0
- package/dist/esm/nodeviews/lazy-media-group.js +24 -0
- package/dist/esm/nodeviews/lazy-media-inline.js +22 -0
- package/dist/esm/nodeviews/lazy-media-single.js +23 -0
- package/dist/esm/nodeviews/lazy-media.js +24 -0
- package/dist/esm/plugin.js +20 -19
- package/dist/esm/toDOM-fixes/media.js +19 -0
- package/dist/esm/toDOM-fixes/mediaGroup.js +87 -0
- package/dist/esm/toDOM-fixes/mediaInline.js +41 -0
- package/dist/esm/toDOM-fixes/mediaSingle.js +152 -0
- package/dist/esm/toDOM-fixes/toDOMAttrs.js +74 -0
- package/dist/types/media-plugin-options.d.ts +3 -4
- package/dist/types/nodeviews/lazy-media-group.d.ts +7 -0
- package/dist/types/nodeviews/lazy-media-inline.d.ts +7 -0
- package/dist/types/nodeviews/lazy-media-single.d.ts +9 -0
- package/dist/types/nodeviews/lazy-media.d.ts +8 -0
- package/dist/types/toDOM-fixes/media.d.ts +1 -0
- package/dist/types/toDOM-fixes/mediaGroup.d.ts +36 -0
- package/dist/types/toDOM-fixes/mediaInline.d.ts +1 -0
- package/dist/types/toDOM-fixes/mediaSingle.d.ts +29 -0
- package/dist/types/toDOM-fixes/toDOMAttrs.d.ts +35 -0
- package/dist/types-ts4.5/media-plugin-options.d.ts +3 -4
- package/dist/types-ts4.5/nodeviews/lazy-media-group.d.ts +7 -0
- package/dist/types-ts4.5/nodeviews/lazy-media-inline.d.ts +7 -0
- package/dist/types-ts4.5/nodeviews/lazy-media-single.d.ts +9 -0
- package/dist/types-ts4.5/nodeviews/lazy-media.d.ts +8 -0
- package/dist/types-ts4.5/toDOM-fixes/media.d.ts +1 -0
- package/dist/types-ts4.5/toDOM-fixes/mediaGroup.d.ts +36 -0
- package/dist/types-ts4.5/toDOM-fixes/mediaInline.d.ts +1 -0
- package/dist/types-ts4.5/toDOM-fixes/mediaSingle.d.ts +29 -0
- package/dist/types-ts4.5/toDOM-fixes/toDOMAttrs.d.ts +35 -0
- package/package.json +7 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const wrappedLayouts: string[];
|
|
2
|
+
/**
|
|
3
|
+
* Duplicate of method from `@atlaskit/editor-common/utils`.
|
|
4
|
+
* `packages/editor/editor-common/src/utils/rich-media-utils.ts`
|
|
5
|
+
*
|
|
6
|
+
* WHY?
|
|
7
|
+
* This will eventually move to `@atlaskit/adf-schema` and we cannot reference
|
|
8
|
+
* `@atlaskit/editor-common` from here or it will cause dependency issues.
|
|
9
|
+
*
|
|
10
|
+
* In the long term likely `toDOM` will move back out of `adf-schema` in which
|
|
11
|
+
* case we can consolidate them.
|
|
12
|
+
*/
|
|
13
|
+
export declare const shouldAddDefaultWrappedWidth: (layout: string, width?: number, lineLength?: number) => boolean | 0 | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Duplicate of method from `@atlaskit/editor-common/media-single`.
|
|
16
|
+
* `packages/editor/editor-common/src/media-single/utils.ts`
|
|
17
|
+
*
|
|
18
|
+
* WHY?
|
|
19
|
+
* This will eventually move to `@atlaskit/adf-schema` and we cannot reference
|
|
20
|
+
* `@atlaskit/editor-common` from here or it will cause dependency issues.
|
|
21
|
+
*
|
|
22
|
+
* In the long term likely `toDOM` will move back out of `adf-schema` in which
|
|
23
|
+
* case we can consolidate them.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getMediaSinglePixelWidth(width: number, editorWidth: number, widthType?: string, gutterOffset?: number): number;
|
|
26
|
+
export declare const mediaSingleSpecWithFixedToDOM: (mediaSingleOption: {
|
|
27
|
+
withCaption?: boolean;
|
|
28
|
+
withExtendedWidthTypes: boolean;
|
|
29
|
+
}) => import("prosemirror-model").NodeSpec;
|
|
@@ -0,0 +1,35 @@
|
|
|
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-id': any;
|
|
9
|
+
'data-node-type': string;
|
|
10
|
+
'data-type': any;
|
|
11
|
+
'data-collection': any;
|
|
12
|
+
'data-occurrence-key': any;
|
|
13
|
+
'data-width': any;
|
|
14
|
+
'data-height': any;
|
|
15
|
+
'data-url': any;
|
|
16
|
+
'data-alt': any;
|
|
17
|
+
title: string;
|
|
18
|
+
style: 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-node-type': string;
|
|
28
|
+
'data-layout': any;
|
|
29
|
+
'data-width': string;
|
|
30
|
+
} | {
|
|
31
|
+
'data-width-type': any;
|
|
32
|
+
'data-node-type': string;
|
|
33
|
+
'data-layout': any;
|
|
34
|
+
'data-width': string;
|
|
35
|
+
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import type { NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
|
|
1
2
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
2
3
|
import type { ErrorReporter } from '@atlaskit/editor-common/utils';
|
|
3
|
-
import type {
|
|
4
|
-
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { CustomMediaPicker, getPosHandler, MediaState } from './types';
|
|
4
|
+
import type { CustomMediaPicker, MediaState } from './types';
|
|
6
5
|
export type MediaPluginOptions = {
|
|
7
6
|
providerFactory: ProviderFactory;
|
|
8
7
|
nodeViews: {
|
|
9
|
-
[name: string]:
|
|
8
|
+
[name: string]: NodeViewConstructor;
|
|
10
9
|
};
|
|
11
10
|
errorReporter?: ErrorReporter;
|
|
12
11
|
uploadErrorHandler?: (state: MediaState) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
4
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
6
|
+
import type { MediaOptions } from '../types';
|
|
7
|
+
export declare const lazyMediaGroupView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
5
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
7
|
+
export declare const lazyMediaInlineView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
+
import { type NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
|
|
4
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
6
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
8
|
+
import type { MediaOptions } from '../types';
|
|
9
|
+
export declare const lazyMediaSingleView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, options?: MediaOptions) => NodeViewConstructor;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import { type NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
|
|
3
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
5
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
7
|
+
import type { MediaOptions } from '../types';
|
|
8
|
+
export declare const lazyMediaView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => NodeViewConstructor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const mediaSpecWithFixedToDOM: () => import("prosemirror-model").NodeSpec;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Duplicate consts from `media-card`.
|
|
3
|
+
* `packages/media/media-card/src/utils/cardDimensions.ts`
|
|
4
|
+
*
|
|
5
|
+
* WHY?
|
|
6
|
+
* This will eventually move to `@atlaskit/adf-schema` and we cannot reference
|
|
7
|
+
* `media-card` from here or it will cause dependency issues.
|
|
8
|
+
*
|
|
9
|
+
* In the long term likely `toDOM` will move back out of `adf-schema` in which
|
|
10
|
+
* case we can consolidate them.
|
|
11
|
+
*/
|
|
12
|
+
export declare const defaultImageCardDimensions: {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const defaultHorizontalCardDimensions: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
};
|
|
20
|
+
export declare const defaultSquareCardDimensions: {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Duplicate logic from `@atlaskit/media-card` for computing the dimensions of a media group card.
|
|
26
|
+
* From: `packages/media/media-card/src/utils/cardDimensions.ts`
|
|
27
|
+
*
|
|
28
|
+
* WHY?
|
|
29
|
+
* This will eventually move to `@atlaskit/adf-schema` and we cannot reference
|
|
30
|
+
* `@atlaskit/media-card` from here or it will cause dependency issues.
|
|
31
|
+
*
|
|
32
|
+
* In the long term likely `toDOM` will move back out of `adf-schema` in which
|
|
33
|
+
* case we can consolidate them.
|
|
34
|
+
*/
|
|
35
|
+
export declare const getDefaultCardDimensions: (appearance?: 'image' | 'square' | 'horizontal' | 'auto') => Required<typeof defaultImageCardDimensions>;
|
|
36
|
+
export declare const mediaGroupSpecWithFixedToDOM: () => import("prosemirror-model").NodeSpec;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const mediaInlineSpecWithFixedToDOM: () => import("prosemirror-model").NodeSpec;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const wrappedLayouts: string[];
|
|
2
|
+
/**
|
|
3
|
+
* Duplicate of method from `@atlaskit/editor-common/utils`.
|
|
4
|
+
* `packages/editor/editor-common/src/utils/rich-media-utils.ts`
|
|
5
|
+
*
|
|
6
|
+
* WHY?
|
|
7
|
+
* This will eventually move to `@atlaskit/adf-schema` and we cannot reference
|
|
8
|
+
* `@atlaskit/editor-common` from here or it will cause dependency issues.
|
|
9
|
+
*
|
|
10
|
+
* In the long term likely `toDOM` will move back out of `adf-schema` in which
|
|
11
|
+
* case we can consolidate them.
|
|
12
|
+
*/
|
|
13
|
+
export declare const shouldAddDefaultWrappedWidth: (layout: string, width?: number, lineLength?: number) => boolean | 0 | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Duplicate of method from `@atlaskit/editor-common/media-single`.
|
|
16
|
+
* `packages/editor/editor-common/src/media-single/utils.ts`
|
|
17
|
+
*
|
|
18
|
+
* WHY?
|
|
19
|
+
* This will eventually move to `@atlaskit/adf-schema` and we cannot reference
|
|
20
|
+
* `@atlaskit/editor-common` from here or it will cause dependency issues.
|
|
21
|
+
*
|
|
22
|
+
* In the long term likely `toDOM` will move back out of `adf-schema` in which
|
|
23
|
+
* case we can consolidate them.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getMediaSinglePixelWidth(width: number, editorWidth: number, widthType?: string, gutterOffset?: number): number;
|
|
26
|
+
export declare const mediaSingleSpecWithFixedToDOM: (mediaSingleOption: {
|
|
27
|
+
withCaption?: boolean;
|
|
28
|
+
withExtendedWidthTypes: boolean;
|
|
29
|
+
}) => import("prosemirror-model").NodeSpec;
|
|
@@ -0,0 +1,35 @@
|
|
|
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-id': any;
|
|
9
|
+
'data-node-type': string;
|
|
10
|
+
'data-type': any;
|
|
11
|
+
'data-collection': any;
|
|
12
|
+
'data-occurrence-key': any;
|
|
13
|
+
'data-width': any;
|
|
14
|
+
'data-height': any;
|
|
15
|
+
'data-url': any;
|
|
16
|
+
'data-alt': any;
|
|
17
|
+
title: string;
|
|
18
|
+
style: 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-node-type': string;
|
|
28
|
+
'data-layout': any;
|
|
29
|
+
'data-width': string;
|
|
30
|
+
} | {
|
|
31
|
+
'data-width-type': any;
|
|
32
|
+
'data-node-type': string;
|
|
33
|
+
'data-layout': any;
|
|
34
|
+
'data-width': string;
|
|
35
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "1.27.
|
|
3
|
+
"version": "1.27.2",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"@atlaskit/analytics-namespaced-context": "^6.10.0",
|
|
38
38
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
39
39
|
"@atlaskit/button": "^19.1.0",
|
|
40
|
-
"@atlaskit/editor-common": "^
|
|
40
|
+
"@atlaskit/editor-common": "^87.0.0",
|
|
41
41
|
"@atlaskit/editor-palette": "1.6.0",
|
|
42
42
|
"@atlaskit/editor-plugin-analytics": "^1.6.0",
|
|
43
|
-
"@atlaskit/editor-plugin-annotation": "1.18.
|
|
43
|
+
"@atlaskit/editor-plugin-annotation": "1.18.1",
|
|
44
44
|
"@atlaskit/editor-plugin-decorations": "^1.2.0",
|
|
45
45
|
"@atlaskit/editor-plugin-editor-disabled": "^1.2.0",
|
|
46
46
|
"@atlaskit/editor-plugin-editor-viewmode": "^2.1.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
55
55
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
56
56
|
"@atlaskit/form": "^10.4.0",
|
|
57
|
-
"@atlaskit/icon": "^22.
|
|
57
|
+
"@atlaskit/icon": "^22.8.0",
|
|
58
58
|
"@atlaskit/media-card": "^78.0.0",
|
|
59
59
|
"@atlaskit/media-client": "^27.3.0",
|
|
60
60
|
"@atlaskit/media-client-react": "^2.0.0",
|
|
@@ -149,6 +149,9 @@
|
|
|
149
149
|
},
|
|
150
150
|
"platform-editor-a11y-image-border-options-dropdown": {
|
|
151
151
|
"type": "boolean"
|
|
152
|
+
},
|
|
153
|
+
"platform_editor_lazy-node-views": {
|
|
154
|
+
"type": "boolean"
|
|
152
155
|
}
|
|
153
156
|
},
|
|
154
157
|
"stricter": {
|