@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
@@ -11,11 +11,12 @@ import classnames from 'classnames';
11
11
  import { useIntl } from 'react-intl-next';
12
12
  import ButtonGroup from '@atlaskit/button/button-group';
13
13
  import Button from '@atlaskit/button/new';
14
- import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
14
+ import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
15
15
  import messages from '@atlaskit/editor-common/messages';
16
16
  import { GRID_GUTTER } from '@atlaskit/editor-common/styles';
17
17
  import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/ui';
18
18
  import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
19
+ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
19
20
  import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
20
21
  import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
21
22
  import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
@@ -82,13 +83,32 @@ var EditorContainer = componentWithCondition(function () {
82
83
  exposure: true
83
84
  });
84
85
  }, EditorContentContainer, ContentArea);
86
+ var useCommentEditorPluginsStates = sharedPluginStateHookMigratorFactory(function (pluginInjectionApi) {
87
+ return useSharedPluginState(pluginInjectionApi, ['maxContentSize', 'primaryToolbar', 'editorViewMode']);
88
+ }, function (pluginInjectionApi) {
89
+ var maxContentSizeReached = useSharedPluginStateSelector(pluginInjectionApi, 'maxContentSize.maxContentSizeReached');
90
+ var primaryToolbarComponents = useSharedPluginStateSelector(pluginInjectionApi, 'primaryToolbar.components');
91
+ var editorViewMode = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
92
+ return {
93
+ maxContentSizeState: maxContentSizeReached === undefined ? undefined : {
94
+ maxContentSizeReached: maxContentSizeReached
95
+ },
96
+ primaryToolbarState: !primaryToolbarComponents ? undefined : {
97
+ components: primaryToolbarComponents
98
+ },
99
+ editorViewModeState: !editorViewMode ? undefined : {
100
+ mode: editorViewMode
101
+ }
102
+ };
103
+ });
85
104
  export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
86
105
  var editorAPI = props.editorAPI;
87
- var _useSharedPluginState = useSharedPluginState(editorAPI, ['media', 'maxContentSize', 'primaryToolbar', 'editorViewMode']),
88
- mediaState = _useSharedPluginState.mediaState,
89
- maxContentSizeState = _useSharedPluginState.maxContentSizeState,
90
- primaryToolbarState = _useSharedPluginState.primaryToolbarState,
91
- editorViewModeState = _useSharedPluginState.editorViewModeState;
106
+ var _useCommentEditorPlug = useCommentEditorPluginsStates(editorAPI),
107
+ maxContentSizeState = _useCommentEditorPlug.maxContentSizeState,
108
+ primaryToolbarState = _useCommentEditorPlug.primaryToolbarState,
109
+ editorViewModeState = _useCommentEditorPlug.editorViewModeState;
110
+ var _useSharedPluginState = useSharedPluginState(editorAPI, ['media']),
111
+ mediaState = _useSharedPluginState.mediaState;
92
112
  var intl = useIntl();
93
113
  var editorDOMElement = props.editorDOMElement,
94
114
  editorView = props.editorView,
@@ -8,7 +8,7 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { css, jsx } from '@emotion/react';
10
10
  import { browser } from '@atlaskit/editor-common/browser';
11
- import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
11
+ import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
12
12
  import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
13
13
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -55,6 +55,28 @@ var hasCustomComponents = function hasCustomComponents(components) {
55
55
  }
56
56
  return true;
57
57
  };
