@atlaskit/editor-core 207.2.1 → 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 (42) hide show
  1. package/CHANGELOG.md +20 -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 +3 -1
  9. package/dist/cjs/ui/EditorContentContainer/styles/annotationStyles.js +45 -0
  10. package/dist/cjs/ui/EditorContentContainer/styles/embedCardStyles.js +34 -0
  11. package/dist/cjs/version-wrapper.js +1 -1
  12. package/dist/es2019/ui/Appearance/Chromeless.js +28 -10
  13. package/dist/es2019/ui/Appearance/Comment/Comment.js +24 -3
  14. package/dist/es2019/ui/Appearance/FullPage/FullPage.js +24 -2
  15. package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
  16. package/dist/es2019/ui/ContentStyles/layout.js +3 -2
  17. package/dist/es2019/ui/ContextPanel/index.js +11 -5
  18. package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +5 -3
  19. package/dist/es2019/ui/EditorContentContainer/styles/annotationStyles.js +47 -0
  20. package/dist/es2019/ui/EditorContentContainer/styles/embedCardStyles.js +27 -0
  21. package/dist/es2019/version-wrapper.js +1 -1
  22. package/dist/esm/ui/Appearance/Chromeless.js +28 -12
  23. package/dist/esm/ui/Appearance/Comment/Comment.js +26 -6
  24. package/dist/esm/ui/Appearance/FullPage/FullPage.js +27 -5
  25. package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
  26. package/dist/esm/ui/ContentStyles/layout.js +2 -2
  27. package/dist/esm/ui/ContextPanel/index.js +11 -5
  28. package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +4 -2
  29. package/dist/esm/ui/EditorContentContainer/styles/annotationStyles.js +37 -0
  30. package/dist/esm/ui/EditorContentContainer/styles/embedCardStyles.js +27 -0
  31. package/dist/esm/version-wrapper.js +1 -1
  32. package/dist/types/ui/Appearance/Chromeless.d.ts +0 -4
  33. package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -1
  34. package/dist/types/ui/Appearance/FullPage/getEditorViewModeSync.d.ts +1 -1
  35. package/dist/types/ui/EditorContentContainer/styles/annotationStyles.d.ts +1 -0
  36. package/dist/types/ui/EditorContentContainer/styles/embedCardStyles.d.ts +1 -0
  37. package/dist/types-ts4.5/ui/Appearance/Chromeless.d.ts +0 -4
  38. package/dist/types-ts4.5/ui/Appearance/FullPage/FullPage.d.ts +1 -1
  39. package/dist/types-ts4.5/ui/Appearance/FullPage/getEditorViewModeSync.d.ts +1 -1
  40. package/dist/types-ts4.5/ui/EditorContentContainer/styles/annotationStyles.d.ts +1 -0
  41. package/dist/types-ts4.5/ui/EditorContentContainer/styles/embedCardStyles.d.ts +1 -0
  42. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
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
+
3
23
  ## 207.2.1
4
24
 
5
25
  ### Patch 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
@@ -35,7 +35,9 @@ var _panel2 = require("../ContentStyles/panel");
35
35
  var _status = require("../ContentStyles/status");
36
36
  var _tasksAndDecisions = require("../ContentStyles/tasks-and-decisions");
37
37
  var _aiPanel = require("./styles/ai-panel");
38
+ var _annotationStyles = require("./styles/annotationStyles");
38
39
  var _backgroundColorStyles = require("./styles/backgroundColorStyles");
40
+ var _embedCardStyles = require("./styles/embedCardStyles");
39
41
  var _layout = require("./styles/layout");
40
42
  var _link = require("./styles/link");
41
43
  var _rule = require("./styles/rule");
@@ -159,7 +161,7 @@ var contentStyles = function contentStyles() {
159
161
  exposure: false
160
162
  }) && (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && _tasksAndDecisions.vanillaTaskDecisionIconWithVisualRefresh, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
161
163
  exposure: false
162
- }) && !(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && _tasksAndDecisions.vanillaTaskDecisionIconWithoutVisualRefresh, _status.statusStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true) ? (0, _status.vanillaStatusStyles)() : null, (0, _styles.annotationSharedStyles)(), (0, _styles.smartCardStyles)(), (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') ? (0, _styles.getSmartCardSharedStyles)() : _styles.smartCardSharedStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true) ? _date.dateVanillaStyles : null, _date.dateStyles, (0, _styles.embedCardStyles)(), _styles.unsupportedStyles, _styles.resizerStyles, (0, _styles.pragmaticResizerStyles)(), fixBlockControlStylesSSR(), _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT, !(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? (0, _react2.css)(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.hyperlink-open-link {\n\t\t\t\t\tmin-width: 24px;\n\t\t\t\t\tsvg {\n\t\t\t\t\t\tmax-width: 18px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"]))) : null);
164
+ }) && !(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && _tasksAndDecisions.vanillaTaskDecisionIconWithoutVisualRefresh, _status.statusStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true) ? (0, _status.vanillaStatusStyles)() : null, _annotationStyles.annotationStyles, (0, _styles.smartCardStyles)(), (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') ? (0, _styles.getSmartCardSharedStyles)() : _styles.smartCardSharedStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true) ? _date.dateVanillaStyles : null, _date.dateStyles, _embedCardStyles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, (0, _styles.pragmaticResizerStyles)(), fixBlockControlStylesSSR(), _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT, !(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? (0, _react2.css)(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.hyperlink-open-link {\n\t\t\t\t\tmin-width: 24px;\n\t\t\t\t\tsvg {\n\t\t\t\t\t\tmax-width: 18px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"]))) : null);
163
165
  };
164
166
  var CommentEditorMargin = 14;
165
167
 
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.annotationStyles = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _react = require("@emotion/react");
10
+ var _styles = require("@atlaskit/editor-common/styles");
11
+ // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
12
+
13
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
14
+ var annotationStyles = exports.annotationStyles = (0, _react.css)({
15
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
16
+ '.ProseMirror': (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(_styles.AnnotationSharedClassNames.blur, ", .").concat(_styles.AnnotationSharedClassNames.focus, ", .").concat(_styles.AnnotationSharedClassNames.draft, ", .").concat(_styles.AnnotationSharedClassNames.hover), {
17
+ borderBottom: '2px solid transparent',
18
+ cursor: 'pointer',
19
+ padding: '1px 0 2px',
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
21
+ '&:has(.card), &:has([data-inline-card])': {
22
+ padding: '5px 0 3px 0'
23
+ },
24
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
25
+ '&:has(.date-lozenger-container)': {
26
+ paddingTop: "var(--ds-space-025, 2px)"
27
+ }
28
+ }), ".".concat(_styles.AnnotationSharedClassNames.focus), {
29
+ background: "var(--ds-background-accent-yellow-subtlest-pressed, #F5CD47)",
30
+ borderBottomColor: "var(--ds-border-accent-yellow, #B38600)",
31
+ boxShadow: "var(--ds-shadow-raised, 0px 1px 1px #091E4240, 0px 0px 1px #091E424f)"
32
+ }), ".".concat(_styles.AnnotationSharedClassNames.draft), {
33
+ background: "var(--ds-background-accent-yellow-subtlest-pressed, #F5CD47)",
34
+ borderBottomColor: "var(--ds-border-accent-yellow, #B38600)",
35
+ boxShadow: "var(--ds-shadow-raised, 0px 1px 1px #091E4240, 0px 0px 1px #091E424f)",
36
+ cursor: 'initial'
37
+ }), ".".concat(_styles.AnnotationSharedClassNames.blur), {
38
+ background: "var(--ds-background-accent-yellow-subtlest, #FFF7D6)",
39
+ borderBottomColor: "var(--ds-border-accent-yellow, #B38600)"
40
+ }), ".".concat(_styles.AnnotationSharedClassNames.hover), {
41
+ background: "var(--ds-background-accent-yellow-subtlest-hovered, #F8E6A0)",
42
+ borderBottomColor: "var(--ds-border-accent-yellow, #B38600)",
43
+ boxShadow: "var(--ds-shadow-raised, 0px 1px 1px #091E4240, 0px 0px 1px #091E424f)"
44
+ })
45
+ });
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.embedCardStyles = void 0;
7
+ var _react = require("@emotion/react");
8
+ // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
9
+
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
11
+ var embedCardStyles = exports.embedCardStyles = (0, _react.css)({
12
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
13
+ '.ProseMirror': {
14
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
15
+ ".embedCardView-content-wrap[layout^='wrap-']": {
16
+ maxWidth: '100%',
17
+ position: 'relative',
18
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
19
+ zIndex: 2
20
+ },
21
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
22
+ ".embedCardView-content-wrap[layout='wrap-left']": {
23
+ float: 'left'
24
+ },
25
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
26
+ ".embedCardView-content-wrap[layout='wrap-right']": {
27
+ float: 'right'
28
+ },
29
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
30
+ ".embedCardView-content-wrap[layout='wrap-right'] + .embedCardView-content-wrap[layout='wrap-left']": {
31
+ clear: 'both'
32
+ }
33
+ }
34
+ });
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "207.2.1";
8
+ var version = exports.version = "207.3.0";
@@ -7,7 +7,8 @@ import React, { Fragment } from 'react';
7
7
 
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
- import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
10
+ import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
11
+ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
11
12
  import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
12
13
  import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
13
14
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -44,6 +45,14 @@ ContentArea.displayName = 'ContentArea';
44
45
  const EditorContainer = componentWithCondition(() => editorExperiment('platform_editor_core_static_emotion', true, {
45
46
  exposure: true
46
47
  }), EditorContentContainer, ContentArea);
48
+ const useEditorViewModePluginState = sharedPluginStateHookMigratorFactory(pluginInjectionApi => {
49
+ const {
50
+ editorViewModeState
51
+ } = useSharedPluginState(pluginInjectionApi, ['editorViewMode']);
52
+ return editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
53
+ }, pluginInjectionApi => {
54
+ return useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
55
+ });
47
56
 
48
57
  /**
49
58
  * Render the editor in a chromeless appearance.
@@ -78,9 +87,7 @@ export default class Editor extends React.Component {
78
87
  featureFlags
79
88
  } = this.props;
80
89
  const maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
81
- const {
82
- editorViewModeState
83
- } = useSharedPluginState(this.props.editorAPI, ['editorViewMode']);
90
+ const editorViewMode = useEditorViewModePluginState(this.props.editorAPI);
84
91
  return jsx(WithFlash, {
85
92
  animate: maxContentSizeReached
86
93
  }, jsx("div", {
@@ -102,7 +109,7 @@ export default class Editor extends React.Component {
102
109
  , {
103
110
  className: "ak-editor-content-area",
104
111
  featureFlags: featureFlags,
105
- viewMode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode,
112
+ viewMode: editorViewMode,
106
113
  appearance: this.appearance
107
114
  }, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, jsx(PluginSlot, {
108
115
  editorView: editorView,
@@ -122,10 +129,6 @@ export default class Editor extends React.Component {
122
129
  }), editorDOMElement, customContentComponents && 'after' in customContentComponents ? customContentComponents.after : null)));
123
130
  });
124
131
  }
125
- /**
126
- *
127
- * @example
128
- */
129
132
  render() {
130
133
  return jsx(RenderWithPluginState, {
131
134
  editorAPI: this.props.editorAPI,
@@ -134,13 +137,28 @@ export default class Editor extends React.Component {
134
137
  }
135
138
  }
136
139
  _defineProperty(Editor, "displayName", 'ChromelessEditorAppearance');
140
+ const useMaxContentSizePluginState = sharedPluginStateHookMigratorFactory(pluginInjectionApi => {
141
+ const {
142
+ maxContentSizeState
143
+ } = useSharedPluginState(pluginInjectionApi, ['maxContentSize']);
144
+ return {
145
+ maxContentSizeState
146
+ };
147
+ }, pluginInjectionApi => {
148
+ const maxContentSizeReached = useSharedPluginStateSelector(pluginInjectionApi, 'maxContentSize.maxContentSizeReached');
149
+ return {
150
+ maxContentSizeState: maxContentSizeReached === undefined ? undefined : {
151
+ maxContentSizeReached
152
+ }
153
+ };
154
+ });
137
155
  function RenderWithPluginState({
138
156
  renderChrome,
139
157
  editorAPI
140
158
  }) {
141
159
  const {
142
160
  maxContentSizeState
143
- } = useSharedPluginState(editorAPI, ['maxContentSize']);
161
+ } = useMaxContentSizePluginState(editorAPI);
144
162
  return jsx(Fragment, null, renderChrome({
145
163
  maxContentSize: maxContentSizeState
146
164
  }));
@@ -10,11 +10,12 @@ import classnames from 'classnames';
10
10
  import { useIntl } from 'react-intl-next';
11
11
  import ButtonGroup from '@atlaskit/button/button-group';
12
12
  import Button from '@atlaskit/button/new';
13
- import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
13
+ import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
14
14
  import messages from '@atlaskit/editor-common/messages';
15
15
  import { GRID_GUTTER } from '@atlaskit/editor-common/styles';
16
16
  import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/ui';
17
17
  import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
18
+ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
18
19
  import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
19
20
  import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
20
21
  import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
@@ -79,16 +80,36 @@ const appearance = 'comment';
79
80
  const EditorContainer = componentWithCondition(() => editorExperiment('platform_editor_core_static_emotion', true, {
80
81
  exposure: true
81
82
  }), EditorContentContainer, ContentArea);
83
+ const useCommentEditorPluginsStates = sharedPluginStateHookMigratorFactory(pluginInjectionApi => {
84
+ return useSharedPluginState(pluginInjectionApi, ['maxContentSize', 'primaryToolbar', 'editorViewMode']);
85
+ }, pluginInjectionApi => {
86
+ const maxContentSizeReached = useSharedPluginStateSelector(pluginInjectionApi, 'maxContentSize.maxContentSizeReached');
87
+ const primaryToolbarComponents = useSharedPluginStateSelector(pluginInjectionApi, 'primaryToolbar.components');
88
+ const editorViewMode = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
89
+ return {
90
+ maxContentSizeState: maxContentSizeReached === undefined ? undefined : {
91
+ maxContentSizeReached
92
+ },
93
+ primaryToolbarState: !primaryToolbarComponents ? undefined : {
94
+ components: primaryToolbarComponents
95
+ },
96
+ editorViewModeState: !editorViewMode ? undefined : {
97
+ mode: editorViewMode
98
+ }
99
+ };
100
+ });
82
101
  export const CommentEditorWithIntl = props => {
83
102
  const {
84
103
  editorAPI
85
104
  } = props;
86
105
  const {
87
- mediaState,
88
106
  maxContentSizeState,
89
107
  primaryToolbarState,
90
108
  editorViewModeState
91
- } = useSharedPluginState(editorAPI, ['media', 'maxContentSize', 'primaryToolbar', 'editorViewMode']);
109
+ } = useCommentEditorPluginsStates(editorAPI);
110
+ const {
111
+ mediaState
112
+ } = useSharedPluginState(editorAPI, ['media']);
92
113
  const intl = useIntl();
93
114
  const {
94
115
  editorDOMElement,
@@ -7,7 +7,7 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
8
  import { css, jsx } from '@emotion/react';
9
9
  import { browser } from '@atlaskit/editor-common/browser';
10
- import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
10
+ import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
11
11
  import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
12
12
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
13
13
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -49,6 +49,28 @@ const hasCustomComponents = components => {
49
49
  }
50
50
  return true;
51
51
  };
52
+ const useFullPageEditorPluginsStates = sharedPluginStateHookMigratorFactory(pluginInjectionApi => {
53
+ return useSharedPluginState(pluginInjectionApi, ['editorViewMode', 'primaryToolbar', 'interaction']);
54
+ }, pluginInjectionApi => {
55
+ const primaryToolbarComponents = useSharedPluginStateSelector(pluginInjectionApi, 'primaryToolbar.components');
56
+ const editorViewMode = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
57
+ const showTopToolbar = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode._showTopToolbar');
58
+ const hasHadInteraction = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.hasHadInteraction');
59
+ const interactionState = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.interactionState');
60
+ return {
61
+ primaryToolbarState: !primaryToolbarComponents ? undefined : {
62
+ components: primaryToolbarComponents
63
+ },
64
+ editorViewModeState: !editorViewMode ? undefined : {
65
+ mode: editorViewMode,
66
+ _showTopToolbar: showTopToolbar
67
+ },
68
+ interactionState: hasHadInteraction === undefined || interactionState === undefined ? undefined : {
69
+ hasHadInteraction,
70
+ interactionState
71
+ }
72
+ };
73
+ });
52
74
  export const FullPageEditor = props => {
53
75
  var _scrollContentContain, _scrollContentContain2, _scrollContentContain3, _scrollContentContain4, _scrollContentContain5, _wrapperElementRef$cu;
54
76
  const wrapperElementRef = useMemo(() => props.innerRef, [props.innerRef]);
@@ -59,7 +81,7 @@ export const FullPageEditor = props => {
59
81
  editorViewModeState,
60
82
  primaryToolbarState,
61
83
  interactionState
62
- } = useSharedPluginState(editorAPI, ['editorViewMode', 'primaryToolbar', 'interaction']);
84
+ } = useFullPageEditorPluginsStates(editorAPI);
63
85
  const viewMode = getEditorViewMode(editorViewModeState, props.preset);
64
86
  const 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);
65
87
  let toolbarDocking = useSharedPluginStateSelector(editorAPI, 'selectionToolbar.toolbarDocking');
@@ -9,7 +9,7 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
10
10
  const SWOOP_ANIMATION = `0.5s ${akEditorSwoopCubicBezier}`;
11
11
  const getTotalPadding = () => akEditorGutterPaddingDynamic() * 2;
12
- const akNestedDndGutterOffset = 8;
12
+ const AK_NESTED_DND_GUTTER_OFFSET = 8;
13
13
 
14
14
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
15
15
  export const fullPageEditorWrapper = css({
@@ -114,7 +114,7 @@ const editorContentAreaContainerStyle = () => css({
114
114
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
115
115
  '[data-layout-section]': {
116
116
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
117
- maxWidth: `calc(100% + ${(akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? akNestedDndGutterOffset : 0)) * 2}px)`
117
+ maxWidth: `calc(100% + ${(akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? AK_NESTED_DND_GUTTER_OFFSET : 0)) * 2}px)`
118
118
  }
119
119
  }
120
120
  });
@@ -13,7 +13,7 @@ import { tableMarginFullWidthMode } from '@atlaskit/editor-plugins/table/ui/cons
13
13
  import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, akEditorSwoopCubicBezier, akLayoutGutterOffset, getSelectionStyles, gridMediumMaxWidth, SelectionStyle } from '@atlaskit/editor-shared-styles';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
16
- const akNestedDndGutterOffset = 8;
16
+ const AK_NESTED_DND_GUTTER_OFFSET = 8;
17
17
  const firstNodeWithNotMarginTop = () => fg('platform_editor_nested_dnd_styles_changes') ?
18
18
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
19
19
  css`
@@ -283,7 +283,8 @@ export const layoutStyles = viewMode => css`
283
283
  /* Ignored via go/ees007
284
284
  TODO: Migrate away from gridSize
285
285
  Recommendation: Replace directly with 7px */
286
- margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? akNestedDndGutterOffset : 0)}px 0;
286
+ margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? AK_NESTED_DND_GUTTER_OFFSET : 0)}px
287
+ 0;
287
288
  transition: border-color 0.3s ${akEditorSwoopCubicBezier};
288
289
  cursor: ${viewMode === 'view' ? 'default' : 'pointer'};
289
290