@atlaskit/editor-plugin-breakout 2.3.0 → 2.3.1
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 +9 -0
- package/dist/cjs/pm-plugins/resizer-callbacks.js +0 -1
- package/dist/cjs/pm-plugins/resizing-plugin.js +3 -1
- package/dist/es2019/pm-plugins/resizer-callbacks.js +4 -5
- package/dist/es2019/pm-plugins/resizing-plugin.js +3 -1
- package/dist/esm/pm-plugins/resizer-callbacks.js +4 -5
- package/dist/esm/pm-plugins/resizing-plugin.js +3 -1
- package/dist/types/pm-plugins/resizer-callbacks.d.ts +5 -5
- package/dist/types-ts4.5/pm-plugins/resizer-callbacks.d.ts +5 -5
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-breakout
|
|
2
2
|
|
|
3
|
+
## 2.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#160619](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/160619)
|
|
8
|
+
[`6e034b31d6c9c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6e034b31d6c9c) -
|
|
9
|
+
ED-28096 fix nested nodes getting breakout mark
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 2.3.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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.1",
|
|
4
4
|
"description": "Breakout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,19 +34,19 @@
|
|
|
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.10.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
41
|
"@atlaskit/editor-plugin-user-intent": "^0.1.0",
|
|
42
42
|
"@atlaskit/editor-plugin-width": "^3.0.0",
|
|
43
43
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
44
44
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
45
|
-
"@atlaskit/icon": "^26.
|
|
45
|
+
"@atlaskit/icon": "^26.3.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
47
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
48
48
|
"@atlaskit/theme": "^18.0.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^5.0.0",
|
|
50
50
|
"@atlaskit/tokens": "^4.9.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"@emotion/react": "^11.7.1"
|