@atlaskit/editor-core 207.2.0 → 207.3.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/cjs/ui/Appearance/Chromeless.js +27 -11
  3. package/dist/cjs/ui/Appearance/Comment/Comment.js +25 -5
  4. package/dist/cjs/ui/Appearance/FullPage/FullPage.js +26 -4
  5. package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +2 -2
  6. package/dist/cjs/ui/ContentStyles/layout.js +2 -2
  7. package/dist/cjs/ui/ContextPanel/index.js +10 -4
  8. package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +29 -234
  9. package/dist/cjs/ui/EditorContentContainer/styles/ai-panel.js +97 -0
  10. package/dist/cjs/ui/EditorContentContainer/styles/annotationStyles.js +45 -0
  11. package/dist/cjs/ui/EditorContentContainer/styles/embedCardStyles.js +34 -0
  12. package/dist/cjs/ui/EditorContentContainer/styles/layout.js +126 -0
  13. package/dist/cjs/ui/EditorContentContainer/styles/link.js +32 -0
  14. package/dist/cjs/ui/EditorContentContainer/styles/rule.js +29 -0
  15. package/dist/cjs/version-wrapper.js +1 -1
  16. package/dist/es2019/ui/Appearance/Chromeless.js +28 -10
  17. package/dist/es2019/ui/Appearance/Comment/Comment.js +24 -3
  18. package/dist/es2019/ui/Appearance/FullPage/FullPage.js +24 -2
  19. package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
  20. package/dist/es2019/ui/ContentStyles/layout.js +3 -2
  21. package/dist/es2019/ui/ContextPanel/index.js +11 -5
  22. package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +23 -773
  23. package/dist/es2019/ui/EditorContentContainer/styles/ai-panel.js +213 -0
  24. package/dist/es2019/ui/EditorContentContainer/styles/annotationStyles.js +47 -0
  25. package/dist/es2019/ui/EditorContentContainer/styles/embedCardStyles.js +27 -0
  26. package/dist/es2019/ui/EditorContentContainer/styles/layout.js +517 -0
  27. package/dist/es2019/ui/EditorContentContainer/styles/link.js +26 -0
  28. package/dist/es2019/ui/EditorContentContainer/styles/rule.js +22 -0
  29. package/dist/es2019/version-wrapper.js +1 -1
  30. package/dist/esm/ui/Appearance/Chromeless.js +28 -12
  31. package/dist/esm/ui/Appearance/Comment/Comment.js +26 -6
  32. package/dist/esm/ui/Appearance/FullPage/FullPage.js +27 -5
  33. package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
  34. package/dist/esm/ui/ContentStyles/layout.js +2 -2
  35. package/dist/esm/ui/ContextPanel/index.js +11 -5
  36. package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +31 -237
  37. package/dist/esm/ui/EditorContentContainer/styles/ai-panel.js +91 -0
  38. package/dist/esm/ui/EditorContentContainer/styles/annotationStyles.js +37 -0
  39. package/dist/esm/ui/EditorContentContainer/styles/embedCardStyles.js +27 -0
  40. package/dist/esm/ui/EditorContentContainer/styles/layout.js +120 -0
  41. package/dist/esm/ui/EditorContentContainer/styles/link.js +26 -0
  42. package/dist/esm/ui/EditorContentContainer/styles/rule.js +21 -0
  43. package/dist/esm/version-wrapper.js +1 -1
  44. package/dist/types/ui/Appearance/Chromeless.d.ts +0 -4
  45. package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -1
  46. package/dist/types/ui/Appearance/FullPage/getEditorViewModeSync.d.ts +1 -1
  47. package/dist/types/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -11
  48. package/dist/types/ui/EditorContentContainer/styles/ai-panel.d.ts +2 -0
  49. package/dist/types/ui/EditorContentContainer/styles/annotationStyles.d.ts +1 -0
  50. package/dist/types/ui/EditorContentContainer/styles/embedCardStyles.d.ts +1 -0
  51. package/dist/types/ui/EditorContentContainer/styles/layout.d.ts +2 -0
  52. package/dist/types/ui/EditorContentContainer/styles/link.d.ts +2 -0
  53. package/dist/types/ui/EditorContentContainer/styles/rule.d.ts +1 -0
  54. package/dist/types-ts4.5/ui/Appearance/Chromeless.d.ts +0 -4
  55. package/dist/types-ts4.5/ui/Appearance/FullPage/FullPage.d.ts +1 -1
  56. package/dist/types-ts4.5/ui/Appearance/FullPage/getEditorViewModeSync.d.ts +1 -1
  57. package/dist/types-ts4.5/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -11
  58. package/dist/types-ts4.5/ui/EditorContentContainer/styles/ai-panel.d.ts +2 -0
  59. package/dist/types-ts4.5/ui/EditorContentContainer/styles/annotationStyles.d.ts +1 -0
  60. package/dist/types-ts4.5/ui/EditorContentContainer/styles/embedCardStyles.d.ts +1 -0
  61. package/dist/types-ts4.5/ui/EditorContentContainer/styles/layout.d.ts +2 -0
  62. package/dist/types-ts4.5/ui/EditorContentContainer/styles/link.d.ts +2 -0
  63. package/dist/types-ts4.5/ui/EditorContentContainer/styles/rule.d.ts +1 -0
  64. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 207.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#157548](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/157548)
