@atlaskit/editor-plugin-selection 12.0.24 → 12.0.25
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,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection
|
|
2
2
|
|
|
3
|
+
## 12.0.25
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`506c2f6fd3044`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/506c2f6fd3044) -
|
|
8
|
+
Update getSelectionFragment to correctly pass selection (if any) and set selection in tr for
|
|
9
|
+
highlight
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 12.0.24
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -6,16 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getSelectionLocalIds = exports.getSelectionFragment = void 0;
|
|
7
7
|
var _selection2 = require("@atlaskit/editor-common/selection");
|
|
8
8
|
var getSelectionFragment = exports.getSelectionFragment = function getSelectionFragment(api) {
|
|
9
|
-
return function () {
|
|
10
|
-
var _api$selection$shared;
|
|
11
|
-
var selection = api === null || api === void 0 || (_api$selection$shared = api.selection.sharedState) === null || _api$selection$shared === void 0 || (_api$selection$shared = _api$selection$shared.currentState()) === null || _api$selection$shared === void 0 ? void 0 : _api$selection$shared.selection;
|
|
9
|
+
return function (props) {
|
|
10
|
+
var _props$selection, _api$selection$shared;
|
|
11
|
+
var selection = (_props$selection = props === null || props === void 0 ? void 0 : props.selection) !== null && _props$selection !== void 0 ? _props$selection : api === null || api === void 0 || (_api$selection$shared = api.selection.sharedState) === null || _api$selection$shared === void 0 || (_api$selection$shared = _api$selection$shared.currentState()) === null || _api$selection$shared === void 0 ? void 0 : _api$selection$shared.selection;
|
|
12
12
|
return (0, _selection2.getFragmentsFromSelection)(selection);
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
var getSelectionLocalIds = exports.getSelectionLocalIds = function getSelectionLocalIds(api) {
|
|
16
|
-
return function () {
|
|
17
|
-
var _api$selection$shared2, _selection;
|
|
18
|
-
var selection = api === null || api === void 0 || (_api$selection$shared2 = api.selection.sharedState) === null || _api$selection$shared2 === void 0 || (_api$selection$shared2 = _api$selection$shared2.currentState()) === null || _api$selection$shared2 === void 0 ? void 0 : _api$selection$shared2.selection;
|
|
16
|
+
return function (props) {
|
|
17
|
+
var _props$selection2, _api$selection$shared2, _selection;
|
|
18
|
+
var selection = (_props$selection2 = props === null || props === void 0 ? void 0 : props.selection) !== null && _props$selection2 !== void 0 ? _props$selection2 : api === null || api === void 0 || (_api$selection$shared2 = api.selection.sharedState) === null || _api$selection$shared2 === void 0 || (_api$selection$shared2 = _api$selection$shared2.currentState()) === null || _api$selection$shared2 === void 0 ? void 0 : _api$selection$shared2.selection;
|
|
19
19
|
if ((_selection = selection) !== null && _selection !== void 0 && _selection.empty) {
|
|
20
20
|
// If we have an empty selection the current state might not be correct
|
|
21
21
|
// We have a hack here to retrieve the current selection - but not dispatch a transaction
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { getFragmentsFromSelection, getLocalIdsFromSelection } from '@atlaskit/editor-common/selection';
|
|
2
|
-
export const getSelectionFragment = api =>
|
|
3
|
-
var _api$selection$shared, _api$selection$shared2;
|
|
4
|
-
const selection = api === null || api === void 0 ? void 0 : (_api$selection$shared = api.selection.sharedState) === null || _api$selection$shared === void 0 ? void 0 : (_api$selection$shared2 = _api$selection$shared.currentState()) === null || _api$selection$shared2 === void 0 ? void 0 : _api$selection$shared2.selection;
|
|
2
|
+
export const getSelectionFragment = api => props => {
|
|
3
|
+
var _props$selection, _api$selection$shared, _api$selection$shared2;
|
|
4
|
+
const selection = (_props$selection = props === null || props === void 0 ? void 0 : props.selection) !== null && _props$selection !== void 0 ? _props$selection : api === null || api === void 0 ? void 0 : (_api$selection$shared = api.selection.sharedState) === null || _api$selection$shared === void 0 ? void 0 : (_api$selection$shared2 = _api$selection$shared.currentState()) === null || _api$selection$shared2 === void 0 ? void 0 : _api$selection$shared2.selection;
|
|
5
5
|
return getFragmentsFromSelection(selection);
|
|
6
6
|
};
|
|
7
|
-
export const getSelectionLocalIds = api =>
|
|
8
|
-
var _api$selection$shared3, _api$selection$shared4, _selection;
|
|
9
|
-
let selection = api === null || api === void 0 ? void 0 : (_api$selection$shared3 = api.selection.sharedState) === null || _api$selection$shared3 === void 0 ? void 0 : (_api$selection$shared4 = _api$selection$shared3.currentState()) === null || _api$selection$shared4 === void 0 ? void 0 : _api$selection$shared4.selection;
|
|
7
|
+
export const getSelectionLocalIds = api => props => {
|
|
8
|
+
var _props$selection2, _api$selection$shared3, _api$selection$shared4, _selection;
|
|
9
|
+
let selection = (_props$selection2 = props === null || props === void 0 ? void 0 : props.selection) !== null && _props$selection2 !== void 0 ? _props$selection2 : api === null || api === void 0 ? void 0 : (_api$selection$shared3 = api.selection.sharedState) === null || _api$selection$shared3 === void 0 ? void 0 : (_api$selection$shared4 = _api$selection$shared3.currentState()) === null || _api$selection$shared4 === void 0 ? void 0 : _api$selection$shared4.selection;
|
|
10
10
|
if ((_selection = selection) !== null && _selection !== void 0 && _selection.empty) {
|
|
11
11
|
// If we have an empty selection the current state might not be correct
|
|
12
12
|
// We have a hack here to retrieve the current selection - but not dispatch a transaction
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { getFragmentsFromSelection, getLocalIdsFromSelection } from '@atlaskit/editor-common/selection';
|
|
2
2
|
export var getSelectionFragment = function getSelectionFragment(api) {
|
|
3
|
-
return function () {
|
|
4
|
-
var _api$selection$shared;
|
|
5
|
-
var selection = api === null || api === void 0 || (_api$selection$shared = api.selection.sharedState) === null || _api$selection$shared === void 0 || (_api$selection$shared = _api$selection$shared.currentState()) === null || _api$selection$shared === void 0 ? void 0 : _api$selection$shared.selection;
|
|
3
|
+
return function (props) {
|
|
4
|
+
var _props$selection, _api$selection$shared;
|
|
5
|
+
var selection = (_props$selection = props === null || props === void 0 ? void 0 : props.selection) !== null && _props$selection !== void 0 ? _props$selection : api === null || api === void 0 || (_api$selection$shared = api.selection.sharedState) === null || _api$selection$shared === void 0 || (_api$selection$shared = _api$selection$shared.currentState()) === null || _api$selection$shared === void 0 ? void 0 : _api$selection$shared.selection;
|
|
6
6
|
return getFragmentsFromSelection(selection);
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
9
|
export var getSelectionLocalIds = function getSelectionLocalIds(api) {
|
|
10
|
-
return function () {
|
|
11
|
-
var _api$selection$shared2, _selection;
|
|
12
|
-
var selection = api === null || api === void 0 || (_api$selection$shared2 = api.selection.sharedState) === null || _api$selection$shared2 === void 0 || (_api$selection$shared2 = _api$selection$shared2.currentState()) === null || _api$selection$shared2 === void 0 ? void 0 : _api$selection$shared2.selection;
|
|
10
|
+
return function (props) {
|
|
11
|
+
var _props$selection2, _api$selection$shared2, _selection;
|
|
12
|
+
var selection = (_props$selection2 = props === null || props === void 0 ? void 0 : props.selection) !== null && _props$selection2 !== void 0 ? _props$selection2 : api === null || api === void 0 || (_api$selection$shared2 = api.selection.sharedState) === null || _api$selection$shared2 === void 0 || (_api$selection$shared2 = _api$selection$shared2.currentState()) === null || _api$selection$shared2 === void 0 ? void 0 : _api$selection$shared2.selection;
|
|
13
13
|
if ((_selection = selection) !== null && _selection !== void 0 && _selection.empty) {
|
|
14
14
|
// If we have an empty selection the current state might not be correct
|
|
15
15
|
// We have a hack here to retrieve the current selection - but not dispatch a transaction
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { JSONNode } from '@atlaskit/editor-json-transformer';
|
|
3
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
import type { SelectionPlugin } from '../selectionPluginType';
|
|
4
|
-
export declare const getSelectionFragment: (api: ExtractInjectionAPI<SelectionPlugin> | undefined) => (
|
|
5
|
-
|
|
5
|
+
export declare const getSelectionFragment: (api: ExtractInjectionAPI<SelectionPlugin> | undefined) => (props?: {
|
|
6
|
+
selection?: Selection;
|
|
7
|
+
}) => JSONNode[] | null;
|
|
8
|
+
export declare const getSelectionLocalIds: (api?: ExtractInjectionAPI<SelectionPlugin>) => (props?: {
|
|
9
|
+
selection?: Selection;
|
|
10
|
+
}) => string[] | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.25",
|
|
4
4
|
"description": "Selection plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
25
25
|
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
26
26
|
"@atlaskit/editor-tables": "^3.0.0",
|
|
27
|
-
"@atlaskit/tmp-editor-statsig": "^126.
|
|
27
|
+
"@atlaskit/tmp-editor-statsig": "^126.2.0",
|
|
28
28
|
"@atlaskit/tokens": "^16.0.0",
|
|
29
29
|
"@babel/runtime": "^7.0.0"
|
|
30
30
|
},
|