@atlaskit/editor-core 187.8.13 → 187.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/cjs/plugins/floating-toolbar/index.js +1 -3
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +33 -23
- package/dist/cjs/plugins/media/toolbar/index.js +16 -2
- package/dist/cjs/plugins/media/toolbar/utils.js +7 -2
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +574 -0
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/guidelines.js +117 -0
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.js +15 -0
- package/dist/cjs/ui/Resizer/ResizeLabel/index.js +20 -0
- package/dist/cjs/ui/Resizer/ResizeLabel/styles.js +17 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/floating-toolbar/index.js +1 -1
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +34 -23
- package/dist/es2019/plugins/media/toolbar/index.js +19 -3
- package/dist/es2019/plugins/media/toolbar/utils.js +7 -1
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +493 -0
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/guidelines.js +108 -0
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.js +8 -0
- package/dist/es2019/ui/Resizer/ResizeLabel/index.js +12 -0
- package/dist/es2019/ui/Resizer/ResizeLabel/styles.js +25 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/floating-toolbar/index.js +1 -3
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +33 -23
- package/dist/esm/plugins/media/toolbar/index.js +17 -3
- package/dist/esm/plugins/media/toolbar/utils.js +5 -1
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +564 -0
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/guidelines.js +108 -0
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.js +8 -0
- package/dist/esm/ui/Resizer/ResizeLabel/index.js +12 -0
- package/dist/esm/ui/Resizer/ResizeLabel/styles.js +7 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/labs/next/presets/universal.d.ts +1 -2
- package/dist/types/plugins/floating-toolbar/index.d.ts +3 -1
- package/dist/types/plugins/media/index.d.ts +2 -0
- package/dist/types/plugins/media/nodeviews/styles.d.ts +1 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/media/toolbar/utils.d.ts +1 -0
- package/dist/types/plugins/media/types.d.ts +1 -0
- package/dist/types/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +61 -0
- package/dist/types/plugins/media/ui/ResizableMediaSingle/guidelines.d.ts +4 -0
- package/dist/types/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.d.ts +7 -0
- package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +1 -0
- package/dist/types/ui/Resizer/ResizeLabel/index.d.ts +8 -0
- package/dist/types/ui/Resizer/ResizeLabel/styles.d.ts +3 -0
- package/dist/types-ts4.5/labs/next/presets/universal.d.ts +1 -2
- package/dist/types-ts4.5/plugins/floating-toolbar/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/media/index.d.ts +2 -0
- package/dist/types-ts4.5/plugins/media/nodeviews/styles.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/toolbar/utils.d.ts +1 -0
- package/dist/types-ts4.5/plugins/media/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +61 -0
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/guidelines.d.ts +4 -0
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.d.ts +7 -0
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +1 -0
- package/dist/types-ts4.5/ui/Resizer/ResizeLabel/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/Resizer/ResizeLabel/styles.d.ts +3 -0
- package/package.json +2 -2
- package/report.api.md +7 -4
- package/tmp/api-report-tmp.d.ts +5 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { wrapper, text, smallText } from './styles';
|
|
4
|
+
var ResizeLabelBreakoutWidth = 110;
|
|
5
|
+
var ResizeLabel = function ResizeLabel(props) {
|
|
6
|
+
return jsx("div", {
|
|
7
|
+
css: wrapper
|
|
8
|
+
}, jsx("span", {
|
|
9
|
+
css: [text, props.containerWidth < ResizeLabelBreakoutWidth && smallText]
|
|
10
|
+
}, props.label));
|
|
11
|
+
};
|
|
12
|
+
export default ResizeLabel;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { B300 } from '@atlaskit/theme/colors';
|
|
5
|
+
export var wrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-size: ", ";\n width: 100%;\n text-align: center;\n position: absolute;\n transform: translateY(-125%);\n top: 0;\n"])), "var(--ds-font-size-100, 14px)");
|
|
6
|
+
export var text = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-block;\n border-radius: 6px;\n min-width: 75px;\n background-color: ", ";\n color: ", ";\n padding: ", " ", ";\n letter-spacing: 0.5px;\n"])), "var(--ds-text-accent-blue, ".concat(B300, ")"), "var(--ds-text-inverse, white)", "var(--ds-space-050, 4px)", "var(--ds-space-200, 16px)");
|
|
7
|
+
export var smallText = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n letter-spacing: -0.5px;\n font-size: ", ";\n min-width: 27px;\n padding: ", " ", ";\n"])), "var(--ds-font-size-050, 8px)", "var(--ds-space-0, 0px)", "var(--ds-space-025, 2px)");
|
package/dist/esm/version.json
CHANGED
|
@@ -2,9 +2,8 @@ import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
2
2
|
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { DefaultPresetPluginOptions } from './default';
|
|
4
4
|
import type { EditorPresetProps } from './types';
|
|
5
|
-
import type { EditorSharedPropsWithPlugins } from '../../../types/editor-props';
|
|
5
|
+
import type { EditorSharedPropsWithPlugins, EditorPluginFeatureProps, EditorProviderProps } from '../../../types/editor-props';
|
|
6
6
|
import type { FeatureFlags } from '../../../types/feature-flags';
|
|
7
|
-
import type { EditorPluginFeatureProps, EditorProviderProps } from '../../../types/editor-props';
|
|
8
7
|
import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
9
8
|
type UniversalPresetProps = EditorPresetProps & DefaultPresetPluginOptions & EditorSharedPropsWithPlugins & EditorPluginFeatureProps & EditorProviderProps;
|
|
10
9
|
/**
|
|
@@ -3,7 +3,9 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
|
3
3
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { FloatingToolbarConfig } from './types';
|
|
5
5
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
6
|
-
export type FloatingToolbarPluginState =
|
|
6
|
+
export type FloatingToolbarPluginState = {
|
|
7
|
+
getConfigWithNodeInfo: (state: EditorState) => ConfigWithNodeInfo | null | undefined;
|
|
8
|
+
};
|
|
7
9
|
export type ConfigWithNodeInfo = {
|
|
8
10
|
config: FloatingToolbarConfig | undefined;
|
|
9
11
|
pos: number;
|
|
@@ -5,6 +5,7 @@ import type { MediaState } from './pm-plugins/main';
|
|
|
5
5
|
import type { CustomMediaPicker, MediaOptions } from './types';
|
|
6
6
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
7
7
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
8
|
+
import type { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
8
9
|
import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
9
10
|
import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
10
11
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
@@ -18,6 +19,7 @@ declare const mediaPlugin: NextEditorPlugin<'media', {
|
|
|
18
19
|
dependencies: [
|
|
19
20
|
typeof featureFlagsPlugin,
|
|
20
21
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
22
|
+
typeof guidelinePlugin,
|
|
21
23
|
typeof gridPlugin,
|
|
22
24
|
typeof widthPlugin,
|
|
23
25
|
typeof decorationsPlugin,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { NumericalCardDimensions } from '@atlaskit/media-card';
|
|
4
|
+
import type { NumericalCardDimensions } from '@atlaskit/media-card';
|
|
5
5
|
export declare const MediaInlineNodeSelector = "media-inline-node";
|
|
6
6
|
export declare const MediaSingleNodeSelector = "media-single-node";
|
|
7
7
|
export declare const figureWrapper: import("@emotion/react").SerializedStyles;
|
|
@@ -5,7 +5,6 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
6
6
|
import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
7
7
|
import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
8
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
8
|
import type { WidthPluginState } from '@atlaskit/editor-plugin-width';
|
|
10
9
|
import type { Dispatch } from '../../../event-dispatcher';
|
|
11
10
|
import type { ProsemirrorGetPosHandler } from '../../../nodeviews';
|
|
@@ -15,6 +14,7 @@ import type { MediaStateEventSubscriber } from '../picker-facade';
|
|
|
15
14
|
import PickerFacade from '../picker-facade';
|
|
16
15
|
import type { MediaNodeWithPosHandler, MediaPluginState } from './types';
|
|
17
16
|
import type { IntlShape } from 'react-intl-next';
|
|
17
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
18
18
|
import type mediaPlugin from '../index';
|
|
19
19
|
export type { MediaState, MediaProvider, MediaStateStatus };
|
|
20
20
|
export { stateKey } from './plugin-key';
|
|
@@ -6,3 +6,4 @@ import type { MediaPluginState } from '../pm-plugins/types';
|
|
|
6
6
|
export declare const getSelectedMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaBaseAttributes | null;
|
|
7
7
|
export declare const downloadMedia: (mediaPluginState: MediaPluginState) => Promise<boolean>;
|
|
8
8
|
export declare const removeMediaGroupNode: (state: EditorState) => import("prosemirror-state").Transaction;
|
|
9
|
+
export declare const getSelectedMediaSingle: (state: EditorState) => import("prosemirror-utils").ContentNodeWithPos | undefined;
|
|
@@ -10,6 +10,7 @@ import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
|
10
10
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
11
11
|
import type { PlaceholderTextOptions } from '../../plugins/placeholder-text/types';
|
|
12
12
|
export type MediaStateStatus = 'unknown' | 'ready' | 'cancelled' | 'preview' | 'error' | 'mobile-upload-end';
|
|
13
|
+
export type MediaSingleWithType = 'pixel' | 'percentage';
|
|
13
14
|
export interface MediaOptions {
|
|
14
15
|
provider?: Providers['mediaProvider'];
|
|
15
16
|
allowMediaSingle?: boolean | MediaSingleOptions;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/// <reference path="../../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
6
|
+
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
7
|
+
import type { Props } from './types';
|
|
8
|
+
import type { Dimensions } from '@atlaskit/editor-common/resizer';
|
|
9
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
10
|
+
type State = {
|
|
11
|
+
offsetLeft: number;
|
|
12
|
+
isVideoFile: boolean;
|
|
13
|
+
resizedPctWidth?: number;
|
|
14
|
+
isResizing: boolean;
|
|
15
|
+
size: Dimensions;
|
|
16
|
+
};
|
|
17
|
+
export declare const resizerNextTestId = "mediaSingle.resizerNext.testid";
|
|
18
|
+
export declare function calcOffsetLeft(insideInlineLike: boolean, insideLayout: boolean, pmViewDom: Element, wrapper?: HTMLElement): number;
|
|
19
|
+
type ResizableMediaSingleNextProps = Props & WrappedComponentProps;
|
|
20
|
+
declare class ResizableMediaSingleNext extends React.Component<ResizableMediaSingleNextProps, State> {
|
|
21
|
+
constructor(props: ResizableMediaSingleNextProps);
|
|
22
|
+
/**
|
|
23
|
+
* Calculate media single node initial width if props.mediaSingleWidth is undefined
|
|
24
|
+
* (Mainly when switching from lagacy experience to new experience).
|
|
25
|
+
*
|
|
26
|
+
* @returns initial width in pixel
|
|
27
|
+
*/
|
|
28
|
+
calcInitialWidth(): number;
|
|
29
|
+
componentDidUpdate(prevProps: Props, prevState: State): boolean;
|
|
30
|
+
isNestedNode(): boolean;
|
|
31
|
+
private getDefaultGuidelines;
|
|
32
|
+
private getSnaps;
|
|
33
|
+
get wrappedLayout(): boolean;
|
|
34
|
+
componentDidMount(): Promise<void>;
|
|
35
|
+
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
36
|
+
checkVideoFile(viewMediaClientConfig?: MediaClientConfig): Promise<void>;
|
|
37
|
+
calcNewSize: (newWidth: number, stop: boolean) => {
|
|
38
|
+
width: number | null;
|
|
39
|
+
layout: MediaSingleLayout;
|
|
40
|
+
};
|
|
41
|
+
calcUnwrappedLayout: (width: number, containerWidth: number, contentWidth: number) => 'center' | 'wide' | 'full-width';
|
|
42
|
+
get $pos(): import("prosemirror-model").ResolvedPos | null;
|
|
43
|
+
/**
|
|
44
|
+
* The maxmimum number of grid columns this node can resize to.
|
|
45
|
+
*/
|
|
46
|
+
get gridWidth(): number;
|
|
47
|
+
calcColumnLeftOffset: () => number;
|
|
48
|
+
wrapper?: HTMLElement;
|
|
49
|
+
calcPxHeight: (newWidth: number) => number;
|
|
50
|
+
get insideInlineLike(): boolean;
|
|
51
|
+
get insideLayout(): boolean;
|
|
52
|
+
private saveWrapper;
|
|
53
|
+
private displayGuideline;
|
|
54
|
+
private setIsResizing;
|
|
55
|
+
render(): jsx.JSX.Element;
|
|
56
|
+
}
|
|
57
|
+
export { ResizableMediaSingleNext as UnwrappedResizableMediaSingleNext };
|
|
58
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ResizableMediaSingleNextProps>> & {
|
|
59
|
+
WrappedComponent: React.ComponentType<ResizableMediaSingleNextProps>;
|
|
60
|
+
};
|
|
61
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
2
|
+
import type { EditorView } from 'prosemirror-view';
|
|
3
|
+
export declare const generateDefaultGuidelines: (editorWidth: number, containerWidth: number, isFullWidthMode?: boolean | undefined) => GuidelineConfig[];
|
|
4
|
+
export declare const generateDynamicGuidelines: (view: EditorView) => GuidelineConfig[];
|
|
@@ -22,5 +22,6 @@ export type Props = MediaSingleProps & {
|
|
|
22
22
|
viewMediaClientConfig?: MediaClientConfig;
|
|
23
23
|
fullWidthMode?: boolean;
|
|
24
24
|
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
25
|
+
mediaSingleWidth?: number;
|
|
25
26
|
pluginInjectionApi: ExtractInjectionAPI<typeof mediaPlugin> | undefined;
|
|
26
27
|
};
|
|
@@ -2,9 +2,8 @@ import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
2
2
|
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { DefaultPresetPluginOptions } from './default';
|
|
4
4
|
import type { EditorPresetProps } from './types';
|
|
5
|
-
import type { EditorSharedPropsWithPlugins } from '../../../types/editor-props';
|
|
5
|
+
import type { EditorSharedPropsWithPlugins, EditorPluginFeatureProps, EditorProviderProps } from '../../../types/editor-props';
|
|
6
6
|
import type { FeatureFlags } from '../../../types/feature-flags';
|
|
7
|
-
import type { EditorPluginFeatureProps, EditorProviderProps } from '../../../types/editor-props';
|
|
8
7
|
import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
9
8
|
type UniversalPresetProps = EditorPresetProps & DefaultPresetPluginOptions & EditorSharedPropsWithPlugins & EditorPluginFeatureProps & EditorProviderProps;
|
|
10
9
|
/**
|
|
@@ -3,7 +3,9 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
|
3
3
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { FloatingToolbarConfig } from './types';
|
|
5
5
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
6
|
-
export type FloatingToolbarPluginState =
|
|
6
|
+
export type FloatingToolbarPluginState = {
|
|
7
|
+
getConfigWithNodeInfo: (state: EditorState) => ConfigWithNodeInfo | null | undefined;
|
|
8
|
+
};
|
|
7
9
|
export type ConfigWithNodeInfo = {
|
|
8
10
|
config: FloatingToolbarConfig | undefined;
|
|
9
11
|
pos: number;
|
|
@@ -5,6 +5,7 @@ import type { MediaState } from './pm-plugins/main';
|
|
|
5
5
|
import type { CustomMediaPicker, MediaOptions } from './types';
|
|
6
6
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
7
7
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
8
|
+
import type { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
8
9
|
import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
9
10
|
import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
10
11
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
@@ -18,6 +19,7 @@ declare const mediaPlugin: NextEditorPlugin<'media', {
|
|
|
18
19
|
dependencies: [
|
|
19
20
|
typeof featureFlagsPlugin,
|
|
20
21
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
22
|
+
typeof guidelinePlugin,
|
|
21
23
|
typeof gridPlugin,
|
|
22
24
|
typeof widthPlugin,
|
|
23
25
|
typeof decorationsPlugin,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { NumericalCardDimensions } from '@atlaskit/media-card';
|
|
4
|
+
import type { NumericalCardDimensions } from '@atlaskit/media-card';
|
|
5
5
|
export declare const MediaInlineNodeSelector = "media-inline-node";
|
|
6
6
|
export declare const MediaSingleNodeSelector = "media-single-node";
|
|
7
7
|
export declare const figureWrapper: import("@emotion/react").SerializedStyles;
|
|
@@ -5,7 +5,6 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
6
6
|
import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
7
7
|
import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
8
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
8
|
import type { WidthPluginState } from '@atlaskit/editor-plugin-width';
|
|
10
9
|
import type { Dispatch } from '../../../event-dispatcher';
|
|
11
10
|
import type { ProsemirrorGetPosHandler } from '../../../nodeviews';
|
|
@@ -15,6 +14,7 @@ import type { MediaStateEventSubscriber } from '../picker-facade';
|
|
|
15
14
|
import PickerFacade from '../picker-facade';
|
|
16
15
|
import type { MediaNodeWithPosHandler, MediaPluginState } from './types';
|
|
17
16
|
import type { IntlShape } from 'react-intl-next';
|
|
17
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
18
18
|
import type mediaPlugin from '../index';
|
|
19
19
|
export type { MediaState, MediaProvider, MediaStateStatus };
|
|
20
20
|
export { stateKey } from './plugin-key';
|
|
@@ -6,3 +6,4 @@ import type { MediaPluginState } from '../pm-plugins/types';
|
|
|
6
6
|
export declare const getSelectedMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaBaseAttributes | null;
|
|
7
7
|
export declare const downloadMedia: (mediaPluginState: MediaPluginState) => Promise<boolean>;
|
|
8
8
|
export declare const removeMediaGroupNode: (state: EditorState) => import("prosemirror-state").Transaction;
|
|
9
|
+
export declare const getSelectedMediaSingle: (state: EditorState) => import("prosemirror-utils").ContentNodeWithPos | undefined;
|
|
@@ -10,6 +10,7 @@ import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
|
10
10
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
11
11
|
import type { PlaceholderTextOptions } from '../../plugins/placeholder-text/types';
|
|
12
12
|
export type MediaStateStatus = 'unknown' | 'ready' | 'cancelled' | 'preview' | 'error' | 'mobile-upload-end';
|
|
13
|
+
export type MediaSingleWithType = 'pixel' | 'percentage';
|
|
13
14
|
export interface MediaOptions {
|
|
14
15
|
provider?: Providers['mediaProvider'];
|
|
15
16
|
allowMediaSingle?: boolean | MediaSingleOptions;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/// <reference path="../../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
6
|
+
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
7
|
+
import type { Props } from './types';
|
|
8
|
+
import type { Dimensions } from '@atlaskit/editor-common/resizer';
|
|
9
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
10
|
+
type State = {
|
|
11
|
+
offsetLeft: number;
|
|
12
|
+
isVideoFile: boolean;
|
|
13
|
+
resizedPctWidth?: number;
|
|
14
|
+
isResizing: boolean;
|
|
15
|
+
size: Dimensions;
|
|
16
|
+
};
|
|
17
|
+
export declare const resizerNextTestId = "mediaSingle.resizerNext.testid";
|
|
18
|
+
export declare function calcOffsetLeft(insideInlineLike: boolean, insideLayout: boolean, pmViewDom: Element, wrapper?: HTMLElement): number;
|
|
19
|
+
type ResizableMediaSingleNextProps = Props & WrappedComponentProps;
|
|
20
|
+
declare class ResizableMediaSingleNext extends React.Component<ResizableMediaSingleNextProps, State> {
|
|
21
|
+
constructor(props: ResizableMediaSingleNextProps);
|
|
22
|
+
/**
|
|
23
|
+
* Calculate media single node initial width if props.mediaSingleWidth is undefined
|
|
24
|
+
* (Mainly when switching from lagacy experience to new experience).
|
|
25
|
+
*
|
|
26
|
+
* @returns initial width in pixel
|
|
27
|
+
*/
|
|
28
|
+
calcInitialWidth(): number;
|
|
29
|
+
componentDidUpdate(prevProps: Props, prevState: State): boolean;
|
|
30
|
+
isNestedNode(): boolean;
|
|
31
|
+
private getDefaultGuidelines;
|
|
32
|
+
private getSnaps;
|
|
33
|
+
get wrappedLayout(): boolean;
|
|
34
|
+
componentDidMount(): Promise<void>;
|
|
35
|
+
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
36
|
+
checkVideoFile(viewMediaClientConfig?: MediaClientConfig): Promise<void>;
|
|
37
|
+
calcNewSize: (newWidth: number, stop: boolean) => {
|
|
38
|
+
width: number | null;
|
|
39
|
+
layout: MediaSingleLayout;
|
|
40
|
+
};
|
|
41
|
+
calcUnwrappedLayout: (width: number, containerWidth: number, contentWidth: number) => 'center' | 'wide' | 'full-width';
|
|
42
|
+
get $pos(): import("prosemirror-model").ResolvedPos | null;
|
|
43
|
+
/**
|
|
44
|
+
* The maxmimum number of grid columns this node can resize to.
|
|
45
|
+
*/
|
|
46
|
+
get gridWidth(): number;
|
|
47
|
+
calcColumnLeftOffset: () => number;
|
|
48
|
+
wrapper?: HTMLElement;
|
|
49
|
+
calcPxHeight: (newWidth: number) => number;
|
|
50
|
+
get insideInlineLike(): boolean;
|
|
51
|
+
get insideLayout(): boolean;
|
|
52
|
+
private saveWrapper;
|
|
53
|
+
private displayGuideline;
|
|
54
|
+
private setIsResizing;
|
|
55
|
+
render(): jsx.JSX.Element;
|
|
56
|
+
}
|
|
57
|
+
export { ResizableMediaSingleNext as UnwrappedResizableMediaSingleNext };
|
|
58
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ResizableMediaSingleNextProps>> & {
|
|
59
|
+
WrappedComponent: React.ComponentType<ResizableMediaSingleNextProps>;
|
|
60
|
+
};
|
|
61
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
2
|
+
import type { EditorView } from 'prosemirror-view';
|
|
3
|
+
export declare const generateDefaultGuidelines: (editorWidth: number, containerWidth: number, isFullWidthMode?: boolean | undefined) => GuidelineConfig[];
|
|
4
|
+
export declare const generateDynamicGuidelines: (view: EditorView) => GuidelineConfig[];
|
|
@@ -22,5 +22,6 @@ export type Props = MediaSingleProps & {
|
|
|
22
22
|
viewMediaClientConfig?: MediaClientConfig;
|
|
23
23
|
fullWidthMode?: boolean;
|
|
24
24
|
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
25
|
+
mediaSingleWidth?: number;
|
|
25
26
|
pluginInjectionApi: ExtractInjectionAPI<typeof mediaPlugin> | undefined;
|
|
26
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.
|
|
3
|
+
"version": "187.9.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/code": "^14.6.0",
|
|
56
56
|
"@atlaskit/date": "^0.10.0",
|
|
57
57
|
"@atlaskit/datetime-picker": "^12.7.0",
|
|
58
|
-
"@atlaskit/editor-common": "^74.
|
|
58
|
+
"@atlaskit/editor-common": "^74.33.0",
|
|
59
59
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
60
60
|
"@atlaskit/editor-markdown-transformer": "^5.2.5",
|
|
61
61
|
"@atlaskit/editor-palette": "1.5.1",
|
package/report.api.md
CHANGED
|
@@ -88,6 +88,7 @@ import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
|
88
88
|
import { Side as GapCursorSide } from '@atlaskit/editor-common/selection';
|
|
89
89
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
90
90
|
import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
91
|
+
import type { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
91
92
|
import type { HeadingLevelsAndNormalText } from '@atlaskit/editor-common/types';
|
|
92
93
|
import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
|
|
93
94
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
@@ -1103,10 +1104,11 @@ export { FloatingToolbarListPicker };
|
|
|
1103
1104
|
export const floatingToolbarPluginKey: PluginKey<FloatingToolbarPluginState>;
|
|
1104
1105
|
|
|
1105
1106
|
// @public (undocumented)
|
|
1106
|
-
export type FloatingToolbarPluginState =
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1107
|
+
export type FloatingToolbarPluginState = {
|
|
1108
|
+
getConfigWithNodeInfo: (
|
|
1109
|
+
state: EditorState,
|
|
1110
|
+
) => ConfigWithNodeInfo | null | undefined;
|
|
1111
|
+
};
|
|
1110
1112
|
|
|
1111
1113
|
export { FloatingToolbarSelect };
|
|
1112
1114
|
|
|
@@ -1418,6 +1420,7 @@ export const mediaPlugin: NextEditorPlugin<
|
|
|
1418
1420
|
dependencies: [
|
|
1419
1421
|
typeof featureFlagsPlugin,
|
|
1420
1422
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
1423
|
+
typeof guidelinePlugin,
|
|
1421
1424
|
typeof gridPlugin,
|
|
1422
1425
|
typeof widthPlugin,
|
|
1423
1426
|
typeof decorationsPlugin,
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -77,6 +77,7 @@ import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
|
77
77
|
import { Side as GapCursorSide } from '@atlaskit/editor-common/selection';
|
|
78
78
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
79
79
|
import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
80
|
+
import type { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
80
81
|
import type { HeadingLevelsAndNormalText } from '@atlaskit/editor-common/types';
|
|
81
82
|
import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
|
|
82
83
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
@@ -1019,7 +1020,9 @@ export { FloatingToolbarListPicker }
|
|
|
1019
1020
|
export const floatingToolbarPluginKey: PluginKey<FloatingToolbarPluginState>;
|
|
1020
1021
|
|
|
1021
1022
|
// @public (undocumented)
|
|
1022
|
-
export type FloatingToolbarPluginState =
|
|
1023
|
+
export type FloatingToolbarPluginState = {
|
|
1024
|
+
getConfigWithNodeInfo: (state: EditorState) => ConfigWithNodeInfo | null | undefined;
|
|
1025
|
+
};
|
|
1023
1026
|
|
|
1024
1027
|
export { FloatingToolbarSelect }
|
|
1025
1028
|
|
|
@@ -1273,6 +1276,7 @@ export const mediaPlugin: NextEditorPlugin<'media', {
|
|
|
1273
1276
|
dependencies: [
|
|
1274
1277
|
typeof featureFlagsPlugin,
|
|
1275
1278
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
1279
|
+
typeof guidelinePlugin,
|
|
1276
1280
|
typeof gridPlugin,
|
|
1277
1281
|
typeof widthPlugin,
|
|
1278
1282
|
typeof decorationsPlugin,
|