58
+ var useFullPageEditorPluginsStates = sharedPluginStateHookMigratorFactory(function (pluginInjectionApi) {
59
+ return useSharedPluginState(pluginInjectionApi, ['editorViewMode', 'primaryToolbar', 'interaction']);
60
+ }, function (pluginInjectionApi) {
61
+ var primaryToolbarComponents = useSharedPluginStateSelector(pluginInjectionApi, 'primaryToolbar.components');
62
+ var editorViewMode = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
63
+ var showTopToolbar = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode._showTopToolbar');
64
+ var hasHadInteraction = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.hasHadInteraction');
65
+ var interactionState = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.interactionState');
66
+ return {
67
+ primaryToolbarState: !primaryToolbarComponents ? undefined : {
68
+ components: primaryToolbarComponents
69
+ },
70
+ editorViewModeState: !editorViewMode ? undefined : {
71
+ mode: editorViewMode,
72
+ _showTopToolbar: showTopToolbar
73
+ },
74
+ interactionState: hasHadInteraction === undefined || interactionState === undefined ? undefined : {
75
+ hasHadInteraction: hasHadInteraction,
76
+ interactionState: interactionState
77
+ }
78
+ };
79
+ });
58
80
  export var FullPageEditor = function FullPageEditor(props) {
59
81
  var _scrollContentContain, _scrollContentContain2, _scrollContentContain3, _scrollContentContain4, _scrollContentContain5, _wrapperElementRef$cu;
60
82
  var wrapperElementRef = useMemo(function () {
@@ -63,10 +85,10 @@ export var FullPageEditor = function FullPageEditor(props) {
63
85
  var scrollContentContainerRef = useRef(null);
64
86
  var showKeyline = useShowKeyline(scrollContentContainerRef);
65
87
  var editorAPI = props.editorAPI;
66
- var _useSharedPluginState = useSharedPluginState(editorAPI, ['editorViewMode', 'primaryToolbar', 'interaction']),
67
- editorViewModeState = _useSharedPluginState.editorViewModeState,
68
- primaryToolbarState = _useSharedPluginState.primaryToolbarState,
69
- interactionState = _useSharedPluginState.interactionState;
88
+ var _useFullPageEditorPlu = useFullPageEditorPluginsStates(editorAPI),
89
+ editorViewModeState = _useFullPageEditorPlu.editorViewModeState,
90
+ primaryToolbarState = _useFullPageEditorPlu.primaryToolbarState,
91
+ interactionState = _useFullPageEditorPlu.interactionState;
70
92
  var viewMode = getEditorViewMode(editorViewModeState, props.preset);
71
93
  var hasHadInteraction = 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);
72
94
  var toolbarDocking = useSharedPluginStateSelector(editorAPI, 'selectionToolbar.toolbarDocking');
@@ -13,7 +13,7 @@ var SWOOP_ANIMATION = "0.5s ".concat(akEditorSwoopCubicBezier);
13
13
  var getTotalPadding = function getTotalPadding() {
14
14
  return akEditorGutterPaddingDynamic() * 2;
15
15
  };
16
- var akNestedDndGutterOffset = 8;
16
+ var AK_NESTED_DND_GUTTER_OFFSET = 8;
17
17
 
18
18
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
19
19
  export var fullPageEditorWrapper = css({
@@ -119,7 +119,7 @@ var editorContentAreaContainerStyle = function editorContentAreaContainerStyle()
119
119
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
120
120
  '[data-layout-section]': {
121
121
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
122
- maxWidth: "calc(100% + ".concat((akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? akNestedDndGutterOffset : 0)) * 2, "px)")
122
+ maxWidth: "calc(100% + ".concat((akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? AK_NESTED_DND_GUTTER_OFFSET : 0)) * 2, "px)")
123
123
  }
124
124
  }
125
125
  });
@@ -15,7 +15,7 @@ import { tableMarginFullWidthMode } from '@atlaskit/editor-plugins/table/ui/cons
15
15
  import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, akEditorSwoopCubicBezier, akLayoutGutterOffset, getSelectionStyles, gridMediumMaxWidth, SelectionStyle } from '@atlaskit/editor-shared-styles';
16
16
  import { fg } from '@atlaskit/platform-feature-flags';
17
17
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
18
- var akNestedDndGutterOffset = 8;
18
+ var AK_NESTED_DND_GUTTER_OFFSET = 8;
19
19
  var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
20
20
  return fg('platform_editor_nested_dnd_styles_changes') ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
21
21
  css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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
