@atlaskit/editor-common 80.5.0 → 80.5.2

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,27 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 80.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#101513](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/101513)
8
+ [`98b5dfc33bed`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/98b5dfc33bed) -
9
+ [ux] [ED-23156] The highlight primary toolbar button is disabled when trying to apply it on
10
+ nodes that don't enable the mark and when in a gap cursor. The text color primary toolbar button
11
+ is disabled when selecting text with a highlight.
12
+ - Updated dependencies
13
+
14
+ ## 80.5.1
15
+
16
+ ### Patch Changes
17
+
18
+ - [#103099](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103099)
19
+ [`ab382e121799`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ab382e121799) -
20
+ [ED-23248] **@af/editor-libra:** REVERT: Added profilecardPopupName locator to Mention Model
21
+ **@atlaskit/editor-test-helpers:** REVERT: Added optional profilecard provider mock for examples
22
+ **@atlaskit/editor-common:** REVERT: Exporting mention with profile card component
23
+ - Updated dependencies
24
+
3
25
  ## 80.5.0
4
26
 
5
27
  ### Minor Changes
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.applyMarkOnRange = void 0;
6
+ exports.entireSelectionContainsMark = exports.applyMarkOnRange = void 0;
7
7
  exports.filterChildrenBetween = filterChildrenBetween;
8
8
  exports.transformSmartCharsMentionsAndEmojis = exports.toggleMark = exports.removeMark = void 0;
9
9
  var _state = require("@atlaskit/editor-prosemirror/state");
@@ -121,7 +121,7 @@ var applyMarkOnRange = exports.applyMarkOnRange = function applyMarkOnRange(from
121
121
  });
122
122
  return tr;
123
123
  };
124
- var entireSelectionContainsMark = function entireSelectionContainsMark(mark, doc, fromPos, toPos) {
124
+ var entireSelectionContainsMark = exports.entireSelectionContainsMark = function entireSelectionContainsMark(mark, doc, fromPos, toPos) {
125
125
  var onlyContainsMark = true;
126
126
  doc.nodesBetween(fromPos, toPos, function (node) {
127
127
  // Skip recursion once we've found text which doesn't include the mark
@@ -129,7 +129,7 @@ var entireSelectionContainsMark = function entireSelectionContainsMark(mark, doc
129
129
  return false;
130
130
  }
131
131
  if (node.isText) {
132
- onlyContainsMark && (onlyContainsMark = mark.isInSet(node.marks));
132
+ onlyContainsMark && (onlyContainsMark = !!(mark !== null && mark !== void 0 && mark.isInSet(node.marks)));
133
133
  }
134
134
  });
135
135
  return onlyContainsMark;
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "applyMarkOnRange", {
15
15
  return _commands.applyMarkOnRange;
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "entireSelectionContainsMark", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _commands.entireSelectionContainsMark;
22
+ }
23
+ });
18
24
  Object.defineProperty(exports, "filterChildrenBetween", {
19
25
  enumerable: true,
20
26
  get: function get() {
@@ -16,12 +16,5 @@ Object.defineProperty(exports, "MentionSharedCssClassName", {
16
16
  return _mention.MentionSharedCssClassName;
17
17
  }
18
18
  });
19
- Object.defineProperty(exports, "MentionWithProfileCard", {
20
- enumerable: true,
21
- get: function get() {
22
- return _mentionWithProfilecard.default;
23
- }
24
- });
25
19
  var _Mention = _interopRequireDefault(require("./ui/Mention"));
26
- var _mention = require("./styles/shared/mention");
27
- var _mentionWithProfilecard = _interopRequireDefault(require("./ui/Mention/mention-with-profilecard"));
20
+ var _mention = require("./styles/shared/mention");
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
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 = "80.5.0";
19
+ var packageVersion = "80.5.2";
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
@@ -20,7 +20,7 @@ var _Layer = _interopRequireDefault(require("../Layer"));
20
20
  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); }; }
