@atlaskit/editor-plugin-breakout 0.1.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/.eslintrc.js +18 -0
- package/CHANGELOG.md +1 -0
- package/LICENSE.md +13 -0
- package/README.md +30 -0
- package/dist/cjs/commands/remove-breakout.js +30 -0
- package/dist/cjs/commands/set-breakout-mode.js +29 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/plugin-key.js +11 -0
- package/dist/cjs/plugin.js +218 -0
- package/dist/cjs/types.js +5 -0
- package/dist/cjs/ui/LayoutButton.js +114 -0
- package/dist/cjs/utils/find-breakout-node.js +42 -0
- package/dist/cjs/utils/get-breakout-mode.js +24 -0
- package/dist/cjs/utils/is-breakout-mark-allowed.js +27 -0
- package/dist/cjs/utils/is-supported-node.js +15 -0
- package/dist/es2019/commands/remove-breakout.js +22 -0
- package/dist/es2019/commands/set-breakout-mode.js +23 -0
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/plugin-key.js +3 -0
- package/dist/es2019/plugin.js +208 -0
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/ui/LayoutButton.js +111 -0
- package/dist/es2019/utils/find-breakout-node.js +37 -0
- package/dist/es2019/utils/get-breakout-mode.js +17 -0
- package/dist/es2019/utils/is-breakout-mark-allowed.js +22 -0
- package/dist/es2019/utils/is-supported-node.js +9 -0
- package/dist/esm/commands/remove-breakout.js +24 -0
- package/dist/esm/commands/set-breakout-mode.js +23 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/plugin-key.js +5 -0
- package/dist/esm/plugin.js +211 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/ui/LayoutButton.js +106 -0
- package/dist/esm/utils/find-breakout-node.js +37 -0
- package/dist/esm/utils/get-breakout-mode.js +19 -0
- package/dist/esm/utils/is-breakout-mark-allowed.js +22 -0
- package/dist/esm/utils/is-supported-node.js +9 -0
- package/dist/types/commands/remove-breakout.d.ts +2 -0
- package/dist/types/commands/set-breakout-mode.d.ts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/plugin-key.d.ts +5 -0
- package/dist/types/plugin.d.ts +13 -0
- package/dist/types/types.d.ts +4 -0
- package/dist/types/ui/LayoutButton.d.ts +16 -0
- package/dist/types/utils/find-breakout-node.d.ts +9 -0
- package/dist/types/utils/get-breakout-mode.d.ts +7 -0
- package/dist/types/utils/is-breakout-mark-allowed.d.ts +9 -0
- package/dist/types/utils/is-supported-node.d.ts +6 -0
- package/dist/types-ts4.5/commands/remove-breakout.d.ts +2 -0
- package/dist/types-ts4.5/commands/set-breakout-mode.d.ts +2 -0
- package/dist/types-ts4.5/index.d.ts +2 -0
- package/dist/types-ts4.5/plugin-key.d.ts +5 -0
- package/dist/types-ts4.5/plugin.d.ts +15 -0
- package/dist/types-ts4.5/types.d.ts +4 -0
- package/dist/types-ts4.5/ui/LayoutButton.d.ts +16 -0
- package/dist/types-ts4.5/utils/find-breakout-node.d.ts +9 -0
- package/dist/types-ts4.5/utils/get-breakout-mode.d.ts +7 -0
- package/dist/types-ts4.5/utils/is-breakout-mark-allowed.d.ts +9 -0
- package/dist/types-ts4.5/utils/is-supported-node.d.ts +6 -0
- package/package.json +100 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
|
+
import { injectIntl } from 'react-intl-next';
|
|
5
|
+
import { BreakoutCssClassName } from '@atlaskit/editor-common/styles';
|
|
6
|
+
import { Popup } from '@atlaskit/editor-common/ui';
|
|
7
|
+
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
8
|
+
import { getNextBreakoutMode, getTitle } from '@atlaskit/editor-common/utils';
|
|
9
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
|
+
import { findDomRefAtPos, findParentDomRefOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
11
|
+
import CollapseIcon from '@atlaskit/icon/glyph/editor/collapse';
|
|
12
|
+
import ExpandIcon from '@atlaskit/icon/glyph/editor/expand';
|
|
13
|
+
import { B300, N20A, N300 } from '@atlaskit/theme/colors';
|
|
14
|
+
import { layers } from '@atlaskit/theme/constants';
|
|
15
|
+
import { removeBreakout } from '../commands/remove-breakout';
|
|
16
|
+
import { setBreakoutMode } from '../commands/set-breakout-mode';
|
|
17
|
+
import { getPluginState } from '../plugin-key';
|
|
18
|
+
import { getBreakoutMode } from '../utils/get-breakout-mode';
|
|
19
|
+
import { isBreakoutMarkAllowed } from '../utils/is-breakout-mark-allowed';
|
|
20
|
+
import { isSupportedNodeForBreakout } from '../utils/is-supported-node';
|
|
21
|
+
var toolbarButtonWrapperStyles = css({
|
|
22
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
23
|
+
'&& button': {
|
|
24
|
+
background: "var(--ds-background-neutral, ".concat(N20A, ")"),
|
|
25
|
+
color: "var(--ds-icon, ".concat(N300, ")"),
|
|
26
|
+
':hover': {
|
|
27
|
+
background: "var(--ds-background-neutral-hovered, ".concat(B300, ")"),
|
|
28
|
+
color: "var(--ds-icon, white)".concat(" !important")
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
function getBreakoutNodeElement(pluginState, selection, editorView) {
|
|
33
|
+
if (!pluginState.breakoutNode) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
if (selection instanceof NodeSelection && isSupportedNodeForBreakout(selection.node)) {
|
|
37
|
+
return findDomRefAtPos(selection.from, editorView.domAtPos.bind(editorView));
|
|
38
|
+
}
|
|
39
|
+
return findParentDomRefOfType(pluginState.breakoutNode.node.type, editorView.domAtPos.bind(editorView))(selection);
|
|
40
|
+
}
|
|
41
|
+
var LayoutButton = function LayoutButton(_ref) {
|
|
42
|
+
var formatMessage = _ref.intl.formatMessage,
|
|
43
|
+
mountPoint = _ref.mountPoint,
|
|
44
|
+
boundariesElement = _ref.boundariesElement,
|
|
45
|
+
scrollableElement = _ref.scrollableElement,
|
|
46
|
+
editorView = _ref.editorView,
|
|
47
|
+
node = _ref.node;
|
|
48
|
+
var handleClick = useCallback(function (breakoutMode) {
|
|
49
|
+
var state = editorView.state,
|
|
50
|
+
dispatch = editorView.dispatch;
|
|
51
|
+
if (['wide', 'full-width'].indexOf(breakoutMode) !== -1) {
|
|
52
|
+
setBreakoutMode(breakoutMode)(state, dispatch);
|
|
53
|
+
} else {
|
|
54
|
+
removeBreakout()(state, dispatch);
|
|
55
|
+
}
|
|
56
|
+
}, [editorView]);
|
|
57
|
+
var state = editorView.state;
|
|
58
|
+
if (!node || !isBreakoutMarkAllowed(state)) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
var breakoutMode = getBreakoutMode(editorView.state);
|
|
62
|
+
var titleMessage = getTitle(breakoutMode);
|
|
63
|
+
var title = formatMessage(titleMessage);
|
|
64
|
+
var nextBreakoutMode = getNextBreakoutMode(breakoutMode);
|
|
65
|
+
var belowOtherPopupsZIndex = layers.layer() - 1;
|
|
66
|
+
var pluginState = getPluginState(state);
|
|
67
|
+
if (!pluginState) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
var element = getBreakoutNodeElement(pluginState, state.selection, editorView);
|
|
71
|
+
if (!element) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
var closestEl = element.querySelector(".".concat(BreakoutCssClassName.BREAKOUT_MARK_DOM));
|
|
75
|
+
if (closestEl && closestEl.firstChild) {
|
|
76
|
+
element = closestEl.firstChild;
|
|
77
|
+
}
|
|
78
|
+
return jsx(Popup, {
|
|
79
|
+
ariaLabel: title,
|
|
80
|
+
target: element,
|
|
81
|
+
offset: [5, 0],
|
|
82
|
+
alignY: "start",
|
|
83
|
+
alignX: "end",
|
|
84
|
+
mountTo: mountPoint,
|
|
85
|
+
boundariesElement: boundariesElement,
|
|
86
|
+
scrollableElement: scrollableElement,
|
|
87
|
+
stick: true,
|
|
88
|
+
forcePlacement: true,
|
|
89
|
+
zIndex: belowOtherPopupsZIndex
|
|
90
|
+
}, jsx("div", {
|
|
91
|
+
css: toolbarButtonWrapperStyles
|
|
92
|
+
}, jsx(ToolbarButton, {
|
|
93
|
+
title: title,
|
|
94
|
+
testId: titleMessage.id,
|
|
95
|
+
onClick: function onClick() {
|
|
96
|
+
return handleClick(nextBreakoutMode);
|
|
97
|
+
},
|
|
98
|
+
iconBefore: breakoutMode === 'full-width' ? jsx(CollapseIcon, {
|
|
99
|
+
label: title
|
|
100
|
+
}) : jsx(ExpandIcon, {
|
|
101
|
+
label: title
|
|
102
|
+
})
|
|
103
|
+
})));
|
|
104
|
+
};
|
|
105
|
+
LayoutButton.displayName = 'LayoutButton';
|
|
106
|
+
export default injectIntl(LayoutButton);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { findParentNode } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
+
import { isSupportedNodeForBreakout } from './is-supported-node';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Find the nearest parent node to the selection that supports breakout, or if the nearest
|
|
7
|
+
* matching parent node is the doc, return undefined.
|
|
8
|
+
* For depth, if a node is selected and supports breakout, return the depth of the node.
|
|
9
|
+
* @param selection Current editor selection
|
|
10
|
+
*/
|
|
11
|
+
export function findSupportedNodeForBreakout(selection) {
|
|
12
|
+
if (selection instanceof NodeSelection) {
|
|
13
|
+
var supportsBreakout = isSupportedNodeForBreakout(selection.node);
|
|
14
|
+
if (supportsBreakout) {
|
|
15
|
+
return {
|
|
16
|
+
pos: selection.from,
|
|
17
|
+
start: selection.from,
|
|
18
|
+
node: selection.node,
|
|
19
|
+
// If a selected expand is in a doc, the depth of that expand is 0. Therefore
|
|
20
|
+
// we don't need to subtract 1 or instantly return false if the depth is 0
|
|
21
|
+
depth: selection.$anchor.depth
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
var breakoutNode = findParentNode(isSupportedNodeForBreakout)(selection);
|
|
26
|
+
if (!breakoutNode || breakoutNode.depth === 0) {
|
|
27
|
+
// If this node doesn't exist or the only supporting node is the document
|
|
28
|
+
// (with depth 0), then we're not inside a node that supports breakout
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
node: breakoutNode.node,
|
|
33
|
+
start: breakoutNode.start,
|
|
34
|
+
pos: breakoutNode.pos,
|
|
35
|
+
depth: breakoutNode.depth - 1
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { findSupportedNodeForBreakout } from './find-breakout-node';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Get the current mode of the breakout at the selection
|
|
5
|
+
* @param state Current EditorState
|
|
6
|
+
*/
|
|
7
|
+
export function getBreakoutMode(state) {
|
|
8
|
+
var node = findSupportedNodeForBreakout(state.selection);
|
|
9
|
+
if (!node) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
var breakoutMark = node.node.marks.find(function (m) {
|
|
13
|
+
return m.type.name === 'breakout';
|
|
14
|
+
});
|
|
15
|
+
if (!breakoutMark) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
return breakoutMark.attrs.mode;
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { findSupportedNodeForBreakout } from './find-breakout-node';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if breakout should be allowed for the current selection. If a node is selected,
|
|
5
|
+
* can this node be broken out, if text, can the enclosing parent node be broken out.
|
|
6
|
+
*
|
|
7
|
+
* Currently breakout of a node is not possible if it's nested in anything but the document, however
|
|
8
|
+
* this logic supports this changing.
|
|
9
|
+
*/
|
|
10
|
+
export function isBreakoutMarkAllowed(state) {
|
|
11
|
+
if (!state.schema.marks.breakout) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
var supportedNodeParent = findSupportedNodeForBreakout(state.selection);
|
|
15
|
+
if (!supportedNodeParent) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
// At the moment we can only breakout when the depth is 0, ie. doc is the only node
|
|
19
|
+
// that supports breakout. This *could* change though.
|
|
20
|
+
var parent = state.selection.$from.node(supportedNodeParent.depth);
|
|
21
|
+
return parent.type.allowsMarkType(state.schema.marks.breakout);
|
|
22
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var supportedNodesForBreakout = ['codeBlock', 'layoutSection', 'expand'];
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if breakout can be applied to a node
|
|
5
|
+
* @param node Node to check
|
|
6
|
+
*/
|
|
7
|
+
export function isSupportedNodeForBreakout(node) {
|
|
8
|
+
return supportedNodesForBreakout.indexOf(node.type.name) !== -1;
|
|
9
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { BreakoutPluginState } from './types';
|
|
4
|
+
export declare const pluginKey: PluginKey<BreakoutPluginState>;
|
|
5
|
+
export declare const getPluginState: (state: EditorState) => BreakoutPluginState | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
3
|
+
import type { BreakoutPluginState } from './types';
|
|
4
|
+
interface BreakoutPluginOptions {
|
|
5
|
+
allowBreakoutButton?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type BreakoutPlugin = NextEditorPlugin<'breakout', {
|
|
8
|
+
pluginConfiguration: BreakoutPluginOptions | undefined;
|
|
9
|
+
dependencies: [WidthPlugin];
|
|
10
|
+
sharedState: Partial<BreakoutPluginState>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const breakoutPlugin: BreakoutPlugin;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
export interface Props {
|
|
6
|
+
editorView: EditorView;
|
|
7
|
+
mountPoint?: HTMLElement;
|
|
8
|
+
node: PMNode | null;
|
|
9
|
+
boundariesElement?: HTMLElement;
|
|
10
|
+
scrollableElement?: HTMLElement;
|
|
11
|
+
handleClick?: Function;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
14
|
+
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
+
/**
|
|
4
|
+
* Find the nearest parent node to the selection that supports breakout, or if the nearest
|
|
5
|
+
* matching parent node is the doc, return undefined.
|
|
6
|
+
* For depth, if a node is selected and supports breakout, return the depth of the node.
|
|
7
|
+
* @param selection Current editor selection
|
|
8
|
+
*/
|
|
9
|
+
export declare function findSupportedNodeForBreakout(selection: Selection): ContentNodeWithPos | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BreakoutMode } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
/**
|
|
4
|
+
* Get the current mode of the breakout at the selection
|
|
5
|
+
* @param state Current EditorState
|
|
6
|
+
*/
|
|
7
|
+
export declare function getBreakoutMode(state: EditorState): BreakoutMode | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
/**
|
|
3
|
+
* Check if breakout should be allowed for the current selection. If a node is selected,
|
|
4
|
+
* can this node be broken out, if text, can the enclosing parent node be broken out.
|
|
5
|
+
*
|
|
6
|
+
* Currently breakout of a node is not possible if it's nested in anything but the document, however
|
|
7
|
+
* this logic supports this changing.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isBreakoutMarkAllowed(state: EditorState): boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { BreakoutPluginState } from './types';
|
|
4
|
+
export declare const pluginKey: PluginKey<BreakoutPluginState>;
|
|
5
|
+
export declare const getPluginState: (state: EditorState) => BreakoutPluginState | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
3
|
+
import type { BreakoutPluginState } from './types';
|
|
4
|
+
interface BreakoutPluginOptions {
|
|
5
|
+
allowBreakoutButton?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type BreakoutPlugin = NextEditorPlugin<'breakout', {
|
|
8
|
+
pluginConfiguration: BreakoutPluginOptions | undefined;
|
|
9
|
+
dependencies: [
|
|
10
|
+
WidthPlugin
|
|
11
|
+
];
|
|
12
|
+
sharedState: Partial<BreakoutPluginState>;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const breakoutPlugin: BreakoutPlugin;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
export interface Props {
|
|
6
|
+
editorView: EditorView;
|
|
7
|
+
mountPoint?: HTMLElement;
|
|
8
|
+
node: PMNode | null;
|
|
9
|
+
boundariesElement?: HTMLElement;
|
|
10
|
+
scrollableElement?: HTMLElement;
|
|
11
|
+
handleClick?: Function;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
14
|
+
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
+
/**
|
|
4
|
+
* Find the nearest parent node to the selection that supports breakout, or if the nearest
|
|
5
|
+
* matching parent node is the doc, return undefined.
|
|
6
|
+
* For depth, if a node is selected and supports breakout, return the depth of the node.
|
|
7
|
+
* @param selection Current editor selection
|
|
8
|
+
*/
|
|
9
|
+
export declare function findSupportedNodeForBreakout(selection: Selection): ContentNodeWithPos | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BreakoutMode } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
/**
|
|
4
|
+
* Get the current mode of the breakout at the selection
|
|
5
|
+
* @param state Current EditorState
|
|
6
|
+
*/
|
|
7
|
+
export declare function getBreakoutMode(state: EditorState): BreakoutMode | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
/**
|
|
3
|
+
* Check if breakout should be allowed for the current selection. If a node is selected,
|
|
4
|
+
* can this node be broken out, if text, can the enclosing parent node be broken out.
|
|
5
|
+
*
|
|
6
|
+
* Currently breakout of a node is not possible if it's nested in anything but the document, however
|
|
7
|
+
* this logic supports this changing.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isBreakoutMarkAllowed(state: EditorState): boolean;
|
package/package.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-plugin-breakout",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Breakout plugin for @atlaskit/editor-core",
|
|
5
|
+
"author": "Atlassian Pty Ltd",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"registry": "https://registry.npmjs.org/"
|
|
9
|
+
},
|
|
10
|
+
"atlassian": {
|
|
11
|
+
"team": "Editor: Media Experience Porygon",
|
|
12
|
+
"singleton": true,
|
|
13
|
+
"releaseModel": "continuous"
|
|
14
|
+
},
|
|
15
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
16
|
+
"main": "dist/cjs/index.js",
|
|
17
|
+
"module": "dist/esm/index.js",
|
|
18
|
+
"module:es2019": "dist/es2019/index.js",
|
|
19
|
+
"types": "dist/types/index.d.ts",
|
|
20
|
+
"typesVersions": {
|
|
21
|
+
">=4.5 <4.9": {
|
|
22
|
+
"*": [
|
|
23
|
+
"dist/types-ts4.5/*",
|
|
24
|
+
"dist/types-ts4.5/index.d.ts"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"atlaskit:src": "src/index.ts",
|
|
30
|
+
"af:exports": {
|
|
31
|
+
".": "./src/index.ts"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@atlaskit/adf-schema": "^35.2.0",
|
|
35
|
+
"@atlaskit/editor-common": "^76.28.0",
|
|
36
|
+
"@atlaskit/editor-plugin-width": "^0.2.0",
|
|
37
|
+
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
38
|
+
"@atlaskit/editor-shared-styles": "^2.8.0",
|
|
39
|
+
"@atlaskit/icon": "^22.0.0",
|
|
40
|
+
"@atlaskit/theme": "^12.6.0",
|
|
41
|
+
"@atlaskit/tokens": "^1.31.0",
|
|
42
|
+
"@babel/runtime": "^7.0.0",
|
|
43
|
+
"@emotion/react": "^11.7.1"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"react": "^16.8.0",
|
|
47
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@af/integration-testing": "*",
|
|
51
|
+
"@af/visual-regression": "*",
|
|
52
|
+
"@atlaskit/editor-plugin-code-block": "^0.1.0",
|
|
53
|
+
"@atlaskit/editor-plugin-composition": "^0.1.0",
|
|
54
|
+
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
55
|
+
"@atlaskit/ssr": "*",
|
|
56
|
+
"@atlaskit/visual-regression": "*",
|
|
57
|
+
"@atlaskit/webdriver-runner": "*",
|
|
58
|
+
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
59
|
+
"@testing-library/react": "^12.1.5",
|
|
60
|
+
"react-dom": "^16.8.0",
|
|
61
|
+
"typescript": "~4.9.5",
|
|
62
|
+
"wait-for-expect": "^1.2.0"
|
|
63
|
+
},
|
|
64
|
+
"techstack": {
|
|
65
|
+
"@atlassian/frontend": {
|
|
66
|
+
"import-structure": [
|
|
67
|
+
"atlassian-conventions"
|
|
68
|
+
],
|
|
69
|
+
"circular-dependencies": [
|
|
70
|
+
"file-and-folder-level"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"@repo/internal": {
|
|
74
|
+
"dom-events": "use-bind-event-listener",
|
|
75
|
+
"analytics": [
|
|
76
|
+
"analytics-next"
|
|
77
|
+
],
|
|
78
|
+
"design-tokens": [
|
|
79
|
+
"color"
|
|
80
|
+
],
|
|
81
|
+
"theming": [
|
|
82
|
+
"react-context"
|
|
83
|
+
],
|
|
84
|
+
"ui-components": [
|
|
85
|
+
"lite-mode"
|
|
86
|
+
],
|
|
87
|
+
"deprecation": [
|
|
88
|
+
"no-deprecated-imports"
|
|
89
|
+
],
|
|
90
|
+
"styling": [
|
|
91
|
+
"static",
|
|
92
|
+
"emotion"
|
|
93
|
+
],
|
|
94
|
+
"imports": [
|
|
95
|
+
"import-no-extraneous-disable-for-examples-and-docs"
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
100
|
+
}
|