@atlaskit/editor-core 199.2.1 → 199.2.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,21 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 199.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#156301](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156301)
8
+ [`da531da92568b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/da531da92568b) -
9
+ Migrating tests to use url prop from @atlaskit/smart-card instead of deprecated data prop
10
+ - [#155764](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/155764)
11
+ [`fbc8505d98e18`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fbc8505d98e18) -
12
+ Remove safe transaction code as it is duplicated and already protected for dispatched
13
+ transactions.
14
+ - [#156137](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156137)
15
+ [`485e094b29aa9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/485e094b29aa9) -
16
+ Use stage0 layout node spec behind adv layout experiment
17
+ - Updated dependencies
18
+
3
19
  ## 199.2.1
4
20
 
5
21
  ### Patch Changes
@@ -11,7 +11,6 @@ exports.processPluginsList = processPluginsList;
11
11
  exports.sortByRank = sortByRank;
12
12
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
13
  var _errorReporter = require("@atlaskit/editor-common/error-reporter");
14
- var _safeApplyPlugin = require("./safe-apply-plugin");
15
14
  var _sortByOrder = require("./sort-by-order");
16
15
  function sortByRank(a, b) {
17
16
  return a.rank - b.rank;
@@ -94,13 +93,7 @@ function processPluginsList(plugins) {
94
93
  });
95
94
  }
96
95
  function createPMPlugins(config) {
97
- var editorConfig = config.editorConfig,
98
- dispatchAnalyticsEvent = config.dispatchAnalyticsEvent;
99
- var instrumentPlugin = function instrumentPlugin(plugin) {
100
- return _safeApplyPlugin.SafeApplyPlugin.fromPlugin(plugin, {
101
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
102
- });
103
- };
96
+ var editorConfig = config.editorConfig;
104
97
  return editorConfig.pmPlugins.sort((0, _sortByOrder.sortByOrder)('plugins')).map(function (_ref) {
105
98
  var plugin = _ref.plugin;
106
99
  return plugin({
@@ -116,7 +109,7 @@ function createPMPlugins(config) {
116
109
  });
117
110
  }).filter(function (plugin) {
118
111
  return typeof plugin !== 'undefined';
119
- }).map(instrumentPlugin);
112
+ });
120
113
  }
121
114
  function createErrorReporter(errorReporterHandler) {
122
115
  var errorReporter = new _errorReporter.ErrorReporter();
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "199.2.1";
8
+ var version = exports.version = "199.2.2";
@@ -1,5 +1,4 @@
1
1
  import { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
2
- import { SafeApplyPlugin } from './safe-apply-plugin';
3
2
  import { sortByOrder } from './sort-by-order';
4
3
  export function sortByRank(a, b) {
5
4
  return a.rank - b.rank;
@@ -76,12 +75,8 @@ export function processPluginsList(plugins) {
76
75
  }
77
76
  export function createPMPlugins(config) {
78
77
  const {
79
- editorConfig,
80
- dispatchAnalyticsEvent
78
+ editorConfig
81
79
  } = config;
82
- const instrumentPlugin = plugin => SafeApplyPlugin.fromPlugin(plugin, {
83
- dispatchAnalyticsEvent
84
- });
85
80
  return editorConfig.pmPlugins.sort(sortByOrder('plugins')).map(({
86
81
  plugin
87
82
  }) => plugin({
@@ -94,7 +89,7 @@ export function createPMPlugins(config) {
94
89
  dispatchAnalyticsEvent: config.dispatchAnalyticsEvent,
95
90
  featureFlags: config.featureFlags || {},
96
91
  getIntl: config.getIntl
97
- })).filter(plugin => typeof plugin !== 'undefined').map(instrumentPlugin);
92
+ })).filter(plugin => typeof plugin !== 'undefined');
98
93
  }
99
94
  export function createErrorReporter(errorReporterHandler) {
100
95
  const errorReporter = new ErrorReporter();
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "199.2.1";
2
+ export const version = "199.2.2";
@@ -1,6 +1,5 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
3
- import { SafeApplyPlugin } from './safe-apply-plugin';
4
3
  import { sortByOrder } from './sort-by-order';
5
4
  export function sortByRank(a, b) {
6
5
  return a.rank - b.rank;
@@ -83,13 +82,7 @@ export function processPluginsList(plugins) {
83
82
  });
84
83
  }
85
84
  export function createPMPlugins(config) {
86
- var editorConfig = config.editorConfig,
87
- dispatchAnalyticsEvent = config.dispatchAnalyticsEvent;
88
- var instrumentPlugin = function instrumentPlugin(plugin) {
89
- return SafeApplyPlugin.fromPlugin(plugin, {
90
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
91
- });
92
- };
85
+ var editorConfig = config.editorConfig;
93
86
  return editorConfig.pmPlugins.sort(sortByOrder('plugins')).map(function (_ref) {
94
87
  var plugin = _ref.plugin;
95
88
  return plugin({
@@ -105,7 +98,7 @@ export function createPMPlugins(config) {
105
98
  });
106
99
  }).filter(function (plugin) {
107
100
  return typeof plugin !== 'undefined';
108
- }).map(instrumentPlugin);
101
+ });
109
102
  }
