@atlaskit/editor-core 185.5.2 → 185.5.5
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 +7 -0
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +5 -28
- package/dist/cjs/plugins/card/index.js +20 -6
- package/dist/cjs/plugins/card/nodeviews/datasource.js +39 -4
- package/dist/cjs/plugins/card/pm-plugins/actions.js +31 -1
- package/dist/cjs/plugins/card/pm-plugins/main.js +48 -3
- package/dist/cjs/plugins/card/pm-plugins/reducers.js +22 -0
- package/dist/cjs/plugins/card/styles.js +1 -1
- package/dist/cjs/plugins/card/ui/LayoutButton/index.js +113 -0
- package/dist/cjs/plugins/card/ui/LayoutButton/styled.js +17 -0
- package/dist/cjs/plugins/card/ui/LayoutButton/types.js +5 -0
- package/dist/cjs/plugins/card/ui/LayoutButton/utils.js +19 -0
- package/dist/cjs/plugins/media/pm-plugins/main.js +20 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +3 -26
- package/dist/es2019/plugins/breakout/utils/get-breakout-mode.js +0 -1
- package/dist/es2019/plugins/card/index.js +20 -3
- package/dist/es2019/plugins/card/nodeviews/datasource.js +38 -1
- package/dist/es2019/plugins/card/pm-plugins/actions.js +16 -0
- package/dist/es2019/plugins/card/pm-plugins/main.js +55 -4
- package/dist/es2019/plugins/card/pm-plugins/reducers.js +25 -0
- package/dist/es2019/plugins/card/styles.js +6 -0
- package/dist/es2019/plugins/card/ui/LayoutButton/index.js +106 -0
- package/dist/es2019/plugins/card/ui/LayoutButton/styled.js +10 -0
- package/dist/es2019/plugins/card/ui/LayoutButton/types.js +1 -0
- package/dist/es2019/plugins/card/ui/LayoutButton/utils.js +15 -0
- package/dist/es2019/plugins/media/pm-plugins/main.js +25 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +3 -26
- package/dist/esm/plugins/breakout/utils/get-breakout-mode.js +0 -1
- package/dist/esm/plugins/card/index.js +20 -3
- package/dist/esm/plugins/card/nodeviews/datasource.js +37 -3
- package/dist/esm/plugins/card/pm-plugins/actions.js +27 -0
- package/dist/esm/plugins/card/pm-plugins/main.js +49 -4
- package/dist/esm/plugins/card/pm-plugins/reducers.js +22 -0
- package/dist/esm/plugins/card/styles.js +1 -1
- package/dist/esm/plugins/card/ui/LayoutButton/index.js +102 -0
- package/dist/esm/plugins/card/ui/LayoutButton/styled.js +10 -0
- package/dist/esm/plugins/card/ui/LayoutButton/types.js +1 -0
- package/dist/esm/plugins/card/ui/LayoutButton/utils.js +12 -0
- package/dist/esm/plugins/media/pm-plugins/main.js +22 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/breakout/commands/set-breakout-mode.d.ts +1 -1
- package/dist/types/plugins/breakout/utils/get-breakout-mode.d.ts +1 -1
- package/dist/types/plugins/card/index.d.ts +3 -1
- package/dist/types/plugins/card/nodeviews/datasource.d.ts +18 -2
- package/dist/types/plugins/card/pm-plugins/actions.d.ts +7 -0
- package/dist/types/plugins/card/pm-plugins/plugin-key.d.ts +2 -1
- package/dist/types/plugins/card/pm-plugins/util/state.d.ts +2 -0
- package/dist/types/plugins/card/types.d.ts +17 -1
- package/dist/types/plugins/card/ui/LayoutButton/index.d.ts +9 -0
- package/dist/types/plugins/card/ui/LayoutButton/styled.d.ts +1 -0
- package/dist/types/plugins/card/ui/LayoutButton/types.d.ts +19 -0
- package/dist/types/plugins/card/ui/LayoutButton/utils.d.ts +5 -0
- package/dist/types-ts4.5/plugins/breakout/commands/set-breakout-mode.d.ts +1 -1
- package/dist/types-ts4.5/plugins/breakout/utils/get-breakout-mode.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/card/nodeviews/datasource.d.ts +18 -2
- package/dist/types-ts4.5/plugins/card/pm-plugins/actions.d.ts +7 -0
- package/dist/types-ts4.5/plugins/card/pm-plugins/plugin-key.d.ts +2 -1
- package/dist/types-ts4.5/plugins/card/pm-plugins/util/state.d.ts +2 -0
- package/dist/types-ts4.5/plugins/card/types.d.ts +17 -1
- package/dist/types-ts4.5/plugins/card/ui/LayoutButton/index.d.ts +9 -0
- package/dist/types-ts4.5/plugins/card/ui/LayoutButton/styled.d.ts +1 -0
- package/dist/types-ts4.5/plugins/card/ui/LayoutButton/types.d.ts +19 -0
- package/dist/types-ts4.5/plugins/card/ui/LayoutButton/utils.d.ts +5 -0
- package/package.json +2 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import { LayoutButtonProps, LayoutButtonWrapperProps } from './types';
|
|
5
|
+
export declare const LayoutButton: React.FC<LayoutButtonProps>;
|
|
6
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<LayoutButtonWrapperProps & WrappedComponentProps<"intl">>> & {
|
|
7
|
+
WrappedComponent: React.ComponentType<LayoutButtonWrapperProps & WrappedComponentProps<"intl">>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const toolbarButtonWrapper: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EditorView } from 'prosemirror-view';
|
|
2
|
+
import { IntlShape } from 'react-intl-next';
|
|
3
|
+
import type cardPlugin from '../../index';
|
|
4
|
+
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
+
export type DatasourceTableLayout = 'full-width' | 'center' | 'wide';
|
|
6
|
+
export type LayoutButtonProps = {
|
|
7
|
+
mountPoint?: HTMLElement;
|
|
8
|
+
boundariesElement?: HTMLElement;
|
|
9
|
+
scrollableElement?: HTMLElement;
|
|
10
|
+
targetElement?: HTMLElement;
|
|
11
|
+
layout: DatasourceTableLayout;
|
|
12
|
+
onLayoutChange?: (layout: DatasourceTableLayout) => void;
|
|
13
|
+
testId?: string;
|
|
14
|
+
intl: IntlShape;
|
|
15
|
+
};
|
|
16
|
+
export interface LayoutButtonWrapperProps extends Pick<LayoutButtonProps, 'mountPoint' | 'boundariesElement' | 'scrollableElement'> {
|
|
17
|
+
api: ExtractInjectionAPI<typeof cardPlugin> | undefined;
|
|
18
|
+
editorView: EditorView;
|
|
19
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EditorState } from 'prosemirror-state';
|
|
2
|
-
import { BreakoutMode } from '
|
|
2
|
+
import { BreakoutMode } from '@atlaskit/editor-common/types';
|
|
3
3
|
/**
|
|
4
4
|
* Get the current mode of the breakout at the selection
|
|
5
5
|
* @param state Current EditorState
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import { CardPluginOptions } from './types';
|
|
3
3
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
4
4
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
@@ -6,6 +6,7 @@ import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
|
6
6
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
7
7
|
import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
8
8
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
9
|
+
import { CardPluginState } from './types';
|
|
9
10
|
declare const cardPlugin: NextEditorPlugin<'card', {
|
|
10
11
|
pluginConfiguration: CardPluginOptions;
|
|
11
12
|
dependencies: [
|
|
@@ -16,5 +17,6 @@ declare const cardPlugin: NextEditorPlugin<'card', {
|
|
|
16
17
|
typeof gridPlugin,
|
|
17
18
|
FloatingToolbarPlugin
|
|
18
19
|
];
|
|
20
|
+
sharedState: CardPluginState | null;
|
|
19
21
|
}>;
|
|
20
22
|
export default cardPlugin;
|
|
@@ -5,10 +5,22 @@ import { jsx } from '@emotion/react';
|
|
|
5
5
|
import { Node as PMNode } from 'prosemirror-model';
|
|
6
6
|
import { EditorView } from 'prosemirror-view';
|
|
7
7
|
import ReactNodeView, { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
8
|
-
|
|
8
|
+
import { DatasourceTableLayout } from '../ui/LayoutButton/types';
|
|
9
|
+
import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
10
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
11
|
+
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
12
|
+
import type cardPlugin from '../index';
|
|
13
|
+
export declare const DATASOURCE_INNER_CONTAINER_CLASSNAME = "datasourceView-content-inner-wrap";
|
|
14
|
+
interface DatasourceProps extends ReactComponentProps {
|
|
9
15
|
node: PMNode;
|
|
10
16
|
view: EditorView;
|
|
11
17
|
getPos: getPosHandler;
|
|
18
|
+
portalProviderAPI: PortalProviderAPI;
|
|
19
|
+
eventDispatcher: EventDispatcher;
|
|
20
|
+
hasIntlContext: boolean;
|
|
21
|
+
pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
|
|
22
|
+
}
|
|
23
|
+
interface DatasourceComponentProps extends ReactComponentProps, Pick<DatasourceProps, 'node' | 'view' | 'getPos'> {
|
|
12
24
|
}
|
|
13
25
|
export declare class DatasourceComponent extends React.PureComponent<DatasourceComponentProps> {
|
|
14
26
|
static contextTypes: {
|
|
@@ -21,7 +33,11 @@ export declare class DatasourceComponent extends React.PureComponent<DatasourceC
|
|
|
21
33
|
handleColumnChange: (columnKeys: string[]) => void;
|
|
22
34
|
render(): jsx.JSX.Element | null;
|
|
23
35
|
}
|
|
24
|
-
export declare class Datasource extends ReactNodeView<
|
|
36
|
+
export declare class Datasource extends ReactNodeView<DatasourceProps> {
|
|
37
|
+
private tableWidth;
|
|
38
|
+
constructor(props: DatasourceProps);
|
|
39
|
+
createDomRef(): HTMLElement;
|
|
40
|
+
calcTableWidth: (layout: DatasourceTableLayout, containerWidth?: number) => number | 'inherit';
|
|
25
41
|
render(): jsx.JSX.Element;
|
|
26
42
|
}
|
|
27
43
|
export {};
|
|
@@ -2,6 +2,7 @@ import { Transaction } from 'prosemirror-state';
|
|
|
2
2
|
import { CardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
3
3
|
import { CardPluginAction, Request, CardInfo, SmartLinkEventsNext } from '../types';
|
|
4
4
|
import { SmartLinkEvents } from '@atlaskit/smart-card';
|
|
5
|
+
import { DatasourceTableLayout } from '../ui/LayoutButton/types';
|
|
5
6
|
export declare const cardAction: (tr: Transaction, action: CardPluginAction) => Transaction;
|
|
6
7
|
export declare const resolveCard: (url: string) => (tr: Transaction) => Transaction<any>;
|
|
7
8
|
export declare const queueCards: (requests: Request[]) => (tr: Transaction) => Transaction<any>;
|
|
@@ -9,5 +10,11 @@ export declare const registerCard: (info: CardInfo) => (tr: Transaction) => Tran
|
|
|
9
10
|
export declare const registerSmartCardEvents: (smartLinkEvents: SmartLinkEvents) => (tr: Transaction) => Transaction<any>;
|
|
10
11
|
export declare const registerSmartCardEventsNext: (smartLinkEvents: SmartLinkEventsNext) => (tr: Transaction) => Transaction<any>;
|
|
11
12
|
export declare const setProvider: (cardProvider: CardProvider | null) => (tr: Transaction) => Transaction<any>;
|
|
13
|
+
export declare const setDatasourceTableRef: (datasourceTableRef?: HTMLElement) => (tr: Transaction) => Transaction<any>;
|
|
14
|
+
export declare const setCardLayout: (layout: DatasourceTableLayout) => (tr: Transaction) => Transaction<any>;
|
|
15
|
+
export declare const setCardLayoutAndDatasourceTableRef: ({ layout, datasourceTableRef, }: {
|
|
16
|
+
layout: DatasourceTableLayout;
|
|
17
|
+
datasourceTableRef?: HTMLElement | undefined;
|
|
18
|
+
}) => (tr: Transaction) => Transaction<any>;
|
|
12
19
|
export declare const showLinkToolbar: (tr: Transaction) => Transaction<any>;
|
|
13
20
|
export declare const hideLinkToolbar: (tr: Transaction) => Transaction<any>;
|
|
@@ -24,5 +24,7 @@ export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState
|
|
|
24
24
|
smartLinkEventsNext?: import("../../types").SmartLinkEventsNext | undefined;
|
|
25
25
|
createAnalyticsEvent?: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | undefined;
|
|
26
26
|
editorAppearance?: import("@atlaskit/editor-common/types").EditorAppearance | undefined;
|
|
27
|
+
datasourceTableRef?: HTMLElement | undefined;
|
|
28
|
+
layout?: import("../../ui/LayoutButton/types").DatasourceTableLayout | undefined;
|
|
27
29
|
};
|
|
28
30
|
export declare const getNewRequests: (oldState: CardPluginState | undefined, currentState: CardPluginState) => Request[];
|
|
@@ -5,6 +5,7 @@ import { CreateUIAnalyticsEvent, UIAnalyticsEvent } from '@atlaskit/analytics-ne
|
|
|
5
5
|
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
6
6
|
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
7
7
|
import { LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
8
|
+
import { DatasourceTableLayout } from './ui/LayoutButton/types';
|
|
8
9
|
export type CardInfo = {
|
|
9
10
|
title?: string;
|
|
10
11
|
url?: string;
|
|
@@ -100,6 +101,8 @@ export type CardPluginState = {
|
|
|
100
101
|
smartLinkEventsNext?: SmartLinkEventsNext;
|
|
101
102
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
102
103
|
editorAppearance?: EditorAppearance;
|
|
104
|
+
datasourceTableRef?: HTMLElement;
|
|
105
|
+
layout?: DatasourceTableLayout;
|
|
103
106
|
};
|
|
104
107
|
export type CardPluginOptions = CardOptions & {
|
|
105
108
|
editorAppearance?: EditorAppearance;
|
|
@@ -138,6 +141,19 @@ export type RegisterSmartCardEventsNext = {
|
|
|
138
141
|
type: 'REGISTER_EVENTS_NEXT';
|
|
139
142
|
smartLinkEvents: SmartLinkEventsNext;
|
|
140
143
|
};
|
|
141
|
-
export type
|
|
144
|
+
export type SetDatasourceTableRef = {
|
|
145
|
+
type: 'SET_DATASOURCE_TABLE_REF';
|
|
146
|
+
datasourceTableRef?: HTMLElement;
|
|
147
|
+
};
|
|
148
|
+
export type SetCardLayout = {
|
|
149
|
+
type: 'SET_CARD_LAYOUT';
|
|
150
|
+
layout: DatasourceTableLayout;
|
|
151
|
+
};
|
|
152
|
+
export type SetCardLayoutAndDatasourceTableRef = {
|
|
153
|
+
type: 'SET_CARD_LAYOUT_AND_DATASOURCE_TABLE_REF';
|
|
154
|
+
layout: DatasourceTableLayout;
|
|
155
|
+
datasourceTableRef?: HTMLElement;
|
|
156
|
+
};
|
|
157
|
+
export type CardPluginAction = SetProvider | Queue | Resolve | Register | ShowLinkToolbar | HideLinkToolbar | RegisterSmartCardEvents | RegisterSmartCardEventsNext | SetDatasourceTableRef | SetCardLayout | SetCardLayoutAndDatasourceTableRef;
|
|
142
158
|
export type CardReplacementInputMethod = INPUT_METHOD.CLIPBOARD | INPUT_METHOD.AUTO_DETECT | INPUT_METHOD.FORMATTING | INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.FLOATING_TB;
|
|
143
159
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import { LayoutButtonProps, LayoutButtonWrapperProps } from './types';
|
|
5
|
+
export declare const LayoutButton: React.FC<LayoutButtonProps>;
|
|
6
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<LayoutButtonWrapperProps & WrappedComponentProps<"intl">>> & {
|
|
7
|
+
WrappedComponent: React.ComponentType<LayoutButtonWrapperProps & WrappedComponentProps<"intl">>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const toolbarButtonWrapper: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EditorView } from 'prosemirror-view';
|
|
2
|
+
import { IntlShape } from 'react-intl-next';
|
|
3
|
+
import type cardPlugin from '../../index';
|
|
4
|
+
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
+
export type DatasourceTableLayout = 'full-width' | 'center' | 'wide';
|
|
6
|
+
export type LayoutButtonProps = {
|
|
7
|
+
mountPoint?: HTMLElement;
|
|
8
|
+
boundariesElement?: HTMLElement;
|
|
9
|
+
scrollableElement?: HTMLElement;
|
|
10
|
+
targetElement?: HTMLElement;
|
|
11
|
+
layout: DatasourceTableLayout;
|
|
12
|
+
onLayoutChange?: (layout: DatasourceTableLayout) => void;
|
|
13
|
+
testId?: string;
|
|
14
|
+
intl: IntlShape;
|
|
15
|
+
};
|
|
16
|
+
export interface LayoutButtonWrapperProps extends Pick<LayoutButtonProps, 'mountPoint' | 'boundariesElement' | 'scrollableElement'> {
|
|
17
|
+
api: ExtractInjectionAPI<typeof cardPlugin> | undefined;
|
|
18
|
+
editorView: EditorView;
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "185.5.
|
|
3
|
+
"version": "185.5.5",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"@atlaskit/atlassian-navigation": "^2.6.0",
|
|
153
153
|
"@atlaskit/breadcrumbs": "11.10.4",
|
|
154
154
|
"@atlaskit/code": "^14.6.0",
|
|
155
|
-
"@atlaskit/collab-provider": "9.
|
|
155
|
+
"@atlaskit/collab-provider": "9.4.0",
|
|
156
156
|
"@atlaskit/docs": "*",
|
|
157
157
|
"@atlaskit/drawer": "^7.5.0",
|
|
158
158
|
"@atlaskit/dropdown-menu": "^11.10.0",
|