@atlaskit/editor-plugin-block-controls 3.19.12 → 3.19.14
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 +17 -0
- package/dist/cjs/pm-plugins/decorations-drag-handle.js +14 -5
- package/dist/cjs/pm-plugins/decorations-quick-insert-button.js +16 -5
- package/dist/cjs/pm-plugins/main.js +23 -2
- package/dist/cjs/pm-plugins/utils/marks.js +29 -0
- package/dist/cjs/ui/drag-handle.js +1 -1
- package/dist/es2019/pm-plugins/decorations-drag-handle.js +15 -5
- package/dist/es2019/pm-plugins/decorations-quick-insert-button.js +17 -5
- package/dist/es2019/pm-plugins/main.js +23 -2
- package/dist/es2019/pm-plugins/utils/marks.js +23 -0
- package/dist/es2019/ui/drag-handle.js +1 -1
- package/dist/esm/pm-plugins/decorations-drag-handle.js +14 -5
- package/dist/esm/pm-plugins/decorations-quick-insert-button.js +16 -5
- package/dist/esm/pm-plugins/main.js +23 -2
- package/dist/esm/pm-plugins/utils/marks.js +23 -0
- package/dist/esm/ui/drag-handle.js +1 -1
- package/dist/types/pm-plugins/decorations-drag-handle.d.ts +14 -1
- package/dist/types/pm-plugins/decorations-quick-insert-button.d.ts +15 -1
- package/dist/types/pm-plugins/utils/marks.d.ts +16 -0
- package/dist/types-ts4.5/pm-plugins/decorations-drag-handle.d.ts +14 -1
- package/dist/types-ts4.5/pm-plugins/decorations-quick-insert-button.d.ts +15 -1
- package/dist/types-ts4.5/pm-plugins/utils/marks.d.ts +16 -0
- package/package.json +8 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 3.19.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#180346](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/180346)
|
|
8
|
+
[`d00d1d362bd18`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d00d1d362bd18) -
|
|
9
|
+
ED-28086 Clean up platform_editor_no_cursor_on_live_doc_init
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.19.13
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#180394](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/180394)
|
|
17
|
+
[`3d81ac950c9a0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3d81ac950c9a0) -
|
|
18
|
+
Add alignment mark to widget spec under FG platform_editor_breakout_resizing_widget_fix
|
|
19
|
+
|
|
3
20
|
## 3.19.12
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -15,6 +15,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
15
15
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
16
16
|
var _dragHandle = require("../ui/drag-handle");
|
|
17
17
|
var _decorationsCommon = require("./decorations-common");
|
|
18
|
+
var _marks = require("./utils/marks");
|
|
18
19
|
var emptyParagraphNodeDecorations = exports.emptyParagraphNodeDecorations = function emptyParagraphNodeDecorations() {
|
|
19
20
|
var anchorName = "--node-anchor-paragraph-0";
|
|
20
21
|
var style = "anchor-name: ".concat(anchorName, "; margin-top: 0px;");
|
|
@@ -29,7 +30,16 @@ var findHandleDec = exports.findHandleDec = function findHandleDec(decorations,
|
|
|
29
30
|
return spec.type === _decorationsCommon.TYPE_HANDLE_DEC;
|
|
30
31
|
});
|
|
31
32
|
};
|
|
32
|
-
var dragHandleDecoration = exports.dragHandleDecoration = function dragHandleDecoration(
|
|
33
|
+
var dragHandleDecoration = exports.dragHandleDecoration = function dragHandleDecoration(_ref) {
|
|
34
|
+
var api = _ref.api,
|
|
35
|
+
formatMessage = _ref.formatMessage,
|
|
36
|
+
pos = _ref.pos,
|
|
37
|
+
anchorName = _ref.anchorName,
|
|
38
|
+
nodeType = _ref.nodeType,
|
|
39
|
+
nodeViewPortalProviderAPI = _ref.nodeViewPortalProviderAPI,
|
|
40
|
+
handleOptions = _ref.handleOptions,
|
|
41
|
+
anchorRectCache = _ref.anchorRectCache,
|
|
42
|
+
editorState = _ref.editorState;
|
|
33
43
|
if (!(0, _experiments.editorExperiment)('platform_editor_block_control_optimise_render', true, {
|
|
34
44
|
exposure: true
|
|
35
45
|
})) {
|
|
@@ -43,11 +53,10 @@ var dragHandleDecoration = exports.dragHandleDecoration = function dragHandleDec
|
|
|
43
53
|
testid: "".concat(_decorationsCommon.TYPE_HANDLE_DEC, "-").concat((0, _uuid.default)()),
|
|
44
54
|
/**
|
|
45
55
|
* sigh - `marks` influences the position that the widget is drawn (as described on the `side` property).
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* this exact position at the top of the DOM.
|
|
56
|
+
* Exclude 'breakout' on purpose, so the widgets render at the top of the document to avoid z-index issues
|
|
57
|
+
* Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
|
|
49
58
|
*/
|
|
50
|
-
marks: [],
|
|
59
|
+
marks: (0, _platformFeatureFlags.fg)('platform_editor_breakout_resizing_widget_fix') ? (0, _marks.getActiveBlockMarks)(editorState, pos) : [],
|
|
51
60
|
destroy: function destroy(node) {
|
|
52
61
|
unbind && unbind();
|
|
53
62
|
if ((0, _experiments.editorExperiment)('platform_editor_block_control_optimise_render', true) && node instanceof HTMLElement) {
|
|
@@ -11,6 +11,7 @@ var _view = require("@atlaskit/editor-prosemirror/view");
|
|
|
11
11
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
12
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
13
13
|
var _quickInsertButton = require("../ui/quick-insert-button");
|
|
14
|
+
var _marks = require("./utils/marks");
|
|
14
15
|
var _vanillaQuickInsert = require("./vanilla-quick-insert");
|
|
15
16
|
var TYPE_QUICK_INSERT = 'INSERT_BUTTON';
|
|
16
17
|
var findQuickInsertInsertButtonDecoration = exports.findQuickInsertInsertButtonDecoration = function findQuickInsertInsertButtonDecoration(decorations, from, to) {
|
|
@@ -18,7 +19,17 @@ var findQuickInsertInsertButtonDecoration = exports.findQuickInsertInsertButtonD
|
|
|
18
19
|
return spec.type === TYPE_QUICK_INSERT;
|
|
19
20
|
});
|
|
20
21
|
};
|
|
21
|
-
var quickInsertButtonDecoration = exports.quickInsertButtonDecoration = function quickInsertButtonDecoration(
|
|
22
|
+
var quickInsertButtonDecoration = exports.quickInsertButtonDecoration = function quickInsertButtonDecoration(_ref) {
|
|
23
|
+
var api = _ref.api,
|
|
24
|
+
formatMessage = _ref.formatMessage,
|
|
25
|
+
rootPos = _ref.rootPos,
|
|
26
|
+
anchorName = _ref.anchorName,
|
|
27
|
+
nodeType = _ref.nodeType,
|
|
28
|
+
nodeViewPortalProviderAPI = _ref.nodeViewPortalProviderAPI,
|
|
29
|
+
rootAnchorName = _ref.rootAnchorName,
|
|
30
|
+
rootNodeType = _ref.rootNodeType,
|
|
31
|
+
anchorRectCache = _ref.anchorRectCache,
|
|
32
|
+
editorState = _ref.editorState;
|
|
22
33
|
var key = (0, _uuid.default)();
|
|
23
34
|
var cleanupCallbacks = [];
|
|
24
35
|
var widgetSpec = (0, _experiments.editorExperiment)('platform_editor_breakout_resizing', true) ? {
|
|
@@ -26,11 +37,11 @@ var quickInsertButtonDecoration = exports.quickInsertButtonDecoration = function
|
|
|
26
37
|
type: TYPE_QUICK_INSERT,
|
|
27
38
|
/**
|
|
28
39
|
* sigh - `marks` influences the position that the widget is drawn (as described on the `side` property).
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* this exact position at the top of the DOM.
|
|
40
|
+
* Exclude 'breakout' on purpose, so the widgets render at the top of the document to avoid z-index issues
|
|
41
|
+
* Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
|
|
32
42
|
*/
|
|
33
|
-
|
|
43
|
+
|
|
44
|
+
marks: (0, _platformFeatureFlags.fg)('platform_editor_breakout_resizing_widget_fix') ? (0, _marks.getActiveBlockMarks)(editorState, rootPos) : [],
|
|
34
45
|
destroy: function destroy(_) {
|
|
35
46
|
if ((0, _platformFeatureFlags.fg)('platform_editor_fix_widget_destroy')) {
|
|
36
47
|
nodeViewPortalProviderAPI.remove(key);
|
|
@@ -419,14 +419,35 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
|
|
|
419
419
|
var _activeNode9, _activeNode0, _latestActiveNode, _latestActiveNode2, _latestActiveNode3, _latestActiveNode4;
|
|
420
420
|
var _oldHandle = (0, _decorationsDragHandle.findHandleDec)(decorations, (_activeNode9 = activeNode) === null || _activeNode9 === void 0 ? void 0 : _activeNode9.pos, (_activeNode0 = activeNode) === null || _activeNode0 === void 0 ? void 0 : _activeNode0.pos);
|
|
421
421
|
decorations = decorations.remove(_oldHandle);
|
|
422
|
-
var handleDec = (0, _decorationsDragHandle.dragHandleDecoration)(
|
|
422
|
+
var handleDec = (0, _decorationsDragHandle.dragHandleDecoration)({
|
|
423
|
+
api: api,
|
|
424
|
+
formatMessage: formatMessage,
|
|
425
|
+
pos: (_latestActiveNode = latestActiveNode) === null || _latestActiveNode === void 0 ? void 0 : _latestActiveNode.pos,
|
|
426
|
+
anchorName: (_latestActiveNode2 = latestActiveNode) === null || _latestActiveNode2 === void 0 ? void 0 : _latestActiveNode2.anchorName,
|
|
427
|
+
nodeType: (_latestActiveNode3 = latestActiveNode) === null || _latestActiveNode3 === void 0 ? void 0 : _latestActiveNode3.nodeType,
|
|
428
|
+
handleOptions: (_latestActiveNode4 = latestActiveNode) === null || _latestActiveNode4 === void 0 ? void 0 : _latestActiveNode4.handleOptions,
|
|
429
|
+
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI,
|
|
430
|
+
anchorRectCache: anchorRectCache,
|
|
431
|
+
editorState: newState
|
|
432
|
+
});
|
|
423
433
|
decorations = decorations.add(newState.doc, [handleDec]);
|
|
424
434
|
}
|
|
425
435
|
if (shouldRecreateQuickInsertButton && ((_latestActiveNode5 = latestActiveNode) === null || _latestActiveNode5 === void 0 ? void 0 : _latestActiveNode5.rootPos) !== undefined && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
426
436
|
var _activeNode1, _activeNode10, _latestActiveNode6, _latestActiveNode7, _latestActiveNode8, _latestActiveNode9, _latestActiveNode0;
|
|
427
437
|
var _oldQuickInsertButton = (0, _decorationsQuickInsertButton.findQuickInsertInsertButtonDecoration)(decorations, (_activeNode1 = activeNode) === null || _activeNode1 === void 0 ? void 0 : _activeNode1.rootPos, (_activeNode10 = activeNode) === null || _activeNode10 === void 0 ? void 0 : _activeNode10.rootPos);
|
|
428
438
|
decorations = decorations.remove(_oldQuickInsertButton);
|
|
429
|
-
var quickInsertButton = (0, _decorationsQuickInsertButton.quickInsertButtonDecoration)(
|
|
439
|
+
var quickInsertButton = (0, _decorationsQuickInsertButton.quickInsertButtonDecoration)({
|
|
440
|
+
api: api,
|
|
441
|
+
formatMessage: formatMessage,
|
|
442
|
+
anchorName: (_latestActiveNode6 = latestActiveNode) === null || _latestActiveNode6 === void 0 ? void 0 : _latestActiveNode6.anchorName,
|
|
443
|
+
nodeType: (_latestActiveNode7 = latestActiveNode) === null || _latestActiveNode7 === void 0 ? void 0 : _latestActiveNode7.nodeType,
|
|
444
|
+
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI,
|
|
445
|
+
rootPos: (_latestActiveNode8 = latestActiveNode) === null || _latestActiveNode8 === void 0 ? void 0 : _latestActiveNode8.rootPos,
|
|
446
|
+
rootAnchorName: (_latestActiveNode9 = latestActiveNode) === null || _latestActiveNode9 === void 0 ? void 0 : _latestActiveNode9.rootAnchorName,
|
|
447
|
+
rootNodeType: (_latestActiveNode0 = latestActiveNode) === null || _latestActiveNode0 === void 0 ? void 0 : _latestActiveNode0.rootNodeType,
|
|
448
|
+
anchorRectCache: anchorRectCache,
|
|
449
|
+
editorState: newState
|
|
450
|
+
});
|
|
430
451
|
decorations = decorations.add(newState.doc, [quickInsertButton]);
|
|
431
452
|
}
|
|
432
453
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getActiveBlockMarks = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Returns list of block marks on schema that widgets are allowed to render inside
|
|
9
|
+
* Currently
|
|
10
|
+
* - indent
|
|
11
|
+
* - alignment
|
|
12
|
+
* @param state - The editor state
|
|
13
|
+
* @returns The block marks
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const marks = getBlockMarks(state);
|
|
17
|
+
* console.log(marks);
|
|
18
|
+
* // [indent, alignment]
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
var getActiveBlockMarks = exports.getActiveBlockMarks = function getActiveBlockMarks(state, pos) {
|
|
22
|
+
var alignment = state.schema.marks.alignment;
|
|
23
|
+
var resolvedPos = state.doc.resolve(pos);
|
|
24
|
+
// find all active marks at the position
|
|
25
|
+
var marks = resolvedPos.marks();
|
|
26
|
+
return marks.filter(function (mark) {
|
|
27
|
+
return mark.type === alignment;
|
|
28
|
+
});
|
|
29
|
+
};
|
|
@@ -862,7 +862,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
862
862
|
var handleOnDrop = function handleOnDrop(event) {
|
|
863
863
|
(0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true) && event.stopPropagation();
|
|
864
864
|
};
|
|
865
|
-
var hasHadInteraction =
|
|
865
|
+
var hasHadInteraction = interactionState !== 'hasNotHadInteraction';
|
|
866
866
|
var renderButton = function renderButton() {
|
|
867
867
|
return (
|
|
868
868
|
// eslint-disable-next-line @atlaskit/design-system/no-html-button
|
|
@@ -7,6 +7,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
7
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
8
|
import { DragHandle, DragHandleWithVisibility } from '../ui/drag-handle';
|
|
9
9
|
import { TYPE_HANDLE_DEC, TYPE_NODE_DEC, unmountDecorations } from './decorations-common';
|
|
10
|
+
import { getActiveBlockMarks } from './utils/marks';
|
|
10
11
|
export const emptyParagraphNodeDecorations = () => {
|
|
11
12
|
const anchorName = `--node-anchor-paragraph-0`;
|
|
12
13
|
const style = `anchor-name: ${anchorName}; margin-top: 0px;`;
|
|
@@ -20,7 +21,17 @@ export const emptyParagraphNodeDecorations = () => {
|
|
|
20
21
|
export const findHandleDec = (decorations, from, to) => {
|
|
21
22
|
return decorations.find(from, to, spec => spec.type === TYPE_HANDLE_DEC);
|
|
22
23
|
};
|
|
23
|
-
export const dragHandleDecoration = (
|
|
24
|
+
export const dragHandleDecoration = ({
|
|
25
|
+
api,
|
|
26
|
+
formatMessage,
|
|
27
|
+
pos,
|
|
28
|
+
anchorName,
|
|
29
|
+
nodeType,
|
|
30
|
+
nodeViewPortalProviderAPI,
|
|
31
|
+
handleOptions,
|
|
32
|
+
anchorRectCache,
|
|
33
|
+
editorState
|
|
34
|
+
}) => {
|
|
24
35
|
if (!editorExperiment('platform_editor_block_control_optimise_render', true, {
|
|
25
36
|
exposure: true
|
|
26
37
|
})) {
|
|
@@ -34,11 +45,10 @@ export const dragHandleDecoration = (api, formatMessage, pos, anchorName, nodeTy
|
|
|
34
45
|
testid: `${TYPE_HANDLE_DEC}-${uuid()}`,
|
|
35
46
|
/**
|
|
36
47
|
* sigh - `marks` influences the position that the widget is drawn (as described on the `side` property).
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* this exact position at the top of the DOM.
|
|
48
|
+
* Exclude 'breakout' on purpose, so the widgets render at the top of the document to avoid z-index issues
|
|
49
|
+
* Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
|
|
40
50
|
*/
|
|
41
|
-
marks: [],
|
|
51
|
+
marks: fg('platform_editor_breakout_resizing_widget_fix') ? getActiveBlockMarks(editorState, pos) : [],
|
|
42
52
|
destroy: node => {
|
|
43
53
|
unbind && unbind();
|
|
44
54
|
if (editorExperiment('platform_editor_block_control_optimise_render', true) && node instanceof HTMLElement) {
|
|
@@ -4,12 +4,24 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
5
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
6
|
import { QuickInsertWithVisibility, TypeAheadControl } from '../ui/quick-insert-button';
|
|
7
|
+
import { getActiveBlockMarks } from './utils/marks';
|
|
7
8
|
import { createVanillaButton } from './vanilla-quick-insert';
|
|
8
9
|
const TYPE_QUICK_INSERT = 'INSERT_BUTTON';
|
|
9
10
|
export const findQuickInsertInsertButtonDecoration = (decorations, from, to) => {
|
|
10
11
|
return decorations.find(from, to, spec => spec.type === TYPE_QUICK_INSERT);
|
|
11
12
|
};
|
|
12
|
-
export const quickInsertButtonDecoration = (
|
|
13
|
+
export const quickInsertButtonDecoration = ({
|
|
14
|
+
api,
|
|
15
|
+
formatMessage,
|
|
16
|
+
rootPos,
|
|
17
|
+
anchorName,
|
|
18
|
+
nodeType,
|
|
19
|
+
nodeViewPortalProviderAPI,
|
|
20
|
+
rootAnchorName,
|
|
21
|
+
rootNodeType,
|
|
22
|
+
anchorRectCache,
|
|
23
|
+
editorState
|
|
24
|
+
}) => {
|
|
13
25
|
const key = uuid();
|
|
14
26
|
const cleanupCallbacks = [];
|
|
15
27
|
const widgetSpec = editorExperiment('platform_editor_breakout_resizing', true) ? {
|
|
@@ -17,11 +29,11 @@ export const quickInsertButtonDecoration = (api, formatMessage, rootPos, anchorN
|
|
|
17
29
|
type: TYPE_QUICK_INSERT,
|
|
18
30
|
/**
|
|
19
31
|
* sigh - `marks` influences the position that the widget is drawn (as described on the `side` property).
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* this exact position at the top of the DOM.
|
|
32
|
+
* Exclude 'breakout' on purpose, so the widgets render at the top of the document to avoid z-index issues
|
|
33
|
+
* Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
|
|
23
34
|
*/
|
|
24
|
-
|
|
35
|
+
|
|
36
|
+
marks: fg('platform_editor_breakout_resizing_widget_fix') ? getActiveBlockMarks(editorState, rootPos) : [],
|
|
25
37
|
destroy: _ => {
|
|
26
38
|
if (fg('platform_editor_fix_widget_destroy')) {
|
|
27
39
|
nodeViewPortalProviderAPI.remove(key);
|
|
@@ -418,14 +418,35 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
|
|
|
418
418
|
var _activeNode9, _activeNode0, _latestActiveNode, _latestActiveNode2, _latestActiveNode3, _latestActiveNode4;
|
|
419
419
|
const oldHandle = findHandleDec(decorations, (_activeNode9 = activeNode) === null || _activeNode9 === void 0 ? void 0 : _activeNode9.pos, (_activeNode0 = activeNode) === null || _activeNode0 === void 0 ? void 0 : _activeNode0.pos);
|
|
420
420
|
decorations = decorations.remove(oldHandle);
|
|
421
|
-
const handleDec = dragHandleDecoration(
|
|
421
|
+
const handleDec = dragHandleDecoration({
|
|
422
|
+
api,
|
|
423
|
+
formatMessage,
|
|
424
|
+
pos: (_latestActiveNode = latestActiveNode) === null || _latestActiveNode === void 0 ? void 0 : _latestActiveNode.pos,
|
|
425
|
+
anchorName: (_latestActiveNode2 = latestActiveNode) === null || _latestActiveNode2 === void 0 ? void 0 : _latestActiveNode2.anchorName,
|
|
426
|
+
nodeType: (_latestActiveNode3 = latestActiveNode) === null || _latestActiveNode3 === void 0 ? void 0 : _latestActiveNode3.nodeType,
|
|
427
|
+
handleOptions: (_latestActiveNode4 = latestActiveNode) === null || _latestActiveNode4 === void 0 ? void 0 : _latestActiveNode4.handleOptions,
|
|
428
|
+
nodeViewPortalProviderAPI,
|
|
429
|
+
anchorRectCache,
|
|
430
|
+
editorState: newState
|
|
431
|
+
});
|
|
422
432
|
decorations = decorations.add(newState.doc, [handleDec]);
|
|
423
433
|
}
|
|
424
434
|
if (shouldRecreateQuickInsertButton && ((_latestActiveNode5 = latestActiveNode) === null || _latestActiveNode5 === void 0 ? void 0 : _latestActiveNode5.rootPos) !== undefined && editorExperiment('platform_editor_controls', 'variant1')) {
|
|
425
435
|
var _activeNode1, _activeNode10, _latestActiveNode6, _latestActiveNode7, _latestActiveNode8, _latestActiveNode9, _latestActiveNode0;
|
|
426
436
|
const oldQuickInsertButton = findQuickInsertInsertButtonDecoration(decorations, (_activeNode1 = activeNode) === null || _activeNode1 === void 0 ? void 0 : _activeNode1.rootPos, (_activeNode10 = activeNode) === null || _activeNode10 === void 0 ? void 0 : _activeNode10.rootPos);
|
|
427
437
|
decorations = decorations.remove(oldQuickInsertButton);
|
|
428
|
-
const quickInsertButton = quickInsertButtonDecoration(
|
|
438
|
+
const quickInsertButton = quickInsertButtonDecoration({
|
|
439
|
+
api,
|
|
440
|
+
formatMessage,
|
|
441
|
+
anchorName: (_latestActiveNode6 = latestActiveNode) === null || _latestActiveNode6 === void 0 ? void 0 : _latestActiveNode6.anchorName,
|
|
442
|
+
nodeType: (_latestActiveNode7 = latestActiveNode) === null || _latestActiveNode7 === void 0 ? void 0 : _latestActiveNode7.nodeType,
|
|
443
|
+
nodeViewPortalProviderAPI,
|
|
444
|
+
rootPos: (_latestActiveNode8 = latestActiveNode) === null || _latestActiveNode8 === void 0 ? void 0 : _latestActiveNode8.rootPos,
|
|
445
|
+
rootAnchorName: (_latestActiveNode9 = latestActiveNode) === null || _latestActiveNode9 === void 0 ? void 0 : _latestActiveNode9.rootAnchorName,
|
|
446
|
+
rootNodeType: (_latestActiveNode0 = latestActiveNode) === null || _latestActiveNode0 === void 0 ? void 0 : _latestActiveNode0.rootNodeType,
|
|
447
|
+
anchorRectCache,
|
|
448
|
+
editorState: newState
|
|
449
|
+
});
|
|
429
450
|
decorations = decorations.add(newState.doc, [quickInsertButton]);
|
|
430
451
|
}
|
|
431
452
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns list of block marks on schema that widgets are allowed to render inside
|
|
3
|
+
* Currently
|
|
4
|
+
* - indent
|
|
5
|
+
* - alignment
|
|
6
|
+
* @param state - The editor state
|
|
7
|
+
* @returns The block marks
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const marks = getBlockMarks(state);
|
|
11
|
+
* console.log(marks);
|
|
12
|
+
* // [indent, alignment]
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export const getActiveBlockMarks = (state, pos) => {
|
|
16
|
+
const {
|
|
17
|
+
alignment
|
|
18
|
+
} = state.schema.marks;
|
|
19
|
+
const resolvedPos = state.doc.resolve(pos);
|
|
20
|
+
// find all active marks at the position
|
|
21
|
+
const marks = resolvedPos.marks();
|
|
22
|
+
return marks.filter(mark => mark.type === alignment);
|
|
23
|
+
};
|
|
@@ -850,7 +850,7 @@ export const DragHandle = ({
|
|
|
850
850
|
const handleOnDrop = event => {
|
|
851
851
|
editorExperiment('platform_editor_element_drag_and_drop_multiselect', true) && event.stopPropagation();
|
|
852
852
|
};
|
|
853
|
-
const hasHadInteraction =
|
|
853
|
+
const hasHadInteraction = interactionState !== 'hasNotHadInteraction';
|
|
854
854
|
const renderButton = () =>
|
|
855
855
|
// eslint-disable-next-line @atlaskit/design-system/no-html-button
|
|
856
856
|
jsx("button", {
|
|
@@ -8,6 +8,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
8
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
9
|
import { DragHandle, DragHandleWithVisibility } from '../ui/drag-handle';
|
|
10
10
|
import { TYPE_HANDLE_DEC, TYPE_NODE_DEC, unmountDecorations } from './decorations-common';
|
|
11
|
+
import { getActiveBlockMarks } from './utils/marks';
|
|
11
12
|
export var emptyParagraphNodeDecorations = function emptyParagraphNodeDecorations() {
|
|
12
13
|
var anchorName = "--node-anchor-paragraph-0";
|
|
13
14
|
var style = "anchor-name: ".concat(anchorName, "; margin-top: 0px;");
|
|
@@ -22,7 +23,16 @@ export var findHandleDec = function findHandleDec(decorations, from, to) {
|
|
|
22
23
|
return spec.type === TYPE_HANDLE_DEC;
|
|
23
24
|
});
|
|
24
25
|
};
|
|
25
|
-
export var dragHandleDecoration = function dragHandleDecoration(
|
|
26
|
+
export var dragHandleDecoration = function dragHandleDecoration(_ref) {
|
|
27
|
+
var api = _ref.api,
|
|
28
|
+
formatMessage = _ref.formatMessage,
|
|
29
|
+
pos = _ref.pos,
|
|
30
|
+
anchorName = _ref.anchorName,
|
|
31
|
+
nodeType = _ref.nodeType,
|
|
32
|
+
nodeViewPortalProviderAPI = _ref.nodeViewPortalProviderAPI,
|
|
33
|
+
handleOptions = _ref.handleOptions,
|
|
34
|
+
anchorRectCache = _ref.anchorRectCache,
|
|
35
|
+
editorState = _ref.editorState;
|
|
26
36
|
if (!editorExperiment('platform_editor_block_control_optimise_render', true, {
|
|
27
37
|
exposure: true
|
|
28
38
|
})) {
|
|
@@ -36,11 +46,10 @@ export var dragHandleDecoration = function dragHandleDecoration(api, formatMessa
|
|
|
36
46
|
testid: "".concat(TYPE_HANDLE_DEC, "-").concat(uuid()),
|
|
37
47
|
/**
|
|
38
48
|
* sigh - `marks` influences the position that the widget is drawn (as described on the `side` property).
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* this exact position at the top of the DOM.
|
|
49
|
+
* Exclude 'breakout' on purpose, so the widgets render at the top of the document to avoid z-index issues
|
|
50
|
+
* Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
|
|
42
51
|
*/
|
|
43
|
-
marks: [],
|
|
52
|
+
marks: fg('platform_editor_breakout_resizing_widget_fix') ? getActiveBlockMarks(editorState, pos) : [],
|
|
44
53
|
destroy: function destroy(node) {
|
|
45
54
|
unbind && unbind();
|
|
46
55
|
if (editorExperiment('platform_editor_block_control_optimise_render', true) && node instanceof HTMLElement) {
|
|
@@ -4,6 +4,7 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
5
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
6
|
import { QuickInsertWithVisibility, TypeAheadControl } from '../ui/quick-insert-button';
|
|
7
|
+
import { getActiveBlockMarks } from './utils/marks';
|
|
7
8
|
import { createVanillaButton } from './vanilla-quick-insert';
|
|
8
9
|
var TYPE_QUICK_INSERT = 'INSERT_BUTTON';
|
|
9
10
|
export var findQuickInsertInsertButtonDecoration = function findQuickInsertInsertButtonDecoration(decorations, from, to) {
|
|
@@ -11,7 +12,17 @@ export var findQuickInsertInsertButtonDecoration = function findQuickInsertInser
|
|
|
11
12
|
return spec.type === TYPE_QUICK_INSERT;
|
|
12
13
|
});
|
|
13
14
|
};
|
|
14
|
-
export var quickInsertButtonDecoration = function quickInsertButtonDecoration(
|
|
15
|
+
export var quickInsertButtonDecoration = function quickInsertButtonDecoration(_ref) {
|
|
16
|
+
var api = _ref.api,
|
|
17
|
+
formatMessage = _ref.formatMessage,
|
|
18
|
+
rootPos = _ref.rootPos,
|
|
19
|
+
anchorName = _ref.anchorName,
|
|
20
|
+
nodeType = _ref.nodeType,
|
|
21
|
+
nodeViewPortalProviderAPI = _ref.nodeViewPortalProviderAPI,
|
|
22
|
+
rootAnchorName = _ref.rootAnchorName,
|
|
23
|
+
rootNodeType = _ref.rootNodeType,
|
|
24
|
+
anchorRectCache = _ref.anchorRectCache,
|
|
25
|
+
editorState = _ref.editorState;
|
|
15
26
|
var key = uuid();
|
|
16
27
|
var cleanupCallbacks = [];
|
|
17
28
|
var widgetSpec = editorExperiment('platform_editor_breakout_resizing', true) ? {
|
|
@@ -19,11 +30,11 @@ export var quickInsertButtonDecoration = function quickInsertButtonDecoration(ap
|
|
|
19
30
|
type: TYPE_QUICK_INSERT,
|
|
20
31
|
/**
|
|
21
32
|
* sigh - `marks` influences the position that the widget is drawn (as described on the `side` property).
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* this exact position at the top of the DOM.
|
|
33
|
+
* Exclude 'breakout' on purpose, so the widgets render at the top of the document to avoid z-index issues
|
|
34
|
+
* Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
|
|
25
35
|
*/
|
|
26
|
-
|
|
36
|
+
|
|
37
|
+
marks: fg('platform_editor_breakout_resizing_widget_fix') ? getActiveBlockMarks(editorState, rootPos) : [],
|
|
27
38
|
destroy: function destroy(_) {
|
|
28
39
|
if (fg('platform_editor_fix_widget_destroy')) {
|
|
29
40
|
nodeViewPortalProviderAPI.remove(key);
|
|
@@ -412,14 +412,35 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
|
|
|
412
412
|
var _activeNode9, _activeNode0, _latestActiveNode, _latestActiveNode2, _latestActiveNode3, _latestActiveNode4;
|
|
413
413
|
var _oldHandle = findHandleDec(decorations, (_activeNode9 = activeNode) === null || _activeNode9 === void 0 ? void 0 : _activeNode9.pos, (_activeNode0 = activeNode) === null || _activeNode0 === void 0 ? void 0 : _activeNode0.pos);
|
|
414
414
|
decorations = decorations.remove(_oldHandle);
|
|
415
|
-
var handleDec = dragHandleDecoration(
|
|
415
|
+
var handleDec = dragHandleDecoration({
|
|
416
|
+
api: api,
|
|
417
|
+
formatMessage: formatMessage,
|
|
418
|
+
pos: (_latestActiveNode = latestActiveNode) === null || _latestActiveNode === void 0 ? void 0 : _latestActiveNode.pos,
|
|
419
|
+
anchorName: (_latestActiveNode2 = latestActiveNode) === null || _latestActiveNode2 === void 0 ? void 0 : _latestActiveNode2.anchorName,
|
|
420
|
+
nodeType: (_latestActiveNode3 = latestActiveNode) === null || _latestActiveNode3 === void 0 ? void 0 : _latestActiveNode3.nodeType,
|
|
421
|
+
handleOptions: (_latestActiveNode4 = latestActiveNode) === null || _latestActiveNode4 === void 0 ? void 0 : _latestActiveNode4.handleOptions,
|
|
422
|
+
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI,
|
|
423
|
+
anchorRectCache: anchorRectCache,
|
|
424
|
+
editorState: newState
|
|
425
|
+
});
|
|
416
426
|
decorations = decorations.add(newState.doc, [handleDec]);
|
|
417
427
|
}
|
|
418
428
|
if (shouldRecreateQuickInsertButton && ((_latestActiveNode5 = latestActiveNode) === null || _latestActiveNode5 === void 0 ? void 0 : _latestActiveNode5.rootPos) !== undefined && editorExperiment('platform_editor_controls', 'variant1')) {
|
|
419
429
|
var _activeNode1, _activeNode10, _latestActiveNode6, _latestActiveNode7, _latestActiveNode8, _latestActiveNode9, _latestActiveNode0;
|
|
420
430
|
var _oldQuickInsertButton = findQuickInsertInsertButtonDecoration(decorations, (_activeNode1 = activeNode) === null || _activeNode1 === void 0 ? void 0 : _activeNode1.rootPos, (_activeNode10 = activeNode) === null || _activeNode10 === void 0 ? void 0 : _activeNode10.rootPos);
|
|
421
431
|
decorations = decorations.remove(_oldQuickInsertButton);
|
|
422
|
-
var quickInsertButton = quickInsertButtonDecoration(
|
|
432
|
+
var quickInsertButton = quickInsertButtonDecoration({
|
|
433
|
+
api: api,
|
|
434
|
+
formatMessage: formatMessage,
|
|
435
|
+
anchorName: (_latestActiveNode6 = latestActiveNode) === null || _latestActiveNode6 === void 0 ? void 0 : _latestActiveNode6.anchorName,
|
|
436
|
+
nodeType: (_latestActiveNode7 = latestActiveNode) === null || _latestActiveNode7 === void 0 ? void 0 : _latestActiveNode7.nodeType,
|
|
437
|
+
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI,
|
|
438
|
+
rootPos: (_latestActiveNode8 = latestActiveNode) === null || _latestActiveNode8 === void 0 ? void 0 : _latestActiveNode8.rootPos,
|
|
439
|
+
rootAnchorName: (_latestActiveNode9 = latestActiveNode) === null || _latestActiveNode9 === void 0 ? void 0 : _latestActiveNode9.rootAnchorName,
|
|
440
|
+
rootNodeType: (_latestActiveNode0 = latestActiveNode) === null || _latestActiveNode0 === void 0 ? void 0 : _latestActiveNode0.rootNodeType,
|
|
441
|
+
anchorRectCache: anchorRectCache,
|
|
442
|
+
editorState: newState
|
|
443
|
+
});
|
|
423
444
|
decorations = decorations.add(newState.doc, [quickInsertButton]);
|
|
424
445
|
}
|
|
425
446
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns list of block marks on schema that widgets are allowed to render inside
|
|
3
|
+
* Currently
|
|
4
|
+
* - indent
|
|
5
|
+
* - alignment
|
|
6
|
+
* @param state - The editor state
|
|
7
|
+
* @returns The block marks
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const marks = getBlockMarks(state);
|
|
11
|
+
* console.log(marks);
|
|
12
|
+
* // [indent, alignment]
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export var getActiveBlockMarks = function getActiveBlockMarks(state, pos) {
|
|
16
|
+
var alignment = state.schema.marks.alignment;
|
|
17
|
+
var resolvedPos = state.doc.resolve(pos);
|
|
18
|
+
// find all active marks at the position
|
|
19
|
+
var marks = resolvedPos.marks();
|
|
20
|
+
return marks.filter(function (mark) {
|
|
21
|
+
return mark.type === alignment;
|
|
22
|
+
});
|
|
23
|
+
};
|
|
@@ -859,7 +859,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
859
859
|
var handleOnDrop = function handleOnDrop(event) {
|
|
860
860
|
editorExperiment('platform_editor_element_drag_and_drop_multiselect', true) && event.stopPropagation();
|
|
861
861
|
};
|
|
862
|
-
var hasHadInteraction =
|
|
862
|
+
var hasHadInteraction = interactionState !== 'hasNotHadInteraction';
|
|
863
863
|
var renderButton = function renderButton() {
|
|
864
864
|
return (
|
|
865
865
|
// eslint-disable-next-line @atlaskit/design-system/no-html-button
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import { type IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
import { type EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
5
|
import { Decoration, type DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
5
6
|
import type { BlockControlsPlugin, HandleOptions } from '../blockControlsPluginType';
|
|
6
7
|
import { AnchorRectCache } from './utils/anchor-utils';
|
|
7
8
|
export declare const emptyParagraphNodeDecorations: () => Decoration;
|
|
8
9
|
export declare const findHandleDec: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
9
|
-
|
|
10
|
+
type DragHandleDecorationParams = {
|
|
11
|
+
api: ExtractInjectionAPI<BlockControlsPlugin>;
|
|
12
|
+
formatMessage: IntlShape['formatMessage'];
|
|
13
|
+
pos: number;
|
|
14
|
+
anchorName: string;
|
|
15
|
+
nodeType: string;
|
|
16
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
17
|
+
handleOptions?: HandleOptions;
|
|
18
|
+
anchorRectCache?: AnchorRectCache;
|
|
19
|
+
editorState: EditorState;
|
|
20
|
+
};
|
|
21
|
+
export declare const dragHandleDecoration: ({ api, formatMessage, pos, anchorName, nodeType, nodeViewPortalProviderAPI, handleOptions, anchorRectCache, editorState, }: DragHandleDecorationParams) => Decoration;
|
|
22
|
+
export {};
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import { type IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
5
|
import { Decoration, type DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
5
6
|
import type { BlockControlsPlugin } from '../blockControlsPluginType';
|
|
6
7
|
import { AnchorRectCache } from './utils/anchor-utils';
|
|
7
8
|
export declare const findQuickInsertInsertButtonDecoration: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
8
|
-
|
|
9
|
+
type QuickInsertButtonDecorationParams = {
|
|
10
|
+
api: ExtractInjectionAPI<BlockControlsPlugin>;
|
|
11
|
+
formatMessage: IntlShape['formatMessage'];
|
|
12
|
+
rootPos: number;
|
|
13
|
+
anchorName: string;
|
|
14
|
+
nodeType: string;
|
|
15
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
16
|
+
rootAnchorName?: string;
|
|
17
|
+
rootNodeType?: string;
|
|
18
|
+
anchorRectCache?: AnchorRectCache;
|
|
19
|
+
editorState: EditorState;
|
|
20
|
+
};
|
|
21
|
+
export declare const quickInsertButtonDecoration: ({ api, formatMessage, rootPos, anchorName, nodeType, nodeViewPortalProviderAPI, rootAnchorName, rootNodeType, anchorRectCache, editorState, }: QuickInsertButtonDecorationParams) => Decoration;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
/**
|
|
3
|
+
* Returns list of block marks on schema that widgets are allowed to render inside
|
|
4
|
+
* Currently
|
|
5
|
+
* - indent
|
|
6
|
+
* - alignment
|
|
7
|
+
* @param state - The editor state
|
|
8
|
+
* @returns The block marks
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const marks = getBlockMarks(state);
|
|
12
|
+
* console.log(marks);
|
|
13
|
+
* // [indent, alignment]
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const getActiveBlockMarks: (state: EditorState, pos: number) => import("prosemirror-model").Mark[];
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import { type IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
import { type EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
5
|
import { Decoration, type DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
5
6
|
import type { BlockControlsPlugin, HandleOptions } from '../blockControlsPluginType';
|
|
6
7
|
import { AnchorRectCache } from './utils/anchor-utils';
|
|
7
8
|
export declare const emptyParagraphNodeDecorations: () => Decoration;
|
|
8
9
|
export declare const findHandleDec: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
9
|
-
|
|
10
|
+
type DragHandleDecorationParams = {
|
|
11
|
+
api: ExtractInjectionAPI<BlockControlsPlugin>;
|
|
12
|
+
formatMessage: IntlShape['formatMessage'];
|
|
13
|
+
pos: number;
|
|
14
|
+
anchorName: string;
|
|
15
|
+
nodeType: string;
|
|
16
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
17
|
+
handleOptions?: HandleOptions;
|
|
18
|
+
anchorRectCache?: AnchorRectCache;
|
|
19
|
+
editorState: EditorState;
|
|
20
|
+
};
|
|
21
|
+
export declare const dragHandleDecoration: ({ api, formatMessage, pos, anchorName, nodeType, nodeViewPortalProviderAPI, handleOptions, anchorRectCache, editorState, }: DragHandleDecorationParams) => Decoration;
|
|
22
|
+
export {};
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import { type IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
5
|
import { Decoration, type DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
5
6
|
import type { BlockControlsPlugin } from '../blockControlsPluginType';
|
|
6
7
|
import { AnchorRectCache } from './utils/anchor-utils';
|
|
7
8
|
export declare const findQuickInsertInsertButtonDecoration: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
8
|
-
|
|
9
|
+
type QuickInsertButtonDecorationParams = {
|
|
10
|
+
api: ExtractInjectionAPI<BlockControlsPlugin>;
|
|
11
|
+
formatMessage: IntlShape['formatMessage'];
|
|
12
|
+
rootPos: number;
|
|
13
|
+
anchorName: string;
|
|
14
|
+
nodeType: string;
|
|
15
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
16
|
+
rootAnchorName?: string;
|
|
17
|
+
rootNodeType?: string;
|
|
18
|
+
anchorRectCache?: AnchorRectCache;
|
|
19
|
+
editorState: EditorState;
|
|
20
|
+
};
|
|
21
|
+
export declare const quickInsertButtonDecoration: ({ api, formatMessage, rootPos, anchorName, nodeType, nodeViewPortalProviderAPI, rootAnchorName, rootNodeType, anchorRectCache, editorState, }: QuickInsertButtonDecorationParams) => Decoration;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
/**
|
|
3
|
+
* Returns list of block marks on schema that widgets are allowed to render inside
|
|
4
|
+
* Currently
|
|
5
|
+
* - indent
|
|
6
|
+
* - alignment
|
|
7
|
+
* @param state - The editor state
|
|
8
|
+
* @returns The block marks
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const marks = getBlockMarks(state);
|
|
12
|
+
* console.log(marks);
|
|
13
|
+
* // [indent, alignment]
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const getActiveBlockMarks: (state: EditorState, pos: number) => import("prosemirror-model").Mark[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "3.19.
|
|
3
|
+
"version": "3.19.14",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
"registry": "https://registry.npmjs.org/"
|
|
9
9
|
},
|
|
10
10
|
"atlassian": {
|
|
11
|
-
"team": "Editor: Jenga"
|
|
12
|
-
"runReact18": true
|
|
11
|
+
"team": "Editor: Jenga"
|
|
13
12
|
},
|
|
14
13
|
"repository": "https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo",
|
|
15
14
|
"main": "dist/cjs/index.js",
|
|
@@ -33,13 +32,13 @@
|
|
|
33
32
|
},
|
|
34
33
|
"dependencies": {
|
|
35
34
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
36
|
-
"@atlaskit/editor-common": "^107.
|
|
35
|
+
"@atlaskit/editor-common": "^107.4.0",
|
|
37
36
|
"@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
|
|
38
37
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
39
38
|
"@atlaskit/editor-plugin-editor-disabled": "^2.1.0",
|
|
40
39
|
"@atlaskit/editor-plugin-feature-flags": "^1.4.0",
|
|
41
40
|
"@atlaskit/editor-plugin-interaction": "^3.0.0",
|
|
42
|
-
"@atlaskit/editor-plugin-metrics": "^3.
|
|
41
|
+
"@atlaskit/editor-plugin-metrics": "^3.6.0",
|
|
43
42
|
"@atlaskit/editor-plugin-quick-insert": "^2.6.0",
|
|
44
43
|
"@atlaskit/editor-plugin-selection": "^2.2.0",
|
|
45
44
|
"@atlaskit/editor-plugin-type-ahead": "^2.7.0",
|
|
@@ -56,7 +55,7 @@
|
|
|
56
55
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
57
56
|
"@atlaskit/primitives": "^14.10.0",
|
|
58
57
|
"@atlaskit/theme": "^18.0.0",
|
|
59
|
-
"@atlaskit/tmp-editor-statsig": "^8.
|
|
58
|
+
"@atlaskit/tmp-editor-statsig": "^8.6.0",
|
|
60
59
|
"@atlaskit/tokens": "^5.4.0",
|
|
61
60
|
"@atlaskit/tooltip": "^20.3.0",
|
|
62
61
|
"@babel/runtime": "^7.0.0",
|
|
@@ -156,9 +155,6 @@
|
|
|
156
155
|
"platform_editor_controls_widget_visibility": {
|
|
157
156
|
"type": "boolean"
|
|
158
157
|
},
|
|
159
|
-
"platform_editor_no_cursor_on_live_doc_init": {
|
|
160
|
-
"type": "boolean"
|
|
161
|
-
},
|
|
162
158
|
"platform_editor_drag_and_drop_perf_analytics": {
|
|
163
159
|
"type": "boolean"
|
|
164
160
|
},
|
|
@@ -188,6 +184,9 @@
|
|
|
188
184
|
},
|
|
189
185
|
"platform_editor_controls_patch_15": {
|
|
190
186
|
"type": "boolean"
|
|
187
|
+
},
|
|
188
|
+
"platform_editor_breakout_resizing_widget_fix": {
|
|
189
|
+
"type": "boolean"
|
|
191
190
|
}
|
|
192
191
|
}
|
|
193
192
|
}
|