@atlaskit/editor-core 187.2.5 → 187.3.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,21 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 187.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`6bacee18c2d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6bacee18c2d) - [ux] Add new allowDatasource prop for enabling datasource in editor and add inlineCard fallback render for blockCard with datasource
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 187.2.7
14
+
15
+ ### Patch Changes
16
+
17
+ - [`022b25d8eed`](https://bitbucket.org/atlassian/atlassian-frontend/commits/022b25d8eed) - ED-17862: Fixed cusor position after pasting panel decisions in the same table cell."
18
+
3
19
  ## 187.2.5
4
20
 
5
21
  ### Patch Changes
@@ -812,7 +812,16 @@ function handleRichText(slice, queueCardsFromChangedTr) {
812
812
  schema: schema
813
813
  });
814
814
  } else if (noNeedForSafeInsert) {
815
+ var _slice$content$lastCh, _slice$content$lastCh2;
815
816
  tr.replaceSelection(slice);
817
+ // when cursor is inside a table cell, and slice.content.lastChild is a panel, expand, or decisionList
818
+ // need to make sure the cursor position is is right after the panel, expand, or decisionList
819
+ // still in the same table cell, see issue: https://product-fabric.atlassian.net/browse/ED-17862
820
+ var shouldUpdateCursorPosAfterPaste = ['panel', 'nestedExpand', 'decisionList'].includes(((_slice$content$lastCh = slice.content.lastChild) === null || _slice$content$lastCh === void 0 ? void 0 : (_slice$content$lastCh2 = _slice$content$lastCh.type) === null || _slice$content$lastCh2 === void 0 ? void 0 : _slice$content$lastCh2.name) || '');
821
+ if ((0, _utils2.insideTableCell)(state) && shouldUpdateCursorPosAfterPaste) {
822
+ var nextPos = tr.doc.resolve(tr.mapping.map(selection.$from.pos));
823
+ tr.setSelection(new _gapCursorSelection.GapCursorSelection(nextPos, _gapCursorSelection.Side.RIGHT));
824
+ }
816
825
  } else {
817
826
  // need to scan the slice if there's a block node or list items inside it
818
827
  var doesBlockNodeExist = false;
@@ -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 = "187.2.5";
9
+ var version = "187.3.0";
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": "187.2.5",
3
+ "version": "187.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -796,7 +796,16 @@ export function handleRichText(slice, queueCardsFromChangedTr) {
796
796
  schema
797
797
  });
798
798
  } else if (noNeedForSafeInsert) {
799
+ var _slice$content$lastCh, _slice$content$lastCh2;
799
800
  tr.replaceSelection(slice);
801
+ // when cursor is inside a table cell, and slice.content.lastChild is a panel, expand, or decisionList
802
+ // need to make sure the cursor position is is right after the panel, expand, or decisionList
803
+ // still in the same table cell, see issue: https://product-fabric.atlassian.net/browse/ED-17862
804
+ const shouldUpdateCursorPosAfterPaste = ['panel', 'nestedExpand', 'decisionList'].includes(((_slice$content$lastCh = slice.content.lastChild) === null || _slice$content$lastCh === void 0 ? void 0 : (_slice$content$lastCh2 = _slice$content$lastCh.type) === null || _slice$content$lastCh2 === void 0 ? void 0 : _slice$content$lastCh2.name) || '');
805
+ if (insideTableCell(state) && shouldUpdateCursorPosAfterPaste) {
806
+ const nextPos = tr.doc.resolve(tr.mapping.map(selection.$from.pos));
807
+ tr.setSelection(new GapCursorSelection(nextPos, Side.RIGHT));
808
+ }
800
809
  } else {
801
810
  // need to scan the slice if there's a block node or list items inside it
802
811
  let doesBlockNodeExist = false;
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "187.2.5";
2
+ export const version = "187.3.0";
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": "187.2.5",
3
+ "version": "187.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -790,7 +790,16 @@ export function handleRichText(slice, queueCardsFromChangedTr) {
790
790
  schema: schema
791
791
  });
792
792
  } else if (noNeedForSafeInsert) {
793
+ var _slice$content$lastCh, _slice$content$lastCh2;
793
794
  tr.replaceSelection(slice);
795
+ // when cursor is inside a table cell, and slice.content.lastChild is a panel, expand, or decisionList
796
+ // need to make sure the cursor position is is right after the panel, expand, or decisionList
797
+ // still in the same table cell, see issue: https://product-fabric.atlassian.net/browse/ED-17862
798
+ var shouldUpdateCursorPosAfterPaste = ['panel', 'nestedExpand', 'decisionList'].includes(((_slice$content$lastCh = slice.content.lastChild) === null || _slice$content$lastCh === void 0 ? void 0 : (_slice$content$lastCh2 = _slice$content$lastCh.type) === null || _slice$content$lastCh2 === void 0 ? void 0 : _slice$content$lastCh2.name) || '');
799
+ if (insideTableCell(state) && shouldUpdateCursorPosAfterPaste) {
800
+ var nextPos = tr.doc.resolve(tr.mapping.map(selection.$from.pos));
801
+ tr.setSelection(new GapCursorSelection(nextPos, Side.RIGHT));
802
+ }
794
803
  } else {
795
804
  // need to scan the slice if there's a block node or list items inside it
796
805
  var doesBlockNodeExist = false;
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "187.2.5";
2
+ export var version = "187.3.0";
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": "187.2.5",
3
+ "version": "187.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,9 +1,10 @@
1
- import { Schema, Slice } from 'prosemirror-model';
2
- import { EditorState } from 'prosemirror-state';
3
- import { ExtensionAutoConvertHandler } from '@atlaskit/editor-common/extensions';
4
- import { Command } from '../../types';
5
- import { InputMethodInsertMedia } from '../analytics';
6
- import { CardOptions } from '@atlaskit/editor-common/card';
1
+ import { Slice } from 'prosemirror-model';
2
+ import type { Schema } from 'prosemirror-model';
3
+ import type { EditorState } from 'prosemirror-state';
4
+ import type { ExtensionAutoConvertHandler } from '@atlaskit/editor-common/extensions';
5
+ import type { Command } from '../../types';
6
+ import type { InputMethodInsertMedia } from '../analytics';
7
+ import type { CardOptions } from '@atlaskit/editor-common/card';
7
8
  import type { QueueCardsFromTransactionAction } from '@atlaskit/editor-common/card';
8
9
  export declare function handleMention(slice: Slice, schema: Schema): Slice;
9
10
  export declare function handlePasteIntoTaskOrDecisionOrPanel(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
@@ -1,10 +1,10 @@
1
- import { Schema } from 'prosemirror-model';
1
+ import type { Schema } from 'prosemirror-model';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import { CardOptions } from '@atlaskit/editor-common/card';
4
- import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
- import { DispatchAnalyticsEvent } from '../../analytics';
3
+ import type { CardOptions } from '@atlaskit/editor-common/card';
4
+ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
+ import type { DispatchAnalyticsEvent } from '../../analytics';
6
6
  export { pluginKey as stateKey } from './plugin-factory';
7
7
  import type { Dispatch } from '../../../event-dispatcher';
8
- import { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
+ import type { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
9
  import type pastePlugin from '../';
10
10
  export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, featureFlags: FeatureFlags, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<any>;
@@ -1,9 +1,10 @@
1
- import { Schema, Slice } from 'prosemirror-model';
2
- import { EditorState } from 'prosemirror-state';
3
- import { ExtensionAutoConvertHandler } from '@atlaskit/editor-common/extensions';
4
- import { Command } from '../../types';
5
- import { InputMethodInsertMedia } from '../analytics';
6
- import { CardOptions } from '@atlaskit/editor-common/card';
1
+ import { Slice } from 'prosemirror-model';
2
+ import type { Schema } from 'prosemirror-model';
3
+ import type { EditorState } from 'prosemirror-state';
4
+ import type { ExtensionAutoConvertHandler } from '@atlaskit/editor-common/extensions';
5
+ import type { Command } from '../../types';
6
+ import type { InputMethodInsertMedia } from '../analytics';
7
+ import type { CardOptions } from '@atlaskit/editor-common/card';
7
8
  import type { QueueCardsFromTransactionAction } from '@atlaskit/editor-common/card';
8
9
  export declare function handleMention(slice: Slice, schema: Schema): Slice;
9
10
  export declare function handlePasteIntoTaskOrDecisionOrPanel(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
@@ -1,10 +1,10 @@
1
- import { Schema } from 'prosemirror-model';
1
+ import type { Schema } from 'prosemirror-model';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import { CardOptions } from '@atlaskit/editor-common/card';
4
- import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
- import { DispatchAnalyticsEvent } from '../../analytics';
3
+ import type { CardOptions } from '@atlaskit/editor-common/card';
4
+ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
+ import type { DispatchAnalyticsEvent } from '../../analytics';
6
6
  export { pluginKey as stateKey } from './plugin-factory';
7
7
  import type { Dispatch } from '../../../event-dispatcher';
8
- import { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
+ import type { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
9
  import type pastePlugin from '../';
10
10
  export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, featureFlags: FeatureFlags, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.2.5",
3
+ "version": "187.3.0",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -55,12 +55,12 @@
55
55
  "@atlaskit/code": "^14.6.0",
56
56
  "@atlaskit/date": "^0.10.0",
57
57
  "@atlaskit/datetime-picker": "^12.7.0",
58
- "@atlaskit/editor-common": "^74.24.0",
58
+ "@atlaskit/editor-common": "^74.25.0",
59
59
  "@atlaskit/editor-json-transformer": "^8.10.0",
60
60
  "@atlaskit/editor-markdown-transformer": "^5.2.5",
61
61
  "@atlaskit/editor-palette": "1.5.1",
62
62
  "@atlaskit/editor-plugin-analytics": "^0.1.0",
63
- "@atlaskit/editor-plugin-card": "^0.1.0",
63
+ "@atlaskit/editor-plugin-card": "^0.2.0",
64
64
  "@atlaskit/editor-plugin-content-insertion": "^0.0.6",
65
65
  "@atlaskit/editor-plugin-context-panel": "^0.1.0",
66
66
  "@atlaskit/editor-plugin-decorations": "^0.1.0",
@@ -147,7 +147,7 @@
147
147
  "@af/editor-libra": "*",
148
148
  "@af/integration-testing": "*",
149
149
  "@atlaskit/code": "^14.6.0",
150
- "@atlaskit/collab-provider": "9.7.2",
150
+ "@atlaskit/collab-provider": "9.7.3",
151
151
  "@atlaskit/dropdown-menu": "^11.10.0",
152
152
  "@atlaskit/editor-extension-dropbox": "^0.4.0",
153
153
  "@atlaskit/editor-plugin-table": "^2.5.0",
@@ -163,7 +163,7 @@
163
163
  "@atlaskit/media-test-helpers": "^33.0.0",
164
164
  "@atlaskit/menu": "^1.9.0",
165
165
  "@atlaskit/platform-feature-flags": "^0.2.0",
166
- "@atlaskit/renderer": "^108.7.0",
166
+ "@atlaskit/renderer": "^108.8.0",
167
167
  "@atlaskit/section-message": "^6.4.0",
168
168
  "@atlaskit/smart-user-picker": "^6.1.0",
169
169
  "@atlaskit/synchrony-test-helpers": "^2.3.0",