21
21
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "80.5.0";
23
+ var packageVersion = "80.5.2";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  var DropList = /*#__PURE__*/function (_Component) {
@@ -129,7 +129,7 @@ export const applyMarkOnRange = (from, to, removeMark, mark, tr) => {
129
129
  });
130
130
  return tr;
131
131
  };
132
- const entireSelectionContainsMark = (mark, doc, fromPos, toPos) => {
132
+ export const entireSelectionContainsMark = (mark, doc, fromPos, toPos) => {
133
133
  let onlyContainsMark = true;
134
134
  doc.nodesBetween(fromPos, toPos, node => {
135
135
  // Skip recursion once we've found text which doesn't include the mark
@@ -137,7 +137,7 @@ const entireSelectionContainsMark = (mark, doc, fromPos, toPos) => {
137
137
  return false;
138
138
  }
139
139
  if (node.isText) {
140
- onlyContainsMark && (onlyContainsMark = mark.isInSet(node.marks));
140
+ onlyContainsMark && (onlyContainsMark = !!(mark !== null && mark !== void 0 && mark.isInSet(node.marks)));
141
141
  }
142
142
  });
143
143
  return onlyContainsMark;
@@ -1,2 +1,2 @@
1
- export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark } from './commands';
1
+ export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark, entireSelectionContainsMark } from './commands';
2
2
  export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded } from './text-formatting';
@@ -1,3 +1,2 @@
1
1
  export { default as Mention } from './ui/Mention';
2
- export { MentionSharedCssClassName } from './styles/shared/mention';
3
- export { default as MentionWithProfileCard } from './ui/Mention/mention-with-profilecard';
2
+ export { MentionSharedCssClassName } from './styles/shared/mention';
@@ -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 = "80.5.0";
3
+ const packageVersion = "80.5.2";
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
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
7
7
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
8
8
  import Layer from '../Layer';
9
9
  const packageName = "@atlaskit/editor-common";
10
- const packageVersion = "80.5.0";
10
+ const packageVersion = "80.5.2";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -113,7 +113,7 @@ export var applyMarkOnRange = function applyMarkOnRange(from, to, removeMark, ma
113
113
  });
114
114
  return tr;
115
115
  };
116
- var entireSelectionContainsMark = function entireSelectionContainsMark(mark, doc, fromPos, toPos) {
116
+ export var entireSelectionContainsMark = function entireSelectionContainsMark(mark, doc, fromPos, toPos) {
117
117
  var onlyContainsMark = true;
118
118
  doc.nodesBetween(fromPos, toPos, function (node) {
119
119
  // Skip recursion once we've found text which doesn't include the mark
@@ -121,7 +121,7 @@ var entireSelectionContainsMark = function entireSelectionContainsMark(mark, doc
121
121
  return false;
122
122
  }
123
123
  if (node.isText) {
124
- onlyContainsMark && (onlyContainsMark = mark.isInSet(node.marks));
124
+ onlyContainsMark && (onlyContainsMark = !!(mark !== null && mark !== void 0 && mark.isInSet(node.marks)));
125
125
  }
126
126
  });
127
127
  return onlyContainsMark;
@@ -1,2 +1,2 @@
1
- export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark } from './commands';
1
+ export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark, entireSelectionContainsMark } from './commands';
2
2
  export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded } from './text-formatting';
@@ -1,3 +1,2 @@
1
1
  export { default as Mention } from './ui/Mention';
2
- export { MentionSharedCssClassName } from './styles/shared/mention';
3
- export { default as MentionWithProfileCard } from './ui/Mention/mention-with-profilecard';
2
+ export { MentionSharedCssClassName } from './styles/shared/mention';
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
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 = "80.5.0";
9
+ var packageVersion = "80.5.2";
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
@@ -15,7 +15,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
15
15
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
16
16
  import Layer from '../Layer';
17
17
  var packageName = "@atlaskit/editor-common";
