@atlaskit/editor-plugin-synced-block 10.2.2 → 10.2.3
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
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 10.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`95370844dfbda`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/95370844dfbda) -
|
|
8
|
+
Hide the Sync block block-menu action for Native Tabs.
|
|
9
|
+
|
|
3
10
|
## 10.2.2
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.wasExtensionInsertedInBodiedSyncBlock = exports.sliceFullyContainsNode = exports.isBodiedSyncBlockNode = exports.findSyncBlockOrBodiedSyncBlock = exports.findSyncBlock = exports.findBodiedSyncBlock = exports.deferDispatch = exports.canBeConvertedToSyncBlock = void 0;
|
|
7
|
+
exports.wasExtensionInsertedInBodiedSyncBlock = exports.sliceFullyContainsNode = exports.isBodiedSyncBlockNode = exports.getUnsupportedNodeTypes = exports.findSyncBlockOrBodiedSyncBlock = exports.findSyncBlock = exports.findBodiedSyncBlock = exports.deferDispatch = exports.canBeConvertedToSyncBlock = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
7
10
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
8
11
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
9
12
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
10
13
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
15
|
/**
|
|
12
16
|
* Defers a callback to the next microtask (when gated) or next macrotask via setTimeout(0).
|
|
13
17
|
* Used to avoid re-entrant ProseMirror dispatch cycles.
|
|
@@ -28,7 +32,9 @@ var findSyncBlockOrBodiedSyncBlock = exports.findSyncBlockOrBodiedSyncBlock = fu
|
|
|
28
32
|
var isBodiedSyncBlockNode = exports.isBodiedSyncBlockNode = function isBodiedSyncBlockNode(node, bodiedSyncBlock) {
|
|
29
33
|
return node.type === bodiedSyncBlock;
|
|
30
34
|
};
|
|
31
|
-
var
|
|
35
|
+
var getUnsupportedNodeTypes = exports.getUnsupportedNodeTypes = (0, _memoizeOne.default)(function () {
|
|
36
|
+
return new Set(['inlineExtension', 'extension', 'bodiedExtension', 'syncBlock', 'bodiedSyncBlock'].concat((0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('confluence_frontend_native_tabs_extension') ? ['multiBodiedExtension'] : [])));
|
|
37
|
+
});
|
|
32
38
|
|
|
33
39
|
/**
|
|
34
40
|
* Checks whether the selection can be converted to sync block
|
|
@@ -47,9 +53,10 @@ var canBeConvertedToSyncBlock = exports.canBeConvertedToSyncBlock = function can
|
|
|
47
53
|
}
|
|
48
54
|
var from = range.start;
|
|
49
55
|
var to = range.end;
|
|
56
|
+
var unsupportedNodeTypes = getUnsupportedNodeTypes();
|
|
50
57
|
var canBeConverted = true;
|
|
51
58
|
$from.doc.nodesBetween(from, to, function (node) {
|
|
52
|
-
if (
|
|
59
|
+
if (unsupportedNodeTypes.has(node.type.name)) {
|
|
53
60
|
canBeConverted = false;
|
|
54
61
|
return false;
|
|
55
62
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import memoizeOne from 'memoize-one';
|
|
1
2
|
import { expandSelectionToBlockRange } from '@atlaskit/editor-common/selection';
|
|
2
3
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
3
4
|
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
5
|
import { findParentNodeOfType, findParentNodeOfTypeClosestToPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
|
|
5
8
|
/**
|
|
6
9
|
* Defers a callback to the next microtask (when gated) or next macrotask via setTimeout(0).
|
|
7
10
|
* Used to avoid re-entrant ProseMirror dispatch cycles.
|
|
@@ -22,7 +25,7 @@ export const findSyncBlockOrBodiedSyncBlock = (schema, selection) => {
|
|
|
22
25
|
return findSyncBlock(schema, selection) || findBodiedSyncBlock(schema, selection);
|
|
23
26
|
};
|
|
24
27
|
export const isBodiedSyncBlockNode = (node, bodiedSyncBlock) => node.type === bodiedSyncBlock;
|
|
25
|
-
const
|
|
28
|
+
export const getUnsupportedNodeTypes = memoizeOne(() => new Set(['inlineExtension', 'extension', 'bodiedExtension', 'syncBlock', 'bodiedSyncBlock', ...(fg('confluence_frontend_native_tabs_extension') ? ['multiBodiedExtension'] : [])]));
|
|
26
29
|
|
|
27
30
|
/**
|
|
28
31
|
* Checks whether the selection can be converted to sync block
|
|
@@ -42,9 +45,10 @@ export const canBeConvertedToSyncBlock = selection => {
|
|
|
42
45
|
}
|
|
43
46
|
const from = range.start;
|
|
44
47
|
const to = range.end;
|
|
48
|
+
const unsupportedNodeTypes = getUnsupportedNodeTypes();
|
|
45
49
|
let canBeConverted = true;
|
|
46
50
|
$from.doc.nodesBetween(from, to, node => {
|
|
47
|
-
if (
|
|
51
|
+
if (unsupportedNodeTypes.has(node.type.name)) {
|
|
48
52
|
canBeConverted = false;
|
|
49
53
|
return false;
|
|
50
54
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import memoizeOne from 'memoize-one';
|
|
1
3
|
import { expandSelectionToBlockRange } from '@atlaskit/editor-common/selection';
|
|
2
4
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
3
5
|
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
6
|
import { findParentNodeOfType, findParentNodeOfTypeClosestToPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
|
|
5
9
|
/**
|
|
6
10
|
* Defers a callback to the next microtask (when gated) or next macrotask via setTimeout(0).
|
|
7
11
|
* Used to avoid re-entrant ProseMirror dispatch cycles.
|
|
@@ -22,7 +26,9 @@ export var findSyncBlockOrBodiedSyncBlock = function findSyncBlockOrBodiedSyncBl
|
|
|
22
26
|
export var isBodiedSyncBlockNode = function isBodiedSyncBlockNode(node, bodiedSyncBlock) {
|
|
23
27
|
return node.type === bodiedSyncBlock;
|
|
24
28
|
};
|
|
25
|
-
var
|
|
29
|
+
export var getUnsupportedNodeTypes = memoizeOne(function () {
|
|
30
|
+
return new Set(['inlineExtension', 'extension', 'bodiedExtension', 'syncBlock', 'bodiedSyncBlock'].concat(_toConsumableArray(fg('confluence_frontend_native_tabs_extension') ? ['multiBodiedExtension'] : [])));
|
|
31
|
+
});
|
|
26
32
|
|
|
27
33
|
/**
|
|
28
34
|
* Checks whether the selection can be converted to sync block
|
|
@@ -41,9 +47,10 @@ export var canBeConvertedToSyncBlock = function canBeConvertedToSyncBlock(select
|
|
|
41
47
|
}
|
|
42
48
|
var from = range.start;
|
|
43
49
|
var to = range.end;
|
|
50
|
+
var unsupportedNodeTypes = getUnsupportedNodeTypes();
|
|
44
51
|
var canBeConverted = true;
|
|
45
52
|
$from.doc.nodesBetween(from, to, function (node) {
|
|
46
|
-
if (
|
|
53
|
+
if (unsupportedNodeTypes.has(node.type.name)) {
|
|
47
54
|
canBeConverted = false;
|
|
48
55
|
return false;
|
|
49
56
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MemoizedFn } from 'memoize-one';
|
|
1
2
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
3
|
import type { NodeType, Node as PMNode, Schema, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
4
|
import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -16,6 +17,7 @@ export interface SyncBlockConversionInfo {
|
|
|
16
17
|
from: number;
|
|
17
18
|
to: number;
|
|
18
19
|
}
|
|
20
|
+
export declare const getUnsupportedNodeTypes: MemoizedFn<() => Set<string>>;
|
|
19
21
|
/**
|
|
20
22
|
* Checks whether the selection can be converted to sync block
|
|
21
23
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.3",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
37
37
|
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
38
38
|
"@atlaskit/editor-synced-block-provider": "^8.6.0",
|
|
39
|
-
"@atlaskit/editor-toolbar": "^2.
|
|
39
|
+
"@atlaskit/editor-toolbar": "^2.2.0",
|
|
40
40
|
"@atlaskit/flag": "^18.1.0",
|
|
41
41
|
"@atlaskit/icon": "37.0.0",
|
|
42
42
|
"@atlaskit/icon-lab": "^7.3.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/lozenge": "^14.1.0",
|
|
45
45
|
"@atlaskit/modal-dialog": "^16.1.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
47
|
-
"@atlaskit/primitives": "^20.
|
|
47
|
+
"@atlaskit/primitives": "^20.6.0",
|
|
48
48
|
"@atlaskit/spinner": "20.1.0",
|
|
49
49
|
"@atlaskit/tmp-editor-statsig": "^124.1.0",
|
|
50
50
|
"@atlaskit/tokens": "15.6.0",
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@compiled/react": "^0.20.0",
|
|
55
55
|
"bind-event-listener": "^3.0.0",
|
|
56
|
-
"date-fns": "^2.17.0"
|
|
56
|
+
"date-fns": "^2.17.0",
|
|
57
|
+
"memoize-one": "^6.0.0"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
59
60
|
"@atlaskit/editor-common": "^116.25.0",
|
|
@@ -102,6 +103,9 @@
|
|
|
102
103
|
}
|
|
103
104
|
},
|
|
104
105
|
"platform-feature-flags": {
|
|
106
|
+
"confluence_frontend_native_tabs_extension": {
|
|
107
|
+
"type": "boolean"
|
|
108
|
+
},
|
|
105
109
|
"confluence_fronend_labels_categorization_migration": {
|
|
106
110
|
"type": "boolean"
|
|
107
111
|
},
|