@atlaskit/editor-core 185.7.0 → 185.8.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.
@@ -2,7 +2,7 @@
2
2
  import { jsx, useTheme } from '@emotion/react';
3
3
  import { WidthConsumer } from '@atlaskit/editor-common/ui';
4
4
  import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
5
- import React from 'react';
5
+ import React, { useImperativeHandle, useRef } from 'react';
6
6
  import { injectIntl } from 'react-intl-next';
7
7
  import { ClickAreaBlock } from '../../Addon';
8
8
  import ContextPanel from '../../ContextPanel';
@@ -10,55 +10,71 @@ import PluginSlot from '../../PluginSlot';
10
10
  import { contentArea, editorContentAreaStyle, sidebarArea, ScrollContainer, editorContentGutterStyle, positionedOverEditorStyle } from './StyledComponents';
11
11
  import messages from './messages';
12
12
  export const CONTENT_AREA_TEST_ID = 'ak-editor-fp-content-area';
13
- const Content = /*#__PURE__*/React.memo(props => {
13
+ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
14
14
  const theme = useTheme();
15
15
  const fullWidthMode = props.appearance === 'full-width';
16
+ const scrollContainerRef = useRef(null);
17
+ const contentAreaRef = useRef(null);
18
+ useImperativeHandle(ref, () => ({
19
+ get scrollContainer() {
20
+ return scrollContainerRef.current;
21
+ },
22
+ get contentArea() {
23
+ return contentAreaRef.current;
24
+ }
25
+ }), []);
16
26
  return jsx(WidthConsumer, null, ({
17
27
  width
18
28
  }) => jsx(ContextPanelConsumer, null, ({
19
29
  positionedOverEditor
20
- }) => jsx("div", {
21
- css: [contentArea, positionedOverEditor && positionedOverEditorStyle],
22
- "data-testid": CONTENT_AREA_TEST_ID
23
- }, jsx(ScrollContainer, {
24
- ref: props.scrollContainerRef,
25
- className: "fabric-editor-popup-scroll-parent",
26
- featureFlags: props.featureFlags
27
- }, jsx(ClickAreaBlock, {
28
- editorView: props.editorView,
29
- editorDisabled: props.disabled
30
- }, jsx("div", {
31
- css: editorContentAreaStyle({
32
- fullWidthMode,
33
- layoutMaxWidth: theme.layoutMaxWidth,
34
- containerWidth: width
35
- }),
36
- role: "region",
37
- "aria-label": props.intl.formatMessage(messages.editableContentLabel),
38
- ref: props.contentAreaRef
39
- }, jsx("div", {
40
- css: editorContentGutterStyle,
41
- className: ['ak-editor-content-area', fullWidthMode ? 'fabric-editor--full-width-mode' : ''].join(' ')
42
- }, props.customContentComponents, jsx(PluginSlot, {
43
- editorView: props.editorView,
44
- editorActions: props.editorActions,
45
- eventDispatcher: props.eventDispatcher,
46
- providerFactory: props.providerFactory,
47
- appearance: props.appearance,
48
- items: props.contentComponents,
49
- pluginHooks: props.pluginHooks,
50
- contentArea: props.contentArea,
51
- popupsMountPoint: props.popupsMountPoint,
52
- popupsBoundariesElement: props.popupsBoundariesElement,
53
- popupsScrollableElement: props.popupsScrollableElement,
54
- disabled: !!props.disabled,
55
- containerElement: props.scrollContainer,
56
- dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
57
- wrapperElement: props.wrapperElement
58
- }), props.editorDOMElement)))), jsx("div", {
59
- css: sidebarArea
60
- }, props.contextPanel || jsx(ContextPanel, {
61
- visible: false
62
- })))));
30
+ }) => {
31
+ var _contentAreaRef$curre;
32
+ return jsx("div", {
33
+ css: [contentArea, positionedOverEditor && positionedOverEditorStyle],
34
+ "data-testid": CONTENT_AREA_TEST_ID
35
+ }, jsx(ScrollContainer, {
36
+ className: "fabric-editor-popup-scroll-parent",
37
+ featureFlags: props.featureFlags,
38
+ ref: scrollContainerRef
39
+ }, jsx(ClickAreaBlock, {
40
+ editorView: props.editorView,
41
+ editorDisabled: props.disabled
42
+ }, jsx("div", {
43
+ css: editorContentAreaStyle({
44
+ fullWidthMode,
45
+ layoutMaxWidth: theme.layoutMaxWidth,
46
+ containerWidth: width
47
+ }),
48
+ role: "region",
49
+ "aria-label": props.intl.formatMessage(messages.editableContentLabel),
50
+ ref: contentAreaRef
51
+ }, jsx("div", {
52
+ css: editorContentGutterStyle,
53
+ className: ['ak-editor-content-area', fullWidthMode ? 'fabric-editor--full-width-mode' : ''].join(' '),
54
+ ref: contentAreaRef
55
+ }, props.customContentComponents, jsx(PluginSlot, {
56
+ editorView: props.editorView,
57
+ editorActions: props.editorActions,
58
+ eventDispatcher: props.eventDispatcher,
59
+ providerFactory: props.providerFactory,
60
+ appearance: props.appearance,
61
+ items: props.contentComponents,
62
+ pluginHooks: props.pluginHooks,
63
+ contentArea: (_contentAreaRef$curre = contentAreaRef.current) !== null && _contentAreaRef$curre !== void 0 ? _contentAreaRef$curre : undefined,
64
+ popupsMountPoint: props.popupsMountPoint,
65
+ popupsBoundariesElement: props.popupsBoundariesElement,
66
+ popupsScrollableElement: props.popupsScrollableElement,
67
+ disabled: !!props.disabled,
68
+ containerElement: scrollContainerRef.current,
69
+ dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
70
+ wrapperElement: props.wrapperElement
71
+ }), props.editorDOMElement)))), jsx("div", {
72
+ css: sidebarArea
73
+ }, props.contextPanel || jsx(ContextPanel, {
74
+ visible: false
75
+ })));
76
+ }));
63
77
  });