18
- var packageVersion = "80.5.0";
18
+ var packageVersion = "80.5.2";
19
19
  var halfFocusRing = 1;
20
20
  var dropOffset = '0, 8';
21
21
  var DropList = /*#__PURE__*/function (_Component) {
@@ -7,6 +7,7 @@ export declare function filterChildrenBetween(doc: PMNode, from: number, to: num
7
7
  }[];
8
8
  export declare const transformSmartCharsMentionsAndEmojis: (from: number, to: number, tr: Transaction) => void;
9
9
  export declare const applyMarkOnRange: (from: number, to: number, removeMark: boolean, mark: Mark, tr: Transaction) => Transaction;
10
+ export declare const entireSelectionContainsMark: (mark: Mark | MarkType, doc: PMNode, fromPos: number, toPos: number) => boolean;
10
11
  /**
11
12
  * A custom version of the ProseMirror toggleMark, where we only toggle marks
12
13
  * on text nodes in the selection rather than all inline nodes.
@@ -1,2 +1,2 @@
1
- export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark, } from './commands';
1
+ export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark, entireSelectionContainsMark, } from './commands';
2
2
  export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded, } from './text-formatting';
@@ -1,3 +1,2 @@
1
1
  export { default as Mention } from './ui/Mention';
2
2
  export { MentionSharedCssClassName } from './styles/shared/mention';
3
- export { default as MentionWithProfileCard } from './ui/Mention/mention-with-profilecard';
@@ -7,6 +7,7 @@ export declare function filterChildrenBetween(doc: PMNode, from: number, to: num
7
7
  }[];
8
8
  export declare const transformSmartCharsMentionsAndEmojis: (from: number, to: number, tr: Transaction) => void;
9
9
  export declare const applyMarkOnRange: (from: number, to: number, removeMark: boolean, mark: Mark, tr: Transaction) => Transaction;
10
+ export declare const entireSelectionContainsMark: (mark: Mark | MarkType, doc: PMNode, fromPos: number, toPos: number) => boolean;
10
11
  /**
11
12
  * A custom version of the ProseMirror toggleMark, where we only toggle marks
12
13
  * on text nodes in the selection rather than all inline nodes.
@@ -1,2 +1,2 @@
1
- export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark, } from './commands';
1
+ export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark, entireSelectionContainsMark, } from './commands';
2
2
  export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded, } from './text-formatting';
@@ -1,3 +1,2 @@
1
1
  export { default as Mention } from './ui/Mention';
2
2
  export { MentionSharedCssClassName } from './styles/shared/mention';
3
- export { default as MentionWithProfileCard } from './ui/Mention/mention-with-profilecard';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "80.5.0",
3
+ "version": "80.5.2",
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/"
@@ -103,7 +103,7 @@
103
103
  "@atlaskit/analytics-namespaced-context": "^6.9.0",
104
104
  "@atlaskit/analytics-next": "^9.3.0",
105
105
  "@atlaskit/analytics-next-stable-react-context": "1.0.1",
106
- "@atlaskit/button": "^17.15.0",
106
+ "@atlaskit/button": "^17.16.0",
107
107
  "@atlaskit/code": "^15.2.0",
108
108
  "@atlaskit/codemod-utils": "^4.2.0",
109
109
  "@atlaskit/custom-steps": "^0.2.0",
@@ -132,7 +132,7 @@
132
132
  "@atlaskit/primitives": "^6.3.0",
133
133
  "@atlaskit/profilecard": "^19.13.0",
134
134
  "@atlaskit/section-message": "^6.5.0",
135
- "@atlaskit/smart-card": "^26.69.0",
135
+ "@atlaskit/smart-card": "^26.73.0",
136
136
  "@atlaskit/smart-user-picker": "^6.9.0",
137
137
  "@atlaskit/spinner": "^16.1.0",
138
138
  "@atlaskit/task-decision": "^17.10.0",