@atlaskit/editor-core 195.6.0 → 195.6.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.
Files changed (106) hide show
  1. package/.eslintrc.js +2 -0
  2. package/CHANGELOG.md +21 -0
  3. package/codemods/migrates/next-remove-allow-more-text-colors-prop.ts +1 -1
  4. package/codemods/migrates/remove-config-panel-width-prop.ts +1 -1
  5. package/codemods/migrates/rename-editor-to-editor-migration-component.ts +1 -1
  6. package/codemods/migrates/rename-smartlinks-prop.ts +1 -1
  7. package/codemods/utils.ts +11 -4
  8. package/dist/cjs/CollapsedEditor/index.js +1 -0
  9. package/dist/cjs/actions/index.js +6 -1
  10. package/dist/cjs/composable-editor/editor-internal.js +6 -2
  11. package/dist/cjs/create-editor/ReactEditorView.js +3 -10
  12. package/dist/cjs/create-editor/create-editor.js +0 -1
  13. package/dist/cjs/create-editor/create-plugins-list.js +3 -1
  14. package/dist/cjs/create-editor/create-universal-preset.js +3 -1
  15. package/dist/cjs/presets/context.js +3 -0
  16. package/dist/cjs/test-utils.js +3 -1
  17. package/dist/cjs/ui/ContextPanel/index.js +2 -0
  18. package/dist/cjs/ui/Toolbar/ToolbarInner.js +3 -4
  19. package/dist/cjs/ui/ToolbarFeedback/index.js +1 -0
  20. package/dist/cjs/ui/WithHelpTrigger/index.js +2 -0
  21. package/dist/cjs/use-preset.js +2 -0
  22. package/dist/cjs/utils/action.js +1 -0
  23. package/dist/cjs/utils/deprecation-warnings.js +2 -2
  24. package/dist/cjs/utils/performance/instrumented-plugin.js +2 -0
  25. package/dist/cjs/version-wrapper.js +1 -1
  26. package/dist/es2019/CollapsedEditor/index.js +3 -0
  27. package/dist/es2019/actions/index.js +6 -1
  28. package/dist/es2019/composable-editor/editor-internal.js +6 -2
  29. package/dist/es2019/create-editor/ReactEditorView.js +3 -6
  30. package/dist/es2019/create-editor/create-editor.js +0 -1
  31. package/dist/es2019/create-editor/create-plugins-list.js +3 -1
  32. package/dist/es2019/create-editor/create-universal-preset.js +3 -1
  33. package/dist/es2019/presets/context.js +4 -0
  34. package/dist/es2019/test-utils.js +3 -1
  35. package/dist/es2019/ui/Appearance/Mobile.js +1 -0
  36. package/dist/es2019/ui/ContextPanel/index.js +2 -0
  37. package/dist/es2019/ui/Toolbar/ToolbarInner.js +3 -4
  38. package/dist/es2019/ui/ToolbarFeedback/index.js +1 -0
  39. package/dist/es2019/ui/WithHelpTrigger/index.js +2 -0
  40. package/dist/es2019/use-preset.js +3 -0
  41. package/dist/es2019/utils/action.js +1 -0
  42. package/dist/es2019/utils/deprecation-warnings.js +2 -2
  43. package/dist/es2019/utils/performance/instrumented-plugin.js +2 -0
  44. package/dist/es2019/version-wrapper.js +1 -1
  45. package/dist/esm/CollapsedEditor/index.js +2 -0
  46. package/dist/esm/actions/index.js +6 -1
  47. package/dist/esm/composable-editor/editor-internal.js +6 -2
  48. package/dist/esm/create-editor/ReactEditorView.js +3 -10
  49. package/dist/esm/create-editor/create-editor.js +0 -1
  50. package/dist/esm/create-editor/create-plugins-list.js +3 -1
  51. package/dist/esm/create-editor/create-universal-preset.js +3 -1
  52. package/dist/esm/presets/context.js +4 -0
  53. package/dist/esm/test-utils.js +3 -1
  54. package/dist/esm/ui/ContextPanel/index.js +2 -0
  55. package/dist/esm/ui/Toolbar/ToolbarInner.js +3 -4
  56. package/dist/esm/ui/ToolbarFeedback/index.js +1 -0
  57. package/dist/esm/ui/WithHelpTrigger/index.js +2 -0
  58. package/dist/esm/use-preset.js +3 -0
  59. package/dist/esm/utils/action.js +1 -0
  60. package/dist/esm/utils/deprecation-warnings.js +2 -2
  61. package/dist/esm/utils/performance/instrumented-plugin.js +2 -0
  62. package/dist/esm/version-wrapper.js +1 -1
  63. package/dist/types/CollapsedEditor/index.d.ts +7 -7
  64. package/dist/types/EditorWithActions/index.d.ts +1 -6
  65. package/dist/types/create-editor/ReactEditorView.d.ts +3 -5
  66. package/dist/types/create-editor/get-plugins.d.ts +4 -4
  67. package/dist/types/types/editor-props.d.ts +1 -1
  68. package/dist/types/ui/Addon/ClickAreaBlock/index.d.ts +6 -1
  69. package/dist/types/ui/Addon/ClickAreaMobile/index.d.ts +1 -1
  70. package/dist/types/ui/Addon/Dropdown/index.d.ts +1 -1
  71. package/dist/types/ui/Addon/click-area-helper.d.ts +1 -1
  72. package/dist/types/ui/Addon/types.d.ts +3 -3
  73. package/dist/types/ui/Appearance/Chromeless.d.ts +1 -1
  74. package/dist/types/ui/Appearance/FullPage/BeforeWrapper.d.ts +1 -1
  75. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
  76. package/dist/types/ui/CollapsedEditor/index.d.ts +2 -2
  77. package/dist/types/ui/ContentStyles/index.d.ts +2 -1
  78. package/dist/types/ui/PluginSlot/index.d.ts +1 -1
  79. package/dist/types/ui/WithEditorActions/index.d.ts +2 -2
  80. package/dist/types/ui/WithFlash/index.d.ts +1 -1
  81. package/dist/types/ui/WithHelpTrigger/index.d.ts +1 -1
  82. package/dist/types/use-preset.d.ts +2 -1
  83. package/dist/types/utils/deprecation-warnings.d.ts +3 -3
  84. package/dist/types-ts4.5/CollapsedEditor/index.d.ts +7 -7
  85. package/dist/types-ts4.5/EditorWithActions/index.d.ts +1 -6
  86. package/dist/types-ts4.5/create-editor/ReactEditorView.d.ts +3 -5
  87. package/dist/types-ts4.5/create-editor/get-plugins.d.ts +4 -4
  88. package/dist/types-ts4.5/types/editor-props.d.ts +1 -1
  89. package/dist/types-ts4.5/ui/Addon/ClickAreaBlock/index.d.ts +6 -1
  90. package/dist/types-ts4.5/ui/Addon/ClickAreaMobile/index.d.ts +1 -1
  91. package/dist/types-ts4.5/ui/Addon/Dropdown/index.d.ts +1 -1
  92. package/dist/types-ts4.5/ui/Addon/click-area-helper.d.ts +1 -1
  93. package/dist/types-ts4.5/ui/Addon/types.d.ts +3 -3
  94. package/dist/types-ts4.5/ui/Appearance/Chromeless.d.ts +1 -1
  95. package/dist/types-ts4.5/ui/Appearance/FullPage/BeforeWrapper.d.ts +1 -1
  96. package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
  97. package/dist/types-ts4.5/ui/CollapsedEditor/index.d.ts +2 -2
  98. package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -1
  99. package/dist/types-ts4.5/ui/PluginSlot/index.d.ts +1 -1
  100. package/dist/types-ts4.5/ui/WithEditorActions/index.d.ts +2 -2
  101. package/dist/types-ts4.5/ui/WithFlash/index.d.ts +1 -1
  102. package/dist/types-ts4.5/ui/WithHelpTrigger/index.d.ts +1 -1
  103. package/dist/types-ts4.5/use-preset.d.ts +2 -1
  104. package/dist/types-ts4.5/utils/deprecation-warnings.d.ts +3 -3
  105. package/docs/4-annotations.tsx +1 -0
  106. package/package.json +9 -13
