@atlaskit/editor-common 70.0.0 → 70.1.0
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 +6 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/editor-core-utils.js +9 -2
- package/dist/cjs/utils/index.js +6 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/editor-core-utils.js +9 -2
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/editor-core-utils.js +7 -2
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/utils/editor-core-utils.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types-ts4.0/utils/editor-core-utils.d.ts +1 -0
- package/dist/types-ts4.0/utils/index.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 70.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`74abc212007`](https://bitbucket.org/atlassian/atlassian-frontend/commits/74abc212007) - Move `setTextSelection` from `editor-core` to `editor-common`, then re-export it form `editor-core` to ensure there are no breaking changes
|
|
8
|
+
|
|
3
9
|
## 70.0.0
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -46,7 +46,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
46
46
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
47
47
|
|
|
48
48
|
var packageName = "@atlaskit/editor-common";
|
|
49
|
-
var packageVersion = "70.
|
|
49
|
+
var packageVersion = "70.1.0";
|
|
50
50
|
var halfFocusRing = 1;
|
|
51
51
|
var dropOffset = "0, ".concat((0, _constants.gridSize)(), "px");
|
|
52
52
|
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.isValidPosition = exports.isTextSelection = exports.isLastItemMediaGroup = exports.isElementInTableCell = exports.extractSliceFromStep = void 0;
|
|
7
7
|
exports.nonNullable = nonNullable;
|
|
8
8
|
exports.setNodeSelection = void 0;
|
|
9
|
+
exports.setTextSelection = setTextSelection;
|
|
9
10
|
exports.stepAddsOneOf = stepAddsOneOf;
|
|
10
11
|
exports.stepHasSlice = void 0;
|
|
11
12
|
|
|
@@ -73,8 +74,7 @@ exports.isElementInTableCell = isElementInTableCell;
|
|
|
73
74
|
var isLastItemMediaGroup = function isLastItemMediaGroup(node) {
|
|
74
75
|
var content = node.content;
|
|
75
76
|
return !!content.lastChild && content.lastChild.type.name === 'mediaGroup';
|
|
76
|
-
};
|
|
77
|
-
|
|
77
|
+
};
|
|
78
78
|
|
|
79
79
|
exports.isLastItemMediaGroup = isLastItemMediaGroup;
|
|
80
80
|
|
|
@@ -92,6 +92,13 @@ var setNodeSelection = function setNodeSelection(view, pos) {
|
|
|
92
92
|
|
|
93
93
|
exports.setNodeSelection = setNodeSelection;
|
|
94
94
|
|
|
95
|
+
function setTextSelection(view, anchor, head) {
|
|
96
|
+
var state = view.state,
|
|
97
|
+
dispatch = view.dispatch;
|
|
98
|
+
var tr = state.tr.setSelection(_prosemirrorState.TextSelection.create(state.doc, anchor, head));
|
|
99
|
+
dispatch(tr);
|
|
100
|
+
}
|
|
101
|
+
|
|
95
102
|
function nonNullable(value) {
|
|
96
103
|
return value !== null && value !== undefined;
|
|
97
104
|
} // checks if the given position is within the ProseMirror document
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -419,6 +419,12 @@ Object.defineProperty(exports, "setNodeSelection", {
|
|
|
419
419
|
return _editorCoreUtils.setNodeSelection;
|
|
420
420
|
}
|
|
421
421
|
});
|
|
422
|
+
Object.defineProperty(exports, "setTextSelection", {
|
|
423
|
+
enumerable: true,
|
|
424
|
+
get: function get() {
|
|
425
|
+
return _editorCoreUtils.setTextSelection;
|
|
426
|
+
}
|
|
427
|
+
});
|
|
422
428
|
Object.defineProperty(exports, "shouldForceTracking", {
|
|
423
429
|
enumerable: true,
|
|
424
430
|
get: function get() {
|
package/dist/cjs/version.json
CHANGED
|
@@ -10,7 +10,7 @@ import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
|
10
10
|
import { token } from '@atlaskit/tokens';
|
|
11
11
|
import Layer from '../Layer';
|
|
12
12
|
const packageName = "@atlaskit/editor-common";
|
|
13
|
-
const packageVersion = "70.
|
|
13
|
+
const packageVersion = "70.1.0";
|
|
14
14
|
const halfFocusRing = 1;
|
|
15
15
|
const dropOffset = `0, ${gridSize()}px`;
|
|
16
16
|
|
|
@@ -44,8 +44,7 @@ export const isLastItemMediaGroup = node => {
|
|
|
44
44
|
content
|
|
45
45
|
} = node;
|
|
46
46
|
return !!content.lastChild && content.lastChild.type.name === 'mediaGroup';
|
|
47
|
-
};
|
|
48
|
-
|
|
47
|
+
};
|
|
49
48
|
export const setNodeSelection = (view, pos) => {
|
|
50
49
|
const {
|
|
51
50
|
state,
|
|
@@ -59,6 +58,14 @@ export const setNodeSelection = (view, pos) => {
|
|
|
59
58
|
const tr = state.tr.setSelection(NodeSelection.create(state.doc, pos));
|
|
60
59
|
dispatch(tr);
|
|
61
60
|
};
|
|
61
|
+
export function setTextSelection(view, anchor, head) {
|
|
62
|
+
const {
|
|
63
|
+
state,
|
|
64
|
+
dispatch
|
|
65
|
+
} = view;
|
|
66
|
+
const tr = state.tr.setSelection(TextSelection.create(state.doc, anchor, head));
|
|
67
|
+
dispatch(tr);
|
|
68
|
+
}
|
|
62
69
|
export function nonNullable(value) {
|
|
63
70
|
return value !== null && value !== undefined;
|
|
64
71
|
} // checks if the given position is within the ProseMirror document
|
|
@@ -3,7 +3,7 @@ export { getExtensionLozengeData } from './macro';
|
|
|
3
3
|
export { default as browser } from './browser';
|
|
4
4
|
export { default as ErrorReporter } from './error-reporter';
|
|
5
5
|
export { isPastDate, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC } from './date';
|
|
6
|
-
export { isElementInTableCell, isTextSelection, isLastItemMediaGroup, setNodeSelection, nonNullable, stepAddsOneOf, stepHasSlice, extractSliceFromStep, isValidPosition } from './editor-core-utils';
|
|
6
|
+
export { isElementInTableCell, isTextSelection, isLastItemMediaGroup, setNodeSelection, setTextSelection, nonNullable, stepAddsOneOf, stepHasSlice, extractSliceFromStep, isValidPosition } from './editor-core-utils';
|
|
7
7
|
export { withImageLoader } from './imageLoader';
|
|
8
8
|
export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts } from './breakout';
|
|
9
9
|
export { findChangedNodesFromTransaction, validNode, validateNodes, isType, isParagraph, isText, isLinkMark, SelectedState, isNodeSelectedOrInRange, isSupportedInParent } from './nodes';
|
package/dist/es2019/version.json
CHANGED
|
@@ -23,7 +23,7 @@ import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
|
23
23
|
import { token } from '@atlaskit/tokens';
|
|
24
24
|
import Layer from '../Layer';
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "70.
|
|
26
|
+
var packageVersion = "70.1.0";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = "0, ".concat(gridSize(), "px");
|
|
29
29
|
|
|
@@ -46,8 +46,7 @@ export var isElementInTableCell = function isElementInTableCell(element) {
|
|
|
46
46
|
export var isLastItemMediaGroup = function isLastItemMediaGroup(node) {
|
|
47
47
|
var content = node.content;
|
|
48
48
|
return !!content.lastChild && content.lastChild.type.name === 'mediaGroup';
|
|
49
|
-
};
|
|
50
|
-
|
|
49
|
+
};
|
|
51
50
|
export var setNodeSelection = function setNodeSelection(view, pos) {
|
|
52
51
|
var state = view.state,
|
|
53
52
|
dispatch = view.dispatch;
|
|
@@ -59,6 +58,12 @@ export var setNodeSelection = function setNodeSelection(view, pos) {
|
|
|
59
58
|
var tr = state.tr.setSelection(NodeSelection.create(state.doc, pos));
|
|
60
59
|
dispatch(tr);
|
|
61
60
|
};
|
|
61
|
+
export function setTextSelection(view, anchor, head) {
|
|
62
|
+
var state = view.state,
|
|
63
|
+
dispatch = view.dispatch;
|
|
64
|
+
var tr = state.tr.setSelection(TextSelection.create(state.doc, anchor, head));
|
|
65
|
+
dispatch(tr);
|
|
66
|
+
}
|
|
62
67
|
export function nonNullable(value) {
|
|
63
68
|
return value !== null && value !== undefined;
|
|
64
69
|
} // checks if the given position is within the ProseMirror document
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export { getExtensionLozengeData } from './macro';
|
|
|
3
3
|
export { default as browser } from './browser';
|
|
4
4
|
export { default as ErrorReporter } from './error-reporter';
|
|
5
5
|
export { isPastDate, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC } from './date';
|
|
6
|
-
export { isElementInTableCell, isTextSelection, isLastItemMediaGroup, setNodeSelection, nonNullable, stepAddsOneOf, stepHasSlice, extractSliceFromStep, isValidPosition } from './editor-core-utils';
|
|
6
|
+
export { isElementInTableCell, isTextSelection, isLastItemMediaGroup, setNodeSelection, setTextSelection, nonNullable, stepAddsOneOf, stepHasSlice, extractSliceFromStep, isValidPosition } from './editor-core-utils';
|
|
7
7
|
export { withImageLoader } from './imageLoader';
|
|
8
8
|
export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts } from './breakout';
|
|
9
9
|
export { findChangedNodesFromTransaction, validNode, validateNodes, isType, isParagraph, isText, isLinkMark, SelectedState, isNodeSelectedOrInRange, isSupportedInParent } from './nodes';
|
package/dist/esm/version.json
CHANGED
|
@@ -19,5 +19,6 @@ export declare const isTextSelection: (selection: Selection) => selection is Tex
|
|
|
19
19
|
export declare const isElementInTableCell: (element: HTMLElement | null) => HTMLElement | null;
|
|
20
20
|
export declare const isLastItemMediaGroup: (node: Node) => boolean;
|
|
21
21
|
export declare const setNodeSelection: (view: EditorView, pos: number) => void;
|
|
22
|
+
export declare function setTextSelection(view: EditorView, anchor: number, head?: number): void;
|
|
22
23
|
export declare function nonNullable<T>(value: T): value is NonNullable<T>;
|
|
23
24
|
export declare const isValidPosition: (pos: number, state: EditorState) => boolean;
|
|
@@ -6,7 +6,7 @@ export { default as ErrorReporter } from './error-reporter';
|
|
|
6
6
|
export type { ErrorReportingHandler } from './error-reporter';
|
|
7
7
|
export { isPastDate, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC, } from './date';
|
|
8
8
|
export type { Date } from './date';
|
|
9
|
-
export { isElementInTableCell, isTextSelection, isLastItemMediaGroup, setNodeSelection, nonNullable, stepAddsOneOf, stepHasSlice, extractSliceFromStep, isValidPosition, } from './editor-core-utils';
|
|
9
|
+
export { isElementInTableCell, isTextSelection, isLastItemMediaGroup, setNodeSelection, setTextSelection, nonNullable, stepAddsOneOf, stepHasSlice, extractSliceFromStep, isValidPosition, } from './editor-core-utils';
|
|
10
10
|
export { withImageLoader } from './imageLoader';
|
|
11
11
|
export type { ImageLoaderProps, ImageLoaderState, ImageStatus, } from './imageLoader';
|
|
12
12
|
export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts, } from './breakout';
|
|
@@ -19,5 +19,6 @@ export declare const isTextSelection: (selection: Selection) => selection is Tex
|
|
|
19
19
|
export declare const isElementInTableCell: (element: HTMLElement | null) => HTMLElement | null;
|
|
20
20
|
export declare const isLastItemMediaGroup: (node: Node) => boolean;
|
|
21
21
|
export declare const setNodeSelection: (view: EditorView, pos: number) => void;
|
|
22
|
+
export declare function setTextSelection(view: EditorView, anchor: number, head?: number): void;
|
|
22
23
|
export declare function nonNullable<T>(value: T): value is NonNullable<T>;
|
|
23
24
|
export declare const isValidPosition: (pos: number, state: EditorState) => boolean;
|
|
@@ -6,7 +6,7 @@ export { default as ErrorReporter } from './error-reporter';
|
|
|
6
6
|
export type { ErrorReportingHandler } from './error-reporter';
|
|
7
7
|
export { isPastDate, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC, } from './date';
|
|
8
8
|
export type { Date } from './date';
|
|
9
|
-
export { isElementInTableCell, isTextSelection, isLastItemMediaGroup, setNodeSelection, nonNullable, stepAddsOneOf, stepHasSlice, extractSliceFromStep, isValidPosition, } from './editor-core-utils';
|
|
9
|
+
export { isElementInTableCell, isTextSelection, isLastItemMediaGroup, setNodeSelection, setTextSelection, nonNullable, stepAddsOneOf, stepHasSlice, extractSliceFromStep, isValidPosition, } from './editor-core-utils';
|
|
10
10
|
export { withImageLoader } from './imageLoader';
|
|
11
11
|
export type { ImageLoaderProps, ImageLoaderState, ImageStatus, } from './imageLoader';
|
|
12
12
|
export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts, } from './breakout';
|
package/package.json
CHANGED