@@ -71,5 +71,5 @@ var layoutResponsiveStyles = function layoutResponsiveStyles(viewMode) {
71
71
 
72
72
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
73
73
  export var layoutStyles = function layoutStyles(viewMode) {
74
- return css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\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)", akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? akNestedDndGutterOffset : 0), akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', viewMode === 'view' || editorExperiment('advanced_layouts', true) ? 0 : akEditorSelectedBorderSize, "var(--ds-border, #091E4224)", LAYOUT_COLUMN_PADDING, LAYOUT_COLUMN_PADDING + (fg('platform_editor_nested_dnd_styles_changes') ? 8 : 0), firstNodeWithNotMarginTop(), layoutColumnStyles(), editorExperiment('advanced_layouts', true) ? layoutWithSeparatorBorderStyles(viewMode) : layoutBorderStyles(viewMode), editorExperiment('advanced_layouts', true) && layoutResponsiveStyles(viewMode), TableCssClassName.TABLE_CONTAINER, tableMarginFullWidthMode, editorExperiment('advanced_layouts', false) && 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)", " -", akLayoutGutterOffset + 8, "px 0;\n\t\t\t\t}"));
74
+ return css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\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)", akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? AK_NESTED_DND_GUTTER_OFFSET : 0), akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', viewMode === 'view' || editorExperiment('advanced_layouts', true) ? 0 : akEditorSelectedBorderSize, "var(--ds-border, #091E4224)", LAYOUT_COLUMN_PADDING, LAYOUT_COLUMN_PADDING + (fg('platform_editor_nested_dnd_styles_changes') ? 8 : 0), firstNodeWithNotMarginTop(), layoutColumnStyles(), editorExperiment('advanced_layouts', true) ? layoutWithSeparatorBorderStyles(viewMode) : layoutBorderStyles(viewMode), editorExperiment('advanced_layouts', true) && layoutResponsiveStyles(viewMode), TableCssClassName.TABLE_CONTAINER, tableMarginFullWidthMode, editorExperiment('advanced_layouts', false) && 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)", " -", akLayoutGutterOffset + 8, "px 0;\n\t\t\t\t}"));
75
75
  };
@@ -18,8 +18,9 @@ import React from 'react';
18
18
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
19
19
  import { css, jsx } from '@emotion/react';
20
20
  import Transition from 'react-transition-group/Transition';
21
- import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
21
+ import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
22
22
  import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
23
+ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
23
24
  import { akEditorContextPanelWidth, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
24
25
  import { fg } from '@atlaskit/platform-feature-flags';
25
26
  var ANIM_SPEED_MS = 500;
@@ -169,11 +170,16 @@ export var SwappableContentArea = /*#__PURE__*/function (_React$PureComponent) {
169
170
  }
170
171
  }]);
171
172
  }(React.PureComponent);
172
- export function ContextPanel(props) {
173
- var _contextPanelState$co;
174
- var _useSharedPluginState = useSharedPluginState(props.editorAPI, ['contextPanel']),
173
+ var useContextPanelSharedState = sharedPluginStateHookMigratorFactory(function (pluginInjectionApi) {
174
+ var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['contextPanel']),
175
175
  contextPanelState = _useSharedPluginState.contextPanelState;
176
- var firstContent = contextPanelState && (contextPanelState === null || contextPanelState === void 0 || (_contextPanelState$co = contextPanelState.contents) === null || _contextPanelState$co === void 0 ? void 0 : _contextPanelState$co.find(Boolean));
176
+ return contextPanelState === null || contextPanelState === void 0 ? void 0 : contextPanelState.contents;
177
+ }, function (pluginInjectionApi) {
178
+ return useSharedPluginStateSelector(pluginInjectionApi, 'contextPanel.contents');
179
+ });
180
+ export function ContextPanel(props) {
181
+ var contextPanelContents = useContextPanelSharedState(props.editorAPI);
182
+ var firstContent = contextPanelContents && contextPanelContents.find(Boolean);
177
183
  return (
178
184
  // Ignored via go/ees005
179
185
  // eslint-disable-next-line react/jsx-props-no-spreading