@atlaskit/editor-common 74.7.9 → 74.9.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/monitoring/error.js +1 -1
  3. package/dist/cjs/react-node-view/index.js +5 -3
  4. package/dist/cjs/selection-based-node-view/SelectionBasedNodeView.js +124 -0
  5. package/dist/cjs/selection-based-node-view/index.js +12 -0
  6. package/dist/cjs/ui/DropList/index.js +1 -1
  7. package/dist/cjs/ui/PortalProvider/index.js +0 -1
  8. package/dist/cjs/ui-menu/DropdownMenu/index.js +12 -1
  9. package/dist/cjs/version.json +1 -1
  10. package/dist/es2019/monitoring/error.js +1 -1
  11. package/dist/es2019/react-node-view/index.js +5 -3
  12. package/dist/es2019/selection-based-node-view/SelectionBasedNodeView.js +100 -0
  13. package/dist/es2019/selection-based-node-view/index.js +1 -0
  14. package/dist/es2019/ui/DropList/index.js +1 -1
  15. package/dist/es2019/ui/PortalProvider/index.js +1 -2
  16. package/dist/es2019/ui-menu/DropdownMenu/index.js +12 -1
  17. package/dist/es2019/version.json +1 -1
  18. package/dist/esm/monitoring/error.js +1 -1
  19. package/dist/esm/react-node-view/index.js +5 -3
  20. package/dist/esm/selection-based-node-view/SelectionBasedNodeView.js +117 -0
  21. package/dist/esm/selection-based-node-view/index.js +1 -0
  22. package/dist/esm/ui/DropList/index.js +1 -1
  23. package/dist/esm/ui/PortalProvider/index.js +0 -1
  24. package/dist/esm/ui-menu/DropdownMenu/index.js +12 -1
  25. package/dist/esm/version.json +1 -1
  26. package/dist/types/react-node-view/index.d.ts +4 -3
  27. package/dist/types/selection-based-node-view/SelectionBasedNodeView.d.ts +49 -0
  28. package/dist/types/selection-based-node-view/index.d.ts +1 -0
  29. package/dist/types-ts4.5/react-node-view/index.d.ts +4 -3
  30. package/dist/types-ts4.5/selection-based-node-view/SelectionBasedNodeView.d.ts +49 -0
  31. package/dist/types-ts4.5/selection-based-node-view/index.d.ts +1 -0
  32. package/package.json +15 -10
  33. package/selection-based-node-view/package.json +15 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 74.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`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.
8
+
9
+ ### Patch Changes
10
+
11
+ - [`73b5128036b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73b5128036b) - [ED-17082] Mark package as a singleton one
12
+ - Updated dependencies
13
+
14
+ ## 74.8.0
15
+
16
+ ### Minor Changes
17
+
18
+ - [`5e01082b600`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5e01082b600) - Extracting SelectionBasedNodeView to editor-common.
19
+
3
20
  ## 74.7.9
4
21
 
5
22
  ### Patch 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.7.9";
