@atlaskit/editor-core 199.2.0 → 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,30 @@
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
+
19
+ ## 199.2.1
20
+
21
+ ### Patch Changes
22
+
23
+ - [#155693](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/155693)
24
+ [`172485595104b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/172485595104b) -
25
+ [ED-24685] Removing feature flag that gated multi bodied extensions being available in the editor
26
+ - Updated dependencies
27
+
3
28
  ## 199.2.0
4
29
 
5
30
  ### Minor 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.0";
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.0";
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.0";
2
+ export var version = "199.2.2";
@@ -1793,7 +1793,10 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
1793
1793
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
1794
1794
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
1795
1795
  actions: {
1796
- insertLayoutColumns: (inputMethod: import("@atlaskit/editor-common/types").TOOLBAR_MENU_TYPE) => import("@atlaskit/editor-common/types").Command;
1796
+ insertLayoutColumns: (inputMethod: import("@atlaskit/editor-common/types").TOOLBAR_MENU_TYPE, formatMessage?: {
1797
+ (descriptor: import("react-intl-next").MessageDescriptor, values?: Record<string, import("intl-messageformat").PrimitiveType | import("intl-messageformat").FormatXMLElementFn<string, string>> | undefined, opts?: import("intl-messageformat").Options | undefined): string;
1798
+ (descriptor: import("react-intl-next").MessageDescriptor, values?: Record<string, string | number | boolean | {} | import("react").ReactPortal | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNodeArray | Date | import("intl-messageformat").FormatXMLElementFn<import("react").ReactNode, import("react").ReactNode> | null | undefined> | undefined, opts?: import("intl-messageformat").Options | undefined): import("react").ReactNode;
1799
+ } | undefined) => import("@atlaskit/editor-common/types").Command;
1797
1800
  };
1798
1801
  }, import("@atlaskit/editor-plugin-layout").LayoutPluginOptions | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"placeholderText", {
1799
1802
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
@@ -1844,7 +1844,10 @@ export default function createUniversalPresetInternal({ appearance, props, featu
1844
1844
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
1845
1845
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
1846
1846
  actions: {
1847
- insertLayoutColumns: (inputMethod: import("@atlaskit/editor-common/types").TOOLBAR_MENU_TYPE) => import("@atlaskit/editor-common/types").Command;
1847
+ insertLayoutColumns: (inputMethod: import("@atlaskit/editor-common/types").TOOLBAR_MENU_TYPE, formatMessage?: {
1848
+ (descriptor: import("react-intl-next").MessageDescriptor, values?: Record<string, import("intl-messageformat").PrimitiveType | import("intl-messageformat").FormatXMLElementFn<string, string>> | undefined, opts?: import("intl-messageformat").Options | undefined): string;
1849
+ (descriptor: import("react-intl-next").MessageDescriptor, values?: Record<string, string | number | boolean | {} | import("react").ReactPortal | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNodeArray | Date | import("intl-messageformat").FormatXMLElementFn<import("react").ReactNode, import("react").ReactNode> | null | undefined> | undefined, opts?: import("intl-messageformat").Options | undefined): import("react").ReactNode;
1850
+ } | undefined) => import("@atlaskit/editor-common/types").Command;
1848
1851
  };
1849
1852
  }, import("@atlaskit/editor-plugins/layout").LayoutPluginOptions | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"placeholderText", {
1850
1853
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
@@ -1793,7 +1793,10 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
1793
1793
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
1794
1794
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
1795
1795
  actions: {
1796
- insertLayoutColumns: (inputMethod: import("@atlaskit/editor-common/types").TOOLBAR_MENU_TYPE) => import("@atlaskit/editor-common/types").Command;
1796
+ insertLayoutColumns: (inputMethod: import("@atlaskit/editor-common/types").TOOLBAR_MENU_TYPE, formatMessage?: {
1797
+ (descriptor: import("react-intl-next").MessageDescriptor, values?: Record<string, import("intl-messageformat").PrimitiveType | import("intl-messageformat").FormatXMLElementFn<string, string>> | undefined, opts?: import("intl-messageformat").Options | undefined): string;
1798
+ (descriptor: import("react-intl-next").MessageDescriptor, values?: Record<string, string | number | boolean | {} | import("react").ReactPortal | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNodeArray | Date | import("intl-messageformat").FormatXMLElementFn<import("react").ReactNode, import("react").ReactNode> | null | undefined> | undefined, opts?: import("intl-messageformat").Options | undefined): import("react").ReactNode;
1799
+ } | undefined) => import("@atlaskit/editor-common/types").Command;
1797
1800
  };
1798
1801
  }, import("@atlaskit/editor-plugin-layout").LayoutPluginOptions | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"placeholderText", {
1799
1802
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
@@ -2231,7 +2231,10 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
2231
2231
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
2232
2232
  ];
2233
2233
  actions: {
2234
- insertLayoutColumns: (inputMethod: import("@atlaskit/editor-common/types").TOOLBAR_MENU_TYPE) => import("@atlaskit/editor-common/types").Command;
2234
+ insertLayoutColumns: (inputMethod: import("@atlaskit/editor-common/types").TOOLBAR_MENU_TYPE, formatMessage?: {
2235
+ (descriptor: import("react-intl-next").MessageDescriptor, values?: Record<string, import("intl-messageformat").PrimitiveType | import("intl-messageformat").FormatXMLElementFn<string, string>> | undefined, opts?: import("intl-messageformat").Options | undefined): string;
2236
+ (descriptor: import("react-intl-next").MessageDescriptor, values?: Record<string, string | number | boolean | {} | import("react").ReactPortal | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNodeArray | Date | import("intl-messageformat").FormatXMLElementFn<import("react").ReactNode, import("react").ReactNode> | null | undefined> | undefined, opts?: import("intl-messageformat").Options | undefined): import("react").ReactNode;
2237
+ } | undefined) => import("@atlaskit/editor-common/types").Command;
2235
2238
  };
2236
2239
  }, import("@atlaskit/editor-plugin-layout").LayoutPluginOptions | undefined> | undefined,
2237
2240
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"placeholderText", {
@@ -2282,7 +2282,10 @@ export default function createUniversalPresetInternal({ appearance, props, featu
2282
2282
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
2283
2283
  ];
2284
2284
  actions: {
2285
- insertLayoutColumns: (inputMethod: import("@atlaskit/editor-common/types").TOOLBAR_MENU_TYPE) => import("@atlaskit/editor-common/types").Command;
2285
+ insertLayoutColumns: (inputMethod: import("@atlaskit/editor-common/types").TOOLBAR_MENU_TYPE, formatMessage?: {
2286
+ (descriptor: import("react-intl-next").MessageDescriptor, values?: Record<string, import("intl-messageformat").PrimitiveType | import("intl-messageformat").FormatXMLElementFn<string, string>> | undefined, opts?: import("intl-messageformat").Options | undefined): string;
2287
+ (descriptor: import("react-intl-next").MessageDescriptor, values?: Record<string, string | number | boolean | {} | import("react").ReactPortal | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNodeArray | Date | import("intl-messageformat").FormatXMLElementFn<import("react").ReactNode, import("react").ReactNode> | null | undefined> | undefined, opts?: import("intl-messageformat").Options | undefined): import("react").ReactNode;
2288
+ } | undefined) => import("@atlaskit/editor-common/types").Command;
2286
2289
  };
2287
2290
  }, import("@atlaskit/editor-plugins/layout").LayoutPluginOptions | undefined> | undefined,
2288
2291
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"placeholderText", {
@@ -2231,7 +2231,10 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
2231
2231
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
2232
2232
  ];
2233
2233
  actions: {
2234
- insertLayoutColumns: (inputMethod: import("@atlaskit/editor-common/types").TOOLBAR_MENU_TYPE) => import("@atlaskit/editor-common/types").Command;
2234
+ insertLayoutColumns: (inputMethod: import("@atlaskit/editor-common/types").TOOLBAR_MENU_TYPE, formatMessage?: {
2235
+ (descriptor: import("react-intl-next").MessageDescriptor, values?: Record<string, import("intl-messageformat").PrimitiveType | import("intl-messageformat").FormatXMLElementFn<string, string>> | undefined, opts?: import("intl-messageformat").Options | undefined): string;
2236
+ (descriptor: import("react-intl-next").MessageDescriptor, values?: Record<string, string | number | boolean | {} | import("react").ReactPortal | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNodeArray | Date | import("intl-messageformat").FormatXMLElementFn<import("react").ReactNode, import("react").ReactNode> | null | undefined> | undefined, opts?: import("intl-messageformat").Options | undefined): import("react").ReactNode;
2237
+ } | undefined) => import("@atlaskit/editor-common/types").Command;
2235
2238
  };
2236
2239
  }, import("@atlaskit/editor-plugin-layout").LayoutPluginOptions | undefined> | undefined,
2237
2240
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"placeholderText", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "199.2.0",
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,15 +43,15 @@
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
- "@atlaskit/editor-plugin-quick-insert": "1.5.0",
48
+ "@atlaskit/editor-plugin-quick-insert": "1.5.1",
49
49
  "@atlaskit/editor-plugins": "^5.6.0",
50
50
  "@atlaskit/editor-prosemirror": "6.0.0",
51
51
  "@atlaskit/editor-shared-styles": "^3.0.0",
52
52
  "@atlaskit/emoji": "^67.8.0",
53
- "@atlaskit/icon": "^22.23.0",
54
- "@atlaskit/media-card": "^78.7.0",
53
+ "@atlaskit/icon": "^22.24.0",
54
+ "@atlaskit/media-card": "^78.8.0",
55
55
  "@atlaskit/mention": "^23.3.0",
56
56
  "@atlaskit/platform-feature-flags": "^0.3.0",
57
57
  "@atlaskit/task-decision": "^17.11.0",
@@ -81,10 +81,10 @@
81
81
  "devDependencies": {
82
82
  "@af/editor-libra": "*",
83
83
  "@af/visual-regression": "*",
84
- "@atlaskit/adf-utils": "^19.9.0",
84
+ "@atlaskit/adf-utils": "^19.10.0",
85
85
  "@atlaskit/analytics-listeners": "^8.11.0",
86
86
  "@atlaskit/collab-provider": "9.43.3",
87
- "@atlaskit/editor-plugin-annotation": "1.21.2",
87
+ "@atlaskit/editor-plugin-annotation": "1.21.3",
88
88
  "@atlaskit/editor-plugin-card": "^4.3.0",
89
89
  "@atlaskit/editor-plugin-list": "^3.9.0",
90
90
  "@atlaskit/editor-plugin-paste": "^1.14.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.152",
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",
@@ -156,10 +156,6 @@
156
156
  "type": "boolean",
157
157
  "referenceOnly": "true"
158
158
  },
159
- "platform.editor.multi-bodied-extension_0rygg": {
160
- "type": "boolean",
161
- "referenceOnly": "true"
162
- },
163
159
  "editor_inline_comments_on_inline_nodes": {
164
160
  "type": "boolean",
165
161
  "referenceOnly": "true"
@@ -298,6 +294,10 @@
298
294
  "platform_editor_advanced_layouts_pre_release_1": {
299
295
  "type": "boolean"
300
296
  },
297
+ "platform_editor_advanced_layouts_pre_release_2": {
298
+ "type": "boolean",
299
+ "referenceOnly": true
300
+ },
301
301
  "platform_editor_utilize_linebreakreplacement": {
302
302
  "type": "boolean",
303
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 {};