@atlaskit/editor-plugin-breakout 2.3.0 → 2.3.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 +18 -0
- package/dist/cjs/breakoutPlugin.js +5 -0
- package/dist/cjs/pm-plugins/resizer-callbacks.js +0 -1
- package/dist/cjs/pm-plugins/resizing-plugin.js +3 -1
- package/dist/es2019/breakoutPlugin.js +5 -0
- package/dist/es2019/pm-plugins/resizer-callbacks.js +4 -5
- package/dist/es2019/pm-plugins/resizing-plugin.js +3 -1
- package/dist/esm/breakoutPlugin.js +5 -0
- package/dist/esm/pm-plugins/resizer-callbacks.js +4 -5
- package/dist/esm/pm-plugins/resizing-plugin.js +3 -1
- package/dist/types/breakoutPluginType.d.ts +3 -1
- package/dist/types/pm-plugins/resizer-callbacks.d.ts +5 -5
- package/dist/types-ts4.5/breakoutPluginType.d.ts +3 -1
- package/dist/types-ts4.5/pm-plugins/resizer-callbacks.d.ts +5 -5
- package/package.json +10 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-breakout
|
|
2
2
|
|
|
3
|
+
## 2.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#159070](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159070)
|
|
8
|
+
[`9857b771c1da1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9857b771c1da1) -
|
|
9
|
+
[ux] [ED-27778] Fix selection state hiding for tables, breakout buttons and layout
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 2.3.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#160619](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/160619)
|
|
17
|
+
[`6e034b31d6c9c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6e034b31d6c9c) -
|
|
18
|
+
ED-28096 fix nested nodes getting breakout mark
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 2.3.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -15,6 +15,7 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
15
15
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
16
16
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
17
17
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
18
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
19
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
19
20
|
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
20
21
|
var _resizingPlugin = require("./pm-plugins/resizing-plugin");
|
|
@@ -152,6 +153,10 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref2) {
|
|
|
152
153
|
isPMDragging = _useSharedState.isPMDragging,
|
|
153
154
|
mode = _useSharedState.mode,
|
|
154
155
|
editorDisabled = _useSharedState.editorDisabled;
|
|
156
|
+
var interactionState = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'interaction.interactionState');
|
|
157
|
+
if (interactionState === 'hasNotHadInteraction' && (0, _platformFeatureFlags.fg)('platform_editor_hide_expand_selection_states')) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
155
160
|
if (isDragging || isPMDragging) {
|
|
156
161
|
if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
157
162
|
return null;
|
|
@@ -26,7 +26,6 @@ function getProposedWidth(_ref) {
|
|
|
26
26
|
var containerWidth = ((api === null || api === void 0 || (_api$width$sharedStat = api.width.sharedState) === null || _api$width$sharedStat === void 0 || (_api$width$sharedStat = _api$width$sharedStat.currentState()) === null || _api$width$sharedStat === void 0 ? void 0 : _api$width$sharedStat.width) || 0) - 2 * (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() - _editorSharedStyles.akEditorGutterPadding;
|
|
27
27
|
return Math.min(Math.max(WIDTHS.MIN, Math.min(proposedWidth, containerWidth)), WIDTHS.MAX);
|
|
28
28
|
}
|
|
29
|
-
;
|
|
30
29
|
function createResizerCallbacks(_ref2) {
|
|
31
30
|
var dom = _ref2.dom,
|
|
32
31
|
contentDOM = _ref2.contentDOM,
|
|
@@ -19,7 +19,9 @@ var addBreakoutToResizableNode = function addBreakoutToResizableNode(_ref) {
|
|
|
19
19
|
isFullWidthEnabled = _ref.isFullWidthEnabled;
|
|
20
20
|
var updatedDocChanged = false;
|
|
21
21
|
var updatedTr = newTr;
|
|
22
|
-
|
|
22
|
+
var $pos = newState.doc.resolve(pos);
|
|
23
|
+
var isTopLevelNode = ($pos === null || $pos === void 0 ? void 0 : $pos.depth) === 0;
|
|
24
|
+
if (breakoutResizableNodes.has(node.type) && isTopLevelNode) {
|
|
23
25
|
var breakout = newState.schema.marks.breakout;
|
|
24
26
|
var breakoutMark = node.marks.find(function (mark) {
|
|
25
27
|
return mark.type === breakout;
|
|
@@ -5,6 +5,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
5
5
|
import { BreakoutCssClassName } from '@atlaskit/editor-common/styles';
|
|
6
6
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
7
7
|
import { akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
10
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
10
11
|
import { createResizingPlugin } from './pm-plugins/resizing-plugin';
|
|
@@ -146,6 +147,10 @@ const LayoutButtonWrapper = ({
|
|
|
146
147
|
mode,
|
|
147
148
|
editorDisabled
|
|
148
149
|
} = useSharedState(api);
|
|
150
|
+
const interactionState = useSharedPluginStateSelector(api, 'interaction.interactionState');
|
|
151
|
+
if (interactionState === 'hasNotHadInteraction' && fg('platform_editor_hide_expand_selection_states')) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
149
154
|
if (isDragging || isPMDragging) {
|
|
150
155
|
if (editorExperiment('advanced_layouts', true)) {
|
|
151
156
|
return null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { akEditorGutterPaddingDynamic, akEditorGutterPadding } from
|
|
2
|
-
import { preventUnhandled } from
|
|
3
|
-
import { setBreakoutWidth } from
|
|
4
|
-
import { LOCAL_RESIZE_PROPERTY } from
|
|
1
|
+
import { akEditorGutterPaddingDynamic, akEditorGutterPadding } from '@atlaskit/editor-shared-styles';
|
|
2
|
+
import { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';
|
|
3
|
+
import { setBreakoutWidth } from '../editor-commands/set-breakout-width';
|
|
4
|
+
import { LOCAL_RESIZE_PROPERTY } from './resizing-mark-view';
|
|
5
5
|
const RESIZE_RATIO = 2;
|
|
6
6
|
const WIDTHS = {
|
|
7
7
|
MIN: 760,
|
|
@@ -21,7 +21,6 @@ function getProposedWidth({
|
|
|
21
21
|
const containerWidth = ((api === null || api === void 0 ? void 0 : (_api$width$sharedStat = api.width.sharedState) === null || _api$width$sharedStat === void 0 ? void 0 : (_api$width$sharedStat2 = _api$width$sharedStat.currentState()) === null || _api$width$sharedStat2 === void 0 ? void 0 : _api$width$sharedStat2.width) || 0) - 2 * akEditorGutterPaddingDynamic() - akEditorGutterPadding;
|
|
22
22
|
return Math.min(Math.max(WIDTHS.MIN, Math.min(proposedWidth, containerWidth)), WIDTHS.MAX);
|
|
23
23
|
}
|
|
24
|
-
;
|
|
25
24
|
export function createResizerCallbacks({
|
|
26
25
|
dom,
|
|
27
26
|
contentDOM,
|
|
@@ -14,7 +14,9 @@ const addBreakoutToResizableNode = ({
|
|
|
14
14
|
}) => {
|
|
15
15
|
let updatedDocChanged = false;
|
|
16
16
|
let updatedTr = newTr;
|
|
17
|
-
|
|
17
|
+
const $pos = newState.doc.resolve(pos);
|
|
18
|
+
const isTopLevelNode = ($pos === null || $pos === void 0 ? void 0 : $pos.depth) === 0;
|
|
19
|
+
if (breakoutResizableNodes.has(node.type) && isTopLevelNode) {
|
|
18
20
|
const {
|
|
19
21
|
breakout
|
|
20
22
|
} = newState.schema.marks;
|
|
@@ -10,6 +10,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
10
10
|
import { BreakoutCssClassName } from '@atlaskit/editor-common/styles';
|
|
11
11
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
12
12
|
import { akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
14
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
14
15
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
15
16
|
import { createResizingPlugin } from './pm-plugins/resizing-plugin';
|
|
@@ -145,6 +146,10 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref2) {
|
|
|
145
146
|
isPMDragging = _useSharedState.isPMDragging,
|
|
146
147
|
mode = _useSharedState.mode,
|
|
147
148
|
editorDisabled = _useSharedState.editorDisabled;
|
|
149
|
+
var interactionState = useSharedPluginStateSelector(api, 'interaction.interactionState');
|
|
150
|
+
if (interactionState === 'hasNotHadInteraction' && fg('platform_editor_hide_expand_selection_states')) {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
148
153
|
if (isDragging || isPMDragging) {
|
|
149
154
|
if (editorExperiment('advanced_layouts', true)) {
|
|
150
155
|
return null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { akEditorGutterPaddingDynamic, akEditorGutterPadding } from
|
|
2
|
-
import { preventUnhandled } from
|
|
3
|
-
import { setBreakoutWidth } from
|
|
4
|
-
import { LOCAL_RESIZE_PROPERTY } from
|
|
1
|
+
import { akEditorGutterPaddingDynamic, akEditorGutterPadding } from '@atlaskit/editor-shared-styles';
|
|
2
|
+
import { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';
|
|
3
|
+
import { setBreakoutWidth } from '../editor-commands/set-breakout-width';
|
|
4
|
+
import { LOCAL_RESIZE_PROPERTY } from './resizing-mark-view';
|
|
5
5
|
var RESIZE_RATIO = 2;
|
|
6
6
|
var WIDTHS = {
|
|
7
7
|
MIN: 760,
|
|
@@ -20,7 +20,6 @@ function getProposedWidth(_ref) {
|
|
|
20
20
|
var containerWidth = ((api === null || api === void 0 || (_api$width$sharedStat = api.width.sharedState) === null || _api$width$sharedStat === void 0 || (_api$width$sharedStat = _api$width$sharedStat.currentState()) === null || _api$width$sharedStat === void 0 ? void 0 : _api$width$sharedStat.width) || 0) - 2 * akEditorGutterPaddingDynamic() - akEditorGutterPadding;
|
|
21
21
|
return Math.min(Math.max(WIDTHS.MIN, Math.min(proposedWidth, containerWidth)), WIDTHS.MAX);
|
|
22
22
|
}
|
|
23
|
-
;
|
|
24
23
|
export function createResizerCallbacks(_ref2) {
|
|
25
24
|
var dom = _ref2.dom,
|
|
26
25
|
contentDOM = _ref2.contentDOM,
|
|
@@ -13,7 +13,9 @@ var addBreakoutToResizableNode = function addBreakoutToResizableNode(_ref) {
|
|
|
13
13
|
isFullWidthEnabled = _ref.isFullWidthEnabled;
|
|
14
14
|
var updatedDocChanged = false;
|
|
15
15
|
var updatedTr = newTr;
|
|
16
|
-
|
|
16
|
+
var $pos = newState.doc.resolve(pos);
|
|
17
|
+
var isTopLevelNode = ($pos === null || $pos === void 0 ? void 0 : $pos.depth) === 0;
|
|
18
|
+
if (breakoutResizableNodes.has(node.type) && isTopLevelNode) {
|
|
17
19
|
var breakout = newState.schema.marks.breakout;
|
|
18
20
|
var breakoutMark = node.marks.find(function (mark) {
|
|
19
21
|
return mark.type === breakout;
|
|
@@ -2,7 +2,8 @@ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/t
|
|
|
2
2
|
import { type BlockControlsPlugin } from '@atlaskit/editor-plugin-block-controls';
|
|
3
3
|
import { type EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
4
4
|
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
5
|
-
import {
|
|
5
|
+
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
6
|
+
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
|
|
6
7
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
7
8
|
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
8
9
|
export interface BreakoutPluginState {
|
|
@@ -16,6 +17,7 @@ export type BreakoutPluginDependencies = [
|
|
|
16
17
|
OptionalPlugin<EditorViewModePlugin>,
|
|
17
18
|
OptionalPlugin<EditorDisabledPlugin>,
|
|
18
19
|
OptionalPlugin<BlockControlsPlugin>,
|
|
20
|
+
OptionalPlugin<InteractionPlugin>,
|
|
19
21
|
OptionalPlugin<UserIntentPlugin>
|
|
20
22
|
];
|
|
21
23
|
export type BreakoutPlugin = NextEditorPlugin<'breakout', {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ExtractInjectionAPI } from
|
|
1
|
+
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
2
|
import { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { EditorView } from
|
|
4
|
-
import { BaseEventPayload, ElementDragType } from
|
|
5
|
-
import { BreakoutPlugin } from
|
|
6
|
-
export declare function createResizerCallbacks({ dom, contentDOM, view, mark, api }: {
|
|
3
|
+
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import { BaseEventPayload, ElementDragType } from '@atlaskit/pragmatic-drag-and-drop/types';
|
|
5
|
+
import { BreakoutPlugin } from '../breakoutPluginType';
|
|
6
|
+
export declare function createResizerCallbacks({ dom, contentDOM, view, mark, api, }: {
|
|
7
7
|
dom: HTMLElement;
|
|
8
8
|
contentDOM: HTMLElement;
|
|
9
9
|
view: EditorView;
|
|
@@ -2,7 +2,8 @@ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/t
|
|
|
2
2
|
import { type BlockControlsPlugin } from '@atlaskit/editor-plugin-block-controls';
|
|
3
3
|
import { type EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
4
4
|
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
5
|
-
import {
|
|
5
|
+
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
6
|
+
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
|
|
6
7
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
7
8
|
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
8
9
|
export interface BreakoutPluginState {
|
|
@@ -16,6 +17,7 @@ export type BreakoutPluginDependencies = [
|
|
|
16
17
|
OptionalPlugin<EditorViewModePlugin>,
|
|
17
18
|
OptionalPlugin<EditorDisabledPlugin>,
|
|
18
19
|
OptionalPlugin<BlockControlsPlugin>,
|
|
20
|
+
OptionalPlugin<InteractionPlugin>,
|
|
19
21
|
OptionalPlugin<UserIntentPlugin>
|
|
20
22
|
];
|
|
21
23
|
export type BreakoutPlugin = NextEditorPlugin<'breakout', {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ExtractInjectionAPI } from
|
|
1
|
+
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
2
|
import { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { EditorView } from
|
|
4
|
-
import { BaseEventPayload, ElementDragType } from
|
|
5
|
-
import { BreakoutPlugin } from
|
|
6
|
-
export declare function createResizerCallbacks({ dom, contentDOM, view, mark, api }: {
|
|
3
|
+
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import { BaseEventPayload, ElementDragType } from '@atlaskit/pragmatic-drag-and-drop/types';
|
|
5
|
+
import { BreakoutPlugin } from '../breakoutPluginType';
|
|
6
|
+
export declare function createResizerCallbacks({ dom, contentDOM, view, mark, api, }: {
|
|
7
7
|
dom: HTMLElement;
|
|
8
8
|
contentDOM: HTMLElement;
|
|
9
9
|
view: EditorView;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-breakout",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "Breakout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,19 +34,20 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
37
|
-
"@atlaskit/editor-common": "^105.
|
|
38
|
-
"@atlaskit/editor-plugin-block-controls": "^3.
|
|
37
|
+
"@atlaskit/editor-common": "^105.11.0",
|
|
38
|
+
"@atlaskit/editor-plugin-block-controls": "^3.15.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
40
|
-
"@atlaskit/editor-plugin-editor-viewmode": "^
|
|
40
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
|
|
41
|
+
"@atlaskit/editor-plugin-interaction": "^1.1.0",
|
|
41
42
|
"@atlaskit/editor-plugin-user-intent": "^0.1.0",
|
|
42
43
|
"@atlaskit/editor-plugin-width": "^3.0.0",
|
|
43
44
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
44
45
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
45
|
-
"@atlaskit/icon": "^26.
|
|
46
|
+
"@atlaskit/icon": "^26.3.0",
|
|
46
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
48
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
48
49
|
"@atlaskit/theme": "^18.0.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^5.1.0",
|
|
50
51
|
"@atlaskit/tokens": "^4.9.0",
|
|
51
52
|
"@babel/runtime": "^7.0.0",
|
|
52
53
|
"@emotion/react": "^11.7.1"
|
|
@@ -107,6 +108,9 @@
|
|
|
107
108
|
"platform-feature-flags": {
|
|
108
109
|
"platform-editor-single-player-expand": {
|
|
109
110
|
"type": "boolean"
|
|
111
|
+
},
|
|
112
|
+
"platform_editor_hide_expand_selection_states": {
|
|
113
|
+
"type": "boolean"
|
|
110
114
|
}
|
|
111
115
|
}
|
|
112
116
|
}
|