@atlaskit/editor-core 185.9.1 → 185.9.5

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,18 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 185.9.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`dbfd6704c14`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dbfd6704c14) - [ux] ED-18061 - Safe insert node selected codeblock in paste handler logic
8
+ - Updated dependencies
9
+
10
+ ## 185.9.2
11
+
12
+ ### Patch Changes
13
+
14
+ - [`42e5defb430`](https://bitbucket.org/atlassian/atlassian-frontend/commits/42e5defb430) - Fix typing of internal EditorNext react component.
15
+
3
16
  ## 185.9.1
4
17
 
5
18
  ### Patch Changes
@@ -138,7 +138,11 @@ var EditorNext = /*#__PURE__*/function (_React$Component) {
138
138
  return EditorNext;
139
139
  }(_react2.default.Component);
140
140
  exports.default = EditorNext;
141
- (0, _defineProperty2.default)(EditorNext, "defaultProps", _editorPropTypes.defaultProps);
141
+ (0, _defineProperty2.default)(EditorNext, "defaultProps", {
142
+ appearance: 'comment',
143
+ disabled: false,
144
+ quickInsert: true
145
+ });
142
146
  (0, _defineProperty2.default)(EditorNext, "contextTypes", {
143
147
  editorActions: _propTypes.default.object
144
148
  });
@@ -121,7 +121,9 @@ function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChangedTr) {
121
121
  // and the slice is not a whole node (i.e. openStart is 1 and openEnd is 0)
122
122
  // or the slice's first node is a paragraph,
123
123
  // then we can replace the selection with our slice.
124
- if ((transformedSliceIsValidNode || selectionIsValidNode) && !(transformedSlice.openStart === 1 && transformedSlice.openEnd === 0) || ((_transformedSlice$con = transformedSlice.content.firstChild) === null || _transformedSlice$con === void 0 ? void 0 : _transformedSlice$con.type) === paragraph) {
124
+ if ((transformedSliceIsValidNode || selectionIsValidNode) && !(transformedSlice.openStart === 1 && transformedSlice.openEnd === 0 ||
125
+ // Whole codeblock node has reverse slice depths.
126
+ transformedSlice.openStart === 0 && transformedSlice.openEnd === 1) || ((_transformedSlice$con = transformedSlice.content.firstChild) === null || _transformedSlice$con === void 0 ? void 0 : _transformedSlice$con.type) === paragraph) {
125
127
  tr.replaceSelection(transformedSlice).scrollIntoView();
126
128
  } else {
127
129
  // This maintains both the selection (destination) and the slice (paste content).
@@ -268,7 +268,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
268
268
  var selectionParentNode = state.selection.$head.node(selectionDepth - 1);
269
269
  var selectionParentType = selectionParentNode === null || selectionParentNode === void 0 ? void 0 : selectionParentNode.type;
270
270
  var edgeCaseNodeTypes = [(_schema$nodes = schema.nodes) === null || _schema$nodes === void 0 ? void 0 : _schema$nodes.panel, (_schema$nodes2 = schema.nodes) === null || _schema$nodes2 === void 0 ? void 0 : _schema$nodes2.taskList, (_schema$nodes3 = schema.nodes) === null || _schema$nodes3 === void 0 ? void 0 : _schema$nodes3.decisionList];
271
- if (slice.openStart === 0 && selectionParentNode && edgeCaseNodeTypes.includes(selectionParentType)) {
271
+ if (slice.openStart === 0 && slice.openEnd !== 1 && selectionParentNode && edgeCaseNodeTypes.includes(selectionParentType)) {
272
272
  // @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
273
273
  slice.openStart = 1;
274
274
  }
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "185.9.1";
9
+ var version = "185.9.5";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.9.1",
3
+ "version": "185.9.5",
4
4
  "sideEffects": false
5
5
  }
@@ -13,7 +13,7 @@ import React from 'react';
13
13
  import EditorActions from '../actions';
14
14
  import { fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
15
15
  import EditorInternal from './editor-internal';
16
- import { defaultProps, propTypes } from './utils/editorPropTypes';
16
+ import { propTypes } from './utils/editorPropTypes';
17
17
  import trackEditorActions from './utils/trackEditorActions';
18
18
  import onEditorCreated from './utils/onEditorCreated';
19
19
  import deprecationWarnings from './utils/deprecationWarnings';
@@ -91,7 +91,11 @@ export default class EditorNext extends React.Component {
91
91
  );
92
92
  }
93
93
  }
94
- _defineProperty(EditorNext, "defaultProps", defaultProps);
94
+ _defineProperty(EditorNext, "defaultProps", {
95
+ appearance: 'comment',
96
+ disabled: false,
97
+ quickInsert: true
98
+ });
95
99
  _defineProperty(EditorNext, "contextTypes", {
96
100
  editorActions: PropTypes.object
97
101
  });
@@ -101,7 +101,9 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChange
101
101
  // and the slice is not a whole node (i.e. openStart is 1 and openEnd is 0)
102
102
  // or the slice's first node is a paragraph,
103
103
  // then we can replace the selection with our slice.
104
- if ((transformedSliceIsValidNode || selectionIsValidNode) && !(transformedSlice.openStart === 1 && transformedSlice.openEnd === 0) || ((_transformedSlice$con = transformedSlice.content.firstChild) === null || _transformedSlice$con === void 0 ? void 0 : _transformedSlice$con.type) === paragraph) {
104
+ if ((transformedSliceIsValidNode || selectionIsValidNode) && !(transformedSlice.openStart === 1 && transformedSlice.openEnd === 0 ||
105
+ // Whole codeblock node has reverse slice depths.
106
+ transformedSlice.openStart === 0 && transformedSlice.openEnd === 1) || ((_transformedSlice$con = transformedSlice.content.firstChild) === null || _transformedSlice$con === void 0 ? void 0 : _transformedSlice$con.type) === paragraph) {
105
107
  tr.replaceSelection(transformedSlice).scrollIntoView();
106
108
  } else {
107
109
  // This maintains both the selection (destination) and the slice (paste content).
@@ -234,7 +234,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
234
234
  const selectionParentNode = state.selection.$head.node(selectionDepth - 1);
235
235
  const selectionParentType = selectionParentNode === null || selectionParentNode === void 0 ? void 0 : selectionParentNode.type;
236
236
  const edgeCaseNodeTypes = [(_schema$nodes = schema.nodes) === null || _schema$nodes === void 0 ? void 0 : _schema$nodes.panel, (_schema$nodes2 = schema.nodes) === null || _schema$nodes2 === void 0 ? void 0 : _schema$nodes2.taskList, (_schema$nodes3 = schema.nodes) === null || _schema$nodes3 === void 0 ? void 0 : _schema$nodes3.decisionList];
237
- if (slice.openStart === 0 && selectionParentNode && edgeCaseNodeTypes.includes(selectionParentType)) {
237
+ if (slice.openStart === 0 && slice.openEnd !== 1 && selectionParentNode && edgeCaseNodeTypes.includes(selectionParentType)) {
238
238
  // @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
239
239
  slice.openStart = 1;
240
240
  }
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "185.9.1";
2
+ export const version = "185.9.5";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.9.1",
3
+ "version": "185.9.5",
4
4
  "sideEffects": false
5
5
  }
@@ -23,7 +23,7 @@ import React from 'react';
23
23
  import EditorActions from '../actions';
24
24
  import { fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
25
25
  import EditorInternal from './editor-internal';
26
- import { defaultProps, propTypes } from './utils/editorPropTypes';
26
+ import { propTypes } from './utils/editorPropTypes';
27
27
  import trackEditorActions from './utils/trackEditorActions';
28
28
  import _onEditorCreated from './utils/onEditorCreated';
29
29
  import deprecationWarnings from './utils/deprecationWarnings';
@@ -134,7 +134,11 @@ var EditorNext = /*#__PURE__*/function (_React$Component) {
134
134
  }]);
135
135
  return EditorNext;
136
136
  }(React.Component);
137
- _defineProperty(EditorNext, "defaultProps", defaultProps);
137
+ _defineProperty(EditorNext, "defaultProps", {
138
+ appearance: 'comment',
139
+ disabled: false,
140
+ quickInsert: true
141
+ });
138
142
  _defineProperty(EditorNext, "contextTypes", {
139
143
  editorActions: PropTypes.object
140
144
  });
@@ -99,7 +99,9 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChange
99
99
  // and the slice is not a whole node (i.e. openStart is 1 and openEnd is 0)
100
100
  // or the slice's first node is a paragraph,
101
101
  // then we can replace the selection with our slice.
102
- if ((transformedSliceIsValidNode || selectionIsValidNode) && !(transformedSlice.openStart === 1 && transformedSlice.openEnd === 0) || ((_transformedSlice$con = transformedSlice.content.firstChild) === null || _transformedSlice$con === void 0 ? void 0 : _transformedSlice$con.type) === paragraph) {
102
+ if ((transformedSliceIsValidNode || selectionIsValidNode) && !(transformedSlice.openStart === 1 && transformedSlice.openEnd === 0 ||
103
+ // Whole codeblock node has reverse slice depths.
104
+ transformedSlice.openStart === 0 && transformedSlice.openEnd === 1) || ((_transformedSlice$con = transformedSlice.content.firstChild) === null || _transformedSlice$con === void 0 ? void 0 : _transformedSlice$con.type) === paragraph) {
103
105
  tr.replaceSelection(transformedSlice).scrollIntoView();
104
106
  } else {
105
107
  // This maintains both the selection (destination) and the slice (paste content).
@@ -254,7 +254,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
254
254
  var selectionParentNode = state.selection.$head.node(selectionDepth - 1);
255
255
  var selectionParentType = selectionParentNode === null || selectionParentNode === void 0 ? void 0 : selectionParentNode.type;
256
256
  var edgeCaseNodeTypes = [(_schema$nodes = schema.nodes) === null || _schema$nodes === void 0 ? void 0 : _schema$nodes.panel, (_schema$nodes2 = schema.nodes) === null || _schema$nodes2 === void 0 ? void 0 : _schema$nodes2.taskList, (_schema$nodes3 = schema.nodes) === null || _schema$nodes3 === void 0 ? void 0 : _schema$nodes3.decisionList];
257
- if (slice.openStart === 0 && selectionParentNode && edgeCaseNodeTypes.includes(selectionParentType)) {
257
+ if (slice.openStart === 0 && slice.openEnd !== 1 && selectionParentNode && edgeCaseNodeTypes.includes(selectionParentType)) {
258
258
  // @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
259
259
  slice.openStart = 1;
260
260
  }
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "185.9.1";
2
+ export var version = "185.9.5";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.9.1",
3
+ "version": "185.9.5",
4
4
  "sideEffects": false
5
5
  }
@@ -4,7 +4,11 @@ import React from 'react';
4
4
  import { EditorNextProps } from '../types/editor-props';
5
5
  import { Context } from './utils/editorPropTypes';
6
6
  export default class EditorNext extends React.Component<EditorNextProps> {
7
- static defaultProps: import("../types/editor-props").EditorProps;
7
+ static defaultProps: {
8
+ appearance: string;
9
+ disabled: boolean;
10
+ quickInsert: boolean;
11
+ };
8
12
  static contextTypes: {
9
13
  editorActions: PropTypes.Requireable<object>;
10
14
  };
@@ -54,7 +54,7 @@ export type PrimaryToolbarComponents = BeforeAndAfterToolbarComponents | ReactCo
54
54
  export type UseStickyToolbarType = boolean | RefObject<HTMLElement> | {
55
55
  offsetTop: number;
56
56
  };
57
- export interface EditorBaseProps extends EditorPluginFeatureProps, EditorProviderProps {
57
+ interface EditorBaseProps {
58
58
  appearance?: EditorAppearance;
59
59
  contentComponents?: ReactComponents;
60
60
  primaryToolbarIconBefore?: ReactElement;
@@ -4,7 +4,11 @@ import React from 'react';
4
4
  import { EditorNextProps } from '../types/editor-props';
5
5
  import { Context } from './utils/editorPropTypes';
6
6
  export default class EditorNext extends React.Component<EditorNextProps> {
7
- static defaultProps: import("../types/editor-props").EditorProps;
7
+ static defaultProps: {
8
+ appearance: string;
9
+ disabled: boolean;
10
+ quickInsert: boolean;
11
+ };
8
12
  static contextTypes: {
9
13
  editorActions: PropTypes.Requireable<object>;
10
14
  };
@@ -54,7 +54,7 @@ export type PrimaryToolbarComponents = BeforeAndAfterToolbarComponents | ReactCo
54
54
  export type UseStickyToolbarType = boolean | RefObject<HTMLElement> | {
55
55
  offsetTop: number;
56
56
  };
57
- export interface EditorBaseProps extends EditorPluginFeatureProps, EditorProviderProps {
57
+ interface EditorBaseProps {
58
58
  appearance?: EditorAppearance;
59
59
  contentComponents?: ReactComponents;
60
60
  primaryToolbarIconBefore?: ReactElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.9.1",
3
+ "version": "185.9.5",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -49,7 +49,7 @@
49
49
  "@atlaskit/code": "^14.6.0",
50
50
  "@atlaskit/date": "^0.10.0",
51
51
  "@atlaskit/datetime-picker": "^12.7.0",
52
- "@atlaskit/editor-common": "^74.15.0",
52
+ "@atlaskit/editor-common": "^74.17.0",
53
53
  "@atlaskit/editor-json-transformer": "^8.10.0",
54
54
  "@atlaskit/editor-markdown-transformer": "^5.2.0",
55
55
  "@atlaskit/editor-palette": "1.5.1",
@@ -95,7 +95,7 @@
95
95
  "@atlaskit/spinner": "^15.5.0",
96
96
  "@atlaskit/status": "^1.3.0",
97
97
  "@atlaskit/tabs": "^13.4.0",
98
- "@atlaskit/task-decision": "^17.6.0",
98
+ "@atlaskit/task-decision": "^17.7.0",
99
99
  "@atlaskit/textarea": "^4.7.0",
100
100
  "@atlaskit/textfield": "^5.6.0",
101
101
  "@atlaskit/theme": "^12.5.0",
@@ -243,6 +243,10 @@
243
243
  },
244
244
  "platform.editor.media.extended-resize-experience": {
245
245
  "type": "boolean"
246
+ },
247
+ "platform.design-system-team.border-checkbox_nyoiu": {
248
+ "type": "boolean",
249
+ "referenceOnly": "true"
246
250
  }
247
251
  },
248
252
  "tests": {
package/report.api.md CHANGED
@@ -653,9 +653,7 @@ export class EditorActions<T = any> implements EditorActionsOptions<T> {
653
653
  }
654
654
 
655
655
  // @public (undocumented)
656
- interface EditorBaseProps
657
- extends EditorPluginFeatureProps,
658
- EditorProviderProps {
656
+ interface EditorBaseProps {
659
657
  // (undocumented)
660
658
  appearance?: EditorAppearance;
661
659
  // (undocumented)
@@ -816,7 +814,11 @@ class EditorNext extends React_2.Component<EditorNextProps> {
816
814
  editorActions: PropTypes.Requireable<object>;
817
815
  };
818
816
  // (undocumented)
819
- static defaultProps: EditorProps;
817
+ static defaultProps: {
818
+ appearance: string;
819
+ disabled: boolean;
820
+ quickInsert: boolean;
821
+ };
820
822
  // (undocumented)
821
823
  static propTypes: {
822
824
  preset: ({ preset }: Pick<EditorNextProps, 'preset'>) => Error | null;
@@ -592,7 +592,7 @@ export class EditorActions<T = any> implements EditorActionsOptions<T> {
592
592
  }
593
593
 
594
594
  // @public (undocumented)
595
- interface EditorBaseProps extends EditorPluginFeatureProps, EditorProviderProps {
595
+ interface EditorBaseProps {
596
596
  // (undocumented)
597
597
  appearance?: EditorAppearance;
598
598
  // (undocumented)
@@ -748,7 +748,11 @@ class EditorNext extends React_2.Component<EditorNextProps> {
748
748
  editorActions: PropTypes.Requireable<object>;
749
749
  };
750
750
  // (undocumented)
751
- static defaultProps: EditorProps;
751
+ static defaultProps: {
752
+ appearance: string;
753
+ disabled: boolean;
754
+ quickInsert: boolean;
755
+ };
752
756
  // (undocumented)
753
757
  static propTypes: {
754
758
  preset: ({ preset }: Pick<EditorNextProps, 'preset'>) => Error | null;