@@ -178,6 +178,7 @@ class ToolbarFeedbackInternal extends PureComponent {
178
178
  }, "Learn more")))))) : null;
179
179
  }
180
180
  }
181
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
181
182
  _defineProperty(ToolbarFeedbackInternal, "contextTypes", {
182
183
  editorActions: PropTypes.object.isRequired
183
184
  });
@@ -12,6 +12,8 @@ export default class WithHelpTrigger extends React.Component {
12
12
  const {
13
13
  editorActions
14
14
  } = this.context;
15
+
16
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
17
  const dispatch = createDispatch(editorActions.eventDispatcher);
16
18
  dispatch(analyticsEventKey, {
17
19
  payload: {
@@ -1,5 +1,8 @@
1
1
  import { useLayoutEffect, useMemo, useState } from 'react';
2
2
  import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
3
+
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+
3
6
  /**
4
7
  * Creates a preset.
5
8
  *
@@ -4,6 +4,7 @@
4
4
  const mediaPluginKey = {
5
5
  key: 'mediaPlugin$',
6
6
  getState: state => {
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
8
  return state['mediaPlugin$'];
8
9
  }
9
10
  };
@@ -1,4 +1,4 @@
1
- const deprecationWarnings = (className, props, deprecations) => {
1
+ function deprecationWarnings(className, props, deprecations) {
2
2
  if (process.env.NODE_ENV === 'production') {
3
3
  return;
4
4
  }
@@ -16,5 +16,5 @@ const deprecationWarnings = (className, props, deprecations) => {
16
16
  }
17
17
  }
18
18
  }
19
- };
19
+ }
20
20
  export default deprecationWarnings;
@@ -15,6 +15,7 @@ export class InstrumentedPlugin extends SafePlugin {
15
15
  if (spec.state) {
16
16
  const originalApply = spec.state.apply.bind(spec.state);
17
17
  spec.state.apply = (aTr, value, oldState, newState) => {
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
19
  const self = this;
19
20
  const tr = new Proxy(aTr, freezeUnsafeTransactionProperties({
20
21
  dispatchAnalyticsEvent,
@@ -41,6 +42,7 @@ export class InstrumentedPlugin extends SafePlugin {
41
42
  if (uiTracking.enabled && spec.view) {
42
43
  const originalView = spec.view.bind(spec);
43
44
  spec.view = editorView => {
45
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
44
46
  const self = this;
45
47
  const measure = `🦉${self.key}::view::update`;
46
48
  const view = originalView(editorView);
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "195.6.0";
2
+ export const version = "195.6.2";
@@ -11,6 +11,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
11
11
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
12
  import React from 'react';
13
13
  import ChromeCollapsed from '../ui/ChromeCollapsed';
14
+
15
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
16
  var CollapsedEditor = /*#__PURE__*/function (_React$Component) {
15
17
  _inherits(CollapsedEditor, _React$Component);
16
18
  var _super = _createSuper(CollapsedEditor);
@@ -19,9 +19,12 @@ import { findNodePosByFragmentLocalIds } from '../utils/nodes-by-localIds';
19
19
  var fakePluginKey = {
20
20
  key: 'nativeCollabProviderPlugin$',
21
21
  getState: function getState(state) {
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
23
  return state['nativeCollabProviderPlugin$'];
23
24
  }
24
25
  };
26
+
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
28
  var EditorActions = /*#__PURE__*/function () {
26
29
  function EditorActions() {
27
30
  var _this = this;
@@ -321,7 +324,9 @@ var EditorActions = /*#__PURE__*/function () {
321
324
  }
322
325
  }, {
323
326
  key: "replaceDocument",
324
- value: function replaceDocument(rawValue) {
327
+ value: function replaceDocument(
328
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
329
+ rawValue) {
325
330
  var shouldScrollToBottom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
326
331
  var shouldAddToHistory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
327
332
  deprecationWarnings('EditorActions.replaceDocument', {
@@ -40,7 +40,9 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
40
40
  onEditorDestroyed = _ref.onEditorDestroyed,
41
41
  preset = _ref.preset;
42
42
  var Component = getUiComponent(props.appearance);
43
- var setEditorApi = useCallback(function (api) {
43
+ var setEditorApi = useCallback(
44
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
+ function (api) {
44
46
  // This is an workaround to unblock Editor Lego Decoupling project, if you have questions ping us #cc-editor-lego
45
47
  // We may clean up this code when EditorActions deprecation process starts
46
48
  // @ts-expect-error 2339: Property '__EDITOR_INTERNALS_DO_NOT_USE__API' does not exist on type 'EditorActions<any>'.
@@ -153,7 +155,9 @@ function ReactEditorViewContextWrapper(props) {
153
155
  * so we should also set the value for the `EditorContext` that is used in
154
156
  * `EditorInternal`.
155
157
  */
156
- var setEditorAPI = useCallback(function (api) {
158
+ var setEditorAPI = useCallback(
159
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
160
+ function (api) {
157
161
  setInternalEditorAPI === null || setInternalEditorAPI === void 0 || setInternalEditorAPI(api);
158
162
  setExternalEditorAPI === null || setExternalEditorAPI === void 0 || setExternalEditorAPI(api);
159
163
  }, [setInternalEditorAPI, setExternalEditorAPI]);
@@ -79,11 +79,11 @@ function handleEditorFocus(view) {
79
79
  export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
80
80
  _inherits(ReactEditorView, _React$Component);
81
81
  var _super = _createSuper(ReactEditorView);
82
- function ReactEditorView(props, context) {
82
+ function ReactEditorView(props) {
83
83
  var _props$setEditorApi, _props$editorProps;
84
84
  var _this;
85
85
  _classCallCheck(this, ReactEditorView);
86
- _this = _super.call(this, props, context);
86
+ _this = _super.call(this, props);
87
87
  _defineProperty(_assertThisInitialized(_this), "editorRef", /*#__PURE__*/React.createRef());
88
88
  // ProseMirror is instantiated prior to the initial React render cycle,
89
89
  // so we allow transactions by default, to avoid discarding the initial one.
@@ -128,7 +128,6 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
128
128
  _this.featureFlags = createFeatureFlagsFromProps(_this.props.editorProps);
129
129
  _this.editorState = _this.createEditorState({
130
130
  props: _this.props,
131
- context: _this.context,
132
131
  doc: doc,
133
132
  resetting: true,
134
133
  selectionAtStart: !shouldScrollToBottom
@@ -194,9 +193,6 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
194
193
  eventDispatcher: _this.eventDispatcher,
195
194
  providerFactory: options.props.providerFactory,
196
195
  portalProviderAPI: _this.props.portalProviderAPI,
197
- reactContext: function reactContext() {
198
- return options.context;
199
- },
200
196
  dispatchAnalyticsEvent: _this.dispatchAnalyticsEvent,
201
197
  performanceTracking: _this.props.editorProps.performanceTracking,
202
198
  transactionTracker: _this.transactionTracker,
@@ -575,7 +571,6 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
575
571
  _this.eventDispatcher.on('resetEditorState', _this.resetEditorState);
576
572
  _this.editorState = _this.createEditorState({
577
573
  props: props,
578
- context: context,
579
574
  doc: props.editorProps.defaultValue,
580
575
  // ED-4759: Don't set selection at end for full-page editor - should be at start.
581
576
  selectionAtStart: isFullPage(props.editorProps.appearance)
@@ -609,6 +604,7 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
609
604
  }, {
610
605
  key: "getPluginNames",
611
606
  value: function getPluginNames() {
607
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
612
608
  return this.editorState.plugins.map(function (p) {
613
609
  return p.key;
614
610
  });
@@ -689,9 +685,6 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
689
685
  eventDispatcher: this.eventDispatcher,
690
686
  providerFactory: props.providerFactory,
691
687
  portalProviderAPI: props.portalProviderAPI,
692
- reactContext: function reactContext() {
693
- return _this2.context;
694
- },
695
688
  dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
696
689
  performanceTracking: props.editorProps.performanceTracking,
697
690
  transactionTracker: this.transactionTracker,
@@ -120,7 +120,6 @@ export function createPMPlugins(config) {
120
120
  providerFactory: config.providerFactory,
121
121
  errorReporter: config.errorReporter,
122
122
  portalProviderAPI: config.portalProviderAPI,
123
- reactContext: config.reactContext,
124
123
  dispatchAnalyticsEvent: config.dispatchAnalyticsEvent,
125
124
  featureFlags: config.featureFlags || {},
126
125
  getIntl: config.getIntl
@@ -100,7 +100,9 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
100
100
  * Note: The order that presets are added determines
101
101
  * their placement in the editor toolbar.
102
102
  */
103
- export default function createPluginsList(preset, props, pluginInjectionAPI) {
103
+ export default function createPluginsList(
104
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
105
+ preset, props, pluginInjectionAPI) {
104
106
  var excludes = new Set();
105
107
  if (!isCodeBlockAllowed({
106
108
  allowBlockType: props.allowBlockType
@@ -19,7 +19,9 @@ export function createUniversalPreset(_ref) {
19
19
  return withDangerouslyAppendPlugins(preset)((_props$dangerouslyApp = props.dangerouslyAppendPlugins) === null || _props$dangerouslyApp === void 0 ? void 0 : _props$dangerouslyApp.__plugins);
20
20
  }
21
21
  function withDangerouslyAppendPlugins(preset) {
22
- function createEditorNextPluginsFromDangerouslyAppended(plugins) {
22
+ function createEditorNextPluginsFromDangerouslyAppended(plugins
23
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
+ ) {
23
25
  return plugins ? plugins.map(function (plugin) {
24
26
  return function () {
25
27
  return plugin;
@@ -1,8 +1,12 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import React, { useContext, useMemo, useState } from 'react';
3
+
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+
3
6
  export var EditorAPIContext = /*#__PURE__*/React.createContext({});
4
7
  export var PresetContextProvider = function PresetContextProvider(_ref) {
5
8
  var children = _ref.children;
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
10
  var _useState = useState(),
7
11
  _useState2 = _slicedToArray(_useState, 2),
8
12
  editorApi = _useState2[0],
@@ -21,7 +21,9 @@ function lightProcessPluginsList(editorPlugins) {
21
21
  });
22
22
  }
23
23
  return acc;
24
- }, {});
24
+ },
25
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
+ {});
25
27
 
26
28
  /**
27
29
  * Process plugins
@@ -215,6 +215,7 @@ export var SwappableContentArea = /*#__PURE__*/function (_React$PureComponent) {
215
215
  var widthPluginKey = {
216
216
  key: 'widthPlugin$',
217
217
  getState: function getState(state) {
218
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
218
219
  return state['widthPlugin$'];
219
220
  }
220
221
  };
@@ -223,6 +224,7 @@ var widthPluginKey = {
223
224
  var contextPanelPluginKey = {
224
225
  key: 'contextPanelPluginKey$',
225
226
  getState: function getState(state) {
227
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
226
228
  return state['contextPanelPluginKey$'];
227
229
  }
228
230
  };
@@ -56,9 +56,6 @@ export var ToolbarInner = /*#__PURE__*/function (_React$Component) {
56
56
  return jsx("div", {
57
57
  css: toolbarComponentsWrapper
58
58
  }, items.map(function (component, key) {
59
- var props = {
60
- key: key
61
- };
62
59
  var element = component({
63
60
  editorView: editorView,
64
61
  editorActions: editorActions,
@@ -76,7 +73,9 @@ export var ToolbarInner = /*#__PURE__*/function (_React$Component) {
76
73
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
77
74
  wrapperElement: null
78
75
  });
79
- return element && /*#__PURE__*/React.cloneElement(element, props);
76
+ return element && /*#__PURE__*/React.cloneElement(element, {
77
+ key: key
78
+ });
80
79
  }));
81
80
  }
82
81
  }]);
@@ -202,6 +202,7 @@ var ToolbarFeedbackInternal = /*#__PURE__*/function (_PureComponent) {
202
202
  }]);
203
203
  return ToolbarFeedbackInternal;
204
204
  }(PureComponent);
205
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
205
206
  _defineProperty(ToolbarFeedbackInternal, "contextTypes", {
206
207
  editorActions: PropTypes.object.isRequired
207
208
  });
@@ -26,6 +26,8 @@ var WithHelpTrigger = /*#__PURE__*/function (_React$Component) {
26
26
  _defineProperty(_assertThisInitialized(_this), "openHelp", function () {
27
27
  var _ref = _this.context,
28
28
  editorActions = _ref.editorActions;
29
+
30
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
31
  var dispatch = createDispatch(editorActions.eventDispatcher);
30
32
  dispatch(analyticsEventKey, {
31
33
  payload: {
@@ -1,6 +1,9 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import { useLayoutEffect, useMemo, useState } from 'react';
3
3
  import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
4
+
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+
4
7
  /**
5
8
  * Creates a preset.
6
9
  *
@@ -6,6 +6,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  var mediaPluginKey = {
7
7
  key: 'mediaPlugin$',
8
8
  getState: function getState(state) {
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
10
  return state['mediaPlugin$'];
10
11
  }
11
12
  };
@@ -1,7 +1,7 @@
1
1
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
2
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
3
3
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
4
- var deprecationWarnings = function deprecationWarnings(className, props, deprecations) {
4
+ function deprecationWarnings(className, props, deprecations) {
5
5
  if (process.env.NODE_ENV === 'production') {
6
6
  return;
7
7
  }
@@ -31,5 +31,5 @@ var deprecationWarnings = function deprecationWarnings(className, props, depreca
31
31
  } finally {
32
32
  _iterator.f();
33
33
  }
34
- };
34
+ }
35
35
  export default deprecationWarnings;
@@ -29,6 +29,7 @@ export var InstrumentedPlugin = /*#__PURE__*/function (_SafePlugin) {
29
29
  if (spec.state) {
30
30
  var originalApply = spec.state.apply.bind(spec.state);
31
31
  spec.state.apply = function (aTr, value, oldState, newState) {
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
33
  var self = _assertThisInitialized(_this);
33
34
  var tr = new Proxy(aTr, freezeUnsafeTransactionProperties({
34
35
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
@@ -53,6 +54,7 @@ export var InstrumentedPlugin = /*#__PURE__*/function (_SafePlugin) {
53
54
  if (uiTracking.enabled && spec.view) {
54
55
  var originalView = spec.view.bind(spec);
55
56
  spec.view = function (editorView) {
57
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
56
58
  var self = _assertThisInitialized(_this);
57
59
  var measure = "\uD83E\uDD89".concat(self.key, "::view::update");
58
60
  var view = originalView(editorView);
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "195.6.0";
2
+ export var version = "195.6.2";
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
2
  import type * as EditorImports from '../index';
3
+ type EditorModules = {
4
+ [x: string]: any;
5
+ };
3
6
  export type EditorModule = {
4
7
  EditorContext: typeof EditorImports.EditorContext;
5
8
  WithEditorActions: typeof EditorImports.WithEditorActions;
6
- } & {
7
- [x: string]: any;
8
- };
9
+ } & EditorModules;
9
10
  export interface Props {
10
11
  placeholder?: string;
11
12
  isExpanded?: boolean;
@@ -13,14 +14,13 @@ export interface Props {
13
14
  renderEditor: (Editor: typeof EditorImports.Editor, modules: EditorModule) => JSX.Element;
14
15
  }
15
16
  export interface State {
16
- editorModules?: {
17
- [x: string]: any;
18
- };
17
+ editorModules?: EditorModules;
19
18
  }
20
19
  export default class CollapsedEditor extends React.Component<Props, State> {
21
- static editorModules: any;
20
+ static editorModules: EditorModules;
22
21
  state: State;
23
22
  componentDidMount(): void;
24
23
  loadEditorModules(): void;
25
24
  render(): JSX.Element;
26
25
  }
26
+ export {};
@@ -2,12 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import type EditorActions from '../actions';
4
4
  import type { EditorProps } from '../editor';
5
- export interface EditorWithActionsPropsOverride extends EditorProps {
6
- onSave?: any;
7
- onChange?: any;
8
- onCancel?: any;
9
- }
10
- export interface EditorWithActionsProps extends EditorWithActionsPropsOverride {
5
+ export interface EditorWithActionsProps extends Omit<EditorProps, 'onSave' | 'onChange' | 'onCancel'> {
11
6
  onSave?: (actions: EditorActions) => void;
12
7
  onChange?: (actions: EditorActions) => void;
13
8
  onCancel?: (actions: EditorActions) => void;
@@ -17,7 +17,7 @@ import type { DirectEditorProps } from '@atlaskit/editor-prosemirror/view';
17
17
  import { EventDispatcher } from '../event-dispatcher';
18
18
  import type { Dispatch } from '../event-dispatcher';
19
19
  import type { SetEditorAPI } from '../presets/context';
20
- import type { EditorAppearance, EditorConfig, EditorPlugin, EditorProps, EditorReactContext } from '../types';
20
+ import type { EditorAppearance, EditorConfig, EditorPlugin, EditorProps } from '../types';
21
21
  import type { EditorNextProps } from '../types/editor-props';
22
22
  import { TransactionTracker } from '../utils/performance/track-transactions';
23
23
  export interface EditorViewProps {
@@ -56,12 +56,11 @@ export interface EditorViewProps {
56
56
  }
57
57
  interface CreateEditorStateOptions {
58
58
  props: EditorViewProps;
59
- context: EditorReactContext;
60
59
  doc?: string | Object | PMNode;
61
60
  resetting?: boolean;
62
61
  selectionAtStart?: boolean;
63
62
  }
64
- export declare class ReactEditorView<T = {}> extends React.Component<EditorViewProps & WrappedComponentProps & T, {}, EditorReactContext> {
63
+ export declare class ReactEditorView<T = {}> extends React.Component<EditorViewProps & WrappedComponentProps & T, {}> {
65
64
  view?: EditorView;
66
65
  eventDispatcher: EventDispatcher;
67
66
  contentTransformer?: Transformer<string>;
@@ -77,7 +76,6 @@ export declare class ReactEditorView<T = {}> extends React.Component<EditorViewP
77
76
  static contextTypes: {
78
77
  getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
79
78
  };
80
- context: EditorReactContext;
81
79
  private canDispatchTransactions;
82
80
  private focusTimeoutId?;
83
81
  private reliabilityInterval?;
@@ -89,7 +87,7 @@ export declare class ReactEditorView<T = {}> extends React.Component<EditorViewP
89
87
  private getPluginNames;
90
88
  private countNodes;
91
89
  private isTransactionTrackingExplicitlyDisabled;
92
- constructor(props: EditorViewProps & WrappedComponentProps & T, context: EditorReactContext);
90
+ constructor(props: EditorViewProps & WrappedComponentProps & T);
93
91
  getEditorState: () => EditorState | undefined;
94
92
  getEditorView: () => EditorView | undefined;
95
93
  UNSAFE_componentWillReceiveProps(nextProps: EditorViewProps): void;
@@ -1,11 +1,12 @@
1
1
  import type { IntlShape } from 'react-intl-next';
2
+ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
+ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
2
4
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
5
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
6
  import type { ReactHookFactory, UIComponentFactory } from '@atlaskit/editor-common/types';
5
7
  import type { Schema } from '@atlaskit/editor-prosemirror/model';
6
8
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
7
9
  import type { Dispatch, EventDispatcher } from '../event-dispatcher';
8
- import type { EditorReactContext } from '../types/editor-react-context';
9
10
  import type { FeatureFlags } from '../types/feature-flags';
10
11
  import type { MarkConfig, NodeConfig } from '../types/pm-config';
11
12
  export type LightPMPluginFactoryParams = {
@@ -15,9 +16,8 @@ export type LightPMPluginFactoryParams = {
15
16
  providerFactory: ProviderFactory;
16
17
  props: {};
17
18
  prevProps?: {};
18
- portalProviderAPI: any;
19
- reactContext: () => EditorReactContext;
20
- dispatchAnalyticsEvent: any;
19
+ portalProviderAPI: PortalProviderAPI;
20
+ dispatchAnalyticsEvent: DispatchAnalyticsEvent;
21
21
  featureFlags: FeatureFlags;
22
22
  getIntl: () => IntlShape;
23
23
  };
@@ -33,7 +33,7 @@ import type { EmptyStateHandler } from './empty-state-handler';
33
33
  import type { ExtensionConfig } from './extension-config';
34
34
  import type { PerformanceTracking } from './performance-tracking';
35
35
  export type { UseStickyToolbarType };
36
- export type ReactComponents = ReactElement<any> | ReactElement<any>[];
36
+ export type ReactComponents = ReactElement | ReactElement[];
37
37
  type ExtensionProviders = (ExtensionProvider | Promise<ExtensionProvider>)[];
38
38
  type ExtensionProvidersWithEditorAction = (editorActions?: EditorActions) => ExtensionProviders;
39
39
  export type ExtensionProvidersProp = ExtensionProviders | ExtensionProvidersWithEditorAction;
@@ -1,8 +1,13 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
1
6
  import { jsx } from '@emotion/react';
2
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
8
  export interface Props {
4
9
  editorView?: EditorView;
5
- children?: any;
10
+ children?: React.ReactNode;
6
11
  editorDisabled?: boolean;
7
12
  }
8
13
  export declare const ClickAreaBlock: ({ editorView, editorDisabled, children }: Props) => jsx.JSX.Element;
@@ -8,7 +8,7 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
8
  export interface Props {
9
9
  editorView?: EditorView;
10
10
  minHeight: number;
11
- children?: any;
11
+ children?: React.ReactNode;
12
12
  persistScrollGutter?: boolean;
13
13
  isExpanded?: boolean;
14
14
  editorDisabled?: boolean;
@@ -12,7 +12,7 @@ export interface Props {
12
12
  editorActions: EditorActions;
13
13
  togglePopup: () => void;
14
14
  }
15
- export default class DropdownWrapper extends React.Component<Props, any> {
15
+ export default class DropdownWrapper extends React.Component<Props> {
16
16
  render(): jsx.JSX.Element;
17
17
  private handleClick;
18
18
  }
@@ -9,5 +9,5 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
9
9
  * 2. if another modal is open (e.g. delete confirmation modal for confluence table) then ignore clicks as they shouldn't influence editor state
10
10
  */
11
11
  export declare const checkForModal: (target: HTMLElement | null) => boolean;
12
- declare const clickAreaClickHandler: (view: EditorView, event: React.MouseEvent<any>) => false | undefined;
12
+ declare const clickAreaClickHandler: (view: EditorView, event: React.MouseEvent<HTMLElement>) => false | undefined;
13
13
  export { clickAreaClickHandler };
@@ -1,16 +1,16 @@
1
1
  /// <reference types="react" />
2
2
  import type EditorActions from '../../actions';
3
- export type RenderOnClickHandler = (editorActions: EditorActions, closePopup: () => void) => React.ReactElement<any>;
3
+ export type RenderOnClickHandler = (editorActions: EditorActions, closePopup: () => void) => React.ReactElement;
4
4
  export interface AddonActions {
5
5
  actionOnClick?: (editorActions: EditorActions) => void;
6
6
  renderOnClick?: RenderOnClickHandler;
7
7
  }
8
8
  export interface AddonCommonProps extends AddonActions {
9
- icon: React.ReactElement<any>;
9
+ icon: React.ReactElement;
10
10
  }
11
11
  export interface AddonProps extends AddonCommonProps {
12
12
  onClick?: (actions: AddonActions) => void;
13
- children?: React.ReactElement<any>[];
13
+ children?: React.ReactElement[];
14
14
  }
15
15
  export interface AddonConfiguration extends AddonCommonProps {
16
16
  text: string;
@@ -8,7 +8,7 @@ import { type OptionalPlugin } from '@atlaskit/editor-common/types';
8
8
  import type { MaxContentSizePlugin } from '@atlaskit/editor-plugins/max-content-size';
9
9
  import type { EditorAppearanceComponentProps } from '../../types';
10
10
  type AppearanceProps = EditorAppearanceComponentProps<[OptionalPlugin<MaxContentSizePlugin>]>;
11
- export default class Editor extends React.Component<AppearanceProps, any> {
11
+ export default class Editor extends React.Component<AppearanceProps> {
12
12
  static displayName: string;
13
13
  private appearance;
14
14
  private containerElement;
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { ReactElement } from 'react';
6
6
  import { jsx } from '@emotion/react';
7
- type ReactComponents = ReactElement<any> | ReactElement<any>[];
7
+ type ReactComponents = ReactElement | ReactElement[];
8
8
  export declare const BeforePrimaryToolbarWrapper: (props: {
9
9
  beforePrimaryToolbarComponents: ReactComponents | undefined;
10
10
  }) => jsx.JSX.Element;
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  export declare const fullPageEditorWrapper: import("@emotion/react").SerializedStyles;
3
3
  export declare const ScrollContainer: import("react").ForwardRefExoticComponent<Pick<{
4
- theme?: any;
4
+ theme?: import("@emotion/react").Theme | undefined;
5
5
  colorMode?: "light" | "dark" | undefined;
6
6
  featureFlags?: import("@atlaskit/editor-common/types").FeatureFlags | undefined;
7
7
  viewMode?: "view" | "edit" | undefined;
8
8
  } & import("react").HTMLProps<HTMLDivElement>, "headers" | "method" | "id" | "default" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "children" | "key" | "name" | "width" | "property" | "type" | "content" | "disabled" | "defaultValue" | "onChange" | "placeholder" | "media" | "value" | "list" | "open" | "accessKey" | "dir" | "className" | "role" | "start" | "action" | "step" | "wrap" | "color" | "height" | "translate" | "hidden" | keyof {
9
- theme?: any;
9
+ theme?: import("@emotion/react").Theme | undefined;
10
10
  colorMode?: "light" | "dark" | undefined;
11
11
  featureFlags?: import("@atlaskit/editor-common/types").FeatureFlags | undefined;
12
12
  viewMode?: "view" | "edit" | undefined;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import Editor from '../../editor';
2
+ import type Editor from '../../editor';
3
3
  export interface Props {
4
4
  placeholder?: string;
5
5
  children?: any;
@@ -14,6 +14,6 @@ export default class CollapsedEditor extends React.Component<Props, State> {
14
14
  previouslyExpanded?: boolean;
15
15
  functionalEditor?: boolean;
16
16
  componentDidUpdate(): void;
17
- handleEditorRef: (editorRef?: Editor, editorRefCallback?: any) => void;
17
+ handleEditorRef: (editorRef?: Editor, editorRefCallback?: ((editor: Editor | undefined) => void) | undefined) => void;
18
18
  render(): any;
19
19
  }
@@ -4,10 +4,11 @@
4
4
  */
5
5
  import React from 'react';
6
6
  import type { SerializedStyles } from '@emotion/react';
7
+ import { type Theme } from '@emotion/react';
7
8
  import type { FeatureFlags } from '../../types/feature-flags';
8
9
  export declare const linkStyles: SerializedStyles;
9
10
  type ContentStylesProps = {
10
- theme?: any;
11
+ theme?: Theme;
11
12
  colorMode?: 'light' | 'dark';
12
13
  featureFlags?: FeatureFlags;
13
14
  viewMode?: 'view' | 'edit';
@@ -28,7 +28,7 @@ export interface Props {
28
28
  contentArea?: HTMLElement;
29
29
  wrapperElement: HTMLElement | null;
30
30
  }
31
- export default class PluginSlot extends React.Component<Props, any> {
31
+ export default class PluginSlot extends React.Component<Props> {
32
32
  static displayName: string;
33
33
  transitionEvent: "transitionend" | undefined;
34
34
  shouldComponentUpdate(nextProps: Props): boolean;