64
- export const FullPageContentArea = injectIntl(Content);
78
+ export const FullPageContentArea = injectIntl(Content, {
79
+ forwardRef: true
80
+ });
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "185.7.0";
2
+ export const version = "185.8.2";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.7.0",
3
+ "version": "185.8.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { PluginKey, NodeSelection } from 'prosemirror-state';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
- import { media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline } from '@atlaskit/adf-schema';
4
+ import { media, mediaGroup, mediaInline, mediaSingleSpec } from '@atlaskit/adf-schema';
5
5
  import { stateKey as pluginKey, createPlugin } from './pm-plugins/main';
6
6
  import { getMediaFeatureFlag } from '@atlaskit/media-common';
7
7
  import { createPlugin as createMediaAltTextPlugin } from './pm-plugins/alt-text';
@@ -22,6 +22,7 @@ import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
22
22
  import { ReactMediaNode } from './nodeviews/mediaNodeView';
23
23
  import { ReactMediaInlineNode } from './nodeviews/mediaInline';
24
24
  import { stateKey } from './pm-plugins/plugin-key';
25
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
25
26
  export { insertMediaSingleNode } from './utils/media-single';
26
27
  var mediaPlugin = function mediaPlugin() {
27
28
  var _api$dependencies, _api$dependencies$fea;
@@ -45,7 +46,14 @@ var mediaPlugin = function mediaPlugin() {
45
46
  mediaFeatureFlags = _ref.featureFlags;
46
47
  var captions = getMediaFeatureFlag('captions', mediaFeatureFlags);
47
48
  var allowMediaInline = getMediaFeatureFlag('mediaInline', mediaFeatureFlags);
48
- var mediaSingleNode = captions ? mediaSingleWithCaption : mediaSingle;
49
+ var mediaSingleOption = getBooleanFF('platform.editor.media.extended-resize-experience') ? {
50
+ withCaption: captions,
51
+ withExtendedWidthTypes: true
52
+ } : {
53
+ withCaption: captions,
54
+ withExtendedWidthTypes: false
55
+ };
56
+ var mediaSingleNode = mediaSingleSpec(mediaSingleOption);
49
57
  return [{
50
58
  name: 'mediaGroup',
51
59
  node: mediaGroup
@@ -1,137 +1,90 @@
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
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
- 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; } }
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
10
2
  /** @jsx jsx */
11
- import React from 'react';
3
+ import React, { useEffect, useState, useRef, useMemo } from 'react';
12
4
  import { jsx } from '@emotion/react';
13
- import rafSchedule from 'raf-schd';
14
- import { akEditorToolbarKeylineHeight } from '@atlaskit/editor-shared-styles';
15
5
  import { fullPageEditorWrapper } from './StyledComponents';
16
6
  import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
17
7
  import { FullPageContentArea } from './FullPageContentArea';
18
8
  import { FullPageToolbar } from './FullPageToolbar';
19
- export var FullPageEditor = /*#__PURE__*/function (_React$Component) {
20
- _inherits(FullPageEditor, _React$Component);
21
- var _super = _createSuper(FullPageEditor);
22
- function FullPageEditor(props) {
23
- var _this;
24
- _classCallCheck(this, FullPageEditor);
25
- _this = _super.call(this, props);
26
- _defineProperty(_assertThisInitialized(_this), "state", {
27
- showKeyline: false
28
- });
29
- _defineProperty(_assertThisInitialized(_this), "scrollContainer", null);
30
- // Wrapper container for toolbar and content area
31
- _defineProperty(_assertThisInitialized(_this), "wrapperElementRef", /*#__PURE__*/React.createRef());
32
- _defineProperty(_assertThisInitialized(_this), "contentAreaRef", function (contentArea) {
33
- _this.contentArea = contentArea;
34
- });
35
- _defineProperty(_assertThisInitialized(_this), "scrollContainerRef", function (ref) {
36
- var previousScrollContainer = _this.scrollContainer;
37
-
38
- // remove existing handler
39
- if (previousScrollContainer) {
40
- previousScrollContainer.removeEventListener('scroll', _this.updateToolbarKeyline);
41
- }
42
- _this.scrollContainer = ref ? ref : null;
43
- if (_this.scrollContainer) {
44
- _this.scrollContainer.addEventListener('scroll', _this.updateToolbarKeyline, false);
45
- _this.updateToolbarKeyline();
46
- }
47
- });
48
- _defineProperty(_assertThisInitialized(_this), "updateToolbarKeyline", rafSchedule(function () {
49
- if (!_this.scrollContainer) {
50
- return false;
51
- }
52
- var scrollTop = _this.scrollContainer.scrollTop;
53
- var showKeyline = scrollTop > akEditorToolbarKeylineHeight;
54
- if (showKeyline !== _this.state.showKeyline) {
55
- _this.setState({
56
- showKeyline: showKeyline
57
- });
58
- }
59
- return false;
60
- }));
61
- _defineProperty(_assertThisInitialized(_this), "handleResize", function () {
62
- _this.updateToolbarKeyline();
63
- });
64
- _this.featureFlags = props.featureFlags;
65
- if (props.innerRef) {
66
- _this.wrapperElementRef = props.innerRef;
9
+ import { browser } from '@atlaskit/editor-common/utils';
10
+ var useShowKeyline = function useShowKeyline(contentAreaRef) {
11
+ var _useState = useState(false),
12
+ _useState2 = _slicedToArray(_useState, 2),
13
+ showKeyline = _useState2[0],
14
+ setShowKeyline = _useState2[1];
15
+ useEffect(function () {
16
+ var _contentAreaRef$curre;
17
+ if (!((_contentAreaRef$curre = contentAreaRef.current) !== null && _contentAreaRef$curre !== void 0 && _contentAreaRef$curre.contentArea)) {
18
+ return;
67
19
  }
68
- return _this;
69
- }
70
- _createClass(FullPageEditor, [{
71
- key: "componentDidMount",
72
- value: function componentDidMount() {
73
- window.addEventListener('resize', this.handleResize, false);
74
- }
75
- }, {
76
- key: "componentWillUnmount",
77
- value: function componentWillUnmount() {
78
- window.removeEventListener('resize', this.handleResize);
79
- this.updateToolbarKeyline.cancel();
80
- }
81
- }, {
82
- key: "render",
83
- value: function render() {
84
- var props = this.props;
85
- var showKeyline = this.state.showKeyline;
86
- return jsx(ContextPanelWidthProvider, null, jsx("div", {
87
- css: fullPageEditorWrapper,
88
- className: "akEditor",
89
- ref: this.wrapperElementRef
90
- }, jsx(FullPageToolbar, {
91
- appearance: props.appearance,
92
- beforeIcon: props.primaryToolbarIconBefore,
93
- collabEdit: props.collabEdit,
94
- containerElement: this.scrollContainer,
95
- customPrimaryToolbarComponents: props.customPrimaryToolbarComponents,
96
- disabled: !!props.disabled,
97
- dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
98
- editorActions: props.editorActions,
99
- editorDOMElement: props.editorDOMElement,
100
- editorView: props.editorView,
101
- eventDispatcher: props.eventDispatcher,
102
- hasMinWidth: props.enableToolbarMinWidth,
103
- popupsBoundariesElement: props.popupsBoundariesElement,
104
- popupsMountPoint: props.popupsMountPoint,
105
- popupsScrollableElement: props.popupsScrollableElement,
106
- primaryToolbarComponents: props.primaryToolbarComponents,
107
- providerFactory: props.providerFactory,
108
- showKeyline: showKeyline,
109
- featureFlags: this.featureFlags
110
- }), jsx(FullPageContentArea, {
111
- appearance: props.appearance,
112
- contentArea: this.contentArea,
113
- contentAreaRef: this.contentAreaRef,
114
- contentComponents: props.contentComponents,
115
- contextPanel: props.contextPanel,
116
- customContentComponents: props.customContentComponents,
117
- disabled: props.disabled,
118
- dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
119
- editorActions: props.editorActions,
120
- editorDOMElement: props.editorDOMElement,
121
- editorView: props.editorView,
122
- eventDispatcher: props.eventDispatcher,
123
- popupsBoundariesElement: props.popupsBoundariesElement,
124
- popupsMountPoint: props.popupsMountPoint,
125
- popupsScrollableElement: props.popupsScrollableElement,
126
- providerFactory: props.providerFactory,
127
- scrollContainer: this.scrollContainer,
128
- scrollContainerRef: this.scrollContainerRef,
129
- wrapperElement: this.wrapperElementRef.current,
130
- pluginHooks: props.pluginHooks,
131
- featureFlags: this.featureFlags
132
- })));
133
- }
134
- }]);
135
- return FullPageEditor;
136
- }(React.Component);
137
- _defineProperty(FullPageEditor, "displayName", 'FullPageEditor');
20
+ var intersection = new IntersectionObserver(function (_ref) {
21
+ var _ref2 = _slicedToArray(_ref, 1),
22
+ entry = _ref2[0];
23
+ setShowKeyline(!entry.isIntersecting && entry.boundingClientRect.top < entry.intersectionRect.top);
24
+ }, {
25
+ root: undefined,
26
+ // Safari seems to miss events (on fast scroll) sometimes due
27
+ // to differences in IntersectionObserver behaviour between browsers.
28
+ // By lowering the threshold a little it gives Safari more
29
+ // time to catch these events.
30
+ threshold: browser.safari ? 0.98 : 1
31
+ });
32
+ intersection.observe(contentAreaRef.current.contentArea);
33
+ return function () {
34
+ intersection.disconnect();
35
+ };
36
+ }, [contentAreaRef]);
37
+ return showKeyline;
38
+ };
39
+ export var FullPageEditor = function FullPageEditor(props) {
40
+ var _scrollContentContain, _scrollContentContain2, _wrapperElementRef$cu;
41
+ var wrapperElementRef = useMemo(function () {
42
+ return props.innerRef;
43
+ }, [props.innerRef]);
44
+ var scrollContentContainerRef = useRef(null);
45
+ var showKeyline = useShowKeyline(scrollContentContainerRef);
46
+ return jsx(ContextPanelWidthProvider, null, jsx("div", {
47
+ css: fullPageEditorWrapper,
48
+ className: "akEditor",
49
+ ref: wrapperElementRef
50
+ }, jsx(FullPageToolbar, {
51
+ appearance: props.appearance,
52
+ beforeIcon: props.primaryToolbarIconBefore,
53
+ collabEdit: props.collabEdit,
54
+ containerElement: (_scrollContentContain = (_scrollContentContain2 = scrollContentContainerRef.current) === null || _scrollContentContain2 === void 0 ? void 0 : _scrollContentContain2.scrollContainer) !== null && _scrollContentContain !== void 0 ? _scrollContentContain : null,
55
+ customPrimaryToolbarComponents: props.customPrimaryToolbarComponents,
56
+ disabled: !!props.disabled,
57
+ dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
58
+ editorActions: props.editorActions,
59
+ editorDOMElement: props.editorDOMElement,
60
+ editorView: props.editorView,
61
+ eventDispatcher: props.eventDispatcher,
62
+ hasMinWidth: props.enableToolbarMinWidth,
63
+ popupsBoundariesElement: props.popupsBoundariesElement,
64
+ popupsMountPoint: props.popupsMountPoint,
65
+ popupsScrollableElement: props.popupsScrollableElement,
66
+ primaryToolbarComponents: props.primaryToolbarComponents,
67
+ providerFactory: props.providerFactory,
68
+ showKeyline: showKeyline,
69
+ featureFlags: props.featureFlags
70
+ }), jsx(FullPageContentArea, {
71
+ ref: scrollContentContainerRef,
72
+ appearance: props.appearance,
73
+ contentComponents: props.contentComponents,
74
+ contextPanel: props.contextPanel,
75
+ customContentComponents: props.customContentComponents,
76
+ disabled: props.disabled,
77
+ dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
78
+ editorActions: props.editorActions,
79
+ editorDOMElement: props.editorDOMElement,
80
+ editorView: props.editorView,
81
+ eventDispatcher: props.eventDispatcher,
82
+ popupsBoundariesElement: props.popupsBoundariesElement,
83
+ popupsMountPoint: props.popupsMountPoint,
84
+ popupsScrollableElement: props.popupsScrollableElement,
85
+ providerFactory: props.providerFactory,
86
+ wrapperElement: (_wrapperElementRef$cu = wrapperElementRef === null || wrapperElementRef === void 0 ? void 0 : wrapperElementRef.current) !== null && _wrapperElementRef$cu !== void 0 ? _wrapperElementRef$cu : null,
87
+ pluginHooks: props.pluginHooks,
88
+ featureFlags: props.featureFlags
89
+ })));
90
+ };
@@ -2,7 +2,7 @@
2
2
  import { jsx, useTheme } from '@emotion/react';
3
3
  import { WidthConsumer } from '@atlaskit/editor-common/ui';
4
4
  import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
5
- import React from 'react';
5
+ import React, { useImperativeHandle, useRef } from 'react';
6
6
  import { injectIntl } from 'react-intl-next';
7
7
  import { ClickAreaBlock } from '../../Addon';
8
8
  import ContextPanel from '../../ContextPanel';
@@ -10,20 +10,33 @@ import PluginSlot from '../../PluginSlot';
10
10
  import { contentArea, editorContentAreaStyle, sidebarArea, ScrollContainer, editorContentGutterStyle, positionedOverEditorStyle } from './StyledComponents';
11
11
  import messages from './messages';
12
12
  export var CONTENT_AREA_TEST_ID = 'ak-editor-fp-content-area';
13
- var Content = /*#__PURE__*/React.memo(function (props) {
13
+ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
14
14
  var theme = useTheme();
15
15
  var fullWidthMode = props.appearance === 'full-width';
16
+ var scrollContainerRef = useRef(null);
17
+ var contentAreaRef = useRef(null);
18
+ useImperativeHandle(ref, function () {
19
+ return {
20
+ get scrollContainer() {
21
+ return scrollContainerRef.current;
22
+ },
23
+ get contentArea() {
24
+ return contentAreaRef.current;
25
+ }
26
+ };
27
+ }, []);
16
28
  return jsx(WidthConsumer, null, function (_ref) {
17
29
  var width = _ref.width;
18
30
  return jsx(ContextPanelConsumer, null, function (_ref2) {
31
+ var _contentAreaRef$curre;
19
32
  var positionedOverEditor = _ref2.positionedOverEditor;
20
33
  return jsx("div", {
21
34
  css: [contentArea, positionedOverEditor && positionedOverEditorStyle],
22
35
  "data-testid": CONTENT_AREA_TEST_ID
23
36
  }, jsx(ScrollContainer, {
24
- ref: props.scrollContainerRef,
25
37
  className: "fabric-editor-popup-scroll-parent",
26
- featureFlags: props.featureFlags
38
+ featureFlags: props.featureFlags,
39
+ ref: scrollContainerRef
27
40
  }, jsx(ClickAreaBlock, {
28
41
  editorView: props.editorView,
29
42
  editorDisabled: props.disabled
@@ -35,10 +48,11 @@ var Content = /*#__PURE__*/React.memo(function (props) {
35
48
  }),
36
49
  role: "region",
37
50
  "aria-label": props.intl.formatMessage(messages.editableContentLabel),
38
- ref: props.contentAreaRef
51
+ ref: contentAreaRef
39
52
  }, jsx("div", {
40
53
  css: editorContentGutterStyle,
41
- className: ['ak-editor-content-area', fullWidthMode ? 'fabric-editor--full-width-mode' : ''].join(' ')
54
+ className: ['ak-editor-content-area', fullWidthMode ? 'fabric-editor--full-width-mode' : ''].join(' '),
55
+ ref: contentAreaRef
42
56
  }, props.customContentComponents, jsx(PluginSlot, {
43
57
  editorView: props.editorView,
44
58
  editorActions: props.editorActions,
@@ -47,12 +61,12 @@ var Content = /*#__PURE__*/React.memo(function (props) {
47
61
  appearance: props.appearance,
48
62
  items: props.contentComponents,
49
63
  pluginHooks: props.pluginHooks,
50
- contentArea: props.contentArea,
64
+ contentArea: (_contentAreaRef$curre = contentAreaRef.current) !== null && _contentAreaRef$curre !== void 0 ? _contentAreaRef$curre : undefined,
51
65
  popupsMountPoint: props.popupsMountPoint,
52
66
  popupsBoundariesElement: props.popupsBoundariesElement,
53
67
  popupsScrollableElement: props.popupsScrollableElement,
54
68
  disabled: !!props.disabled,
55
- containerElement: props.scrollContainer,
69
+ containerElement: scrollContainerRef.current,
56
70
  dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
57
71
  wrapperElement: props.wrapperElement
58
72
  }), props.editorDOMElement)))), jsx("div", {
@@ -63,4 +77,6 @@ var Content = /*#__PURE__*/React.memo(function (props) {
63
77
  });
64
78
  });
65
79
  });
66
- export var FullPageContentArea = injectIntl(Content);
80
+ export var FullPageContentArea = injectIntl(Content, {
81
+ forwardRef: true
82
+ });
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "185.7.0";
2
+ export var version = "185.8.2";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.7.0",
3
+ "version": "185.8.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,25 +1,3 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
1
  import { jsx } from '@emotion/react';
4
2
  import { EditorAppearanceComponentProps } from '../../../types';
5
- import { FeatureFlags } from '@atlaskit/editor-common/types';
6
- interface FullPageEditorState {
7
- showKeyline: boolean;
8
- }
9
- export declare class FullPageEditor extends React.Component<EditorAppearanceComponentProps, FullPageEditorState> {
10
- state: FullPageEditorState;
11
- featureFlags: FeatureFlags;
12
- static displayName: string;
13
- private scrollContainer;
14
- private contentArea;
15
- private wrapperElementRef;
16
- constructor(props: any);
17
- private contentAreaRef;
18
- private scrollContainerRef;
19
- private updateToolbarKeyline;
20
- private handleResize;
21
- componentDidMount(): void;
22
- componentWillUnmount(): void;
23
- render(): jsx.JSX.Element;
24
- }
25
- export {};
3
+ export declare const FullPageEditor: (props: EditorAppearanceComponentProps) => jsx.JSX.Element;
@@ -10,7 +10,6 @@ import type { ReactHookFactory } from '@atlaskit/editor-common/types';
10
10
  import type { FeatureFlags } from '../../../types/feature-flags';
11
11
  interface FullPageEditorContentAreaProps {
12
12
  appearance: EditorAppearance | undefined;
13
- contentArea: HTMLElement | undefined;
14
13
  contentComponents: UIComponentFactory[] | undefined;
15
14
  pluginHooks: ReactHookFactory[] | undefined;
16
15
  contextPanel: ReactComponents | undefined;
@@ -25,14 +24,15 @@ interface FullPageEditorContentAreaProps {
25
24
  popupsBoundariesElement: HTMLElement | undefined;
26
25
  popupsScrollableElement: HTMLElement | undefined;
27
26
  providerFactory: ProviderFactory;
28
- scrollContainer: HTMLElement | null;
29
- contentAreaRef(ref: HTMLElement | null): void;
30
- scrollContainerRef(ref: HTMLElement | null): void;
31
27
  wrapperElement: HTMLElement | null;
32
28
  featureFlags?: FeatureFlags;
33
29
  }
34
30
  export declare const CONTENT_AREA_TEST_ID = "ak-editor-fp-content-area";
35
- export declare const FullPageContentArea: React.FC<import("react-intl-next").WithIntlProps<FullPageEditorContentAreaProps & WrappedComponentProps<"intl">>> & {
36
- WrappedComponent: React.ComponentType<FullPageEditorContentAreaProps & WrappedComponentProps<"intl">>;
31
+ type ScrollContainerRefs = {
32
+ scrollContainer: HTMLDivElement | null;
33
+ contentArea: HTMLDivElement | null;
34
+ };
35
+ export declare const FullPageContentArea: React.ForwardRefExoticComponent<Pick<import("react-intl-next").WithIntlProps<React.PropsWithChildren<FullPageEditorContentAreaProps & WrappedComponentProps<"intl"> & React.RefAttributes<ScrollContainerRefs>>>, "children" | "key" | "forwardedRef" | keyof FullPageEditorContentAreaProps> & React.RefAttributes<any>> & {
36
+ WrappedComponent: React.ComponentType<FullPageEditorContentAreaProps & WrappedComponentProps<"intl"> & React.RefAttributes<ScrollContainerRefs>>;
37
37
  };
38
38
  export {};
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import React, { ReactElement } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
4
5
  import { EditorView } from 'prosemirror-view';
5
6
  import { WrappedComponentProps } from 'react-intl-next';
@@ -30,7 +31,7 @@ export interface FullPageToolbarProps {
30
31
  hasMinWidth?: boolean;
31
32
  featureFlags?: FeatureFlags;
32
33
  }
33
- export declare const EditorToolbar: React.FunctionComponent<FullPageToolbarProps & WrappedComponentProps>;
34
+ export declare const EditorToolbar: React.MemoExoticComponent<(props: FullPageToolbarProps & WrappedComponentProps) => jsx.JSX.Element>;
34
35
  export declare const FullPageToolbar: React.FC<import("react-intl-next").WithIntlProps<FullPageToolbarProps & WrappedComponentProps<"intl">>> & {
35
36
  WrappedComponent: React.ComponentType<FullPageToolbarProps & WrappedComponentProps<"intl">>;
36
37
  };
@@ -1,25 +1,3 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
1
  import { jsx } from '@emotion/react';
4
2
  import { EditorAppearanceComponentProps } from '../../../types';
5
- import { FeatureFlags } from '@atlaskit/editor-common/types';
6
- interface FullPageEditorState {
7
- showKeyline: boolean;
8
- }
9
- export declare class FullPageEditor extends React.Component<EditorAppearanceComponentProps, FullPageEditorState> {
10
- state: FullPageEditorState;
11
- featureFlags: FeatureFlags;
12
- static displayName: string;
13
- private scrollContainer;
14
- private contentArea;
15
- private wrapperElementRef;
16
- constructor(props: any);
17
- private contentAreaRef;
18
- private scrollContainerRef;
19
- private updateToolbarKeyline;
20
- private handleResize;
21
- componentDidMount(): void;
22
- componentWillUnmount(): void;
23
- render(): jsx.JSX.Element;
24
- }
25
- export {};
3
+ export declare const FullPageEditor: (props: EditorAppearanceComponentProps) => jsx.JSX.Element;
@@ -10,7 +10,6 @@ import type { ReactHookFactory } from '@atlaskit/editor-common/types';
10
10
  import type { FeatureFlags } from '../../../types/feature-flags';
11
11
  interface FullPageEditorContentAreaProps {
12
12
  appearance: EditorAppearance | undefined;
13
- contentArea: HTMLElement | undefined;
14
13
  contentComponents: UIComponentFactory[] | undefined;
15
14
  pluginHooks: ReactHookFactory[] | undefined;
16
15
  contextPanel: ReactComponents | undefined;
@@ -25,14 +24,15 @@ interface FullPageEditorContentAreaProps {
25
24
  popupsBoundariesElement: HTMLElement | undefined;
26
25
  popupsScrollableElement: HTMLElement | undefined;
27
26
  providerFactory: ProviderFactory;
28
- scrollContainer: HTMLElement | null;
29
- contentAreaRef(ref: HTMLElement | null): void;
30
- scrollContainerRef(ref: HTMLElement | null): void;
31
27
  wrapperElement: HTMLElement | null;
32
28
  featureFlags?: FeatureFlags;
33
29
  }
34
30
  export declare const CONTENT_AREA_TEST_ID = "ak-editor-fp-content-area";
35
- export declare const FullPageContentArea: React.FC<import("react-intl-next").WithIntlProps<FullPageEditorContentAreaProps & WrappedComponentProps<"intl">>> & {
36
- WrappedComponent: React.ComponentType<FullPageEditorContentAreaProps & WrappedComponentProps<"intl">>;
31
+ type ScrollContainerRefs = {
32
+ scrollContainer: HTMLDivElement | null;
33
+ contentArea: HTMLDivElement | null;
34
+ };
35
+ export declare const FullPageContentArea: React.ForwardRefExoticComponent<Pick<import("react-intl-next").WithIntlProps<React.PropsWithChildren<FullPageEditorContentAreaProps & WrappedComponentProps<"intl"> & React.RefAttributes<ScrollContainerRefs>>>, "children" | "key" | "forwardedRef" | keyof FullPageEditorContentAreaProps> & React.RefAttributes<any>> & {
36
+ WrappedComponent: React.ComponentType<FullPageEditorContentAreaProps & WrappedComponentProps<"intl"> & React.RefAttributes<ScrollContainerRefs>>;
37
37
  };
38
38
  export {};