110
103
  export function createErrorReporter(errorReporterHandler) {
111
104
  var errorReporter = new ErrorReporter();
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "199.2.1";
2
+ export var version = "199.2.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "199.2.1",
3
+ "version": "199.2.2",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,7 +43,7 @@
43
43
  "@atlaskit/analytics-next": "^10.1.0",
44
44
  "@atlaskit/analytics-next-stable-react-context": "1.0.1",
45
45
  "@atlaskit/button": "^20.3.0",
46
- "@atlaskit/editor-common": "^94.2.0",
46
+ "@atlaskit/editor-common": "^94.3.0",
47
47
  "@atlaskit/editor-json-transformer": "^8.20.0",
48
48
  "@atlaskit/editor-plugin-quick-insert": "1.5.1",
49
49
  "@atlaskit/editor-plugins": "^5.6.0",
@@ -95,7 +95,7 @@
95
95
  "@atlaskit/media-test-helpers": "^34.5.0",
96
96
  "@atlaskit/modal-dialog": "^12.17.0",
97
97
  "@atlaskit/primitives": "^12.2.0",
98
- "@atlaskit/renderer": "^111.2.0",
98
+ "@atlaskit/renderer": "^111.3.0",
99
99
  "@atlaskit/smart-card": "^30.1.0",
100
100
  "@atlaskit/synchrony-test-helpers": "^2.5.0",
101
101
  "@atlaskit/toggle": "^13.4.0",
@@ -103,7 +103,7 @@
103
103
  "@atlaskit/visual-regression": "*",
104
104
  "@atlassian/adf-schema-json": "^1.22.0",
105
105
  "@atlassian/feature-flags-test-utils": "*",
106
- "@atlassian/search-provider": "2.4.153",
106
+ "@atlassian/search-provider": "2.4.154",
107
107
  "@emotion/jest": "^11.8.0",
108
108
  "@storybook/addon-knobs": "^5.3.18",
109
109
  "@testing-library/react": "^12.1.5",
@@ -294,6 +294,10 @@
294
294
  "platform_editor_advanced_layouts_pre_release_1": {
295
295
  "type": "boolean"
296
296
  },
297
+ "platform_editor_advanced_layouts_pre_release_2": {
298
+ "type": "boolean",
299
+ "referenceOnly": true
300
+ },
297
301
  "platform_editor_utilize_linebreakreplacement": {
298
302
  "type": "boolean",
299
303
  "referenceOnly": true
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.SafeApplyPlugin = void 0;
8
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
- var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
15
- var _saferTransactions = require("../utils/performance/safer-transactions");
16
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
17
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
- /**
19
- * This is for safety in case someone is trying to mutate
20
- * the transaction in the apply which should never be done.
21
- */
22
- var SafeApplyPlugin = exports.SafeApplyPlugin = /*#__PURE__*/function (_SafePlugin) {
23
- (0, _inherits2.default)(SafeApplyPlugin, _SafePlugin);
24
- var _super = _createSuper(SafeApplyPlugin);
25
- function SafeApplyPlugin(spec) {
26
- var _this;
27
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
28
- (0, _classCallCheck2.default)(this, SafeApplyPlugin);
29
- var dispatchAnalyticsEvent = options.dispatchAnalyticsEvent;
30
- if (spec.state) {
31
- var originalApply = spec.state.apply.bind(spec.state);
32
- spec.state.apply = function (aTr, value, oldState, newState) {
33
- var self = (0, _assertThisInitialized2.default)(_this);
34
- var pluginKey = self === null || self === void 0 ? void 0 : self.key;
35
- var tr = new Proxy(aTr, (0, _saferTransactions.freezeUnsafeTransactionProperties)({
36
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
37
- pluginKey: typeof pluginKey === 'string' ? pluginKey : undefined
38
- }));
39
- return originalApply(tr, value, oldState, newState);
40
- };
41
- }
42
- return _this = _super.call(this, spec);
43
- }
44
- (0, _createClass2.default)(SafeApplyPlugin, null, [{
45
- key: "fromPlugin",
46
- value: function fromPlugin(plugin, options) {
47
- return new SafeApplyPlugin(plugin.spec, options);
48
- }
49
- }]);
50
- return SafeApplyPlugin;
51
- }(_safePlugin.SafePlugin);
@@ -1,29 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { freezeUnsafeTransactionProperties } from '../utils/performance/safer-transactions';
3
- /**
4
- * This is for safety in case someone is trying to mutate
5
- * the transaction in the apply which should never be done.
6
- */
7
- export class SafeApplyPlugin extends SafePlugin {
8
- constructor(spec, options = {}) {
9
- const {
10
- dispatchAnalyticsEvent
11
- } = options;
12
- if (spec.state) {
13
- const originalApply = spec.state.apply.bind(spec.state);
14
- spec.state.apply = (aTr, value, oldState, newState) => {
15
- const self = this;
16
- const pluginKey = self === null || self === void 0 ? void 0 : self.key;
17
- const tr = new Proxy(aTr, freezeUnsafeTransactionProperties({
18
- dispatchAnalyticsEvent,
19
- pluginKey: typeof pluginKey === 'string' ? pluginKey : undefined
20
- }));
21
- return originalApply(tr, value, oldState, newState);
22
- };
23
- }
24
- super(spec);
25
- }
26
- static fromPlugin(plugin, options) {
27
- return new SafeApplyPlugin(plugin.spec, options);
28
- }
29
- }
@@ -1,44 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
8
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
10
- import { freezeUnsafeTransactionProperties } from '../utils/performance/safer-transactions';
11
- /**
12
- * This is for safety in case someone is trying to mutate
13
- * the transaction in the apply which should never be done.
14
- */
15
- export var SafeApplyPlugin = /*#__PURE__*/function (_SafePlugin) {
16
- _inherits(SafeApplyPlugin, _SafePlugin);
17
- var _super = _createSuper(SafeApplyPlugin);
18
- function SafeApplyPlugin(spec) {
19
- var _this;
20
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21
- _classCallCheck(this, SafeApplyPlugin);
22
- var dispatchAnalyticsEvent = options.dispatchAnalyticsEvent;
23
- if (spec.state) {
24
- var originalApply = spec.state.apply.bind(spec.state);
25
- spec.state.apply = function (aTr, value, oldState, newState) {
26
- var self = _assertThisInitialized(_this);
27
- var pluginKey = self === null || self === void 0 ? void 0 : self.key;
28
- var tr = new Proxy(aTr, freezeUnsafeTransactionProperties({
29
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
30
- pluginKey: typeof pluginKey === 'string' ? pluginKey : undefined
31
- }));
32
- return originalApply(tr, value, oldState, newState);
33
- };
34
- }
35
- return _this = _super.call(this, spec);
36
- }
37
- _createClass(SafeApplyPlugin, null, [{
38
- key: "fromPlugin",
39
- value: function fromPlugin(plugin, options) {
40
- return new SafeApplyPlugin(plugin.spec, options);
41
- }
42
- }]);
43
- return SafeApplyPlugin;
44
- }(SafePlugin);
@@ -1,15 +0,0 @@
1
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
4
- type SafeApplyPluginOptions = {
5
- dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
6
- };
7
- /**
8
- * This is for safety in case someone is trying to mutate
9
- * the transaction in the apply which should never be done.
10
- */
11
- export declare class SafeApplyPlugin<PluginState> extends SafePlugin<PluginState> {
12
- constructor(spec: SafePluginSpec, options?: SafeApplyPluginOptions);
13
- static fromPlugin<T>(plugin: SafePlugin<T>, options: SafeApplyPluginOptions): SafeApplyPlugin<T>;
14
- }
15
- export {};
@@ -1,15 +0,0 @@
1
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
4
- type SafeApplyPluginOptions = {
5
- dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
6
- };
7
- /**
8
- * This is for safety in case someone is trying to mutate
9
- * the transaction in the apply which should never be done.
10
- */
11
- export declare class SafeApplyPlugin<PluginState> extends SafePlugin<PluginState> {
12
- constructor(spec: SafePluginSpec, options?: SafeApplyPluginOptions);
13
- static fromPlugin<T>(plugin: SafePlugin<T>, options: SafeApplyPluginOptions): SafeApplyPlugin<T>;
14
- }
15
- export {};