@atlaskit/editor-core 187.10.2 → 187.10.4

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-core
2
2
 
3
+ ## 187.10.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`14fb6018157`](https://bitbucket.org/atlassian/atlassian-frontend/commits/14fb6018157) - [ED-19354] Small fixes to respect the next ProseMirror version
8
+
9
+ ## 187.10.3
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 187.10.2
4
16
 
5
17
  ### Patch Changes
@@ -66,7 +66,7 @@ function createPlugin(options, featureFlags, pluginInjectionApi) {
66
66
  measureName, function (_ref) {
67
67
  var duration = _ref.duration,
68
68
  distortedDuration = _ref.distortedDuration;
69
- (0, _analytics.fireAnalyticsEvent)(pluginState.createAnalyticsEvent)({
69
+ (0, _analytics.fireAnalyticsEvent)(pluginState.createAnalyticsEvent || undefined)({
70
70
  payload: extendPayload({
71
71
  payload: payload,
72
72
  duration: duration,
@@ -316,13 +316,22 @@ function handlePasteLinkOnSelectedText(slice) {
316
316
  }
317
317
  function handlePasteAsPlainText(slice, _event) {
318
318
  return function (state, dispatch, view) {
319
+ var _input;
320
+ if (!view) {
321
+ return false;
322
+ }
323
+
324
+ // prosemirror-bump-fix
325
+ // Yes, this is wrong by default. But, we need to keep the private PAI usage to unblock the prosemirror bump
326
+ // So, this code will make sure we are checking for both version (current and the newest prosemirror-view version
327
+ var isShiftKeyPressed = view.shiftKey || ((_input = view.input) === null || _input === void 0 ? void 0 : _input.shiftKey);
319
328
  // In case of SHIFT+CMD+V ("Paste and Match Style") we don't want to run the usual
320
329
  // fuzzy matching of content. ProseMirror already handles this scenario and will
321
330
  // provide us with slice containing paragraphs with plain text, which we decorate
322
331
  // with "stored marks".
323
332
  // @see prosemirror-view/src/clipboard.js:parseFromClipboard()).
324
333
  // @see prosemirror-view/src/input.js:doPaste().
325
- if (view && view.shiftKey) {
334
+ if (isShiftKeyPressed) {
326
335
  var tr = (0, _history.closeHistory)(state.tr);
327
336
  var _tr = tr,
328
337
  selection = _tr.selection;
@@ -115,7 +115,7 @@ var buildMenuIconState = function buildMenuIconState(iconMark) {
115
115
  return function (_ref2) {
116
116
  var schema = _ref2.schema,
117
117
  textFormattingPluginState = _ref2.textFormattingPluginState;
118
- var hasPluginState = Boolean(textFormattingPluginState);
118
+ var hasPluginState = Boolean(Object.keys(textFormattingPluginState || {}).length);
119
119
  var markSchema = IconsMarkSchema[iconMark];
120
120
  var hasSchemaMark = Boolean(schema.marks[markSchema]);
121
121
  if (!hasPluginState) {
@@ -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.10.2";
9
+ var version = "187.10.4";
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.10.2",
3
+ "version": "187.10.4",
4
4
  "sideEffects": false
5
5
  }
@@ -52,7 +52,7 @@ function createPlugin(options, featureFlags, pluginInjectionApi) {
52
52
  duration,
53
53
  distortedDuration
54
54
  }) => {
55
- fireAnalyticsEvent(pluginState.createAnalyticsEvent)({
55
+ fireAnalyticsEvent(pluginState.createAnalyticsEvent || undefined)({
56
56
  payload: extendPayload({
57
57
  payload,
58
58
  duration,
@@ -309,13 +309,22 @@ export function handlePasteLinkOnSelectedText(slice) {
309
309
  }
310
310
  export function handlePasteAsPlainText(slice, _event) {
311
311
  return (state, dispatch, view) => {
312
+ var _input;
313
+ if (!view) {
314
+ return false;
315
+ }
316
+
317
+ // prosemirror-bump-fix
318
+ // Yes, this is wrong by default. But, we need to keep the private PAI usage to unblock the prosemirror bump
319
+ // So, this code will make sure we are checking for both version (current and the newest prosemirror-view version
320
+ const isShiftKeyPressed = view.shiftKey || ((_input = view.input) === null || _input === void 0 ? void 0 : _input.shiftKey);
312
321
  // In case of SHIFT+CMD+V ("Paste and Match Style") we don't want to run the usual
313
322
  // fuzzy matching of content. ProseMirror already handles this scenario and will
314
323
  // provide us with slice containing paragraphs with plain text, which we decorate
315
324
  // with "stored marks".
316
325
  // @see prosemirror-view/src/clipboard.js:parseFromClipboard()).
317
326
  // @see prosemirror-view/src/input.js:doPaste().
318
- if (view && view.shiftKey) {
327
+ if (isShiftKeyPressed) {
319
328
  let tr = closeHistory(state.tr);
320
329
  const {
321
330
  selection
@@ -106,7 +106,7 @@ const buildMenuIconState = iconMark => ({
106
106
  schema,
107
107
  textFormattingPluginState
108
108
  }) => {
109
- const hasPluginState = Boolean(textFormattingPluginState);
109
+ const hasPluginState = Boolean(Object.keys(textFormattingPluginState || {}).length);
110
110
  const markSchema = IconsMarkSchema[iconMark];
111
111
  const hasSchemaMark = Boolean(schema.marks[markSchema]);
112
112
  if (!hasPluginState) {
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "187.10.2";
2
+ export const version = "187.10.4";
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.10.2",
3
+ "version": "187.10.4",
4
4
  "sideEffects": false
5
5
  }
@@ -58,7 +58,7 @@ function createPlugin(options, featureFlags, pluginInjectionApi) {
58
58
  measureName, function (_ref) {
59
59
  var duration = _ref.duration,
60
60
  distortedDuration = _ref.distortedDuration;
61
- fireAnalyticsEvent(pluginState.createAnalyticsEvent)({
61
+ fireAnalyticsEvent(pluginState.createAnalyticsEvent || undefined)({
62
62
  payload: extendPayload({
63
63
  payload: payload,
64
64
  duration: duration,
@@ -294,13 +294,22 @@ export function handlePasteLinkOnSelectedText(slice) {
294
294
  }
295
295
  export function handlePasteAsPlainText(slice, _event) {
296
296
  return function (state, dispatch, view) {
297
+ var _input;
298
+ if (!view) {
299
+ return false;
300
+ }
301
+
302
+ // prosemirror-bump-fix
303
+ // Yes, this is wrong by default. But, we need to keep the private PAI usage to unblock the prosemirror bump
304
+ // So, this code will make sure we are checking for both version (current and the newest prosemirror-view version
305
+ var isShiftKeyPressed = view.shiftKey || ((_input = view.input) === null || _input === void 0 ? void 0 : _input.shiftKey);
297
306
  // In case of SHIFT+CMD+V ("Paste and Match Style") we don't want to run the usual
298
307
  // fuzzy matching of content. ProseMirror already handles this scenario and will
299
308
  // provide us with slice containing paragraphs with plain text, which we decorate
300
309
  // with "stored marks".
301
310
  // @see prosemirror-view/src/clipboard.js:parseFromClipboard()).
302
311
  // @see prosemirror-view/src/input.js:doPaste().
303
- if (view && view.shiftKey) {
312
+ if (isShiftKeyPressed) {
304
313
  var tr = closeHistory(state.tr);
305
314
  var _tr = tr,
306
315
  selection = _tr.selection;
@@ -105,7 +105,7 @@ var buildMenuIconState = function buildMenuIconState(iconMark) {
105
105
  return function (_ref2) {
106
106
  var schema = _ref2.schema,
107
107
  textFormattingPluginState = _ref2.textFormattingPluginState;
108
- var hasPluginState = Boolean(textFormattingPluginState);
108
+ var hasPluginState = Boolean(Object.keys(textFormattingPluginState || {}).length);
109
109
  var markSchema = IconsMarkSchema[iconMark];
110
110
  var hasSchemaMark = Boolean(schema.marks[markSchema]);
111
111
  if (!hasPluginState) {
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "187.10.2";
2
+ export var version = "187.10.4";
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.10.2",
3
+ "version": "187.10.4",
4
4
  "sideEffects": false
5
5
  }
@@ -1,8 +1,8 @@
1
- import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
1
+ import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
2
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
3
- import { AnalyticsEventPayload } from './types';
3
+ import type { AnalyticsEventPayload } from './types';
4
4
  import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
5
- import { PerformanceTracking } from '../../types/performance-tracking';
5
+ import type { PerformanceTracking } from '../../types/performance-tracking';
6
6
  import type { analyticsPlugin as newAnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
7
  interface AnalyticsPluginOptions {
8
8
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
@@ -1,8 +1,8 @@
1
- import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
1
+ import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
2
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
3
- import { AnalyticsEventPayload } from './types';
3
+ import type { AnalyticsEventPayload } from './types';
4
4
  import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
5
- import { PerformanceTracking } from '../../types/performance-tracking';
5
+ import type { PerformanceTracking } from '../../types/performance-tracking';
6
6
  import type { analyticsPlugin as newAnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
7
  interface AnalyticsPluginOptions {
8
8
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.10.2",
3
+ "version": "187.10.4",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -83,7 +83,7 @@
83
83
  "@atlaskit/logo": "^13.14.0",
84
84
  "@atlaskit/media-card": "^76.1.0",
85
85
  "@atlaskit/media-client": "^23.1.0",
86
- "@atlaskit/media-common": "^7.1.0",
86
+ "@atlaskit/media-common": "^8.0.0",
87
87
  "@atlaskit/media-filmstrip": "^47.0.0",
88
88
  "@atlaskit/media-picker": "^66.1.0",
89
89
  "@atlaskit/media-ui": "^23.2.0",