8
+ [`586b29cfecfb2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/586b29cfecfb2) -
9
+ refactor: editor-core appearances to useSharedPluginStateSelector
10
+ - [#159163](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159163)
11
+ [`aa05b5f45ce2a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aa05b5f45ce2a) -
12
+ [https://product-fabric.atlassian.net/browse/ED-27746](ED-27746) - rewrite editor annotation CSS
13
+ in static emotion
14
+ - [#159754](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159754)
15
+ [`4906474d30373`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4906474d30373) -
16
+ [https://product-fabric.atlassian.net/browse/ED-27746](ED-27746) - rewrite editor embed card CSS
17
+ in static emotion
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
23
+ ## 207.2.1
24
+
25
+ ### Patch Changes
26
+
27
+ - [#159359](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159359)
28
+ [`c3b98323f50a2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c3b98323f50a2) -
29
+ refactor link and rule styles
30
+ - Updated dependencies
31
+
3
32
  ## 207.2.0
4
33
 
5
34
  ### Minor Changes
@@ -15,6 +15,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
15
15
  var _react = _interopRequireWildcard(require("react"));
16
16
  var _react2 = require("@emotion/react");
17
17
  var _hooks = require("@atlaskit/editor-common/hooks");
18
+ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
18
19
  var _scrollbar = require("@atlaskit/editor-shared-styles/scrollbar");
19
20
  var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
20
21
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
@@ -60,6 +61,13 @@ var EditorContainer = (0, _platformFeatureFlagsReact.componentWithCondition)(fun
60
61
  exposure: true
61
62
  });
62
63
  }, _EditorContentContainer.default, ContentArea);
64
+ var useEditorViewModePluginState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (pluginInjectionApi) {
65
+ var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['editorViewMode']),
66
+ editorViewModeState = _useSharedPluginState.editorViewModeState;
67
+ return editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
68
+ }, function (pluginInjectionApi) {
69
+ return (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'editorViewMode.mode');
70
+ });
63
71
 
64
72
  /**
65
73
  * Render the editor in a chromeless appearance.
@@ -98,8 +106,7 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
98
106
  pluginHooks = _this$props.pluginHooks,
99
107
  featureFlags = _this$props.featureFlags;
100
108
  var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
101
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(_this.props.editorAPI, ['editorViewMode']),
102
- editorViewModeState = _useSharedPluginState.editorViewModeState;
109
+ var editorViewMode = useEditorViewModePluginState(_this.props.editorAPI);
103
110
  return (0, _react2.jsx)(_WithFlash.default, {
104
111
  animate: maxContentSizeReached
105
112
  }, (0, _react2.jsx)("div", {
@@ -123,7 +130,7 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
123
130
  , {
124
131
  className: "ak-editor-content-area",
125
132
  featureFlags: featureFlags,
126
- viewMode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode,
133
+ viewMode: editorViewMode,
127
134
  appearance: _this.appearance
128
135
  }, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, (0, _react2.jsx)(_PluginSlot.default, {
129
136
  editorView: editorView,
@@ -147,12 +154,7 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
147
154
  (0, _inherits2.default)(Editor, _React$Component);
148
155
  return (0, _createClass2.default)(Editor, [{
149
156
  key: "render",
150
- value:
151
- /**
152
- *
153
- * @example
154
- */
155
- function render() {
157
+ value: function render() {
156
158
  return (0, _react2.jsx)(RenderWithPluginState, {
157
159
  editorAPI: this.props.editorAPI,
158
160
  renderChrome: this.renderChrome
@@ -161,11 +163,25 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
161
163
  }]);
162
164
  }(_react.default.Component);
163
165
  (0, _defineProperty2.default)(Editor, "displayName", 'ChromelessEditorAppearance');
166
+ var useMaxContentSizePluginState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (pluginInjectionApi) {
167
+ var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['maxContentSize']),
168
+ maxContentSizeState = _useSharedPluginState2.maxContentSizeState;
169
+ return {
170
+ maxContentSizeState: maxContentSizeState
171
+ };
172
+ }, function (pluginInjectionApi) {
173
+ var maxContentSizeReached = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'maxContentSize.maxContentSizeReached');
174
+ return {
175
+ maxContentSizeState: maxContentSizeReached === undefined ? undefined : {
176
+ maxContentSizeReached: maxContentSizeReached
177
+ }
178
+ };
179
+ });
164
180
  function RenderWithPluginState(_ref3) {
165
181
  var renderChrome = _ref3.renderChrome,
166
182
  editorAPI = _ref3.editorAPI;
167
- var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(editorAPI, ['maxContentSize']),
168
- maxContentSizeState = _useSharedPluginState2.maxContentSizeState;
183
+ var _useMaxContentSizePlu = useMaxContentSizePluginState(editorAPI),
184
+ maxContentSizeState = _useMaxContentSizePlu.maxContentSizeState;
169
185
  return (0, _react2.jsx)(_react.Fragment, null, renderChrome({
170
186
  maxContentSize: maxContentSizeState
171
187
  }));
@@ -18,6 +18,7 @@ var _messages = _interopRequireDefault(require("@atlaskit/editor-common/messages
18
18
  var _styles = require("@atlaskit/editor-common/styles");
19
19
  var _ui = require("@atlaskit/editor-common/ui");
20
20
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
21
+ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
21
22
  var _commonStyles = require("@atlaskit/editor-plugins/table/ui/common-styles");
22
23
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
23
24
  var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
@@ -94,13 +95,32 @@ var EditorContainer = (0, _platformFeatureFlagsReact.componentWithCondition)(fun
94
95
  exposure: true
95
96
  });
96
97
  }, _EditorContentContainer.default, ContentArea);
98
+ var useCommentEditorPluginsStates = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (pluginInjectionApi) {
99
+ return (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['maxContentSize', 'primaryToolbar', 'editorViewMode']);
100
+ }, function (pluginInjectionApi) {
101
+ var maxContentSizeReached = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'maxContentSize.maxContentSizeReached');
102
+ var primaryToolbarComponents = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'primaryToolbar.components');
103
+ var editorViewMode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'editorViewMode.mode');
104
+ return {
105
+ maxContentSizeState: maxContentSizeReached === undefined ? undefined : {
106
+ maxContentSizeReached: maxContentSizeReached
107
+ },
108
+ primaryToolbarState: !primaryToolbarComponents ? undefined : {
109
+ components: primaryToolbarComponents
110
+ },
111
+ editorViewModeState: !editorViewMode ? undefined : {
112
+ mode: editorViewMode
113
+ }
114
+ };
115
+ });
97
116
  var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEditorWithIntl(props) {
98
117
  var editorAPI = props.editorAPI;
99
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(editorAPI, ['media', 'maxContentSize', 'primaryToolbar', 'editorViewMode']),
100
- mediaState = _useSharedPluginState.mediaState,
101
- maxContentSizeState = _useSharedPluginState.maxContentSizeState,
102
- primaryToolbarState = _useSharedPluginState.primaryToolbarState,
103
- editorViewModeState = _useSharedPluginState.editorViewModeState;
118
+ var _useCommentEditorPlug = useCommentEditorPluginsStates(editorAPI),
119
+ maxContentSizeState = _useCommentEditorPlug.maxContentSizeState,
120
+ primaryToolbarState = _useCommentEditorPlug.primaryToolbarState,
121
+ editorViewModeState = _useCommentEditorPlug.editorViewModeState;
122
+ var _useSharedPluginState = (0, _hooks.useSharedPluginState)(editorAPI, ['media']),
123
+ mediaState = _useSharedPluginState.mediaState;
104
124
  var intl = (0, _reactIntlNext.useIntl)();
105
125
  var editorDOMElement = props.editorDOMElement,
106
126
  editorView = props.editorView,
@@ -66,6 +66,28 @@ var hasCustomComponents = function hasCustomComponents(components) {
66
66
  }
67
67
  return true;
68
68
  };
69
+ var useFullPageEditorPluginsStates = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (pluginInjectionApi) {
70
+ return (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['editorViewMode', 'primaryToolbar', 'interaction']);
71
+ }, function (pluginInjectionApi) {
72
+ var primaryToolbarComponents = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'primaryToolbar.components');
73
+ var editorViewMode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'editorViewMode.mode');
74
+ var showTopToolbar = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'editorViewMode._showTopToolbar');
75
+ var hasHadInteraction = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'interaction.hasHadInteraction');
76
+ var interactionState = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'interaction.interactionState');
77
+ return {
78
+ primaryToolbarState: !primaryToolbarComponents ? undefined : {
79
+ components: primaryToolbarComponents
80
+ },
81
+ editorViewModeState: !editorViewMode ? undefined : {
82
+ mode: editorViewMode,
83
+ _showTopToolbar: showTopToolbar
84
+ },
85
+ interactionState: hasHadInteraction === undefined || interactionState === undefined ? undefined : {
86
+ hasHadInteraction: hasHadInteraction,
87
+ interactionState: interactionState
88
+ }
89
+ };
90
+ });
69
91
  var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
70
92
  var _scrollContentContain, _scrollContentContain2, _scrollContentContain3, _scrollContentContain4, _scrollContentContain5, _wrapperElementRef$cu;
71
93
  var wrapperElementRef = (0, _react.useMemo)(function () {
@@ -74,10 +96,10 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
74
96
  var scrollContentContainerRef = (0, _react.useRef)(null);
75
97
  var showKeyline = useShowKeyline(scrollContentContainerRef);
76
98
  var editorAPI = props.editorAPI;
77
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(editorAPI, ['editorViewMode', 'primaryToolbar', 'interaction']),
78
- editorViewModeState = _useSharedPluginState.editorViewModeState,
79
- primaryToolbarState = _useSharedPluginState.primaryToolbarState,
80
- interactionState = _useSharedPluginState.interactionState;
99
+ var _useFullPageEditorPlu = useFullPageEditorPluginsStates(editorAPI),
100
+ editorViewModeState = _useFullPageEditorPlu.editorViewModeState,
101
+ primaryToolbarState = _useFullPageEditorPlu.primaryToolbarState,
102
+ interactionState = _useFullPageEditorPlu.interactionState;
81
103
  var viewMode = (0, _getEditorViewModeSync.getEditorViewMode)(editorViewModeState, props.preset);
82
104
  var hasHadInteraction = (0, _platformFeatureFlags.fg)('platform_editor_interaction_api_refactor') ? (interactionState === null || interactionState === void 0 ? void 0 : interactionState.interactionState) !== 'hasNotHadInteraction' : Boolean(interactionState === null || interactionState === void 0 ? void 0 : interactionState.hasHadInteraction);
83
105
  var toolbarDocking = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(editorAPI, 'selectionToolbar.toolbarDocking');
@@ -21,7 +21,7 @@ var SWOOP_ANIMATION = "0.5s ".concat(_editorSharedStyles.akEditorSwoopCubicBezie
21
21
  var getTotalPadding = function getTotalPadding() {
22
22
  return (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2;
23
23
  };
24
- var akNestedDndGutterOffset = 8;
24
+ var AK_NESTED_DND_GUTTER_OFFSET = 8;
25
25
 
26
26
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
27
27
  var fullPageEditorWrapper = exports.fullPageEditorWrapper = (0, _react.css)({
@@ -127,7 +127,7 @@ var editorContentAreaContainerStyle = function editorContentAreaContainerStyle()
127
127
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
128
128
  '[data-layout-section]': {
129
129
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
130
- maxWidth: "calc(100% + ".concat((_editorSharedStyles.akLayoutGutterOffset + ((0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? akNestedDndGutterOffset : 0)) * 2, "px)")
130
+ maxWidth: "calc(100% + ".concat((_editorSharedStyles.akLayoutGutterOffset + ((0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? AK_NESTED_DND_GUTTER_OFFSET : 0)) * 2, "px)")
131
131
  }
132
132
  }
133
133
  });
@@ -21,7 +21,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
21
21
  * If you are making updates to this file, please updates in new location as well.
22
22
  */
23
23
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
24
- var akNestedDndGutterOffset = 8;
24
+ var AK_NESTED_DND_GUTTER_OFFSET = 8;
25
25
  var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
26
26
  return (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
27
27
  (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t> :nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span)) {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t"]))) : // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
@@ -77,5 +77,5 @@ var layoutResponsiveStyles = function layoutResponsiveStyles(viewMode) {
77
77
 
78
78
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
79
79
  var layoutStyles = exports.layoutStyles = function layoutStyles(viewMode) {
80
- return (0, _react.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t/* Ignored via go/ees007\n\t\t\tTODO: Migrate away from gridSize\n\t\t\tRecommendation: Replace directly with 7px */\n\t\t\tmargin: ", " -", "px 0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: ", ";\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\tposition: relative;\n\n\t\t\t\tmin-width: 0;\n\t\t\t\t/* disable 4 borders when in view mode and advanced layouts is on */\n\t\t\t\tborder: ", "px\n\t\t\t\t\tsolid ", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t", "\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\n\t\t/* styles to support borders for layout */\n\t\t[data-layout-section],\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t", "\n\n\t/* hide separator when element is dragging on top of a layout column */\n\t[data-blocks-drop-target-container] ~ [data-layout-column] > [data-layout-content]::before {\n\t\tdisplay: none;\n\t}\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n\n\t", "\n"])), layoutSectionStyles(), "var(--ds-space-100, 8px)", _editorSharedStyles.akLayoutGutterOffset + ((0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? akNestedDndGutterOffset : 0), _editorSharedStyles.akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', viewMode === 'view' || (0, _experiments.editorExperiment)('advanced_layouts', true) ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, #091E4224)", _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_COLUMN_PADDING + ((0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? 8 : 0), firstNodeWithNotMarginTop(), layoutColumnStyles(), (0, _experiments.editorExperiment)('advanced_layouts', true) ? layoutWithSeparatorBorderStyles(viewMode) : layoutBorderStyles(viewMode), (0, _experiments.editorExperiment)('advanced_layouts', true) && layoutResponsiveStyles(viewMode), _types.TableCssClassName.TABLE_CONTAINER, _consts.tableMarginFullWidthMode, (0, _experiments.editorExperiment)('advanced_layouts', false) && (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') && ".ak-editor-content-area.appearance-full-page .ProseMirror [data-layout-section] {\n\t\t\t\tmargin: ".concat("var(--ds-space-100, 8px)", " -", _editorSharedStyles.akLayoutGutterOffset + 8, "px 0;\n\t\t\t\t}"));
80
+ return (0, _react.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t/* Ignored via go/ees007\n\t\t\tTODO: Migrate away from gridSize\n\t\t\tRecommendation: Replace directly with 7px */\n\t\t\tmargin: ", " -", "px\n\t\t\t\t0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: ", ";\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\tposition: relative;\n\n\t\t\t\tmin-width: 0;\n\t\t\t\t/* disable 4 borders when in view mode and advanced layouts is on */\n\t\t\t\tborder: ", "px\n\t\t\t\t\tsolid ", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t", "\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\n\t\t/* styles to support borders for layout */\n\t\t[data-layout-section],\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t", "\n\n\t/* hide separator when element is dragging on top of a layout column */\n\t[data-blocks-drop-target-container] ~ [data-layout-column] > [data-layout-content]::before {\n\t\tdisplay: none;\n\t}\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n\n\t", "\n"])), layoutSectionStyles(), "var(--ds-space-100, 8px)", _editorSharedStyles.akLayoutGutterOffset + ((0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? AK_NESTED_DND_GUTTER_OFFSET : 0), _editorSharedStyles.akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', viewMode === 'view' || (0, _experiments.editorExperiment)('advanced_layouts', true) ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, #091E4224)", _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_COLUMN_PADDING + ((0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? 8 : 0), firstNodeWithNotMarginTop(), layoutColumnStyles(), (0, _experiments.editorExperiment)('advanced_layouts', true) ? layoutWithSeparatorBorderStyles(viewMode) : layoutBorderStyles(viewMode), (0, _experiments.editorExperiment)('advanced_layouts', true) && layoutResponsiveStyles(viewMode), _types.TableCssClassName.TABLE_CONTAINER, _consts.tableMarginFullWidthMode, (0, _experiments.editorExperiment)('advanced_layouts', false) && (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') && ".ak-editor-content-area.appearance-full-page .ProseMirror [data-layout-section] {\n\t\t\t\tmargin: ".concat("var(--ds-space-100, 8px)", " -", _editorSharedStyles.akLayoutGutterOffset + 8, "px 0;\n\t\t\t\t}"));
81
81
  };
@@ -18,6 +18,7 @@ var _react2 = require("@emotion/react");
18
18
  var _Transition = _interopRequireDefault(require("react-transition-group/Transition"));
19
19
  var _hooks = require("@atlaskit/editor-common/hooks");
20
20
  var _ui = require("@atlaskit/editor-common/ui");
21
+ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
21
22
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
22
23
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
24
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -174,11 +175,16 @@ var SwappableContentArea = exports.SwappableContentArea = /*#__PURE__*/function
174
175
  }
175
176
  }]);
176
177
  }(_react.default.PureComponent);
177
- function ContextPanel(props) {
178
- var _contextPanelState$co;
179
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(props.editorAPI, ['contextPanel']),
178
+ var useContextPanelSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (pluginInjectionApi) {
179
+ var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['contextPanel']),
180
180
  contextPanelState = _useSharedPluginState.contextPanelState;
181
- var firstContent = contextPanelState && (contextPanelState === null || contextPanelState === void 0 || (_contextPanelState$co = contextPanelState.contents) === null || _contextPanelState$co === void 0 ? void 0 : _contextPanelState$co.find(Boolean));
181
+ return contextPanelState === null || contextPanelState === void 0 ? void 0 : contextPanelState.contents;
182
+ }, function (pluginInjectionApi) {
183
+ return (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'contextPanel.contents');
184
+ });
185
+ function ContextPanel(props) {
186
+ var contextPanelContents = useContextPanelSharedState(props.editorAPI);
187
+ var firstContent = contextPanelContents && contextPanelContents.find(Boolean);
182
188
  return (
183
189
  // Ignored via go/ees005
184
190
  // eslint-disable-next-line react/jsx-props-no-spreading