@atlaskit/editor-common 74.8.0 → 74.9.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 +17 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +3 -1
- package/dist/cjs/selection-based-node-view/SelectionBasedNodeView.js +5 -2
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui-menu/DropdownMenu/index.js +12 -1
- package/dist/cjs/utils/editor-core-utils.js +3 -0
- package/dist/cjs/utils/nodes.js +3 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +3 -1
- package/dist/es2019/selection-based-node-view/SelectionBasedNodeView.js +5 -2
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui-menu/DropdownMenu/index.js +12 -1
- package/dist/es2019/utils/editor-core-utils.js +3 -0
- package/dist/es2019/utils/nodes.js +3 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +3 -1
- package/dist/esm/selection-based-node-view/SelectionBasedNodeView.js +5 -2
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui-menu/DropdownMenu/index.js +12 -1
- package/dist/esm/utils/editor-core-utils.js +3 -0
- package/dist/esm/utils/nodes.js +3 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/react-node-view/getInlineNodeViewProducer.d.ts +4 -9
- package/dist/types/react-node-view/types.d.ts +1 -1
- package/dist/types/types/editor-plugin.d.ts +1 -1
- package/dist/types/utils/editor-core-utils.d.ts +1 -1
- package/dist/types/utils/nodes.d.ts +1 -1
- package/dist/types-ts4.5/react-node-view/getInlineNodeViewProducer.d.ts +4 -9
- package/dist/types-ts4.5/react-node-view/types.d.ts +1 -1
- package/dist/types-ts4.5/types/editor-plugin.d.ts +1 -1
- package/dist/types-ts4.5/utils/editor-core-utils.d.ts +1 -1
- package/dist/types-ts4.5/utils/nodes.d.ts +1 -1
- package/package.json +13 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 74.9.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`18344c31ea3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/18344c31ea3) - [ED-13910] Fix EditorView getPos type
|
|
8
|
+
|
|
9
|
+
## 74.9.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`4bf22e4eb1c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4bf22e4eb1c) - The editor dropdown menu items are now forced to be `position: static` when a feature flag is on to work around menu items being position relative now. This is a short term fix to keep the table cell color nested menu working.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`73b5128036b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73b5128036b) - [ED-17082] Mark package as a singleton one
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 74.8.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "74.
|
|
19
|
+
var packageVersion = "74.9.1";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -178,7 +178,9 @@ function getPortalChildren(_ref2) {
|
|
|
178
178
|
}, (0, _react2.jsx)("span", {
|
|
179
179
|
className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
|
|
180
180
|
}), _utils.ZERO_WIDTH_SPACE), (0, _react2.jsx)(Component, (0, _extends2.default)({
|
|
181
|
-
view: nodeViewParams.view
|
|
181
|
+
view: nodeViewParams.view
|
|
182
|
+
// TODO: ED-13910 - Remove the boolean to fix the prosemirror view type
|
|
183
|
+
,
|
|
182
184
|
getPos: nodeViewParams.getPos,
|
|
183
185
|
node: currentNode
|
|
184
186
|
}, extraComponentProps)), (0, _react2.jsx)("span", {
|
|
@@ -95,8 +95,11 @@ var SelectionBasedNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
95
95
|
if (typeof this.getPos === 'boolean') {
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
var pos = this.getPos();
|
|
99
|
+
if (typeof pos === 'number') {
|
|
100
|
+
this.pos = pos;
|
|
101
|
+
this.posEnd = pos + this.node.nodeSize;
|
|
102
|
+
}
|
|
100
103
|
}
|
|
101
104
|
}, {
|
|
102
105
|
key: "getPositionsWithDefault",
|
|
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
24
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
25
|
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; } } /** @jsx jsx */
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "74.
|
|
27
|
+
var packageVersion = "74.9.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -21,6 +21,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
21
21
|
var _react2 = require("@emotion/react");
|
|
22
22
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
23
23
|
var _menu = require("@atlaskit/menu");
|
|
24
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
24
25
|
var _colors = require("@atlaskit/theme/colors");
|
|
25
26
|
var _components = require("@atlaskit/theme/components");
|
|
26
27
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
@@ -239,7 +240,17 @@ var DropdownMenuItemCustomComponent = /*#__PURE__*/_react.default.forwardRef(fun
|
|
|
239
240
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
240
241
|
return (0, _react2.jsx)("span", (0, _extends2.default)({
|
|
241
242
|
ref: ref
|
|
242
|
-
}, rest
|
|
243
|
+
}, rest, {
|
|
244
|
+
style: {
|
|
245
|
+
// This forces the item container back to be `position: static`, the default value.
|
|
246
|
+
// This ensures the custom nested menu for table color picker still works as now
|
|
247
|
+
// menu items from @atlaskit/menu all have `position: relative` set for the selected borders.
|
|
248
|
+
// The current implementation unfortunately is very brittle. Design System Team will
|
|
249
|
+
// be prioritizing official support for accessible nested menus that we want you to move
|
|
250
|
+
// to in the future.
|
|
251
|
+
position: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.menu-selected-state-change_0see9') ? 'static' : undefined
|
|
252
|
+
}
|
|
253
|
+
}), children);
|
|
243
254
|
});
|
|
244
255
|
function DropdownMenuItem(_ref) {
|
|
245
256
|
var _item$key2;
|
|
@@ -91,6 +91,9 @@ function nonNullable(value) {
|
|
|
91
91
|
|
|
92
92
|
// checks if the given position is within the ProseMirror document
|
|
93
93
|
var isValidPosition = function isValidPosition(pos, state) {
|
|
94
|
+
if (typeof pos !== 'number') {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
94
97
|
if (pos >= 0 && pos <= state.doc.resolve(0).end()) {
|
|
95
98
|
return true;
|
|
96
99
|
}
|
package/dist/cjs/utils/nodes.js
CHANGED
|
@@ -79,6 +79,9 @@ var SelectedState = /*#__PURE__*/function (SelectedState) {
|
|
|
79
79
|
*/
|
|
80
80
|
exports.SelectedState = SelectedState;
|
|
81
81
|
var isNodeSelectedOrInRange = function isNodeSelectedOrInRange(anchorPosition, headPosition, nodePosition, nodeSize) {
|
|
82
|
+
if (typeof nodePosition !== 'number') {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
82
85
|
var rangeStart = Math.min(anchorPosition, headPosition);
|
|
83
86
|
var rangeEnd = Math.max(anchorPosition, headPosition);
|
|
84
87
|
var nodeStart = nodePosition;
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "74.
|
|
3
|
+
const packageVersion = "74.9.1";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -171,7 +171,9 @@ function getPortalChildren({
|
|
|
171
171
|
}, jsx("span", {
|
|
172
172
|
className: `${inlineNodeViewClassname}AddZeroWidthSpace`
|
|
173
173
|
}), ZERO_WIDTH_SPACE), jsx(Component, _extends({
|
|
174
|
-
view: nodeViewParams.view
|
|
174
|
+
view: nodeViewParams.view
|
|
175
|
+
// TODO: ED-13910 - Remove the boolean to fix the prosemirror view type
|
|
176
|
+
,
|
|
175
177
|
getPos: nodeViewParams.getPos,
|
|
176
178
|
node: currentNode
|
|
177
179
|
}, extraComponentProps)), jsx("span", {
|
|
@@ -80,8 +80,11 @@ export class SelectionBasedNodeView extends ReactNodeView {
|
|
|
80
80
|
if (typeof this.getPos === 'boolean') {
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
const pos = this.getPos();
|
|
84
|
+
if (typeof pos === 'number') {
|
|
85
|
+
this.pos = pos;
|
|
86
|
+
this.posEnd = pos + this.node.nodeSize;
|
|
87
|
+
}
|
|
85
88
|
}
|
|
86
89
|
getPositionsWithDefault(pos, posEnd) {
|
|
87
90
|
return {
|
|
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
8
8
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
9
9
|
import Layer from '../Layer';
|
|
10
10
|
const packageName = "@atlaskit/editor-common";
|
|
11
|
-
const packageVersion = "74.
|
|
11
|
+
const packageVersion = "74.9.1";
|
|
12
12
|
const halfFocusRing = 1;
|
|
13
13
|
const dropOffset = '0, 8';
|
|
14
14
|
class DropList extends Component {
|
|
@@ -5,6 +5,7 @@ import React, { PureComponent } from 'react';
|
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { CustomItem, MenuGroup } from '@atlaskit/menu';
|
|
8
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { B100, DN600, DN80, N70, N900 } from '@atlaskit/theme/colors';
|
|
9
10
|
import { themed } from '@atlaskit/theme/components';
|
|
10
11
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -241,7 +242,17 @@ const DropdownMenuItemCustomComponent = /*#__PURE__*/React.forwardRef((props, re
|
|
|
241
242
|
} = props;
|
|
242
243
|
return jsx("span", _extends({
|
|
243
244
|
ref: ref
|
|
244
|
-
}, rest
|
|
245
|
+
}, rest, {
|
|
246
|
+
style: {
|
|
247
|
+
// This forces the item container back to be `position: static`, the default value.
|
|
248
|
+
// This ensures the custom nested menu for table color picker still works as now
|
|
249
|
+
// menu items from @atlaskit/menu all have `position: relative` set for the selected borders.
|
|
250
|
+
// The current implementation unfortunately is very brittle. Design System Team will
|
|
251
|
+
// be prioritizing official support for accessible nested menus that we want you to move
|
|
252
|
+
// to in the future.
|
|
253
|
+
position: getBooleanFF('platform.design-system-team.menu-selected-state-change_0see9') ? 'static' : undefined
|
|
254
|
+
}
|
|
255
|
+
}), children);
|
|
245
256
|
});
|
|
246
257
|
function DropdownMenuItem({
|
|
247
258
|
item,
|
|
@@ -75,6 +75,9 @@ export function nonNullable(value) {
|
|
|
75
75
|
|
|
76
76
|
// checks if the given position is within the ProseMirror document
|
|
77
77
|
export const isValidPosition = (pos, state) => {
|
|
78
|
+
if (typeof pos !== 'number') {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
78
81
|
if (pos >= 0 && pos <= state.doc.resolve(0).end()) {
|
|
79
82
|
return true;
|
|
80
83
|
}
|
|
@@ -53,6 +53,9 @@ export let SelectedState = /*#__PURE__*/function (SelectedState) {
|
|
|
53
53
|
* is fully selected by a range or if the "inside" of the node has been selected or clicked.
|
|
54
54
|
*/
|
|
55
55
|
export const isNodeSelectedOrInRange = (anchorPosition, headPosition, nodePosition, nodeSize) => {
|
|
56
|
+
if (typeof nodePosition !== 'number') {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
56
59
|
const rangeStart = Math.min(anchorPosition, headPosition);
|
|
57
60
|
const rangeEnd = Math.max(anchorPosition, headPosition);
|
|
58
61
|
const nodeStart = nodePosition;
|
package/dist/es2019/version.json
CHANGED
|
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "74.
|
|
9
|
+
var packageVersion = "74.9.1";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -168,7 +168,9 @@ function getPortalChildren(_ref2) {
|
|
|
168
168
|
}, jsx("span", {
|
|
169
169
|
className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
|
|
170
170
|
}), ZERO_WIDTH_SPACE), jsx(Component, _extends({
|
|
171
|
-
view: nodeViewParams.view
|
|
171
|
+
view: nodeViewParams.view
|
|
172
|
+
// TODO: ED-13910 - Remove the boolean to fix the prosemirror view type
|
|
173
|
+
,
|
|
172
174
|
getPos: nodeViewParams.getPos,
|
|
173
175
|
node: currentNode
|
|
174
176
|
}, extraComponentProps)), jsx("span", {
|
|
@@ -89,8 +89,11 @@ export var SelectionBasedNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
89
89
|
if (typeof this.getPos === 'boolean') {
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
var pos = this.getPos();
|
|
93
|
+
if (typeof pos === 'number') {
|
|
94
|
+
this.pos = pos;
|
|
95
|
+
this.posEnd = pos + this.node.nodeSize;
|
|
96
|
+
}
|
|
94
97
|
}
|
|
95
98
|
}, {
|
|
96
99
|
key: "getPositionsWithDefault",
|
|
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
18
18
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
19
19
|
import Layer from '../Layer';
|
|
20
20
|
var packageName = "@atlaskit/editor-common";
|
|
21
|
-
var packageVersion = "74.
|
|
21
|
+
var packageVersion = "74.9.1";
|
|
22
22
|
var halfFocusRing = 1;
|
|
23
23
|
var dropOffset = '0, 8';
|
|
24
24
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -20,6 +20,7 @@ import React, { PureComponent } from 'react';
|
|
|
20
20
|
import { css, jsx } from '@emotion/react';
|
|
21
21
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
22
22
|
import { CustomItem, MenuGroup } from '@atlaskit/menu';
|
|
23
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
23
24
|
import { B100, DN600, DN80, N70, N900 } from '@atlaskit/theme/colors';
|
|
24
25
|
import { themed } from '@atlaskit/theme/components';
|
|
25
26
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -229,7 +230,17 @@ var DropdownMenuItemCustomComponent = /*#__PURE__*/React.forwardRef(function (pr
|
|
|
229
230
|
rest = _objectWithoutProperties(props, _excluded);
|
|
230
231
|
return jsx("span", _extends({
|
|
231
232
|
ref: ref
|
|
232
|
-
}, rest
|
|
233
|
+
}, rest, {
|
|
234
|
+
style: {
|
|
235
|
+
// This forces the item container back to be `position: static`, the default value.
|
|
236
|
+
// This ensures the custom nested menu for table color picker still works as now
|
|
237
|
+
// menu items from @atlaskit/menu all have `position: relative` set for the selected borders.
|
|
238
|
+
// The current implementation unfortunately is very brittle. Design System Team will
|
|
239
|
+
// be prioritizing official support for accessible nested menus that we want you to move
|
|
240
|
+
// to in the future.
|
|
241
|
+
position: getBooleanFF('platform.design-system-team.menu-selected-state-change_0see9') ? 'static' : undefined
|
|
242
|
+
}
|
|
243
|
+
}), children);
|
|
233
244
|
});
|
|
234
245
|
function DropdownMenuItem(_ref) {
|
|
235
246
|
var _item$key2;
|
|
@@ -73,6 +73,9 @@ export function nonNullable(value) {
|
|
|
73
73
|
|
|
74
74
|
// checks if the given position is within the ProseMirror document
|
|
75
75
|
export var isValidPosition = function isValidPosition(pos, state) {
|
|
76
|
+
if (typeof pos !== 'number') {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
76
79
|
if (pos >= 0 && pos <= state.doc.resolve(0).end()) {
|
|
77
80
|
return true;
|
|
78
81
|
}
|
package/dist/esm/utils/nodes.js
CHANGED
|
@@ -66,6 +66,9 @@ export var SelectedState = /*#__PURE__*/function (SelectedState) {
|
|
|
66
66
|
* is fully selected by a range or if the "inside" of the node has been selected or clicked.
|
|
67
67
|
*/
|
|
68
68
|
export var isNodeSelectedOrInRange = function isNodeSelectedOrInRange(anchorPosition, headPosition, nodePosition, nodeSize) {
|
|
69
|
+
if (typeof nodePosition !== 'number') {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
69
72
|
var rangeStart = Math.min(anchorPosition, headPosition);
|
|
70
73
|
var rangeEnd = Math.max(anchorPosition, headPosition);
|
|
71
74
|
var nodeStart = nodePosition;
|
package/dist/esm/version.json
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Node as PMNode } from 'prosemirror-model';
|
|
4
|
-
import {
|
|
4
|
+
import { Decoration, EditorView, NodeView } from 'prosemirror-view';
|
|
5
5
|
import type { PMPluginFactoryParams } from '../types';
|
|
6
6
|
export type InlineNodeViewComponentProps = {
|
|
7
7
|
view: EditorView;
|
|
8
|
-
getPos:
|
|
8
|
+
getPos: () => GetPosReturn;
|
|
9
9
|
node: PMNode;
|
|
10
10
|
};
|
|
11
11
|
type InlineNodeViewComponent<ExtraComponentProps> = React.ComponentType<InlineNodeViewComponentProps & ExtraComponentProps>;
|
|
12
12
|
export declare const inlineNodeViewClassname = "inlineNodeView";
|
|
13
|
-
type NodeViewProducer =
|
|
14
|
-
type
|
|
15
|
-
node: Parameters<NodeViewProducer>[0];
|
|
16
|
-
view: Parameters<NodeViewProducer>[1];
|
|
17
|
-
getPos: Parameters<NodeViewProducer>[2];
|
|
18
|
-
decorations: Parameters<NodeViewProducer>[3];
|
|
19
|
-
};
|
|
13
|
+
type NodeViewProducer = (node: PMNode, view: EditorView, getPos: (() => GetPosReturn) | boolean, decorations: Decoration[]) => NodeView;
|
|
14
|
+
type GetPosReturn = number | undefined;
|
|
20
15
|
export declare function getInlineNodeViewProducer<ExtraComponentProps>({ pmPluginFactoryParams, Component, extraComponentProps, }: {
|
|
21
16
|
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
22
17
|
Component: InlineNodeViewComponent<ExtraComponentProps>;
|
|
@@ -4,7 +4,7 @@ export interface ReactNodeProps {
|
|
|
4
4
|
}
|
|
5
5
|
export type ProsemirrorGetPosHandler = () => number;
|
|
6
6
|
export type getPosHandler = getPosHandlerNode | boolean;
|
|
7
|
-
export type getPosHandlerNode = () => number;
|
|
7
|
+
export type getPosHandlerNode = () => number | undefined;
|
|
8
8
|
export type ReactComponentProps = {
|
|
9
9
|
[key: string]: unknown;
|
|
10
10
|
};
|
|
@@ -88,5 +88,5 @@ export interface EditorPlugin {
|
|
|
88
88
|
onEditorViewStateUpdated?: (props: EditorViewStateUpdatedCallbackProps) => void;
|
|
89
89
|
}
|
|
90
90
|
export type getPosHandler = getPosHandlerNode | boolean;
|
|
91
|
-
export type getPosHandlerNode = () => number;
|
|
91
|
+
export type getPosHandlerNode = () => number | undefined;
|
|
92
92
|
export {};
|
|
@@ -25,5 +25,5 @@ export declare const isLastItemMediaGroup: (node: Node) => boolean;
|
|
|
25
25
|
export declare const setNodeSelection: (view: EditorView, pos: number) => void;
|
|
26
26
|
export declare function setTextSelection(view: EditorView, anchor: number, head?: number): void;
|
|
27
27
|
export declare function nonNullable<T>(value: T): value is NonNullable<T>;
|
|
28
|
-
export declare const isValidPosition: (pos: number, state: EditorState) => boolean;
|
|
28
|
+
export declare const isValidPosition: (pos: number | undefined, state: EditorState) => boolean;
|
|
29
29
|
export declare const isInLayoutColumn: (state: EditorState) => boolean;
|
|
@@ -25,7 +25,7 @@ export declare enum SelectedState {
|
|
|
25
25
|
* If the node is selected then an enum is returned that describes weather the node
|
|
26
26
|
* is fully selected by a range or if the "inside" of the node has been selected or clicked.
|
|
27
27
|
*/
|
|
28
|
-
export declare const isNodeSelectedOrInRange: (anchorPosition: number, headPosition: number, nodePosition: number, nodeSize: number) => SelectedState | null;
|
|
28
|
+
export declare const isNodeSelectedOrInRange: (anchorPosition: number, headPosition: number, nodePosition: number | undefined, nodeSize: number) => SelectedState | null;
|
|
29
29
|
/**
|
|
30
30
|
* Checks if a particular node fragment is supported in the parent
|
|
31
31
|
* @param state EditorState
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Node as PMNode } from 'prosemirror-model';
|
|
4
|
-
import {
|
|
4
|
+
import { Decoration, EditorView, NodeView } from 'prosemirror-view';
|
|
5
5
|
import type { PMPluginFactoryParams } from '../types';
|
|
6
6
|
export type InlineNodeViewComponentProps = {
|
|
7
7
|
view: EditorView;
|
|
8
|
-
getPos:
|
|
8
|
+
getPos: () => GetPosReturn;
|
|
9
9
|
node: PMNode;
|
|
10
10
|
};
|
|
11
11
|
type InlineNodeViewComponent<ExtraComponentProps> = React.ComponentType<InlineNodeViewComponentProps & ExtraComponentProps>;
|
|
12
12
|
export declare const inlineNodeViewClassname = "inlineNodeView";
|
|
13
|
-
type NodeViewProducer =
|
|
14
|
-
type
|
|
15
|
-
node: Parameters<NodeViewProducer>[0];
|
|
16
|
-
view: Parameters<NodeViewProducer>[1];
|
|
17
|
-
getPos: Parameters<NodeViewProducer>[2];
|
|
18
|
-
decorations: Parameters<NodeViewProducer>[3];
|
|
19
|
-
};
|
|
13
|
+
type NodeViewProducer = (node: PMNode, view: EditorView, getPos: (() => GetPosReturn) | boolean, decorations: Decoration[]) => NodeView;
|
|
14
|
+
type GetPosReturn = number | undefined;
|
|
20
15
|
export declare function getInlineNodeViewProducer<ExtraComponentProps>({ pmPluginFactoryParams, Component, extraComponentProps, }: {
|
|
21
16
|
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
22
17
|
Component: InlineNodeViewComponent<ExtraComponentProps>;
|
|
@@ -4,7 +4,7 @@ export interface ReactNodeProps {
|
|
|
4
4
|
}
|
|
5
5
|
export type ProsemirrorGetPosHandler = () => number;
|
|
6
6
|
export type getPosHandler = getPosHandlerNode | boolean;
|
|
7
|
-
export type getPosHandlerNode = () => number;
|
|
7
|
+
export type getPosHandlerNode = () => number | undefined;
|
|
8
8
|
export type ReactComponentProps = {
|
|
9
9
|
[key: string]: unknown;
|
|
10
10
|
};
|
|
@@ -88,5 +88,5 @@ export interface EditorPlugin {
|
|
|
88
88
|
onEditorViewStateUpdated?: (props: EditorViewStateUpdatedCallbackProps) => void;
|
|
89
89
|
}
|
|
90
90
|
export type getPosHandler = getPosHandlerNode | boolean;
|
|
91
|
-
export type getPosHandlerNode = () => number;
|
|
91
|
+
export type getPosHandlerNode = () => number | undefined;
|
|
92
92
|
export {};
|
|
@@ -25,5 +25,5 @@ export declare const isLastItemMediaGroup: (node: Node) => boolean;
|
|
|
25
25
|
export declare const setNodeSelection: (view: EditorView, pos: number) => void;
|
|
26
26
|
export declare function setTextSelection(view: EditorView, anchor: number, head?: number): void;
|
|
27
27
|
export declare function nonNullable<T>(value: T): value is NonNullable<T>;
|
|
28
|
-
export declare const isValidPosition: (pos: number, state: EditorState) => boolean;
|
|
28
|
+
export declare const isValidPosition: (pos: number | undefined, state: EditorState) => boolean;
|
|
29
29
|
export declare const isInLayoutColumn: (state: EditorState) => boolean;
|
|
@@ -25,7 +25,7 @@ export declare enum SelectedState {
|
|
|
25
25
|
* If the node is selected then an enum is returned that describes weather the node
|
|
26
26
|
* is fully selected by a range or if the "inside" of the node has been selected or clicked.
|
|
27
27
|
*/
|
|
28
|
-
export declare const isNodeSelectedOrInRange: (anchorPosition: number, headPosition: number, nodePosition: number, nodeSize: number) => SelectedState | null;
|
|
28
|
+
export declare const isNodeSelectedOrInRange: (anchorPosition: number, headPosition: number, nodePosition: number | undefined, nodeSize: number) => SelectedState | null;
|
|
29
29
|
/**
|
|
30
30
|
* Checks if a particular node fragment is supported in the parent
|
|
31
31
|
* @param state EditorState
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "74.
|
|
3
|
+
"version": "74.9.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"atlassian": {
|
|
26
26
|
"team": "Editor",
|
|
27
27
|
"inPublicMirror": true,
|
|
28
|
+
"singleton": true,
|
|
28
29
|
"releaseModel": "continuous"
|
|
29
30
|
},
|
|
30
31
|
"af:exports": {
|
|
@@ -81,23 +82,23 @@
|
|
|
81
82
|
"@atlaskit/button": "^16.8.0",
|
|
82
83
|
"@atlaskit/code": "^14.6.0",
|
|
83
84
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
84
|
-
"@atlaskit/collab-provider": "^9.
|
|
85
|
-
"@atlaskit/editor-palette": "1.5.
|
|
85
|
+
"@atlaskit/collab-provider": "^9.3.0",
|
|
86
|
+
"@atlaskit/editor-palette": "1.5.1",
|
|
86
87
|
"@atlaskit/editor-shared-styles": "^2.4.0",
|
|
87
88
|
"@atlaskit/emoji": "^67.4.0",
|
|
88
89
|
"@atlaskit/icon": "^21.12.0",
|
|
89
90
|
"@atlaskit/in-product-testing": "^0.2.0",
|
|
90
91
|
"@atlaskit/media-card": "^76.0.0",
|
|
91
92
|
"@atlaskit/media-client": "^23.1.0",
|
|
92
|
-
"@atlaskit/media-picker": "^66.
|
|
93
|
+
"@atlaskit/media-picker": "^66.1.0",
|
|
93
94
|
"@atlaskit/mention": "^22.1.0",
|
|
94
95
|
"@atlaskit/menu": "^1.7.0",
|
|
95
96
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
96
|
-
"@atlaskit/profilecard": "^19.
|
|
97
|
+
"@atlaskit/profilecard": "^19.5.0",
|
|
97
98
|
"@atlaskit/smart-user-picker": "^6.1.0",
|
|
98
99
|
"@atlaskit/task-decision": "^17.6.0",
|
|
99
100
|
"@atlaskit/theme": "^12.5.0",
|
|
100
|
-
"@atlaskit/tokens": "^1.
|
|
101
|
+
"@atlaskit/tokens": "^1.9.0",
|
|
101
102
|
"@atlaskit/tooltip": "^17.8.0",
|
|
102
103
|
"@atlaskit/ufo": "^0.2.0",
|
|
103
104
|
"@atlaskit/width-detector": "^4.1.0",
|
|
@@ -135,10 +136,10 @@
|
|
|
135
136
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
136
137
|
},
|
|
137
138
|
"devDependencies": {
|
|
138
|
-
"@atlaskit/editor-core": "^185.
|
|
139
|
+
"@atlaskit/editor-core": "^185.3.0",
|
|
139
140
|
"@atlaskit/editor-json-transformer": "^8.9.0",
|
|
140
|
-
"@atlaskit/editor-plugin-analytics": "^0.0.
|
|
141
|
-
"@atlaskit/editor-plugin-content-insertion": "^0.0.
|
|
141
|
+
"@atlaskit/editor-plugin-analytics": "^0.0.3",
|
|
142
|
+
"@atlaskit/editor-plugin-content-insertion": "^0.0.3",
|
|
142
143
|
"@atlaskit/editor-plugin-decorations": "^0.1.0",
|
|
143
144
|
"@atlaskit/editor-plugin-feature-flags": "^0.1.0",
|
|
144
145
|
"@atlaskit/editor-plugin-grid": "^0.1.0",
|
|
@@ -184,6 +185,9 @@
|
|
|
184
185
|
"platform-feature-flags": {
|
|
185
186
|
"platform.editor.sentry-error-monitoring_6bksu": {
|
|
186
187
|
"type": "boolean"
|
|
188
|
+
},
|
|
189
|
+
"platform.design-system-team.menu-selected-state-change_0see9": {
|
|
190
|
+
"type": "boolean"
|
|
187
191
|
}
|
|
188
192
|
}
|
|
189
193
|
}
|