@atlaskit/editor-common 74.4.0 → 74.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 74.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`7cd4abcdc0d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7cd4abcdc0d) - Fix workaround in `editor-plugin-width`. This involved removing `WidthEmitter` in `editor-core`, removing `containerWidth` from `WidthPluginState`. This change also introduces `usePluginHook` for an `EditorPlugin` - this enables a react hook to be mounted for plugins (in all appearances).
8
+
3
9
  ## 74.4.0
4
10
 
5
11
  ### Minor Changes
@@ -28,6 +28,16 @@ function mapValues(object, mapFunction) {
28
28
  }, {});
29
29
  }
30
30
 
31
+ // When we use the `useSharedPluginState` example: `useSharedPluginState(api, ['width'])`
32
+ // it will re-render every time the component re-renders as the array "['width']" is seen as an update.
33
+ // This hook is used to prevent re-renders due to this.
34
+ function useStaticPlugins(plugins) {
35
+ // eslint-disable-next-line react-hooks/exhaustive-deps
36
+ return (0, _react.useMemo)(function () {
37
+ return plugins;
38
+ }, []);
39
+ }
40
+
31
41
  /**
32
42
  *
33
43
  * Used to return the current plugin state of
@@ -61,12 +71,14 @@ function mapValues(object, mapFunction) {
61
71
  * the values are the shared state exposed by that plugin.
62
72
  */
63
73
  function useSharedPluginState(injectionApi, plugins) {
74
+ var pluginNames = useStaticPlugins(plugins);
75
+
64
76
  // Create a memoized object containing the named plugins
65
77
  var namedExternalPlugins = (0, _react.useMemo)(function () {
66
- return plugins.reduce(function (acc, pluginName) {
78
+ return pluginNames.reduce(function (acc, pluginName) {
67
79
  return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, "".concat(pluginName, "State"), injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies[pluginName]));
68
80
  }, {});
69
- }, [injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies, plugins]);
81
+ }, [injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies, pluginNames]);
70
82
  return useSharedPluginStateInternal(namedExternalPlugins);
71
83
  }
72
84
  function useSharedPluginStateInternal(externalPlugins) {
@@ -74,10 +86,10 @@ function useSharedPluginStateInternal(externalPlugins) {
74
86
  return value === null || value === void 0 ? void 0 : value.sharedState.currentState();
75
87
  })),
76
88
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
77
- state = _useState2[0],
78
- setState = _useState2[1];
79
- (0, _react.useEffect)(function () {
80
- var unsubscribeListeners = Object.entries(externalPlugins).map(function (_ref3) {
89
+ pluginStates = _useState2[0],
90
+ setPluginState = _useState2[1];
91
+ (0, _react.useLayoutEffect)(function () {
92
+ var unsubs = Object.entries(externalPlugins).map(function (_ref3) {
81
93
  var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
82
94
  pluginKey = _ref4[0],
83
95
  externalPlugin = _ref4[1];
@@ -87,16 +99,19 @@ function useSharedPluginStateInternal(externalPlugins) {
87
99
  if (prevSharedState === nextSharedState) {
88
100
  return;
89
101
  }
90
- setState(function (state) {
91
- return _objectSpread(_objectSpread({}, state), {}, (0, _defineProperty2.default)({}, pluginKey, nextSharedState));
102
+ setPluginState(function (currentPluginStates) {
103
+ return _objectSpread(_objectSpread({}, currentPluginStates), {}, (0, _defineProperty2.default)({}, pluginKey, nextSharedState));
92
104
  });
93
105
  });
94
106
  });
95
107
  return function () {
96
- unsubscribeListeners.forEach(function (cb) {
108
+ unsubs.forEach(function (cb) {
97
109
  return cb === null || cb === void 0 ? void 0 : cb();
98
110
  });
99
111
  };
112
+ // Do not re-render due to state changes, we only need to check this when
113
+ // setting up the initial subscription.
114
+ // eslint-disable-next-line react-hooks/exhaustive-deps
100
115
  }, [externalPlugins]);
101
- return state;
116
+ return pluginStates;
102
117
  }
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "74.4.0";
19
+ var packageVersion = "74.5.0";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
24
24
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
25
25
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "74.4.0";
27
+ var packageVersion = "74.5.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.4.0",
3
+ "version": "74.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,4 @@
1
- import { useEffect, useMemo, useState } from 'react';
1
+ import { useLayoutEffect, useMemo, useState } from 'react';
2
2
  /**
3
3
  *
4
4
  * Directly map object values
@@ -15,6 +15,14 @@ function mapValues(object, mapFunction) {
15
15
  }), {});
16
16
  }
17
17
 
18
+ // When we use the `useSharedPluginState` example: `useSharedPluginState(api, ['width'])`
19
+ // it will re-render every time the component re-renders as the array "['width']" is seen as an update.
20
+ // This hook is used to prevent re-renders due to this.
21
+ function useStaticPlugins(plugins) {
22
+ // eslint-disable-next-line react-hooks/exhaustive-deps
23
+ return useMemo(() => plugins, []);
24
+ }
25
+
18
26
  /**
19
27
  *
20
28
  * Used to return the current plugin state of
@@ -48,31 +56,38 @@ function mapValues(object, mapFunction) {
48
56
  * the values are the shared state exposed by that plugin.
49
57
  */
50
58
  export function useSharedPluginState(injectionApi, plugins) {
59
+ const pluginNames = useStaticPlugins(plugins);
60
+
51
61
  // Create a memoized object containing the named plugins
52
- const namedExternalPlugins = useMemo(() => plugins.reduce((acc, pluginName) => ({
62
+ const namedExternalPlugins = useMemo(() => pluginNames.reduce((acc, pluginName) => ({
53
63
  ...acc,
54
64
  [`${pluginName}State`]: injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies[pluginName]
55
- }), {}), [injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies, plugins]);
65
+ }), {}), [injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies, pluginNames]);
56
66
  return useSharedPluginStateInternal(namedExternalPlugins);
57
67
  }
58
68
  function useSharedPluginStateInternal(externalPlugins) {
59
- const [state, setState] = useState(mapValues(externalPlugins, value => value === null || value === void 0 ? void 0 : value.sharedState.currentState()));
60
- useEffect(() => {
61
- const unsubscribeListeners = Object.entries(externalPlugins).map(([pluginKey, externalPlugin]) => externalPlugin === null || externalPlugin === void 0 ? void 0 : externalPlugin.sharedState.onChange(({
62
- nextSharedState,
63
- prevSharedState
64
- }) => {
65
- if (prevSharedState === nextSharedState) {
66
- return;
67
- }
68
- setState(state => ({
69
- ...state,
70
- [pluginKey]: nextSharedState
71
- }));
72
- }));
69
+ const [pluginStates, setPluginState] = useState(mapValues(externalPlugins, value => value === null || value === void 0 ? void 0 : value.sharedState.currentState()));
70
+ useLayoutEffect(() => {
71
+ const unsubs = Object.entries(externalPlugins).map(([pluginKey, externalPlugin]) => {
72
+ return externalPlugin === null || externalPlugin === void 0 ? void 0 : externalPlugin.sharedState.onChange(({
73
+ nextSharedState,
74
+ prevSharedState
75
+ }) => {
76
+ if (prevSharedState === nextSharedState) {
77
+ return;
78
+ }
79
+ setPluginState(currentPluginStates => ({
80
+ ...currentPluginStates,
81
+ [pluginKey]: nextSharedState
82
+ }));
83
+ });
84
+ });
73
85
  return () => {
74
- unsubscribeListeners.forEach(cb => cb === null || cb === void 0 ? void 0 : cb());
86
+ unsubs.forEach(cb => cb === null || cb === void 0 ? void 0 : cb());
75
87
  };
88
+ // Do not re-render due to state changes, we only need to check this when
89
+ // setting up the initial subscription.
90
+ // eslint-disable-next-line react-hooks/exhaustive-deps
76
91
  }, [externalPlugins]);
77
- return state;
92
+ return pluginStates;
78
93
  }
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "74.4.0";
3
+ const packageVersion = "74.5.0";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
8
8
  import { borderRadius } from '@atlaskit/theme/constants';
9
9
  import Layer from '../Layer';
10
10
  const packageName = "@atlaskit/editor-common";
11
- const packageVersion = "74.4.0";
11
+ const packageVersion = "74.5.0";
12
12
  const halfFocusRing = 1;
13
13
  const dropOffset = '0, 8';
14
14
  class DropList extends Component {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.4.0",
3
+ "version": "74.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
4
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
- import { useEffect, useMemo, useState } from 'react';
5
+ import { useLayoutEffect, useMemo, useState } from 'react';
6
6
  /**
7
7
  *
8
8
  * Directly map object values
@@ -21,6 +21,16 @@ function mapValues(object, mapFunction) {
21
21
  }, {});
22
22
  }
23
23
 
24
+ // When we use the `useSharedPluginState` example: `useSharedPluginState(api, ['width'])`
25
+ // it will re-render every time the component re-renders as the array "['width']" is seen as an update.
26
+ // This hook is used to prevent re-renders due to this.
27
+ function useStaticPlugins(plugins) {
28
+ // eslint-disable-next-line react-hooks/exhaustive-deps
29
+ return useMemo(function () {
30
+ return plugins;
31
+ }, []);
32
+ }
33
+
24
34
  /**
25
35
  *
26
36
  * Used to return the current plugin state of
@@ -54,12 +64,14 @@ function mapValues(object, mapFunction) {
54
64
  * the values are the shared state exposed by that plugin.
55
65
  */
56
66
  export function useSharedPluginState(injectionApi, plugins) {
67
+ var pluginNames = useStaticPlugins(plugins);
68
+
57
69
  // Create a memoized object containing the named plugins
58
70
  var namedExternalPlugins = useMemo(function () {
59
- return plugins.reduce(function (acc, pluginName) {
71
+ return pluginNames.reduce(function (acc, pluginName) {
60
72
  return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, "".concat(pluginName, "State"), injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies[pluginName]));
61
73
  }, {});
62
- }, [injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies, plugins]);
74
+ }, [injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies, pluginNames]);
63
75
  return useSharedPluginStateInternal(namedExternalPlugins);
64
76
  }
65
77
  function useSharedPluginStateInternal(externalPlugins) {
@@ -67,10 +79,10 @@ function useSharedPluginStateInternal(externalPlugins) {
67
79
  return value === null || value === void 0 ? void 0 : value.sharedState.currentState();
68
80
  })),
69
81
  _useState2 = _slicedToArray(_useState, 2),
70
- state = _useState2[0],
71
- setState = _useState2[1];
72
- useEffect(function () {
73
- var unsubscribeListeners = Object.entries(externalPlugins).map(function (_ref3) {
82
+ pluginStates = _useState2[0],
83
+ setPluginState = _useState2[1];
84
+ useLayoutEffect(function () {
85
+ var unsubs = Object.entries(externalPlugins).map(function (_ref3) {
74
86
  var _ref4 = _slicedToArray(_ref3, 2),
75
87
  pluginKey = _ref4[0],
76
88
  externalPlugin = _ref4[1];
@@ -80,16 +92,19 @@ function useSharedPluginStateInternal(externalPlugins) {
80
92
  if (prevSharedState === nextSharedState) {
81
93
  return;
82
94
  }
83
- setState(function (state) {
84
- return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, pluginKey, nextSharedState));
95
+ setPluginState(function (currentPluginStates) {
96
+ return _objectSpread(_objectSpread({}, currentPluginStates), {}, _defineProperty({}, pluginKey, nextSharedState));
85
97
  });
86
98
  });
87
99
  });
88
100
  return function () {
89
- unsubscribeListeners.forEach(function (cb) {
101
+ unsubs.forEach(function (cb) {
90
102
  return cb === null || cb === void 0 ? void 0 : cb();
91
103
  });
92
104
  };
105
+ // Do not re-render due to state changes, we only need to check this when
106
+ // setting up the initial subscription.
107
+ // eslint-disable-next-line react-hooks/exhaustive-deps
93
108
  }, [externalPlugins]);
94
- return state;
109
+ return pluginStates;
95
110
  }
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "74.4.0";
9
+ var packageVersion = "74.5.0";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
18
18
  import { borderRadius } from '@atlaskit/theme/constants';
19
19
  import Layer from '../Layer';
20
20
  var packageName = "@atlaskit/editor-common";
21
- var packageVersion = "74.4.0";
21
+ var packageVersion = "74.5.0";
22
22
  var halfFocusRing = 1;
23
23
  var dropOffset = '0, 8';
24
24
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.4.0",
3
+ "version": "74.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -6,7 +6,6 @@ export type EditorContainerWidth = {
6
6
  * container element prop).
7
7
  */
8
8
  width: number;
9
- containerWidth?: number;
10
9
  /**
11
10
  * Starts as undefined, and then updates to the
12
11
  * clientWidth of the dom element the EditorView
@@ -6,7 +6,7 @@ import type { MarkConfig, NodeConfig } from './prosemirror-config';
6
6
  import type { QuickInsertHandler } from './quick-insert';
7
7
  import type { ToolbarUIComponentFactory } from './toolbar';
8
8
  import type { TypeAheadHandler } from './type-ahead';
9
- import type { UIComponentFactory } from './ui-components';
9
+ import type { ReactHookFactory, UIComponentFactory } from './ui-components';
10
10
  export type PluginsOptions = {
11
11
  [pluginName: string]: any;
12
12
  /**
@@ -60,6 +60,15 @@ export interface EditorPlugin {
60
60
  * Although it’s common to specify a custom mount point (eg. date picker)
61
61
  */
62
62
  contentComponent?: UIComponentFactory;
63
+ /**
64
+ * Optional react hook that is mounted for all appearances
65
+ *
66
+ * This can be used to access React context, or other React specific code (ie. run `useEffect`)
67
+ * within a plugin that will run for all appearances without mounting any components.
68
+ *
69
+ * Example usages include analytics or width.
70
+ */
71
+ usePluginHook?: ReactHookFactory;
63
72
  /**
64
73
  * Optional UI-component that will be added to the toolbar at the top of the editor (doesn't exist in the compact-editor).
65
74
  *
@@ -23,7 +23,7 @@ export type { ContextPanelHandler } from './context-panel';
23
23
  export type { EditorAppearance } from './editor-appearance';
24
24
  export type { ToolbarUiComponentFactoryParams, ToolbarUIComponentFactory, } from './toolbar';
25
25
  export { ToolbarSize, ToolbarWidths, ToolbarWidthsFullPage } from './toolbar';
26
- export type { UiComponentFactoryParams, UIComponentFactory, } from './ui-components';
26
+ export type { UiComponentFactoryParams, UIComponentFactory, ReactHookFactory, } from './ui-components';
27
27
  export type { EditorReactContext } from './editor-react-context';
28
28
  export type { PMPluginFactoryParams, PMPluginFactory, PMPlugin, } from './plugin-factory';
29
29
  export type { NodeConfig, MarkConfig, NodeViewConfig, } from './prosemirror-config';
@@ -20,3 +20,4 @@ export type UiComponentFactoryParams = {
20
20
  wrapperElement: HTMLElement | null;
21
21
  };
22
22
  export type UIComponentFactory = (params: UiComponentFactoryParams) => React.ReactElement<any> | null;
23
+ export type ReactHookFactory = (params: Pick<UiComponentFactoryParams, 'editorView' | 'containerElement'>) => void;
@@ -6,7 +6,6 @@ export type EditorContainerWidth = {
6
6
  * container element prop).
7
7
  */
8
8
  width: number;
9
- containerWidth?: number;
10
9
  /**
11
10
  * Starts as undefined, and then updates to the
12
11
  * clientWidth of the dom element the EditorView
@@ -6,7 +6,7 @@ import type { MarkConfig, NodeConfig } from './prosemirror-config';
6
6
  import type { QuickInsertHandler } from './quick-insert';
7
7
  import type { ToolbarUIComponentFactory } from './toolbar';
8
8
  import type { TypeAheadHandler } from './type-ahead';
9
- import type { UIComponentFactory } from './ui-components';
9
+ import type { ReactHookFactory, UIComponentFactory } from './ui-components';
10
10
  export type PluginsOptions = {
11
11
  [pluginName: string]: any;
12
12
  /**
@@ -60,6 +60,15 @@ export interface EditorPlugin {
60
60
  * Although it’s common to specify a custom mount point (eg. date picker)
61
61
  */
62
62
  contentComponent?: UIComponentFactory;
63
+ /**
64
+ * Optional react hook that is mounted for all appearances
65
+ *
66
+ * This can be used to access React context, or other React specific code (ie. run `useEffect`)
67
+ * within a plugin that will run for all appearances without mounting any components.
68
+ *
69
+ * Example usages include analytics or width.
70
+ */
71
+ usePluginHook?: ReactHookFactory;
63
72
  /**
64
73
  * Optional UI-component that will be added to the toolbar at the top of the editor (doesn't exist in the compact-editor).
65
74
  *
@@ -23,7 +23,7 @@ export type { ContextPanelHandler } from './context-panel';
23
23
  export type { EditorAppearance } from './editor-appearance';
24
24
  export type { ToolbarUiComponentFactoryParams, ToolbarUIComponentFactory, } from './toolbar';
25
25
  export { ToolbarSize, ToolbarWidths, ToolbarWidthsFullPage } from './toolbar';
26
- export type { UiComponentFactoryParams, UIComponentFactory, } from './ui-components';
26
+ export type { UiComponentFactoryParams, UIComponentFactory, ReactHookFactory, } from './ui-components';
27
27
  export type { EditorReactContext } from './editor-react-context';
28
28
  export type { PMPluginFactoryParams, PMPluginFactory, PMPlugin, } from './plugin-factory';
29
29
  export type { NodeConfig, MarkConfig, NodeViewConfig, } from './prosemirror-config';
@@ -20,3 +20,4 @@ export type UiComponentFactoryParams = {
20
20
  wrapperElement: HTMLElement | null;
21
21
  };
22
22
  export type UIComponentFactory = (params: UiComponentFactoryParams) => React.ReactElement<any> | null;
23
+ export type ReactHookFactory = (params: Pick<UiComponentFactoryParams, 'editorView' | 'containerElement'>) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.4.0",
3
+ "version": "74.5.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -25,7 +25,7 @@
25
25
  "atlassian": {
26
26
  "team": "Editor",
27
27
  "inPublicMirror": true,
28
- "releaseModel": "scheduled"
28
+ "releaseModel": "continuous"
29
29
  },
30
30
  "af:exports": {
31
31
  "./event-dispatcher": "./src/event-dispatcher/index.ts",
@@ -79,7 +79,7 @@
79
79
  "@atlaskit/button": "^16.7.0",
80
80
  "@atlaskit/code": "^14.6.0",
81
81
  "@atlaskit/codemod-utils": "^4.2.0",
82
- "@atlaskit/collab-provider": "^9.1.0",
82
+ "@atlaskit/collab-provider": "^9.2.0",
83
83
  "@atlaskit/editor-json-transformer": "^8.9.0",
84
84
  "@atlaskit/editor-palette": "1.4.2",
85
85
  "@atlaskit/editor-shared-styles": "^2.4.0",
@@ -143,7 +143,7 @@
143
143
  "@atlaskit/editor-plugin-feature-flags": "^0.1.0",
144
144
  "@atlaskit/editor-plugin-grid": "^0.1.0",
145
145
  "@atlaskit/editor-plugin-table": "^1.5.0",
146
- "@atlaskit/editor-plugin-width": "^0.0.1",
146
+ "@atlaskit/editor-plugin-width": "^0.1.0",
147
147
  "@atlaskit/editor-test-helpers": "^18.5.0",
148
148
  "@atlaskit/media-core": "^34.1.0",
149
149
  "@atlaskit/util-data-test": "^17.8.0",
@@ -0,0 +1,9 @@
1
+ ## API Report File for "@atlaskit/editor-common"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ // (No @packageDocumentation comment for this package)
8
+
9
+ ```