@atlaskit/editor-common 76.3.2 → 76.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 76.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#41103](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41103) [`e268e178096`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e268e178096) - ED-20195 Decouple Text color plugin from editor core
8
+
9
+ ## 76.3.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#41015](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41015) [`a372c39bc57`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a372c39bc57) - ED-20297 fixed nested video overlapping issue
14
+
3
15
  ## 76.3.2
4
16
 
5
17
  ### Patch Changes
@@ -21,6 +21,18 @@ Object.defineProperty(exports, "filterChildrenBetween", {
21
21
  return _commands.filterChildrenBetween;
22
22
  }
23
23
  });
24
+ Object.defineProperty(exports, "isMarkAllowedInRange", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _textFormatting.isMarkAllowedInRange;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "isMarkExcluded", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _textFormatting.isMarkExcluded;
34
+ }
35
+ });
24
36
  Object.defineProperty(exports, "toggleMark", {
25
37
  enumerable: true,
26
38
  get: function get() {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.anyMarkActive = void 0;
6
+ exports.isMarkExcluded = exports.isMarkAllowedInRange = exports.anyMarkActive = void 0;
7
7
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
8
8
  /**
9
9
  * Determine if a mark of a specific type exists anywhere in the selection.
@@ -30,4 +30,38 @@ var anyMarkActive = exports.anyMarkActive = function anyMarkActive(state, markTy
30
30
  rangeHasMark = state.doc.rangeHasMark(from, to, markType);
31
31
  }
32
32
  return rangeHasMark;
33
+ };
34
+ var isMarkAllowedInRange = exports.isMarkAllowedInRange = function isMarkAllowedInRange(doc, ranges, type) {
35
+ var _loop = function _loop() {
36
+ var _ranges$i = ranges[i],
37
+ $from = _ranges$i.$from,
38
+ $to = _ranges$i.$to;
39
+ var can = $from.depth === 0 ? doc.type.allowsMarkType(type) : false;
40
+ doc.nodesBetween($from.pos, $to.pos, function (node) {
41
+ if (can) {
42
+ return false;
43
+ }
44
+ can = node.inlineContent && node.type.allowsMarkType(type);
45
+ return;
46
+ });
47
+ if (can) {
48
+ return {
49
+ v: can
50
+ };
51
+ }
52
+ },
53
+ _ret;
54
+ for (var i = 0; i < ranges.length; i++) {
55
+ _ret = _loop();
56
+ if (_ret) return _ret.v;
57
+ }
58
+ return false;
59
+ };
60
+ var isMarkExcluded = exports.isMarkExcluded = function isMarkExcluded(type, marks) {
61
+ if (marks) {
62
+ return marks.some(function (mark) {
63
+ return mark.type !== type && mark.type.excludes(type);
64
+ });
65
+ }
66
+ return false;
33
67
  };
@@ -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 = "76.3.2";
19
+ var packageVersion = "76.4.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
@@ -177,6 +177,12 @@ Object.defineProperty(exports, "embedSpacingStyles", {
177
177
  return _embedCard.embedSpacingStyles;
178
178
  }
179
179
  });
180
+ Object.defineProperty(exports, "expandIconWrapperStyle", {
181
+ enumerable: true,
182
+ get: function get() {
183
+ return _expand.expandIconWrapperStyle;
184
+ }
185
+ });
180
186
  Object.defineProperty(exports, "getOrderedListInlineStyles", {
181
187
  enumerable: true,
182
188
  get: function get() {
@@ -416,4 +422,5 @@ var _grid = require("./shared/grid");
416
422
  var _smartCard2 = require("./shared/smartCard");
417
423
  var _embedCard = require("./shared/embedCard");
418
424
  var _plugins = require("./shared/plugins");
419
- var _unsupportedContent = require("./shared/unsupported-content");
425
+ var _unsupportedContent = require("./shared/unsupported-content");
426
+ var _expand = require("./shared/expand");
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.expandIconWrapperStyle = void 0;
8
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
+ var _react = require("@emotion/react");
10
+ var _templateObject;
11
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
12
+ var expandIconWrapperStyle = exports.expandIconWrapperStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n margin-left: ", ";\n"])), "var(--ds-space-negative-100, -8px)");
@@ -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 = "76.3.2";
27
+ var packageVersion = "76.4.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,2 +1,2 @@
1
1
  export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark } from './commands';
2
- export { anyMarkActive } from './text-formatting';
2
+ export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded } from './text-formatting';
@@ -26,4 +26,30 @@ export const anyMarkActive = (state, markType) => {
26
26
  rangeHasMark = state.doc.rangeHasMark(from, to, markType);
27
27
  }
28
28
  return rangeHasMark;
29
+ };
30
+ export const isMarkAllowedInRange = (doc, ranges, type) => {
31
+ for (let i = 0; i < ranges.length; i++) {
32
+ const {
33
+ $from,
34
+ $to
35
+ } = ranges[i];
36
+ let can = $from.depth === 0 ? doc.type.allowsMarkType(type) : false;
37
+ doc.nodesBetween($from.pos, $to.pos, node => {
38
+ if (can) {
39
+ return false;
40
+ }
41
+ can = node.inlineContent && node.type.allowsMarkType(type);
42
+ return;
43
+ });
44
+ if (can) {
45
+ return can;
46
+ }
47
+ }
48
+ return false;
49
+ };
50
+ export const isMarkExcluded = (type, marks) => {
51
+ if (marks) {
52
+ return marks.some(mark => mark.type !== type && mark.type.excludes(type));
53
+ }
54
+ return false;
29
55
  };
@@ -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 = "76.3.2";
3
+ const packageVersion = "76.4.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
@@ -27,4 +27,5 @@ export { gridStyles, GRID_GUTTER } from './shared/grid';
27
27
  export { smartCardStyles, FLOATING_TOOLBAR_LINKPICKER_CLASSNAME, DATASOURCE_INNER_CONTAINER_CLASSNAME } from './shared/smartCard';
28
28
  export { embedCardStyles, embedSpacingStyles } from './shared/embedCard';
29
29
  export { buttonGroupStyle, separatorStyles, wrapperStyle, triggerWrapperStyles } from './shared/plugins';
30
- export { UnsupportedSharedCssClassName, unsupportedStyles } from './shared/unsupported-content';
30
+ export { UnsupportedSharedCssClassName, unsupportedStyles } from './shared/unsupported-content';
31
+ export { expandIconWrapperStyle } from './shared/expand';
@@ -0,0 +1,5 @@
1
+ import { css } from '@emotion/react';
2
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
+ export const expandIconWrapperStyle = css`
4
+ margin-left: ${"var(--ds-space-negative-100, -8px)"};
5
+ `;
@@ -9,7 +9,7 @@ import { themed } from '@atlaskit/theme/components';
9
9
  import { borderRadius } from '@atlaskit/theme/constants';
10
10
  import Layer from '../Layer';
11
11
  const packageName = "@atlaskit/editor-common";
12
- const packageVersion = "76.3.2";
12
+ const packageVersion = "76.4.0";
13
13
  const halfFocusRing = 1;
14
14
  const dropOffset = '0, 8';
15
15
  class DropList extends Component {
@@ -1,2 +1,2 @@
1
1
  export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark } from './commands';
2
- export { anyMarkActive } from './text-formatting';
2
+ export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded } from './text-formatting';
@@ -25,4 +25,38 @@ export var anyMarkActive = function anyMarkActive(state, markType) {
25
25
  rangeHasMark = state.doc.rangeHasMark(from, to, markType);
26
26
  }
27
27
  return rangeHasMark;
28
+ };
29
+ export var isMarkAllowedInRange = function isMarkAllowedInRange(doc, ranges, type) {
30
+ var _loop = function _loop() {
31
+ var _ranges$i = ranges[i],
32
+ $from = _ranges$i.$from,
33
+ $to = _ranges$i.$to;
34
+ var can = $from.depth === 0 ? doc.type.allowsMarkType(type) : false;
35
+ doc.nodesBetween($from.pos, $to.pos, function (node) {
36
+ if (can) {
37
+ return false;
38
+ }
39
+ can = node.inlineContent && node.type.allowsMarkType(type);
40
+ return;
41
+ });
42
+ if (can) {
43
+ return {
44
+ v: can
45
+ };
46
+ }
47
+ },
48
+ _ret;
49
+ for (var i = 0; i < ranges.length; i++) {
50
+ _ret = _loop();
51
+ if (_ret) return _ret.v;
52
+ }
53
+ return false;
54
+ };
55
+ export var isMarkExcluded = function isMarkExcluded(type, marks) {
56
+ if (marks) {
57
+ return marks.some(function (mark) {
58
+ return mark.type !== type && mark.type.excludes(type);
59
+ });
60
+ }
61
+ return false;
28
62
  };
@@ -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 = "76.3.2";
9
+ var packageVersion = "76.4.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
@@ -27,4 +27,5 @@ export { gridStyles, GRID_GUTTER } from './shared/grid';
27
27
  export { smartCardStyles, FLOATING_TOOLBAR_LINKPICKER_CLASSNAME, DATASOURCE_INNER_CONTAINER_CLASSNAME } from './shared/smartCard';
28
28
  export { embedCardStyles, embedSpacingStyles } from './shared/embedCard';
29
29
  export { buttonGroupStyle, separatorStyles, wrapperStyle, triggerWrapperStyles } from './shared/plugins';
30
- export { UnsupportedSharedCssClassName, unsupportedStyles } from './shared/unsupported-content';
30
+ export { UnsupportedSharedCssClassName, unsupportedStyles } from './shared/unsupported-content';
31
+ export { expandIconWrapperStyle } from './shared/expand';
@@ -0,0 +1,5 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+ var _templateObject;
3
+ import { css } from '@emotion/react';
4
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
5
+ export var expandIconWrapperStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-left: ", ";\n"])), "var(--ds-space-negative-100, -8px)");
@@ -19,7 +19,7 @@ import { themed } from '@atlaskit/theme/components';
19
19
  import { borderRadius } from '@atlaskit/theme/constants';
20
20
  import Layer from '../Layer';
21
21
  var packageName = "@atlaskit/editor-common";
22
- var packageVersion = "76.3.2";
22
+ var packageVersion = "76.4.0";
23
23
  var halfFocusRing = 1;
24
24
  var dropOffset = '0, 8';
25
25
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,2 +1,2 @@
1
1
  export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, } from './commands';
2
- export { anyMarkActive } from './text-formatting';
2
+ export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded, } from './text-formatting';
@@ -1,6 +1,8 @@
1
- import type { Mark, MarkType } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
1
+ import type { Mark, MarkType, Node } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorState, SelectionRange } from '@atlaskit/editor-prosemirror/state';
3
3
  /**
4
4
  * Determine if a mark of a specific type exists anywhere in the selection.
5
5
  */
6
6
  export declare const anyMarkActive: (state: EditorState, markType: Mark | MarkType) => boolean;
7
+ export declare const isMarkAllowedInRange: (doc: Node, ranges: readonly SelectionRange[], type: MarkType) => boolean;
8
+ export declare const isMarkExcluded: (type: MarkType, marks?: readonly Mark[] | null) => boolean;
@@ -5,8 +5,8 @@ export type ResizerProps = {
5
5
  className?: string;
6
6
  enable: EnabledHandles;
7
7
  width: number;
8
- minWidth?: number;
9
- maxWidth?: number;
8
+ minWidth?: number | string;
9
+ maxWidth?: number | string;
10
10
  snap?: Snap;
11
11
  snapGap?: number;
12
12
  resizeRatio?: number;
@@ -28,3 +28,4 @@ export { smartCardStyles, FLOATING_TOOLBAR_LINKPICKER_CLASSNAME, DATASOURCE_INNE
28
28
  export { embedCardStyles, embedSpacingStyles } from './shared/embedCard';
29
29
  export { buttonGroupStyle, separatorStyles, wrapperStyle, triggerWrapperStyles, } from './shared/plugins';
30
30
  export { UnsupportedSharedCssClassName, unsupportedStyles, } from './shared/unsupported-content';
31
+ export { expandIconWrapperStyle } from './shared/expand';
@@ -0,0 +1 @@
1
+ export declare const expandIconWrapperStyle: import("@emotion/react").SerializedStyles;
@@ -1,2 +1,2 @@
1
1
  export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, } from './commands';
2
- export { anyMarkActive } from './text-formatting';
2
+ export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded, } from './text-formatting';
@@ -1,6 +1,8 @@
1
- import type { Mark, MarkType } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
1
+ import type { Mark, MarkType, Node } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorState, SelectionRange } from '@atlaskit/editor-prosemirror/state';
3
3
  /**
4
4
  * Determine if a mark of a specific type exists anywhere in the selection.
5
5
  */
6
6
  export declare const anyMarkActive: (state: EditorState, markType: Mark | MarkType) => boolean;
7
+ export declare const isMarkAllowedInRange: (doc: Node, ranges: readonly SelectionRange[], type: MarkType) => boolean;
8
+ export declare const isMarkExcluded: (type: MarkType, marks?: readonly Mark[] | null) => boolean;
@@ -5,8 +5,8 @@ export type ResizerProps = {
5
5
  className?: string;
6
6
  enable: EnabledHandles;
7
7
  width: number;
8
- minWidth?: number;
9
- maxWidth?: number;
8
+ minWidth?: number | string;
9
+ maxWidth?: number | string;
10
10
  snap?: Snap;
11
11
  snapGap?: number;
12
12
  resizeRatio?: number;
@@ -28,3 +28,4 @@ export { smartCardStyles, FLOATING_TOOLBAR_LINKPICKER_CLASSNAME, DATASOURCE_INNE
28
28
  export { embedCardStyles, embedSpacingStyles } from './shared/embedCard';
29
29
  export { buttonGroupStyle, separatorStyles, wrapperStyle, triggerWrapperStyles, } from './shared/plugins';
30
30
  export { UnsupportedSharedCssClassName, unsupportedStyles, } from './shared/unsupported-content';
31
+ export { expandIconWrapperStyle } from './shared/expand';
@@ -0,0 +1 @@
1
+ export declare const expandIconWrapperStyle: import("@emotion/react").SerializedStyles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "76.3.2",
3
+ "version": "76.4.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/"