19
+ var packageVersion = "74.9.0";
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
@@ -35,6 +35,7 @@ var ReactNodeView = /*#__PURE__*/function () {
35
35
  var viewShouldUpdate = arguments.length > 8 ? arguments[8] : undefined;
36
36
  var hasIntlContext = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
37
37
  (0, _classCallCheck2.default)(this, ReactNodeView);
38
+ (0, _defineProperty2.default)(this, "decorations", []);
38
39
  (0, _defineProperty2.default)(this, "handleRef", function (node) {
39
40
  return _this._handleRef(node);
40
41
  });
@@ -162,13 +163,14 @@ var ReactNodeView = /*#__PURE__*/function () {
162
163
  }
163
164
  }, {
164
165
  key: "update",
165
- value: function update(node, _decorations, _innerDecorations) {
166
+ value: function update(node, decorations, _innerDecorations) {
166
167
  var _this4 = this;
167
168
  var validUpdate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {
168
169
  return true;
169
170
  };
170
171
  // @see https://github.com/ProseMirror/prosemirror/issues/648
171
172
  var isValidUpdate = this.node.type === node.type && validUpdate(this.node, node);
173
+ this.decorations = decorations;
172
174
  if (!isValidUpdate) {
173
175
  return false;
174
176
  }
@@ -178,7 +180,7 @@ var ReactNodeView = /*#__PURE__*/function () {
178
180
 
179
181
  // View should not process a re-render if this is false.
180
182
  // We dont want to destroy the view, so we return true.
181
- if (!this.viewShouldUpdate(node)) {
183
+ if (!this.viewShouldUpdate(node, decorations)) {
182
184
  this.node = node;
183
185
  return true;
184
186
  }
@@ -190,7 +192,7 @@ var ReactNodeView = /*#__PURE__*/function () {
190
192
  }
191
193
  }, {
192
194
  key: "viewShouldUpdate",
193
- value: function viewShouldUpdate(nextNode) {
195
+ value: function viewShouldUpdate(nextNode, decorations) {
194
196
  if (this._viewShouldUpdate) {
195
197
  return this._viewShouldUpdate(nextNode);
196
198
  }
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.SelectionBasedNodeView = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
+ var _reactNodeView = _interopRequireDefault(require("../react-node-view"));
16
+ 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); }; }
17
+ 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; } }
18
+ /**
19
+ * A ReactNodeView that handles React components sensitive
20
+ * to selection changes.
21
+ *
22
+ * If the selection changes, it will attempt to re-render the
23
+ * React component. Otherwise it does nothing.
24
+ *
25
+ * You can subclass `viewShouldUpdate` to include other
26
+ * props that your component might want to consider before
27
+ * entering the React lifecycle. These are usually props you
28
+ * compare in `shouldComponentUpdate`.
29
+ *
30
+ * An example:
31
+ *
32
+ * ```
33
+ * viewShouldUpdate(nextNode) {
34
+ * if (nextNode.attrs !== this.node.attrs) {
35
+ * return true;
36
+ * }
37
+ *
38
+ * return super.viewShouldUpdate(nextNode);
39
+ * }```
40
+ */
41
+ var SelectionBasedNodeView = /*#__PURE__*/function (_ReactNodeView) {
42
+ (0, _inherits2.default)(SelectionBasedNodeView, _ReactNodeView);
43
+ var _super = _createSuper(SelectionBasedNodeView);
44
+ function SelectionBasedNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent) {
45
+ var _this;
46
+ var hasContext = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
47
+ var viewShouldUpdate = arguments.length > 8 ? arguments[8] : undefined;
48
+ var hasIntlContext = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
49
+ (0, _classCallCheck2.default)(this, SelectionBasedNodeView);
50
+ _this = _super.call(this, node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, hasContext, viewShouldUpdate, hasIntlContext);
51
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isSelectedNode", false);
52
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isNodeInsideSelection", function (from, to, pos, posEnd) {
53
+ var _this$getPositionsWit = _this.getPositionsWithDefault(pos, posEnd);
54
+ pos = _this$getPositionsWit.pos;
55
+ posEnd = _this$getPositionsWit.posEnd;
56
+ if (typeof pos !== 'number' || typeof posEnd !== 'number') {
57
+ return false;
58
+ }
59
+ return from <= pos && to >= posEnd;
60
+ });
61
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isSelectionInsideNode", function (from, to, pos, posEnd) {
62
+ var _this$getPositionsWit2 = _this.getPositionsWithDefault(pos, posEnd);
63
+ pos = _this$getPositionsWit2.pos;
64
+ posEnd = _this$getPositionsWit2.posEnd;
65
+ if (typeof pos !== 'number' || typeof posEnd !== 'number') {
66
+ return false;
67
+ }
68
+ return pos < from && to < posEnd;
69
+ });
70
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insideSelection", function () {
71
+ var _this$view$state$sele = _this.view.state.selection,
72
+ from = _this$view$state$sele.from,
73
+ to = _this$view$state$sele.to;
74
+ return _this.isSelectedNode || _this.isSelectionInsideNode(from, to);
75
+ });
76
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "nodeInsideSelection", function () {
77
+ var selection = _this.view.state.selection;
78
+ var from = selection.from,
79
+ to = selection.to;
80
+ return _this.isSelectedNode || _this.isNodeInsideSelection(from, to);
81
+ });
82
+ _this.updatePos();
83
+ return _this;
84
+ }
85
+
86
+ /**
87
+ * Update current node's start and end positions.
88
+ *
89
+ * Prefer `this.pos` rather than getPos(), because calling getPos is
90
+ * expensive, unless you know you're definitely going to render.
91
+ */
92
+ (0, _createClass2.default)(SelectionBasedNodeView, [{
93
+ key: "updatePos",
94
+ value: function updatePos() {
95
+ if (typeof this.getPos === 'boolean') {
96
+ return;
97
+ }
98
+ this.pos = this.getPos();
99
+ this.posEnd = this.pos + this.node.nodeSize;
100
+ }
101
+ }, {
102
+ key: "getPositionsWithDefault",
103
+ value: function getPositionsWithDefault(pos, posEnd) {
104
+ return {
105
+ pos: typeof pos !== 'number' ? this.pos : pos,
106
+ posEnd: typeof posEnd !== 'number' ? this.posEnd : posEnd
107
+ };
108
+ }
109
+ }, {
110
+ key: "selectNode",
111
+ value: function selectNode() {
112
+ this.isSelectedNode = true;
113
+ this.update(this.node, this.decorations);
114
+ }
115
+ }, {
116
+ key: "deselectNode",
117
+ value: function deselectNode() {
118
+ this.isSelectedNode = false;
119
+ this.update(this.node, this.decorations);
120
+ }
121
+ }]);
122
+ return SelectionBasedNodeView;
123
+ }(_reactNodeView.default);
124
+ exports.SelectionBasedNodeView = SelectionBasedNodeView;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "SelectionBasedNodeView", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _SelectionBasedNodeView.SelectionBasedNodeView;
10
+ }
11
+ });
12
+ var _SelectionBasedNodeView = require("./SelectionBasedNodeView");
@@ -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.7.9";
27
+ var packageVersion = "74.9.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -111,7 +111,6 @@ var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
111
111
  } catch (error) {
112
112
  if (this.onAnalyticsEvent) {
113
113
  this.onAnalyticsEvent({
114
- // @ts-expect-error
115
114
  payload: {
116
115
  action: _analytics.ACTION.FAILED_TO_UNMOUNT,
117
116
  actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
@@ -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), children);
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;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.7.9",
3
+ "version": "74.9.0",
4
4
  "sideEffects": false
5
5
  }
@@ -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.7.9";
3
+ const packageVersion = "74.9.0";
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
@@ -9,6 +9,7 @@ import { analyticsEventKey } from '../utils/analytics';
9
9
  export { getInlineNodeViewProducer, inlineNodeViewClassname } from './getInlineNodeViewProducer';
10
10
  export default class ReactNodeView {
11
11
  constructor(_node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, hasAnalyticsContext = false, viewShouldUpdate, hasIntlContext = false) {
12
+ _defineProperty(this, "decorations", []);
12
13
  _defineProperty(this, "handleRef", node => this._handleRef(node));
13
14
  _defineProperty(this, "dispatchAnalyticsEvent", payload => {
14
15
  if (this.eventDispatcher) {
@@ -118,9 +119,10 @@ export default class ReactNodeView {
118
119
  forwardRef: forwardRef
119
120
  }, props)) : null;
120
121
  }
121
- update(node, _decorations, _innerDecorations, validUpdate = () => true) {
122
+ update(node, decorations, _innerDecorations, validUpdate = () => true) {
122
123
  // @see https://github.com/ProseMirror/prosemirror/issues/648
123
124
  const isValidUpdate = this.node.type === node.type && validUpdate(this.node, node);
125
+ this.decorations = decorations;
124
126
  if (!isValidUpdate) {
125
127
  return false;
126
128
  }
@@ -130,7 +132,7 @@ export default class ReactNodeView {
130
132
 
131
133
  // View should not process a re-render if this is false.
132
134
  // We dont want to destroy the view, so we return true.
133
- if (!this.viewShouldUpdate(node)) {
135
+ if (!this.viewShouldUpdate(node, decorations)) {
134
136
  this.node = node;
135
137
  return true;
136
138
  }
@@ -138,7 +140,7 @@ export default class ReactNodeView {
138
140
  this.renderReactComponent(() => this.render(this.reactComponentProps, this.handleRef));
139
141
  return true;
140
142
  }
141
- viewShouldUpdate(nextNode) {
143
+ viewShouldUpdate(nextNode, decorations) {
142
144
  if (this._viewShouldUpdate) {
143
145
  return this._viewShouldUpdate(nextNode);
144
146
  }
@@ -0,0 +1,100 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import ReactNodeView from '../react-node-view';
3
+ /**
4
+ * A ReactNodeView that handles React components sensitive
5
+ * to selection changes.
6
+ *
7
+ * If the selection changes, it will attempt to re-render the
8
+ * React component. Otherwise it does nothing.
9
+ *
10
+ * You can subclass `viewShouldUpdate` to include other
11
+ * props that your component might want to consider before
12
+ * entering the React lifecycle. These are usually props you
13
+ * compare in `shouldComponentUpdate`.
14
+ *
15
+ * An example:
16
+ *
17
+ * ```
18
+ * viewShouldUpdate(nextNode) {
19
+ * if (nextNode.attrs !== this.node.attrs) {
20
+ * return true;
21
+ * }
22
+ *
23
+ * return super.viewShouldUpdate(nextNode);
24
+ * }```
25
+ */
26
+
27
+ export class SelectionBasedNodeView extends ReactNodeView {
28
+ constructor(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, hasContext = false, viewShouldUpdate, hasIntlContext = false) {
29
+ super(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, hasContext, viewShouldUpdate, hasIntlContext);
30
+ _defineProperty(this, "isSelectedNode", false);
31
+ _defineProperty(this, "isNodeInsideSelection", (from, to, pos, posEnd) => {
32
+ ({
33
+ pos,
34
+ posEnd
35
+ } = this.getPositionsWithDefault(pos, posEnd));
36
+ if (typeof pos !== 'number' || typeof posEnd !== 'number') {
37
+ return false;
38
+ }
39
+ return from <= pos && to >= posEnd;
40
+ });
41
+ _defineProperty(this, "isSelectionInsideNode", (from, to, pos, posEnd) => {
42
+ ({
43
+ pos,
44
+ posEnd
45
+ } = this.getPositionsWithDefault(pos, posEnd));
46
+ if (typeof pos !== 'number' || typeof posEnd !== 'number') {
47
+ return false;
48
+ }
49
+ return pos < from && to < posEnd;
50
+ });
51
+ _defineProperty(this, "insideSelection", () => {
52
+ const {
53
+ selection: {
54
+ from,
55
+ to
56
+ }
57
+ } = this.view.state;
58
+ return this.isSelectedNode || this.isSelectionInsideNode(from, to);
59
+ });
60
+ _defineProperty(this, "nodeInsideSelection", () => {
61
+ const {
62
+ selection
63
+ } = this.view.state;
64
+ const {
65
+ from,
66
+ to
67
+ } = selection;
68
+ return this.isSelectedNode || this.isNodeInsideSelection(from, to);
69
+ });
70
+ this.updatePos();
71
+ }
72
+
73
+ /**
74
+ * Update current node's start and end positions.
75
+ *
76
+ * Prefer `this.pos` rather than getPos(), because calling getPos is
77
+ * expensive, unless you know you're definitely going to render.
78
+ */
79
+ updatePos() {
80
+ if (typeof this.getPos === 'boolean') {
81
+ return;
82
+ }
83
+ this.pos = this.getPos();
84
+ this.posEnd = this.pos + this.node.nodeSize;
85
+ }
86
+ getPositionsWithDefault(pos, posEnd) {
87
+ return {
88
+ pos: typeof pos !== 'number' ? this.pos : pos,
89
+ posEnd: typeof posEnd !== 'number' ? this.posEnd : posEnd
90
+ };
91
+ }
92
+ selectNode() {
93
+ this.isSelectedNode = true;
94
+ this.update(this.node, this.decorations);
95
+ }
96
+ deselectNode() {
97
+ this.isSelectedNode = false;
98
+ this.update(this.node, this.decorations);
99
+ }
100
+ }
@@ -0,0 +1 @@
1
+ export { SelectionBasedNodeView } from './SelectionBasedNodeView';
@@ -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.7.9";
11
+ const packageVersion = "74.9.0";
12
12
  const halfFocusRing = 1;
13
13
  const dropOffset = '0, 8';
14
14
  class DropList extends Component {
@@ -82,13 +82,12 @@ export class PortalProviderAPI extends EventDispatcher {
82
82
  } catch (error) {
83
83
  if (this.onAnalyticsEvent) {
84
84
  this.onAnalyticsEvent({
85
- // @ts-expect-error
86
85
  payload: {
87
86
  action: ACTION.FAILED_TO_UNMOUNT,
88
87
  actionSubject: ACTION_SUBJECT.EDITOR,
89
88
  actionSubjectId: ACTION_SUBJECT_ID.REACT_NODE_VIEW,
90
89
  attributes: {
91
- error,
90
+ error: error,
92
91
  domNodes: {
93
92
  container: container ? container.className : undefined,
94
93
  child: container.firstElementChild ? container.firstElementChild.className : undefined
@@ -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), children);
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,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.7.9",
3
+ "version": "74.9.0",
4
4
  "sideEffects": false
5
5
  }
@@ -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.7.9";
9
+ var packageVersion = "74.9.0";
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
@@ -16,6 +16,7 @@ var ReactNodeView = /*#__PURE__*/function () {
16
16
  var viewShouldUpdate = arguments.length > 8 ? arguments[8] : undefined;
17
17
  var hasIntlContext = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
18
18
  _classCallCheck(this, ReactNodeView);
19
+ _defineProperty(this, "decorations", []);
19
20
  _defineProperty(this, "handleRef", function (node) {
20
21
  return _this._handleRef(node);
21
22
  });
@@ -143,13 +144,14 @@ var ReactNodeView = /*#__PURE__*/function () {
143
144
  }
144
145
  }, {
145
146
  key: "update",
146
- value: function update(node, _decorations, _innerDecorations) {
147
+ value: function update(node, decorations, _innerDecorations) {
147
148
  var _this4 = this;
148
149
  var validUpdate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {
149
150
  return true;
150
151
  };
151
152
  // @see https://github.com/ProseMirror/prosemirror/issues/648
152
153
  var isValidUpdate = this.node.type === node.type && validUpdate(this.node, node);
154
+ this.decorations = decorations;
153
155
  if (!isValidUpdate) {
154
156
  return false;
155
157
  }
@@ -159,7 +161,7 @@ var ReactNodeView = /*#__PURE__*/function () {
159
161
 
160
162
  // View should not process a re-render if this is false.
161
163
  // We dont want to destroy the view, so we return true.
162
- if (!this.viewShouldUpdate(node)) {
164
+ if (!this.viewShouldUpdate(node, decorations)) {
163
165
  this.node = node;
164
166
  return true;
165
167
  }
@@ -171,7 +173,7 @@ var ReactNodeView = /*#__PURE__*/function () {
171
173
  }
172
174
  }, {
173
175
  key: "viewShouldUpdate",
174
- value: function viewShouldUpdate(nextNode) {
176
+ value: function viewShouldUpdate(nextNode, decorations) {
175
177
  if (this._viewShouldUpdate) {
176
178
  return this._viewShouldUpdate(nextNode);
177
179
  }
@@ -0,0 +1,117 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
+ import _inherits from "@babel/runtime/helpers/inherits";
5
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
+ 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; } }
10
+ import ReactNodeView from '../react-node-view';
11
+ /**
12
+ * A ReactNodeView that handles React components sensitive
13
+ * to selection changes.
14
+ *
15
+ * If the selection changes, it will attempt to re-render the
16
+ * React component. Otherwise it does nothing.
17
+ *
18
+ * You can subclass `viewShouldUpdate` to include other
19
+ * props that your component might want to consider before
20
+ * entering the React lifecycle. These are usually props you
21
+ * compare in `shouldComponentUpdate`.
22
+ *
23
+ * An example:
24
+ *
25
+ * ```
26
+ * viewShouldUpdate(nextNode) {
27
+ * if (nextNode.attrs !== this.node.attrs) {
28
+ * return true;
29
+ * }
30
+ *
31
+ * return super.viewShouldUpdate(nextNode);
32
+ * }```
33
+ */
34
+
35
+ export var SelectionBasedNodeView = /*#__PURE__*/function (_ReactNodeView) {
36
+ _inherits(SelectionBasedNodeView, _ReactNodeView);
37
+ var _super = _createSuper(SelectionBasedNodeView);
38
+ function SelectionBasedNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent) {
39
+ var _this;
40
+ var hasContext = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
41
+ var viewShouldUpdate = arguments.length > 8 ? arguments[8] : undefined;
42
+ var hasIntlContext = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
43
+ _classCallCheck(this, SelectionBasedNodeView);
44
+ _this = _super.call(this, node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, hasContext, viewShouldUpdate, hasIntlContext);
45
+ _defineProperty(_assertThisInitialized(_this), "isSelectedNode", false);
46
+ _defineProperty(_assertThisInitialized(_this), "isNodeInsideSelection", function (from, to, pos, posEnd) {
47
+ var _this$getPositionsWit = _this.getPositionsWithDefault(pos, posEnd);
48
+ pos = _this$getPositionsWit.pos;
49
+ posEnd = _this$getPositionsWit.posEnd;
50
+ if (typeof pos !== 'number' || typeof posEnd !== 'number') {
51
+ return false;
52
+ }
53
+ return from <= pos && to >= posEnd;
54
+ });
55
+ _defineProperty(_assertThisInitialized(_this), "isSelectionInsideNode", function (from, to, pos, posEnd) {
56
+ var _this$getPositionsWit2 = _this.getPositionsWithDefault(pos, posEnd);
57
+ pos = _this$getPositionsWit2.pos;
58
+ posEnd = _this$getPositionsWit2.posEnd;
59
+ if (typeof pos !== 'number' || typeof posEnd !== 'number') {
60
+ return false;
61
+ }
62
+ return pos < from && to < posEnd;
63
+ });
64
+ _defineProperty(_assertThisInitialized(_this), "insideSelection", function () {
65
+ var _this$view$state$sele = _this.view.state.selection,
66
+ from = _this$view$state$sele.from,
67
+ to = _this$view$state$sele.to;
68
+ return _this.isSelectedNode || _this.isSelectionInsideNode(from, to);
69
+ });
70
+ _defineProperty(_assertThisInitialized(_this), "nodeInsideSelection", function () {
71
+ var selection = _this.view.state.selection;
72
+ var from = selection.from,
73
+ to = selection.to;
74
+ return _this.isSelectedNode || _this.isNodeInsideSelection(from, to);
75
+ });
76
+ _this.updatePos();
77
+ return _this;
78
+ }
79
+
80
+ /**
81
+ * Update current node's start and end positions.
82
+ *
83
+ * Prefer `this.pos` rather than getPos(), because calling getPos is
84
+ * expensive, unless you know you're definitely going to render.
85
+ */
86
+ _createClass(SelectionBasedNodeView, [{
87
+ key: "updatePos",
88
+ value: function updatePos() {
89
+ if (typeof this.getPos === 'boolean') {
90
+ return;
91
+ }
92
+ this.pos = this.getPos();
93
+ this.posEnd = this.pos + this.node.nodeSize;
94
+ }
95
+ }, {
96
+ key: "getPositionsWithDefault",
97
+ value: function getPositionsWithDefault(pos, posEnd) {
98
+ return {
99
+ pos: typeof pos !== 'number' ? this.pos : pos,
100
+ posEnd: typeof posEnd !== 'number' ? this.posEnd : posEnd
101
+ };
102
+ }
103
+ }, {
104
+ key: "selectNode",
105
+ value: function selectNode() {
106
+ this.isSelectedNode = true;
107
+ this.update(this.node, this.decorations);
108
+ }
109
+ }, {
110
+ key: "deselectNode",
111
+ value: function deselectNode() {
112
+ this.isSelectedNode = false;
113
+ this.update(this.node, this.decorations);
114
+ }
115
+ }]);
116
+ return SelectionBasedNodeView;
117
+ }(ReactNodeView);
@@ -0,0 +1 @@
1
+ export { SelectionBasedNodeView } from './SelectionBasedNodeView';
@@ -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.7.9";
21
+ var packageVersion = "74.9.0";
22
22
  var halfFocusRing = 1;
23
23
  var dropOffset = '0, 8';
24
24
  var DropList = /*#__PURE__*/function (_Component) {
@@ -104,7 +104,6 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
104
104
  } catch (error) {
105
105
  if (this.onAnalyticsEvent) {
106
106
  this.onAnalyticsEvent({
107
- // @ts-expect-error
108
107
  payload: {
109
108
  action: ACTION.FAILED_TO_UNMOUNT,
110
109
  actionSubject: ACTION_SUBJECT.EDITOR,
@@ -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), children);
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;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.7.9",
3
+ "version": "74.9.0",
4
4
  "sideEffects": false
5
5
  }
@@ -4,7 +4,7 @@ import { Decoration, EditorView, NodeView } from 'prosemirror-view';
4
4
  import { EventDispatcher } from '../event-dispatcher';
5
5
  import type { PortalProviderAPI } from '../ui/PortalProvider';
6
6
  import { ForwardRef, getPosHandler, ReactComponentProps, shouldUpdate } from './types';
7
- export type { getPosHandler, ReactComponentProps };
7
+ export type { getPosHandler, ReactComponentProps, shouldUpdate };
8
8
  export type { InlineNodeViewComponentProps } from './getInlineNodeViewProducer';
9
9
  export { getInlineNodeViewProducer, inlineNodeViewClassname, } from './getInlineNodeViewProducer';
10
10
  export default class ReactNodeView<P = ReactComponentProps> implements NodeView {
@@ -16,6 +16,7 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
16
16
  private _viewShouldUpdate?;
17
17
  protected eventDispatcher?: EventDispatcher;
18
18
  private hasIntlContext;
19
+ protected decorations: Decoration[];
19
20
  reactComponentProps: P;
20
21
  view: EditorView;
21
22
  getPos: getPosHandler;
@@ -41,8 +42,8 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
41
42
  handleRef: (node: HTMLElement | null) => void;
42
43
  private _handleRef;
43
44
  render(props: P, forwardRef?: ForwardRef): React.ReactElement<any> | null;
44
- update(node: PMNode, _decorations: Array<Decoration>, _innerDecorations?: Array<Decoration>, validUpdate?: (currentNode: PMNode, newNode: PMNode) => boolean): boolean;
45
- viewShouldUpdate(nextNode: PMNode): boolean;
45
+ update(node: PMNode, decorations: Array<Decoration>, _innerDecorations?: Array<Decoration>, validUpdate?: (currentNode: PMNode, newNode: PMNode) => boolean): boolean;
46
+ viewShouldUpdate(nextNode: PMNode, decorations?: Array<Decoration>): boolean;
46
47
  /**
47
48
  * Copies the attributes from a ProseMirror Node to a DOM node.
48
49
  * @param node The Prosemirror Node from which to source the attributes
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import { Node as PMNode } from 'prosemirror-model';
3
+ import { EditorView } from 'prosemirror-view';
4
+ import { EventDispatcher } from '../event-dispatcher';
5
+ import ReactNodeView, { getPosHandler, ReactComponentProps, shouldUpdate } from '../react-node-view';
6
+ import { PortalProviderAPI } from '../ui/PortalProvider';
7
+ /**
8
+ * A ReactNodeView that handles React components sensitive
9
+ * to selection changes.
10
+ *
11
+ * If the selection changes, it will attempt to re-render the
12
+ * React component. Otherwise it does nothing.
13
+ *
14
+ * You can subclass `viewShouldUpdate` to include other
15
+ * props that your component might want to consider before
16
+ * entering the React lifecycle. These are usually props you
17
+ * compare in `shouldComponentUpdate`.
18
+ *
19
+ * An example:
20
+ *
21
+ * ```
22
+ * viewShouldUpdate(nextNode) {
23
+ * if (nextNode.attrs !== this.node.attrs) {
24
+ * return true;
25
+ * }
26
+ *
27
+ * return super.viewShouldUpdate(nextNode);
28
+ * }```
29
+ */
30
+ export declare class SelectionBasedNodeView<P = ReactComponentProps> extends ReactNodeView<P> {
31
+ protected isSelectedNode: boolean;
32
+ pos: number | undefined;
33
+ posEnd: number | undefined;
34
+ constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps: P, reactComponent?: React.ComponentType<any>, hasContext?: boolean, viewShouldUpdate?: shouldUpdate, hasIntlContext?: boolean);
35
+ /**
36
+ * Update current node's start and end positions.
37
+ *
38
+ * Prefer `this.pos` rather than getPos(), because calling getPos is
39
+ * expensive, unless you know you're definitely going to render.
40
+ */
41
+ private updatePos;
42
+ private getPositionsWithDefault;
43
+ private isNodeInsideSelection;
44
+ private isSelectionInsideNode;
45
+ insideSelection: () => boolean;
46
+ nodeInsideSelection: () => boolean;
47
+ selectNode(): void;
48
+ deselectNode(): void;
49
+ }
@@ -0,0 +1 @@
1
+ export { SelectionBasedNodeView } from './SelectionBasedNodeView';
@@ -4,7 +4,7 @@ import { Decoration, EditorView, NodeView } from 'prosemirror-view';
4
4
  import { EventDispatcher } from '../event-dispatcher';
5
5
  import type { PortalProviderAPI } from '../ui/PortalProvider';
6
6
  import { ForwardRef, getPosHandler, ReactComponentProps, shouldUpdate } from './types';
7
- export type { getPosHandler, ReactComponentProps };
7
+ export type { getPosHandler, ReactComponentProps, shouldUpdate };
8
8
  export type { InlineNodeViewComponentProps } from './getInlineNodeViewProducer';
9
9
  export { getInlineNodeViewProducer, inlineNodeViewClassname, } from './getInlineNodeViewProducer';
10
10
  export default class ReactNodeView<P = ReactComponentProps> implements NodeView {
@@ -16,6 +16,7 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
16
16
  private _viewShouldUpdate?;
17
17
  protected eventDispatcher?: EventDispatcher;
18
18
  private hasIntlContext;
19
+ protected decorations: Decoration[];
19
20
  reactComponentProps: P;
20
21
  view: EditorView;
21
22
  getPos: getPosHandler;
@@ -41,8 +42,8 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
41
42
  handleRef: (node: HTMLElement | null) => void;
42
43
  private _handleRef;
43
44
  render(props: P, forwardRef?: ForwardRef): React.ReactElement<any> | null;
44
- update(node: PMNode, _decorations: Array<Decoration>, _innerDecorations?: Array<Decoration>, validUpdate?: (currentNode: PMNode, newNode: PMNode) => boolean): boolean;
45
- viewShouldUpdate(nextNode: PMNode): boolean;
45
+ update(node: PMNode, decorations: Array<Decoration>, _innerDecorations?: Array<Decoration>, validUpdate?: (currentNode: PMNode, newNode: PMNode) => boolean): boolean;
46
+ viewShouldUpdate(nextNode: PMNode, decorations?: Array<Decoration>): boolean;
46
47
  /**
47
48
  * Copies the attributes from a ProseMirror Node to a DOM node.
48
49
  * @param node The Prosemirror Node from which to source the attributes
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import { Node as PMNode } from 'prosemirror-model';
3
+ import { EditorView } from 'prosemirror-view';
4
+ import { EventDispatcher } from '../event-dispatcher';
5
+ import ReactNodeView, { getPosHandler, ReactComponentProps, shouldUpdate } from '../react-node-view';
6
+ import { PortalProviderAPI } from '../ui/PortalProvider';
7
+ /**
8
+ * A ReactNodeView that handles React components sensitive
9
+ * to selection changes.
10
+ *
11
+ * If the selection changes, it will attempt to re-render the
12
+ * React component. Otherwise it does nothing.
13
+ *
14
+ * You can subclass `viewShouldUpdate` to include other
15
+ * props that your component might want to consider before
16
+ * entering the React lifecycle. These are usually props you
17
+ * compare in `shouldComponentUpdate`.
18
+ *
19
+ * An example:
20
+ *
21
+ * ```
22
+ * viewShouldUpdate(nextNode) {
23
+ * if (nextNode.attrs !== this.node.attrs) {
24
+ * return true;
25
+ * }
26
+ *
27
+ * return super.viewShouldUpdate(nextNode);
28
+ * }```
29
+ */
30
+ export declare class SelectionBasedNodeView<P = ReactComponentProps> extends ReactNodeView<P> {
31
+ protected isSelectedNode: boolean;
32
+ pos: number | undefined;
33
+ posEnd: number | undefined;
34
+ constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps: P, reactComponent?: React.ComponentType<any>, hasContext?: boolean, viewShouldUpdate?: shouldUpdate, hasIntlContext?: boolean);
35
+ /**
36
+ * Update current node's start and end positions.
37
+ *
38
+ * Prefer `this.pos` rather than getPos(), because calling getPos is
39
+ * expensive, unless you know you're definitely going to render.
40
+ */
41
+ private updatePos;
42
+ private getPositionsWithDefault;
43
+ private isNodeInsideSelection;
44
+ private isSelectionInsideNode;
45
+ insideSelection: () => boolean;
46
+ nodeInsideSelection: () => boolean;
47
+ selectNode(): void;
48
+ deselectNode(): void;
49
+ }
@@ -0,0 +1 @@
1
+ export { SelectionBasedNodeView } from './SelectionBasedNodeView';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.7.9",
3
+ "version": "74.9.0",
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": {
@@ -67,7 +68,8 @@
67
68
  "./monitoring": "./src/monitoring/index.ts",
68
69
  "./paste": "./src/paste/index.ts",
69
70
  "./resizer": "./src/resizer/index.ts",
70
- "./editor-analytics": "./src/editor-analytics/index.ts"
71
+ "./editor-analytics": "./src/editor-analytics/index.ts",
72
+ "./selection-based-node-view": "./src/selection-based-node-view/index.ts"
71
73
  },
72
74
  "dependencies": {
73
75
  "@atlaskit/activity-provider": "^2.4.0",
@@ -80,23 +82,23 @@
80
82
  "@atlaskit/button": "^16.8.0",
81
83
  "@atlaskit/code": "^14.6.0",
82
84
  "@atlaskit/codemod-utils": "^4.2.0",
83
- "@atlaskit/collab-provider": "^9.2.0",
84
- "@atlaskit/editor-palette": "1.5.0",
85
+ "@atlaskit/collab-provider": "^9.3.0",
86
+ "@atlaskit/editor-palette": "1.5.1",
85
87
  "@atlaskit/editor-shared-styles": "^2.4.0",
86
88
  "@atlaskit/emoji": "^67.4.0",
87
89
  "@atlaskit/icon": "^21.12.0",
88
90
  "@atlaskit/in-product-testing": "^0.2.0",
89
91
  "@atlaskit/media-card": "^76.0.0",
90
92
  "@atlaskit/media-client": "^23.1.0",
91
- "@atlaskit/media-picker": "^66.0.0",
93
+ "@atlaskit/media-picker": "^66.1.0",
92
94
  "@atlaskit/mention": "^22.1.0",
93
95
  "@atlaskit/menu": "^1.7.0",
94
96
  "@atlaskit/platform-feature-flags": "^0.2.0",
95
- "@atlaskit/profilecard": "^19.4.0",
97
+ "@atlaskit/profilecard": "^19.5.0",
96
98
  "@atlaskit/smart-user-picker": "^6.1.0",
97
99
  "@atlaskit/task-decision": "^17.6.0",
98
100
  "@atlaskit/theme": "^12.5.0",
99
- "@atlaskit/tokens": "^1.8.0",
101
+ "@atlaskit/tokens": "^1.9.0",
100
102
  "@atlaskit/tooltip": "^17.8.0",
101
103
  "@atlaskit/ufo": "^0.2.0",
102
104
  "@atlaskit/width-detector": "^4.1.0",
@@ -134,10 +136,10 @@
134
136
  "react-intl-next": "npm:react-intl@^5.18.1"
135
137
  },
136
138
  "devDependencies": {
137
- "@atlaskit/editor-core": "^185.2.0",
139
+ "@atlaskit/editor-core": "^185.3.0",
138
140
  "@atlaskit/editor-json-transformer": "^8.9.0",
139
- "@atlaskit/editor-plugin-analytics": "^0.0.2",
140
- "@atlaskit/editor-plugin-content-insertion": "^0.0.2",
141
+ "@atlaskit/editor-plugin-analytics": "^0.0.3",
142
+ "@atlaskit/editor-plugin-content-insertion": "^0.0.3",
141
143
  "@atlaskit/editor-plugin-decorations": "^0.1.0",
142
144
  "@atlaskit/editor-plugin-feature-flags": "^0.1.0",
143
145
  "@atlaskit/editor-plugin-grid": "^0.1.0",
@@ -183,6 +185,9 @@
183
185
  "platform-feature-flags": {
184
186
  "platform.editor.sentry-error-monitoring_6bksu": {
185
187
  "type": "boolean"
188
+ },
189
+ "platform.design-system-team.menu-selected-state-change_0see9": {
190
+ "type": "boolean"
186
191
  }
187
192
  }
188
193
  }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/selection-based-node-view",
3
+ "main": "../dist/cjs/selection-based-node-view/index.js",
4
+ "module": "../dist/esm/selection-based-node-view/index.js",
5
+ "module:es2019": "../dist/es2019/selection-based-node-view/index.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/selection-based-node-view/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <4.9": {
10
+ "*": [
11
+ "../dist/types-ts4.5/selection-based-node-view/index.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }