@atlaskit/editor-core 195.4.7 → 195.4.9

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 +16 -0
  2. package/dist/cjs/composable-editor/editor-internal.js +3 -1
  3. package/dist/cjs/create-editor/ReactEditorView.js +16 -9
  4. package/dist/cjs/ui/Appearance/Chromeless.js +4 -4
  5. package/dist/cjs/ui/Appearance/Comment/Comment.js +5 -7
  6. package/dist/cjs/ui/Appearance/FullPage/FullPage.js +2 -2
  7. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +1 -2
  8. package/dist/cjs/ui/ContentStyles/layout.js +2 -1
  9. package/dist/cjs/version-wrapper.js +1 -1
  10. package/dist/es2019/composable-editor/editor-internal.js +3 -1
  11. package/dist/es2019/create-editor/ReactEditorView.js +15 -8
  12. package/dist/es2019/ui/Appearance/Chromeless.js +4 -4
  13. package/dist/es2019/ui/Appearance/Comment/Comment.js +8 -8
  14. package/dist/es2019/ui/Appearance/FullPage/FullPage.js +2 -2
  15. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
  16. package/dist/es2019/ui/ContentStyles/layout.js +4 -2
  17. package/dist/es2019/version-wrapper.js +1 -1
  18. package/dist/esm/composable-editor/editor-internal.js +3 -1
  19. package/dist/esm/create-editor/ReactEditorView.js +16 -9
  20. package/dist/esm/ui/Appearance/Chromeless.js +4 -4
  21. package/dist/esm/ui/Appearance/Comment/Comment.js +6 -8
  22. package/dist/esm/ui/Appearance/FullPage/FullPage.js +2 -2
  23. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +1 -2
  24. package/dist/esm/ui/ContentStyles/layout.js +2 -1
  25. package/dist/esm/version-wrapper.js +1 -1
  26. package/dist/types/create-editor/ReactEditorView.d.ts +2 -1
  27. package/dist/types/create-editor/get-ui-component.d.ts +3 -1
  28. package/dist/types/types/editor-appearance-component.d.ts +3 -2
  29. package/dist/types/ui/Appearance/Chromeless.d.ts +5 -1
  30. package/dist/types/ui/Appearance/Comment/Comment.d.ts +14 -8
  31. package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +11 -1
  32. package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +16 -0
  33. package/dist/types/ui/Appearance/Mobile.d.ts +1 -1
  34. package/dist/types-ts4.5/create-editor/ReactEditorView.d.ts +2 -1
  35. package/dist/types-ts4.5/create-editor/get-ui-component.d.ts +3 -1
  36. package/dist/types-ts4.5/types/editor-appearance-component.d.ts +3 -2
  37. package/dist/types-ts4.5/ui/Appearance/Chromeless.d.ts +7 -1
  38. package/dist/types-ts4.5/ui/Appearance/Comment/Comment.d.ts +14 -8
  39. package/dist/types-ts4.5/ui/Appearance/FullPage/FullPage.d.ts +11 -1
  40. package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageToolbar.d.ts +16 -0
  41. package/dist/types-ts4.5/ui/Appearance/Mobile.d.ts +1 -1
  42. package/package.json +10 -11
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 195.4.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`01ab0e352a73e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/01ab0e352a73e) -
8
+ Decoupling editor appearances from preset context.
9
+
10
+ ## 195.4.8
11
+
12
+ ### Patch Changes
13
+
14
+ - [#130260](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/130260)
15
+ [`d338ce6e4ff6e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d338ce6e4ff6e) -
16
+ [ux] Add padding to layout nodes to allow space for element controls
17
+ - Updated dependencies
18
+
3
19
  ## 195.4.7
4
20
 
5
21
  ### Patch Changes
@@ -103,11 +103,13 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
103
103
  eventDispatcher = _ref2.eventDispatcher,
104
104
  config = _ref2.config,
105
105
  dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
106
- editorRef = _ref2.editorRef;
106
+ editorRef = _ref2.editorRef,
107
+ editorAPI = _ref2.editorAPI;
107
108
  return (0, _react2.jsx)(_ui.BaseTheme, {
108
109
  baseFontSize: (0, _getBaseFontSize.getBaseFontSize)(props.appearance)
109
110
  }, (0, _react2.jsx)(Component, {
110
111
  innerRef: editorRef,
112
+ editorAPI: editorAPI,
111
113
  appearance: props.appearance,
112
114
  disabled: props.disabled,
113
115
  editorActions: editorActions,
@@ -27,6 +27,7 @@ var _utils = require("@atlaskit/editor-common/utils");
27
27
  var _state2 = require("@atlaskit/editor-prosemirror/state");
28
28
  var _view = require("@atlaskit/editor-prosemirror/view");
29
29
  var _eventDispatcher = require("../event-dispatcher");
30
+ var _context = require("../presets/context");
30
31
  var _document = require("../utils/document");
31
32
  var _isFullPage = require("../utils/is-full-page");
32
33
  var _RenderTracking = require("../utils/performance/components/RenderTracking");
@@ -773,7 +774,8 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
773
774
  }, {
774
775
  key: "render",
775
776
  value: function render() {
776
- var _this$props$editorPro8;
777
+ var _this$props$editorPro8,
778
+ _this3 = this;
777
779
  var renderTracking = (_this$props$editorPro8 = this.props.editorProps.performanceTracking) === null || _this$props$editorPro8 === void 0 || (_this$props$editorPro8 = _this$props$editorPro8.renderTracking) === null || _this$props$editorPro8 === void 0 ? void 0 : _this$props$editorPro8.reactEditorView;
778
780
  var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
779
781
  var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
@@ -789,14 +791,19 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
789
791
  actionSubject: _analytics.ACTION_SUBJECT.REACT_EDITOR_VIEW,
790
792
  handleAnalyticsEvent: this.handleAnalyticsEvent,
791
793
  useShallow: useShallow
792
- }), this.props.render ? this.props.render({
793
- editor: this.editor,
794
- view: this.view,
795
- config: this.config,
796
- eventDispatcher: this.eventDispatcher,
797
- transformer: this.contentTransformer,
798
- dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
799
- editorRef: this.editorRef
794
+ }), this.props.render ? /*#__PURE__*/_react.default.createElement(_context.EditorAPIContext.Consumer, null, function (_ref4) {
795
+ var _this3$props$render, _this3$props$render2, _this3$props;
796
+ var editorApi = _ref4.editorApi;
797
+ return (_this3$props$render = (_this3$props$render2 = (_this3$props = _this3.props).render) === null || _this3$props$render2 === void 0 ? void 0 : _this3$props$render2.call(_this3$props, {
798
+ editor: _this3.editor,
799
+ view: _this3.view,
800
+ config: _this3.config,
801
+ eventDispatcher: _this3.eventDispatcher,
802
+ transformer: _this3.contentTransformer,
803
+ dispatchAnalyticsEvent: _this3.dispatchAnalyticsEvent,
804
+ editorRef: _this3.editorRef,
805
+ editorAPI: editorApi
806
+ })) !== null && _this3$props$render !== void 0 ? _this3$props$render : _this3.editor;
800
807
  }) : this.editor);
801
808
  }
802
809
  }]);
@@ -17,7 +17,6 @@ var _react = _interopRequireWildcard(require("react"));
17
17
  var _react2 = require("@emotion/react");
18
18
  var _hooks = require("@atlaskit/editor-common/hooks");
19
19
  var _scrollbar = require("@atlaskit/editor-shared-styles/scrollbar");
20
- var _context = require("../../presets/context");
21
20
  var _ContentStyles = require("../ContentStyles");
22
21
  var _PluginSlot = _interopRequireDefault(require("../PluginSlot"));
23
22
  var _WithFlash = _interopRequireDefault(require("../WithFlash"));
@@ -132,6 +131,7 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
132
131
  key: "render",
133
132
  value: function render() {
134
133
  return (0, _react2.jsx)(RenderWithPluginState, {
134
+ editorAPI: this.props.editorAPI,
135
135
  renderChrome: this.renderChrome
136
136
  });
137
137
  }
@@ -140,9 +140,9 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
140
140
  }(_react.default.Component);
141
141
  (0, _defineProperty2.default)(Editor, "displayName", 'ChromelessEditorAppearance');
142
142
  function RenderWithPluginState(_ref3) {
143
- var renderChrome = _ref3.renderChrome;
144
- var api = (0, _context.usePresetContext)();
145
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['maxContentSize']),
143
+ var renderChrome = _ref3.renderChrome,
144
+ editorAPI = _ref3.editorAPI;
145
+ var _useSharedPluginState = (0, _hooks.useSharedPluginState)(editorAPI, ['maxContentSize']),
146
146
  maxContentSizeState = _useSharedPluginState.maxContentSizeState;
147
147
  return (0, _react2.jsx)(_react.Fragment, null, renderChrome({
148
148
  maxContentSize: maxContentSizeState
@@ -23,7 +23,6 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
23
  var _colors = require("@atlaskit/theme/colors");
24
24
  var _constants = require("@atlaskit/theme/constants");
25
25
  var _messages = _interopRequireDefault(require("../../../messages"));
26
- var _context = require("../../../presets/context");
27
26
  var _Addon = require("../../Addon");
28
27
  var _ContentStyles = require("../../ContentStyles");
29
28
  var _PluginSlot = _interopRequireDefault(require("../../PluginSlot"));
@@ -86,12 +85,13 @@ var secondaryToolbarStyles = (0, _react2.css)({
86
85
  padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-025, 2px)")
87
86
  });
88
87
  var appearance = 'comment';
89
- var Editor = function Editor(props) {
90
- var api = (0, _context.usePresetContext)();
91
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['media', 'maxContentSize', 'primaryToolbar']),
88
+ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEditorWithIntl(props) {
89
+ var editorAPI = props.editorAPI;
90
+ var _useSharedPluginState = (0, _hooks.useSharedPluginState)(editorAPI, ['media', 'maxContentSize', 'primaryToolbar']),
92
91
  mediaState = _useSharedPluginState.mediaState,
93
92
  maxContentSizeState = _useSharedPluginState.maxContentSizeState,
94
93
  primaryToolbarState = _useSharedPluginState.primaryToolbarState;
94
+ var intl = (0, _reactIntlNext.useIntl)();
95
95
  var editorDOMElement = props.editorDOMElement,
96
96
  editorView = props.editorView,
97
97
  editorActions = props.editorActions,
@@ -112,7 +112,6 @@ var Editor = function Editor(props) {
112
112
  onCancel = props.onCancel,
113
113
  disabled = props.disabled,
114
114
  dispatchAnalyticsEvent = props.dispatchAnalyticsEvent,
115
- intl = props.intl,
116
115
  useStickyToolbar = props.useStickyToolbar,
117
116
  pluginHooks = props.pluginHooks,
118
117
  featureFlags = props.featureFlags,
@@ -256,5 +255,4 @@ var Editor = function Editor(props) {
256
255
  }
257
256
  }), customSecondaryToolbarComponents));
258
257
  };
259
- Editor.displayName = 'CommentEditorAppearance';
260
- var CommentEditorWithIntl = exports.CommentEditorWithIntl = (0, _reactIntlNext.injectIntl)(Editor);
258
+ CommentEditorWithIntl.displayName = 'CommentEditorAppearance';
@@ -12,7 +12,6 @@ var _react2 = require("@emotion/react");
12
12
  var _hooks = require("@atlaskit/editor-common/hooks");
13
13
  var _ui = require("@atlaskit/editor-common/ui");
14
14
  var _utils = require("@atlaskit/editor-common/utils");
15
- var _context = require("../../../presets/context");
16
15
  var _FullPageContentArea = require("./FullPageContentArea");
17
16
  var _FullPageToolbar = require("./FullPageToolbar");
18
17
  var _StyledComponents = require("./StyledComponents");
@@ -61,7 +60,7 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
61
60
  }, [props.innerRef]);
62
61
  var scrollContentContainerRef = (0, _react.useRef)(null);
63
62
  var showKeyline = useShowKeyline(scrollContentContainerRef);
64
- var editorAPI = (0, _context.usePresetContext)();
63
+ var editorAPI = props.editorAPI;
65
64
  var _useSharedPluginState = (0, _hooks.useSharedPluginState)(editorAPI, ['editorViewMode', 'primaryToolbar']),
66
65
  editorViewModeState = _useSharedPluginState.editorViewModeState,
67
66
  primaryToolbarState = _useSharedPluginState.primaryToolbarState;
@@ -83,6 +82,7 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
83
82
  ref: wrapperElementRef
84
83
  }, !isEditorToolbarHidden && (0, _react2.jsx)(_FullPageToolbar.FullPageToolbar, {
85
84
  appearance: props.appearance,
85
+ editorAPI: editorAPI,
86
86
  beforeIcon: props.primaryToolbarIconBefore,
87
87
  collabEdit: props.collabEdit,
88
88
  containerElement: (_scrollContentContain2 = (_scrollContentContain3 = scrollContentContainerRef.current) === null || _scrollContentContain3 === void 0 ? void 0 : _scrollContentContain3.scrollContainer) !== null && _scrollContentContain2 !== void 0 ? _scrollContentContain2 : null,
@@ -14,7 +14,6 @@ var _messages = require("@atlaskit/editor-common/messages");
14
14
  var _ui = require("@atlaskit/editor-common/ui");
15
15
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
16
16
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
- var _context = require("../../../presets/context");
18
17
  var _Toolbar = _interopRequireDefault(require("../../Toolbar"));
19
18
  var _BeforeWrapper = require("./BeforeWrapper");
20
19
  var _MainToolbar = require("./MainToolbar");
@@ -33,7 +32,7 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
33
32
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
34
33
  shouldSplitToolbar = _useState2[0],
35
34
  setShouldSplitToolbar = _useState2[1];
36
- var editorAPI = (0, _context.usePresetContext)();
35
+ var editorAPI = props.editorAPI;
37
36
 
38
37
  // When primary toolbar components is undefined, do not show two line editor toolbar
39
38
  var twoLineEditorToolbar = !!props.customPrimaryToolbarComponents && !!((_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.twoLineEditorToolbar);
@@ -23,9 +23,10 @@ var _styles = require("@atlaskit/editor-common/styles");
23
23
  var _types = require("@atlaskit/editor-plugins/table/types");
24
24
  var _consts = require("@atlaskit/editor-plugins/table/ui/consts");
25
25
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
26
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
26
27
  var _colors = require("@atlaskit/theme/colors");
27
28
  var _templateObject; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
28
29
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
29
30
  var layoutStyles = exports.layoutStyles = function layoutStyles(viewMode) {
30
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", " [data-layout-section] {\n\t\t\t// TODO: Migrate away from gridSize\n\t\t\t// Recommendation: 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\tmin-width: 0;\n\t\t\t\tborder: ", "px solid\n\t\t\t\t\t", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t> :not(style):first-child,\n\t\t\t\t\t> style:first-child + * {\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> style:first-child + .ProseMirror-gapcursor + * {\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 + span + *,\n\t\t\t\t\t> style:first-child + .ProseMirror-gapcursor:first-child + span + * {\n\t\t\t\t\t\tmargin-top: 0;\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[data-layout-column] + [data-layout-column] {\n\t\t\t\tmargin-left: ", "px;\n\t\t\t}\n\n\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n\t\t\t// This is because the default state already uses the same token and, as such, the hover style won't change anything.\n\t\t\t// https://product-fabric.atlassian.net/browse/DSP-4441\n\t\t\t/* Shows the border when cursor is inside a layout */\n\t\t\t&.selected [data-layout-column],\n\t\t\t&:hover [data-layout-column] {\n\t\t\t\tborder: ", "px solid\n\t\t\t\t\t", ";\n\t\t\t}\n\n\t\t\t&.selected.danger > [data-layout-column] {\n\t\t\t\tbackground-color: ", ";\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&.", ":not(.danger) {\n\t\t\t\t[data-layout-column] {\n\t\t\t\t\t", "\n\t\t\t\t}\n\t\t\t}\n\t\t}\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"])), _styles.columnLayoutSharedStyle, "var(--ds-space-100, 8px)", _editorSharedStyles.akLayoutGutterOffset, _editorSharedStyles.akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', viewMode === 'view' ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, ".concat(_colors.N40A, ")"), _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_SECTION_MARGIN, _editorSharedStyles.gridMediumMaxWidth, viewMode === 'view' ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, ".concat(_colors.N50A, ")"), "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Border, _editorSharedStyles.SelectionStyle.Blanket]), _types.TableCssClassName.TABLE_CONTAINER, _consts.tableMarginFullWidthMode);
31
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", " [data-layout-section] {\n\t\t\t// TODO: Migrate away from gridSize\n\t\t\t// Recommendation: 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\tmin-width: 0;\n\t\t\t\tborder: ", "px solid\n\t\t\t\t\t", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px ", "px ", "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> :not(style):first-child,\n\t\t\t\t\t> style:first-child + * {\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> style:first-child + .ProseMirror-gapcursor + * {\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 + span + *,\n\t\t\t\t\t> style:first-child + .ProseMirror-gapcursor:first-child + span + * {\n\t\t\t\t\t\tmargin-top: 0;\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[data-layout-column] + [data-layout-column] {\n\t\t\t\tmargin-left: ", "px;\n\t\t\t}\n\n\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n\t\t\t// This is because the default state already uses the same token and, as such, the hover style won't change anything.\n\t\t\t// https://product-fabric.atlassian.net/browse/DSP-4441\n\t\t\t/* Shows the border when cursor is inside a layout */\n\t\t\t&.selected [data-layout-column],\n\t\t\t&:hover [data-layout-column] {\n\t\t\t\tborder: ", "px solid\n\t\t\t\t\t", ";\n\t\t\t}\n\n\t\t\t&.selected.danger > [data-layout-column] {\n\t\t\t\tbackground-color: ", ";\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&.", ":not(.danger) {\n\t\t\t\t[data-layout-column] {\n\t\t\t\t\t", "\n\t\t\t\t}\n\t\t\t}\n\t\t}\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"])), _styles.columnLayoutSharedStyle, "var(--ds-space-100, 8px)", _editorSharedStyles.akLayoutGutterOffset + ((0, _platformFeatureFlags.fg)('platform_editor_element_padding_changes_gate') ? 8 : 0), _editorSharedStyles.akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', viewMode === 'view' ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, ".concat(_colors.N40A, ")"), _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_COLUMN_PADDING + ((0, _platformFeatureFlags.fg)('platform_editor_element_padding_changes_gate') ? 8 : 0), _styles.LAYOUT_SECTION_MARGIN, _editorSharedStyles.gridMediumMaxWidth, viewMode === 'view' ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, ".concat(_colors.N50A, ")"), "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Border, _editorSharedStyles.SelectionStyle.Blanket]), _types.TableCssClassName.TABLE_CONTAINER, _consts.tableMarginFullWidthMode);
31
32
  };
@@ -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 = "195.4.7";
8
+ var version = exports.version = "195.4.9";
@@ -93,13 +93,15 @@ export const EditorInternal = /*#__PURE__*/memo(({
93
93
  eventDispatcher,
94
94
  config,
95
95
  dispatchAnalyticsEvent,
96
- editorRef
96
+ editorRef,
97
+ editorAPI
97
98
  }) => {
98
99
  var _props$featureFlags, _props$featureFlags2;
99
100
  return jsx(BaseTheme, {
100
101
  baseFontSize: getBaseFontSize(props.appearance)
101
102
  }, jsx(Component, {
102
103
  innerRef: editorRef,
104
+ editorAPI: editorAPI,
103
105
  appearance: props.appearance,
104
106
  disabled: props.disabled,
105
107
  editorActions: editorActions,
@@ -13,6 +13,7 @@ import { analyticsEventKey, browser, countNodes, findChangedNodesFromTransaction
13
13
  import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
14
14
  import { EditorView } from '@atlaskit/editor-prosemirror/view';
15
15
  import { createDispatch, EventDispatcher } from '../event-dispatcher';
16
+ import { EditorAPIContext } from '../presets/context';
16
17
  import { getNodesCount } from '../utils/document';
17
18
  import { isFullPage } from '../utils/is-full-page';
18
19
  import { RenderTracking } from '../utils/performance/components/RenderTracking';
@@ -730,14 +731,20 @@ export class ReactEditorView extends React.Component {
730
731
  actionSubject: ACTION_SUBJECT.REACT_EDITOR_VIEW,
731
732
  handleAnalyticsEvent: this.handleAnalyticsEvent,
732
733
  useShallow: useShallow
733
- }), this.props.render ? this.props.render({
734
- editor: this.editor,
735
- view: this.view,
736
- config: this.config,
737
- eventDispatcher: this.eventDispatcher,
738
- transformer: this.contentTransformer,
739
- dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
740
- editorRef: this.editorRef
734
+ }), this.props.render ? /*#__PURE__*/React.createElement(EditorAPIContext.Consumer, null, ({
735
+ editorApi
736
+ }) => {
737
+ var _this$props$render, _this$props$render2, _this$props;
738
+ return (_this$props$render = (_this$props$render2 = (_this$props = this.props).render) === null || _this$props$render2 === void 0 ? void 0 : _this$props$render2.call(_this$props, {
739
+ editor: this.editor,
740
+ view: this.view,
741
+ config: this.config,
742
+ eventDispatcher: this.eventDispatcher,
743
+ transformer: this.contentTransformer,
744
+ dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
745
+ editorRef: this.editorRef,
746
+ editorAPI: editorApi
747
+ })) !== null && _this$props$render !== void 0 ? _this$props$render : this.editor;
741
748
  }) : this.editor);
742
749
  }
743
750
  }
@@ -9,7 +9,6 @@ import React, { Fragment } from 'react';
9
9
  import { css, jsx } from '@emotion/react';
10
10
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
11
11
  import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
12
- import { usePresetContext } from '../../presets/context';
13
12
  import { createEditorContentStyle } from '../ContentStyles';
14
13
  import PluginSlot from '../PluginSlot';
15
14
  import WithFlash from '../WithFlash';
@@ -106,18 +105,19 @@ export default class Editor extends React.Component {
106
105
  }
107
106
  render() {
108
107
  return jsx(RenderWithPluginState, {
108
+ editorAPI: this.props.editorAPI,
109
109
  renderChrome: this.renderChrome
110
110
  });
111
111
  }
112
112
  }
113
113
  _defineProperty(Editor, "displayName", 'ChromelessEditorAppearance');
114
114
  function RenderWithPluginState({
115
- renderChrome
115
+ renderChrome,
116
+ editorAPI
116
117
  }) {
117
- const api = usePresetContext();
118
118
  const {
119
119
  maxContentSizeState
120
- } = useSharedPluginState(api, ['maxContentSize']);
120
+ } = useSharedPluginState(editorAPI, ['maxContentSize']);
121
121
  return jsx(Fragment, null, renderChrome({
122
122
  maxContentSize: maxContentSizeState
123
123
  }));
@@ -7,7 +7,7 @@ import React, { useCallback, useEffect, useMemo, 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 classnames from 'classnames';
10
- import { injectIntl } from 'react-intl-next';
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
13
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
@@ -20,7 +20,6 @@ import { fg } from '@atlaskit/platform-feature-flags';
20
20
  import { N100 } from '@atlaskit/theme/colors';
21
21
  import { borderRadius } from '@atlaskit/theme/constants';
22
22
  import messages from '../../../messages';
23
- import { usePresetContext } from '../../../presets/context';
24
23
  import { ClickAreaBlock } from '../../Addon';
25
24
  import { createEditorContentStyle } from '../../ContentStyles';
26
25
  import PluginSlot from '../../PluginSlot';
@@ -74,13 +73,16 @@ const secondaryToolbarStyles = css({
74
73
  padding: `${"var(--ds-space-150, 12px)"} ${"var(--ds-space-025, 2px)"}`
75
74
  });
76
75
  const appearance = 'comment';
77
- const Editor = props => {
78
- const api = usePresetContext();
76
+ export const CommentEditorWithIntl = props => {
77
+ const {
78
+ editorAPI
79
+ } = props;
79
80
  const {
80
81
  mediaState,
81
82
  maxContentSizeState,
82
83
  primaryToolbarState
83
- } = useSharedPluginState(api, ['media', 'maxContentSize', 'primaryToolbar']);
84
+ } = useSharedPluginState(editorAPI, ['media', 'maxContentSize', 'primaryToolbar']);
85
+ const intl = useIntl();
84
86
  const {
85
87
  editorDOMElement,
86
88
  editorView,
@@ -101,7 +103,6 @@ const Editor = props => {
101
103
  onCancel,
102
104
  disabled,
103
105
  dispatchAnalyticsEvent,
104
- intl,
105
106
  useStickyToolbar,
106
107
  pluginHooks,
107
108
  featureFlags,
@@ -240,5 +241,4 @@ const Editor = props => {
240
241
  }
241
242
  }), customSecondaryToolbarComponents));
242
243
  };
243
- Editor.displayName = 'CommentEditorAppearance';
244
- export const CommentEditorWithIntl = injectIntl(Editor);
244
+ CommentEditorWithIntl.displayName = 'CommentEditorAppearance';
@@ -9,7 +9,6 @@ import { jsx } from '@emotion/react';
9
9
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
10
10
  import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
11
11
  import { browser } from '@atlaskit/editor-common/utils';
12
- import { usePresetContext } from '../../../presets/context';
13
12
  import { FullPageContentArea } from './FullPageContentArea';
14
13
  import { FullPageToolbar } from './FullPageToolbar';
15
14
  import { fullPageEditorWrapper } from './StyledComponents';
@@ -42,7 +41,7 @@ export const FullPageEditor = props => {
42
41
  const wrapperElementRef = useMemo(() => props.innerRef, [props.innerRef]);
43
42
  const scrollContentContainerRef = useRef(null);
44
43
  const showKeyline = useShowKeyline(scrollContentContainerRef);
45
- const editorAPI = usePresetContext();
44
+ const editorAPI = props.editorAPI;
46
45
  const {
47
46
  editorViewModeState,
48
47
  primaryToolbarState
@@ -65,6 +64,7 @@ export const FullPageEditor = props => {
65
64
  ref: wrapperElementRef
66
65
  }, !isEditorToolbarHidden && jsx(FullPageToolbar, {
67
66
  appearance: props.appearance,
67
+ editorAPI: editorAPI,
68
68
  beforeIcon: props.primaryToolbarIconBefore,
69
69
  collabEdit: props.collabEdit,
70
70
  containerElement: (_scrollContentContain2 = (_scrollContentContain3 = scrollContentContainerRef.current) === null || _scrollContentContain3 === void 0 ? void 0 : _scrollContentContain3.scrollContainer) !== null && _scrollContentContain2 !== void 0 ? _scrollContentContain2 : null,
@@ -12,14 +12,15 @@ import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
12
12
  import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
13
13
  import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
- import { usePresetContext } from '../../../presets/context';
16
15
  import Toolbar from '../../Toolbar';
17
16
  import { BeforePrimaryToolbarWrapper } from './BeforeWrapper';
18
17
  import { customToolbarWrapperStyle, mainToolbarFirstChildStyle, mainToolbarIconBeforeStyle, mainToolbarSecondChildStyle, mainToolbarStyle, MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, nonCustomToolbarWrapperStyle } from './MainToolbar';
19
18
  export const EditorToolbar = /*#__PURE__*/React.memo(props => {
20
19
  var _props$featureFlags, _props$customPrimaryT, _props$featureFlags2, _props$featureFlags3, _editorAPI$avatarGrou, _props$collabEdit, _props$collabEdit2, _props$collabEdit3;
21
20
  const [shouldSplitToolbar, setShouldSplitToolbar] = useState(false);
22
- const editorAPI = usePresetContext();
21
+ const {
22
+ editorAPI
23
+ } = props;
23
24
 
24
25
  // When primary toolbar components is undefined, do not show two line editor toolbar
25
26
  const twoLineEditorToolbar = !!props.customPrimaryToolbarComponents && !!((_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.twoLineEditorToolbar);
@@ -4,6 +4,7 @@ import { columnLayoutSharedStyle, LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN }
4
4
  import { TableCssClassName } from '@atlaskit/editor-plugins/table/types';
5
5
  import { tableMarginFullWidthMode } from '@atlaskit/editor-plugins/table/ui/consts';
6
6
  import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, akEditorSwoopCubicBezier, akLayoutGutterOffset, getSelectionStyles, gridMediumMaxWidth, SelectionStyle } from '@atlaskit/editor-shared-styles';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { N40A, N50A } from '@atlaskit/theme/colors';
8
9
  export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
9
10
 
@@ -13,7 +14,7 @@ export const layoutStyles = viewMode => css`
13
14
  ${columnLayoutSharedStyle} [data-layout-section] {
14
15
  // TODO: Migrate away from gridSize
15
16
  // Recommendation: Replace directly with 7px
16
- margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset}px 0;
17
+ margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + (fg('platform_editor_element_padding_changes_gate') ? 8 : 0)}px 0;
17
18
  transition: border-color 0.3s ${akEditorSwoopCubicBezier};
18
19
  cursor: ${viewMode === 'view' ? 'default' : 'pointer'};
19
20
 
@@ -24,7 +25,8 @@ export const layoutStyles = viewMode => css`
24
25
  border: ${viewMode === 'view' ? 0 : akEditorSelectedBorderSize}px solid
25
26
  ${`var(--ds-border, ${N40A})`};
26
27
  border-radius: 4px;
27
- padding: ${LAYOUT_COLUMN_PADDING}px;
28
+ padding: ${LAYOUT_COLUMN_PADDING}px ${LAYOUT_COLUMN_PADDING}px ${LAYOUT_COLUMN_PADDING}px
29
+ ${LAYOUT_COLUMN_PADDING + (fg('platform_editor_element_padding_changes_gate') ? 8 : 0)}px;
28
30
  box-sizing: border-box;
29
31
 
30
32
  > div {
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "195.4.7";
2
+ export const version = "195.4.9";
@@ -99,11 +99,13 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
99
99
  eventDispatcher = _ref2.eventDispatcher,
100
100
  config = _ref2.config,
101
101
  dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
102
- editorRef = _ref2.editorRef;
102
+ editorRef = _ref2.editorRef,
103
+ editorAPI = _ref2.editorAPI;
103
104
  return jsx(BaseTheme, {
104
105
  baseFontSize: getBaseFontSize(props.appearance)
105
106
  }, jsx(Component, {
106
107
  innerRef: editorRef,
108
+ editorAPI: editorAPI,
107
109
  appearance: props.appearance,
108
110
  disabled: props.disabled,
109
111
  editorActions: editorActions,
@@ -24,6 +24,7 @@ import { analyticsEventKey, browser, countNodes as _countNodes, findChangedNodes
24
24
  import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
25
25
  import { EditorView } from '@atlaskit/editor-prosemirror/view';
26
26
  import { createDispatch, EventDispatcher } from '../event-dispatcher';
27
+ import { EditorAPIContext } from '../presets/context';
27
28
  import { getNodesCount } from '../utils/document';
28
29
  import { isFullPage } from '../utils/is-full-page';
29
30
  import { RenderTracking } from '../utils/performance/components/RenderTracking';
@@ -766,7 +767,8 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
766
767
  }, {
767
768
  key: "render",
768
769
  value: function render() {
769
- var _this$props$editorPro8;
770
+ var _this$props$editorPro8,
771
+ _this3 = this;
770
772
  var renderTracking = (_this$props$editorPro8 = this.props.editorProps.performanceTracking) === null || _this$props$editorPro8 === void 0 || (_this$props$editorPro8 = _this$props$editorPro8.renderTracking) === null || _this$props$editorPro8 === void 0 ? void 0 : _this$props$editorPro8.reactEditorView;
771
773
  var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
772
774
  var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
@@ -782,14 +784,19 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
782
784
  actionSubject: ACTION_SUBJECT.REACT_EDITOR_VIEW,
783
785
  handleAnalyticsEvent: this.handleAnalyticsEvent,
784
786
  useShallow: useShallow
785
- }), this.props.render ? this.props.render({
786
- editor: this.editor,
787
- view: this.view,
788
- config: this.config,
789
- eventDispatcher: this.eventDispatcher,
790
- transformer: this.contentTransformer,
791
- dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
792
- editorRef: this.editorRef
787
+ }), this.props.render ? /*#__PURE__*/React.createElement(EditorAPIContext.Consumer, null, function (_ref4) {
788
+ var _this3$props$render, _this3$props$render2, _this3$props;
789
+ var editorApi = _ref4.editorApi;
790
+ return (_this3$props$render = (_this3$props$render2 = (_this3$props = _this3.props).render) === null || _this3$props$render2 === void 0 ? void 0 : _this3$props$render2.call(_this3$props, {
791
+ editor: _this3.editor,
792
+ view: _this3.view,
793
+ config: _this3.config,
794
+ eventDispatcher: _this3.eventDispatcher,
795
+ transformer: _this3.contentTransformer,
796
+ dispatchAnalyticsEvent: _this3.dispatchAnalyticsEvent,
797
+ editorRef: _this3.editorRef,
798
+ editorAPI: editorApi
799
+ })) !== null && _this3$props$render !== void 0 ? _this3$props$render : _this3.editor;
793
800
  }) : this.editor);
794
801
  }
795
802
  }]);
@@ -17,7 +17,6 @@ import React, { Fragment } from 'react';
17
17
  import { css, jsx } from '@emotion/react';
18
18
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
19
19
  import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
20
- import { usePresetContext } from '../../presets/context';
21
20
  import { createEditorContentStyle } from '../ContentStyles';
22
21
  import PluginSlot from '../PluginSlot';
23
22
  import WithFlash from '../WithFlash';
@@ -125,6 +124,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
125
124
  key: "render",
126
125
  value: function render() {
127
126
  return jsx(RenderWithPluginState, {
127
+ editorAPI: this.props.editorAPI,
128
128
  renderChrome: this.renderChrome
129
129
  });
130
130
  }
@@ -134,9 +134,9 @@ var Editor = /*#__PURE__*/function (_React$Component) {
134
134
  _defineProperty(Editor, "displayName", 'ChromelessEditorAppearance');
135
135
  export { Editor as default };
136
136
  function RenderWithPluginState(_ref3) {
137
- var renderChrome = _ref3.renderChrome;
138
- var api = usePresetContext();
139
- var _useSharedPluginState = useSharedPluginState(api, ['maxContentSize']),
137
+ var renderChrome = _ref3.renderChrome,
138
+ editorAPI = _ref3.editorAPI;
139
+ var _useSharedPluginState = useSharedPluginState(editorAPI, ['maxContentSize']),
140
140
  maxContentSizeState = _useSharedPluginState.maxContentSizeState;
141
141
  return jsx(Fragment, null, renderChrome({
142
142
  maxContentSize: maxContentSizeState
@@ -8,7 +8,7 @@ import React, { useCallback, useEffect, useMemo, 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 classnames from 'classnames';
11
- import { injectIntl } from 'react-intl-next';
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
14
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
@@ -21,7 +21,6 @@ import { fg } from '@atlaskit/platform-feature-flags';
21
21
  import { N100 } from '@atlaskit/theme/colors';
22
22
  import { borderRadius } from '@atlaskit/theme/constants';
23
23
  import messages from '../../../messages';
24
- import { usePresetContext } from '../../../presets/context';
25
24
  import { ClickAreaBlock } from '../../Addon';
26
25
  import { createEditorContentStyle } from '../../ContentStyles';
27
26
  import PluginSlot from '../../PluginSlot';
@@ -75,12 +74,13 @@ var secondaryToolbarStyles = css({
75
74
  padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-025, 2px)")
76
75
  });
77
76
  var appearance = 'comment';
78
- var Editor = function Editor(props) {
79
- var api = usePresetContext();
80
- var _useSharedPluginState = useSharedPluginState(api, ['media', 'maxContentSize', 'primaryToolbar']),
77
+ export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
78
+ var editorAPI = props.editorAPI;
79
+ var _useSharedPluginState = useSharedPluginState(editorAPI, ['media', 'maxContentSize', 'primaryToolbar']),
81
80
  mediaState = _useSharedPluginState.mediaState,
82
81
  maxContentSizeState = _useSharedPluginState.maxContentSizeState,
83
82
  primaryToolbarState = _useSharedPluginState.primaryToolbarState;
83
+ var intl = useIntl();
84
84
  var editorDOMElement = props.editorDOMElement,
85
85
  editorView = props.editorView,
86
86
  editorActions = props.editorActions,
@@ -101,7 +101,6 @@ var Editor = function Editor(props) {
101
101
  onCancel = props.onCancel,
102
102
  disabled = props.disabled,
103
103
  dispatchAnalyticsEvent = props.dispatchAnalyticsEvent,
104
- intl = props.intl,
105
104
  useStickyToolbar = props.useStickyToolbar,
106
105
  pluginHooks = props.pluginHooks,
107
106
  featureFlags = props.featureFlags,
@@ -245,5 +244,4 @@ var Editor = function Editor(props) {
245
244
  }
246
245
  }), customSecondaryToolbarComponents));
247
246
  };
248
- Editor.displayName = 'CommentEditorAppearance';
249
- export var CommentEditorWithIntl = injectIntl(Editor);
247
+ CommentEditorWithIntl.displayName = 'CommentEditorAppearance';
@@ -10,7 +10,6 @@ import { jsx } from '@emotion/react';
10
10
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
11
11
  import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
12
12
  import { browser } from '@atlaskit/editor-common/utils';
13
- import { usePresetContext } from '../../../presets/context';
14
13
  import { FullPageContentArea } from './FullPageContentArea';
15
14
  import { FullPageToolbar } from './FullPageToolbar';
16
15
  import { fullPageEditorWrapper } from './StyledComponents';
@@ -50,7 +49,7 @@ export var FullPageEditor = function FullPageEditor(props) {
50
49
  }, [props.innerRef]);
51
50
  var scrollContentContainerRef = useRef(null);
52
51
  var showKeyline = useShowKeyline(scrollContentContainerRef);
53
- var editorAPI = usePresetContext();
52
+ var editorAPI = props.editorAPI;
54
53
  var _useSharedPluginState = useSharedPluginState(editorAPI, ['editorViewMode', 'primaryToolbar']),
55
54
  editorViewModeState = _useSharedPluginState.editorViewModeState,
56
55
  primaryToolbarState = _useSharedPluginState.primaryToolbarState;
@@ -72,6 +71,7 @@ export var FullPageEditor = function FullPageEditor(props) {
72
71
  ref: wrapperElementRef
73
72
  }, !isEditorToolbarHidden && jsx(FullPageToolbar, {
74
73
  appearance: props.appearance,
74
+ editorAPI: editorAPI,
75
75
  beforeIcon: props.primaryToolbarIconBefore,
76
76
  collabEdit: props.collabEdit,
77
77
  containerElement: (_scrollContentContain2 = (_scrollContentContain3 = scrollContentContainerRef.current) === null || _scrollContentContain3 === void 0 ? void 0 : _scrollContentContain3.scrollContainer) !== null && _scrollContentContain2 !== void 0 ? _scrollContentContain2 : null,
@@ -13,7 +13,6 @@ import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
13
13
  import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
14
14
  import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
15
15
  import { fg } from '@atlaskit/platform-feature-flags';
16
- import { usePresetContext } from '../../../presets/context';
17
16
  import Toolbar from '../../Toolbar';
18
17
  import { BeforePrimaryToolbarWrapper } from './BeforeWrapper';
19
18
  import { customToolbarWrapperStyle, mainToolbarFirstChildStyle, mainToolbarIconBeforeStyle, mainToolbarSecondChildStyle, mainToolbarStyle, MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, nonCustomToolbarWrapperStyle } from './MainToolbar';
@@ -23,7 +22,7 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
23
22
  _useState2 = _slicedToArray(_useState, 2),
24
23
  shouldSplitToolbar = _useState2[0],
25
24
  setShouldSplitToolbar = _useState2[1];
26
- var editorAPI = usePresetContext();
25
+ var editorAPI = props.editorAPI;
27
26
 
28
27
  // When primary toolbar components is undefined, do not show two line editor toolbar
29
28
  var twoLineEditorToolbar = !!props.customPrimaryToolbarComponents && !!((_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.twoLineEditorToolbar);
@@ -6,10 +6,11 @@ import { columnLayoutSharedStyle, LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN }
6
6
  import { TableCssClassName } from '@atlaskit/editor-plugins/table/types';
7
7
  import { tableMarginFullWidthMode } from '@atlaskit/editor-plugins/table/ui/consts';
8
8
  import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, akEditorSwoopCubicBezier, akLayoutGutterOffset, getSelectionStyles, gridMediumMaxWidth, SelectionStyle } from '@atlaskit/editor-shared-styles';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { N40A, N50A } from '@atlaskit/theme/colors';
10
11
  export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
11
12
 
12
13
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
13
14
  export var layoutStyles = function layoutStyles(viewMode) {
14
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\t", " [data-layout-section] {\n\t\t\t// TODO: Migrate away from gridSize\n\t\t\t// Recommendation: 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\tmin-width: 0;\n\t\t\t\tborder: ", "px solid\n\t\t\t\t\t", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t> :not(style):first-child,\n\t\t\t\t\t> style:first-child + * {\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> style:first-child + .ProseMirror-gapcursor + * {\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 + span + *,\n\t\t\t\t\t> style:first-child + .ProseMirror-gapcursor:first-child + span + * {\n\t\t\t\t\t\tmargin-top: 0;\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[data-layout-column] + [data-layout-column] {\n\t\t\t\tmargin-left: ", "px;\n\t\t\t}\n\n\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n\t\t\t// This is because the default state already uses the same token and, as such, the hover style won't change anything.\n\t\t\t// https://product-fabric.atlassian.net/browse/DSP-4441\n\t\t\t/* Shows the border when cursor is inside a layout */\n\t\t\t&.selected [data-layout-column],\n\t\t\t&:hover [data-layout-column] {\n\t\t\t\tborder: ", "px solid\n\t\t\t\t\t", ";\n\t\t\t}\n\n\t\t\t&.selected.danger > [data-layout-column] {\n\t\t\t\tbackground-color: ", ";\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&.", ":not(.danger) {\n\t\t\t\t[data-layout-column] {\n\t\t\t\t\t", "\n\t\t\t\t}\n\t\t\t}\n\t\t}\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"])), columnLayoutSharedStyle, "var(--ds-space-100, 8px)", akLayoutGutterOffset, akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', viewMode === 'view' ? 0 : akEditorSelectedBorderSize, "var(--ds-border, ".concat(N40A, ")"), LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN, gridMediumMaxWidth, viewMode === 'view' ? 0 : akEditorSelectedBorderSize, "var(--ds-border, ".concat(N50A, ")"), "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.Border, SelectionStyle.Blanket]), TableCssClassName.TABLE_CONTAINER, tableMarginFullWidthMode);
15
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\t", " [data-layout-section] {\n\t\t\t// TODO: Migrate away from gridSize\n\t\t\t// Recommendation: 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\tmin-width: 0;\n\t\t\t\tborder: ", "px solid\n\t\t\t\t\t", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px ", "px ", "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> :not(style):first-child,\n\t\t\t\t\t> style:first-child + * {\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> style:first-child + .ProseMirror-gapcursor + * {\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 + span + *,\n\t\t\t\t\t> style:first-child + .ProseMirror-gapcursor:first-child + span + * {\n\t\t\t\t\t\tmargin-top: 0;\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[data-layout-column] + [data-layout-column] {\n\t\t\t\tmargin-left: ", "px;\n\t\t\t}\n\n\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n\t\t\t// This is because the default state already uses the same token and, as such, the hover style won't change anything.\n\t\t\t// https://product-fabric.atlassian.net/browse/DSP-4441\n\t\t\t/* Shows the border when cursor is inside a layout */\n\t\t\t&.selected [data-layout-column],\n\t\t\t&:hover [data-layout-column] {\n\t\t\t\tborder: ", "px solid\n\t\t\t\t\t", ";\n\t\t\t}\n\n\t\t\t&.selected.danger > [data-layout-column] {\n\t\t\t\tbackground-color: ", ";\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&.", ":not(.danger) {\n\t\t\t\t[data-layout-column] {\n\t\t\t\t\t", "\n\t\t\t\t}\n\t\t\t}\n\t\t}\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"])), columnLayoutSharedStyle, "var(--ds-space-100, 8px)", akLayoutGutterOffset + (fg('platform_editor_element_padding_changes_gate') ? 8 : 0), akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', viewMode === 'view' ? 0 : akEditorSelectedBorderSize, "var(--ds-border, ".concat(N40A, ")"), LAYOUT_COLUMN_PADDING, LAYOUT_COLUMN_PADDING, LAYOUT_COLUMN_PADDING, LAYOUT_COLUMN_PADDING + (fg('platform_editor_element_padding_changes_gate') ? 8 : 0), LAYOUT_SECTION_MARGIN, gridMediumMaxWidth, viewMode === 'view' ? 0 : akEditorSelectedBorderSize, "var(--ds-border, ".concat(N50A, ")"), "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.Border, SelectionStyle.Blanket]), TableCssClassName.TABLE_CONTAINER, tableMarginFullWidthMode);
15
16
  };
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "195.4.7";
2
+ export var version = "195.4.9";
@@ -7,7 +7,7 @@ import type { AnalyticsEventPayload, DispatchAnalyticsEvent, FireAnalyticsCallba
7
7
  import type { AllEditorPresetPluginTypes, EditorPresetBuilder } from '@atlaskit/editor-common/preset';
8
8
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
9
9
  import type { PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
10
- import type { Transformer } from '@atlaskit/editor-common/types';
10
+ import type { PublicPluginAPI, Transformer } from '@atlaskit/editor-common/types';
11
11
  import { ExperienceStore } from '@atlaskit/editor-common/ufo';
12
12
  import type { ErrorReporter, SEVERITY } from '@atlaskit/editor-common/utils';
13
13
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
@@ -38,6 +38,7 @@ export interface EditorViewProps {
38
38
  transformer?: Transformer<string>;
39
39
  dispatchAnalyticsEvent: DispatchAnalyticsEvent;
40
40
  editorRef: React.RefObject<HTMLDivElement>;
41
+ editorAPI: PublicPluginAPI<any> | undefined;
41
42
  }) => JSX.Element;
42
43
  onEditorCreated: (instance: {
43
44
  view: EditorView;
@@ -1,3 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import type { EditorAppearance, EditorAppearanceComponentProps } from '../types';
3
- export default function getUiComponent(appearance: EditorAppearance): React.ComponentType<React.PropsWithChildren<EditorAppearanceComponentProps>>;
3
+ type ReturnType = React.ComponentType<React.PropsWithChildren<EditorAppearanceComponentProps<any[]>>>;
4
+ export default function getUiComponent(appearance: EditorAppearance): ReturnType;
5
+ export {};
@@ -3,7 +3,7 @@ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
3
  import type { CollabEditOptions } from '@atlaskit/editor-common/collab';
4
4
  import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
5
5
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
- import type { ReactHookFactory } from '@atlaskit/editor-common/types';
6
+ import type { NextEditorPlugin, PublicPluginAPI, ReactHookFactory } from '@atlaskit/editor-common/types';
7
7
  import type { UseStickyToolbarType } from '@atlaskit/editor-common/ui';
8
8
  import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
@@ -14,7 +14,8 @@ import type { UIComponentFactory } from '../types/ui-components';
14
14
  import type { ToolbarUIComponentFactory } from '../ui/Toolbar/types';
15
15
  import type { EditorAppearance } from './editor-appearance';
16
16
  import type { FeatureFlags } from './feature-flags';
17
- export interface EditorAppearanceComponentProps {
17
+ export interface EditorAppearanceComponentProps<Plugins extends NextEditorPlugin<any, any>[]> {
18
+ editorAPI: PublicPluginAPI<Plugins> | undefined;
18
19
  appearance?: EditorAppearance;
19
20
  onSave?: (editorView: EditorView) => void;
20
21
  onCancel?: (editorView: EditorView) => void;
@@ -4,11 +4,15 @@
4
4
  */
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
+ import { type OptionalPlugin } from '@atlaskit/editor-common/types';
8
+ import type { MaxContentSizePlugin } from '@atlaskit/editor-plugins/max-content-size';
7
9
  import type { EditorAppearanceComponentProps } from '../../types';
8
- export default class Editor extends React.Component<EditorAppearanceComponentProps, any> {
10
+ type AppearanceProps = EditorAppearanceComponentProps<[OptionalPlugin<MaxContentSizePlugin>]>;
11
+ export default class Editor extends React.Component<AppearanceProps, any> {
9
12
  static displayName: string;
10
13
  private appearance;
11
14
  private containerElement;
12
15
  private renderChrome;
13
16
  render(): jsx.JSX.Element;
14
17
  }
18
+ export {};
@@ -1,10 +1,16 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React from 'react';
6
- import type { WrappedComponentProps } from 'react-intl-next';
1
+ import { jsx } from '@emotion/react';
2
+ import type { OptionalPlugin } from '@atlaskit/editor-common/types';
3
+ import type { MaxContentSizePlugin } from '@atlaskit/editor-plugins/max-content-size';
4
+ import type { MediaPlugin } from '@atlaskit/editor-plugins/media';
5
+ import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugins/primary-toolbar';
7
6
  import type { EditorAppearanceComponentProps } from '../../../types';
8
- export declare const CommentEditorWithIntl: React.FC<import("react-intl-next").WithIntlProps<EditorAppearanceComponentProps & WrappedComponentProps>> & {
9
- WrappedComponent: React.ComponentType<EditorAppearanceComponentProps & WrappedComponentProps>;
7
+ type ComponentProps = EditorAppearanceComponentProps<[
8
+ OptionalPlugin<MediaPlugin>,
9
+ OptionalPlugin<MaxContentSizePlugin>,
10
+ OptionalPlugin<PrimaryToolbarPlugin>
11
+ ]>;
12
+ export declare const CommentEditorWithIntl: {
13
+ (props: ComponentProps): jsx.JSX.Element;
14
+ displayName: string;
10
15
  };
16
+ export {};
@@ -1,3 +1,13 @@
1
1
  import { jsx } from '@emotion/react';
2
+ import type { OptionalPlugin } from '@atlaskit/editor-common/types';
3
+ import type { EditorViewModePlugin } from '@atlaskit/editor-plugins/editor-viewmode';
4
+ import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugins/primary-toolbar';
2
5
  import type { EditorAppearanceComponentProps } from '../../../types';
3
- export declare const FullPageEditor: (props: EditorAppearanceComponentProps) => jsx.JSX.Element;
6
+ import type { ToolbarEditorPlugins } from './FullPageToolbar';
7
+ type ComponentProps = EditorAppearanceComponentProps<[
8
+ OptionalPlugin<EditorViewModePlugin>,
9
+ OptionalPlugin<PrimaryToolbarPlugin>,
10
+ ...ToolbarEditorPlugins
11
+ ]>;
12
+ export declare const FullPageEditor: (props: ComponentProps) => jsx.JSX.Element;
13
+ export {};
@@ -10,10 +10,25 @@ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
10
10
  import type { CollabEditOptions } from '@atlaskit/editor-common/collab';
11
11
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
12
12
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
13
+ import type { OptionalPlugin, PublicPluginAPI } from '@atlaskit/editor-common/types';
14
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugins/analytics';
15
+ import type { AvatarGroupPlugin } from '@atlaskit/editor-plugins/avatar-group';
16
+ import type { BeforePrimaryToolbarPlugin } from '@atlaskit/editor-plugins/before-primary-toolbar';
17
+ import type { CollabEditPlugin } from '@atlaskit/editor-plugins/collab-edit';
18
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugins/feature-flags';
19
+ import type { FindReplacePlugin } from '@atlaskit/editor-plugins/find-replace';
13
20
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
14
21
  import type { EditorActions } from '../../../index';
15
22
  import type { EditorAppearance, PrimaryToolbarComponents, ToolbarUIComponentFactory } from '../../../types';
16
23
  import type { FeatureFlags } from '../../../types/feature-flags';
24
+ export type ToolbarEditorPlugins = [
25
+ OptionalPlugin<AnalyticsPlugin>,
26
+ OptionalPlugin<FindReplacePlugin>,
27
+ OptionalPlugin<FeatureFlagsPlugin>,
28
+ OptionalPlugin<CollabEditPlugin>,
29
+ OptionalPlugin<AvatarGroupPlugin>,
30
+ OptionalPlugin<BeforePrimaryToolbarPlugin>
31
+ ];
17
32
  export interface FullPageToolbarProps {
18
33
  appearance?: EditorAppearance;
19
34
  providerFactory: ProviderFactory;
@@ -35,6 +50,7 @@ export interface FullPageToolbarProps {
35
50
  hasMinWidth?: boolean;
36
51
  featureFlags: FeatureFlags;
37
52
  hideAvatarGroup?: boolean;
53
+ editorAPI: PublicPluginAPI<ToolbarEditorPlugins> | undefined;
38
54
  }
39
55
  export declare const EditorToolbar: React.MemoExoticComponent<(props: FullPageToolbarProps & WrappedComponentProps) => jsx.JSX.Element>;
40
56
  export declare const FullPageToolbar: React.FC<import("react-intl-next").WithIntlProps<FullPageToolbarProps & WrappedComponentProps>> & {
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import type { EditorAppearanceComponentProps } from '../../types';
3
- export default function Mobile({ editorView, maxHeight, persistScrollGutter, editorDOMElement, disabled, contentComponents, editorActions, eventDispatcher, dispatchAnalyticsEvent, providerFactory, appearance, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, innerRef, pluginHooks, featureFlags, }: EditorAppearanceComponentProps): JSX.Element;
3
+ export default function Mobile({ editorView, maxHeight, persistScrollGutter, editorDOMElement, disabled, contentComponents, editorActions, eventDispatcher, dispatchAnalyticsEvent, providerFactory, appearance, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, innerRef, pluginHooks, featureFlags, }: EditorAppearanceComponentProps<any>): JSX.Element;
@@ -7,7 +7,7 @@ import type { AnalyticsEventPayload, DispatchAnalyticsEvent, FireAnalyticsCallba
7
7
  import type { AllEditorPresetPluginTypes, EditorPresetBuilder } from '@atlaskit/editor-common/preset';
8
8
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
9
9
  import type { PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
10
- import type { Transformer } from '@atlaskit/editor-common/types';
10
+ import type { PublicPluginAPI, Transformer } from '@atlaskit/editor-common/types';
11
11
  import { ExperienceStore } from '@atlaskit/editor-common/ufo';
12
12
  import type { ErrorReporter, SEVERITY } from '@atlaskit/editor-common/utils';
13
13
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
@@ -38,6 +38,7 @@ export interface EditorViewProps {
38
38
  transformer?: Transformer<string>;
39
39
  dispatchAnalyticsEvent: DispatchAnalyticsEvent;
40
40
  editorRef: React.RefObject<HTMLDivElement>;
41
+ editorAPI: PublicPluginAPI<any> | undefined;
41
42
  }) => JSX.Element;
42
43
  onEditorCreated: (instance: {
43
44
  view: EditorView;
@@ -1,3 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import type { EditorAppearance, EditorAppearanceComponentProps } from '../types';
3
- export default function getUiComponent(appearance: EditorAppearance): React.ComponentType<React.PropsWithChildren<EditorAppearanceComponentProps>>;
3
+ type ReturnType = React.ComponentType<React.PropsWithChildren<EditorAppearanceComponentProps<any[]>>>;
4
+ export default function getUiComponent(appearance: EditorAppearance): ReturnType;
5
+ export {};
@@ -3,7 +3,7 @@ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
3
  import type { CollabEditOptions } from '@atlaskit/editor-common/collab';
4
4
  import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
5
5
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
- import type { ReactHookFactory } from '@atlaskit/editor-common/types';
6
+ import type { NextEditorPlugin, PublicPluginAPI, ReactHookFactory } from '@atlaskit/editor-common/types';
7
7
  import type { UseStickyToolbarType } from '@atlaskit/editor-common/ui';
8
8
  import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
@@ -14,7 +14,8 @@ import type { UIComponentFactory } from '../types/ui-components';
14
14
  import type { ToolbarUIComponentFactory } from '../ui/Toolbar/types';
15
15
  import type { EditorAppearance } from './editor-appearance';
16
16
  import type { FeatureFlags } from './feature-flags';
17
- export interface EditorAppearanceComponentProps {
17
+ export interface EditorAppearanceComponentProps<Plugins extends NextEditorPlugin<any, any>[]> {
18
+ editorAPI: PublicPluginAPI<Plugins> | undefined;
18
19
  appearance?: EditorAppearance;
19
20
  onSave?: (editorView: EditorView) => void;
20
21
  onCancel?: (editorView: EditorView) => void;
@@ -4,11 +4,17 @@
4
4
  */
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
+ import { type OptionalPlugin } from '@atlaskit/editor-common/types';
8
+ import type { MaxContentSizePlugin } from '@atlaskit/editor-plugins/max-content-size';
7
9
  import type { EditorAppearanceComponentProps } from '../../types';
8
- export default class Editor extends React.Component<EditorAppearanceComponentProps, any> {
10
+ type AppearanceProps = EditorAppearanceComponentProps<[
11
+ OptionalPlugin<MaxContentSizePlugin>
12
+ ]>;
13
+ export default class Editor extends React.Component<AppearanceProps, any> {
9
14
  static displayName: string;
10
15
  private appearance;
11
16
  private containerElement;
12
17
  private renderChrome;
13
18
  render(): jsx.JSX.Element;
14
19
  }
20
+ export {};
@@ -1,10 +1,16 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React from 'react';
6
- import type { WrappedComponentProps } from 'react-intl-next';
1
+ import { jsx } from '@emotion/react';
2
+ import type { OptionalPlugin } from '@atlaskit/editor-common/types';
3
+ import type { MaxContentSizePlugin } from '@atlaskit/editor-plugins/max-content-size';
4
+ import type { MediaPlugin } from '@atlaskit/editor-plugins/media';
5
+ import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugins/primary-toolbar';
7
6
  import type { EditorAppearanceComponentProps } from '../../../types';
8
- export declare const CommentEditorWithIntl: React.FC<import("react-intl-next").WithIntlProps<EditorAppearanceComponentProps & WrappedComponentProps>> & {
9
- WrappedComponent: React.ComponentType<EditorAppearanceComponentProps & WrappedComponentProps>;
7
+ type ComponentProps = EditorAppearanceComponentProps<[
8
+ OptionalPlugin<MediaPlugin>,
9
+ OptionalPlugin<MaxContentSizePlugin>,
10
+ OptionalPlugin<PrimaryToolbarPlugin>
11
+ ]>;
12
+ export declare const CommentEditorWithIntl: {
13
+ (props: ComponentProps): jsx.JSX.Element;
14
+ displayName: string;
10
15
  };
16
+ export {};
@@ -1,3 +1,13 @@
1
1
  import { jsx } from '@emotion/react';
2
+ import type { OptionalPlugin } from '@atlaskit/editor-common/types';
3
+ import type { EditorViewModePlugin } from '@atlaskit/editor-plugins/editor-viewmode';
4
+ import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugins/primary-toolbar';
2
5
  import type { EditorAppearanceComponentProps } from '../../../types';
3
- export declare const FullPageEditor: (props: EditorAppearanceComponentProps) => jsx.JSX.Element;
6
+ import type { ToolbarEditorPlugins } from './FullPageToolbar';
7
+ type ComponentProps = EditorAppearanceComponentProps<[
8
+ OptionalPlugin<EditorViewModePlugin>,
9
+ OptionalPlugin<PrimaryToolbarPlugin>,
10
+ ...ToolbarEditorPlugins
11
+ ]>;
12
+ export declare const FullPageEditor: (props: ComponentProps) => jsx.JSX.Element;
13
+ export {};
@@ -10,10 +10,25 @@ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
10
10
  import type { CollabEditOptions } from '@atlaskit/editor-common/collab';
11
11
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
12
12
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
13
+ import type { OptionalPlugin, PublicPluginAPI } from '@atlaskit/editor-common/types';
14
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugins/analytics';
15
+ import type { AvatarGroupPlugin } from '@atlaskit/editor-plugins/avatar-group';
16
+ import type { BeforePrimaryToolbarPlugin } from '@atlaskit/editor-plugins/before-primary-toolbar';
17
+ import type { CollabEditPlugin } from '@atlaskit/editor-plugins/collab-edit';
18
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugins/feature-flags';
19
+ import type { FindReplacePlugin } from '@atlaskit/editor-plugins/find-replace';
13
20
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
14
21
  import type { EditorActions } from '../../../index';
15
22
  import type { EditorAppearance, PrimaryToolbarComponents, ToolbarUIComponentFactory } from '../../../types';
16
23
  import type { FeatureFlags } from '../../../types/feature-flags';
24
+ export type ToolbarEditorPlugins = [
25
+ OptionalPlugin<AnalyticsPlugin>,
26
+ OptionalPlugin<FindReplacePlugin>,
27
+ OptionalPlugin<FeatureFlagsPlugin>,
28
+ OptionalPlugin<CollabEditPlugin>,
29
+ OptionalPlugin<AvatarGroupPlugin>,
30
+ OptionalPlugin<BeforePrimaryToolbarPlugin>
31
+ ];
17
32
  export interface FullPageToolbarProps {
18
33
  appearance?: EditorAppearance;
19
34
  providerFactory: ProviderFactory;
@@ -35,6 +50,7 @@ export interface FullPageToolbarProps {
35
50
  hasMinWidth?: boolean;
36
51
  featureFlags: FeatureFlags;
37
52
  hideAvatarGroup?: boolean;
53
+ editorAPI: PublicPluginAPI<ToolbarEditorPlugins> | undefined;
38
54
  }
39
55
  export declare const EditorToolbar: React.MemoExoticComponent<(props: FullPageToolbarProps & WrappedComponentProps) => jsx.JSX.Element>;
40
56
  export declare const FullPageToolbar: React.FC<import("react-intl-next").WithIntlProps<FullPageToolbarProps & WrappedComponentProps>> & {
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import type { EditorAppearanceComponentProps } from '../../types';
3
- export default function Mobile({ editorView, maxHeight, persistScrollGutter, editorDOMElement, disabled, contentComponents, editorActions, eventDispatcher, dispatchAnalyticsEvent, providerFactory, appearance, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, innerRef, pluginHooks, featureFlags, }: EditorAppearanceComponentProps): JSX.Element;
3
+ export default function Mobile({ editorView, maxHeight, persistScrollGutter, editorDOMElement, disabled, contentComponents, editorActions, eventDispatcher, dispatchAnalyticsEvent, providerFactory, appearance, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, innerRef, pluginHooks, featureFlags, }: EditorAppearanceComponentProps<any>): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "195.4.7",
3
+ "version": "195.4.9",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -45,7 +45,7 @@
45
45
  "@atlaskit/analytics-next": "^10.1.0",
46
46
  "@atlaskit/analytics-next-stable-react-context": "1.0.1",
47
47
  "@atlaskit/button": "^20.0.0",
48
- "@atlaskit/editor-common": "^87.10.0",
48
+ "@atlaskit/editor-common": "^87.11.0",
49
49
  "@atlaskit/editor-plugins": "^4.0.0",
50
50
  "@atlaskit/editor-prosemirror": "5.0.1",
51
51
  "@atlaskit/editor-shared-styles": "^2.13.0",
@@ -74,7 +74,7 @@
74
74
  },
75
75
  "peerDependencies": {
76
76
  "@atlaskit/link-provider": "^1.12.0",
77
- "@atlaskit/media-core": "^34.2.0",
77
+ "@atlaskit/media-core": "^34.3.0",
78
78
  "react": "^16.8.0",
79
79
  "react-dom": "^16.8.0",
80
80
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -95,12 +95,12 @@
95
95
  "@atlaskit/editor-test-helpers": "*",
96
96
  "@atlaskit/link-provider": "^1.14.0",
97
97
  "@atlaskit/logo": "^14.2.0",
98
- "@atlaskit/media-core": "^34.2.0",
99
- "@atlaskit/media-integration-test-helpers": "^3.0.0",
98
+ "@atlaskit/media-core": "^34.3.0",
99
+ "@atlaskit/media-integration-test-helpers": "^3.1.0",
100
100
  "@atlaskit/media-test-helpers": "^34.0.0",
101
101
  "@atlaskit/modal-dialog": "^12.15.0",
102
102
  "@atlaskit/primitives": "^12.0.0",
103
- "@atlaskit/renderer": "^109.46.0",
103
+ "@atlaskit/renderer": "^109.47.0",
104
104
  "@atlaskit/smart-card": "^27.16.0",
105
105
  "@atlaskit/synchrony-test-helpers": "^2.5.0",
106
106
  "@atlaskit/toggle": "^13.3.0",
@@ -108,7 +108,7 @@
108
108
  "@atlaskit/visual-regression": "*",
109
109
  "@atlassian/adf-schema-json": "^1.22.0",
110
110
  "@atlassian/feature-flags-test-utils": "*",
111
- "@atlassian/search-provider": "2.4.106",
111
+ "@atlassian/search-provider": "2.4.107",
112
112
  "@emotion/jest": "^11.8.0",
113
113
  "@storybook/addon-knobs": "^5.3.18",
114
114
  "@testing-library/react": "^12.1.5",
@@ -235,10 +235,6 @@
235
235
  "type": "boolean",
236
236
  "referenceOnly": "true"
237
237
  },
238
- "platform.editor.table.live-pages-sorting_4malx": {
239
- "type": "boolean",
240
- "referenceOnly": "true"
241
- },
242
238
  "platform.editor.table.allow-table-alignment": {
243
239
  "type": "boolean"
244
240
  },
@@ -295,6 +291,9 @@
295
291
  },
296
292
  "platform_editor_drag_and_drop_expand_style_fix": {
297
293
  "type": "boolean"
294
+ },
295
+ "platform_editor_element_padding_changes_gate": {
296
+ "type": "boolean"
298
297
  }
299
298
  },
300
299
  "stricter": {