@atlaskit/editor-core 217.5.0 → 217.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 217.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c68bac53b0cdc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c68bac53b0cdc) -
8
+ Add max appearance support to breakout plugin in universal preset
9
+ - Updated dependencies
10
+
11
+ ## 217.5.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`cdc6ff4788df0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cdc6ff4788df0) -
16
+ [EDITOR-5739] Move TwoStageHydration on toolbar down to around toolbar component rather than
17
+ ToolbarArrowKeyNavigationProvider
18
+ - Updated dependencies
19
+
3
20
  ## 217.5.0
4
21
 
5
22
  ### Minor Changes
@@ -59,6 +59,7 @@ var _toolbarListsIndentation = require("@atlaskit/editor-plugins/toolbar-lists-i
59
59
  var _ufo = require("@atlaskit/editor-plugins/ufo");
60
60
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
61
61
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
62
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
62
63
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
63
64
  var _isFullPage = require("../utils/is-full-page");
64
65
  var _versionWrapper = require("../version-wrapper");
@@ -117,7 +118,7 @@ function createUniversalPresetInternal(_ref) {
117
118
  var finalPreset = defaultPreset.add(_ufo.ufoPlugin).add(_dataConsumer.dataConsumerPlugin).add(_accessibilityUtils.accessibilityUtilsPlugin).add(_contentInsertion.contentInsertionPlugin).add(_batchAttributeUpdates.batchAttributeUpdatesPlugin).maybeAdd([_breakout.breakoutPlugin, {
118
119
  allowBreakoutButton: appearance === 'full-page',
119
120
  appearance: appearance
120
- }], Boolean(props.allowBreakout && isFullPage)).maybeAdd(_alignment.alignmentPlugin, Boolean(props.allowTextAlignment)).maybeAdd([_textColor.textColorPlugin, props.allowTextColor], Boolean(props.allowTextColor)).add(_list.listPlugin).maybeAdd(_rule.rulePlugin, Boolean(props.allowRule)).maybeAdd([_expand.expandPlugin, {
121
+ }], Boolean(props.allowBreakout && (isFullPage || appearance === 'max' && ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEqualsNoExposure.expValEqualsNoExposure)('confluence_max_width_content_appearance', 'isEnabled', true)) && (0, _platformFeatureFlags.fg)('platform_editor_breakout_in_universal_preset')))).maybeAdd(_alignment.alignmentPlugin, Boolean(props.allowTextAlignment)).maybeAdd([_textColor.textColorPlugin, props.allowTextColor], Boolean(props.allowTextColor)).add(_list.listPlugin).maybeAdd(_rule.rulePlugin, Boolean(props.allowRule)).maybeAdd([_expand.expandPlugin, {
121
122
  allowInsertion: isExpandInsertionEnabled(props),
122
123
  useLongPressSelection: false,
123
124
  appearance: appearance,
@@ -119,8 +119,38 @@ var FullPageToolbarNext = exports.FullPageToolbarNext = function FullPageToolbar
119
119
  return /*#__PURE__*/_react.default.createElement(ToolbarPortal, null, null);
120
120
  }
121
121
  }
122
- return /*#__PURE__*/_react.default.createElement(_contextPanel.ContextPanelConsumer, null, function (_ref6) {
123
- var ContextPanelWidth = _ref6.width;
122
+ if ((0, _expValEquals.expValEquals)('platform_editor_toolbar_two_stage_hydration', 'isEnabled', true)) {
123
+ return /*#__PURE__*/_react.default.createElement(_contextPanel.ContextPanelConsumer, null, function (_ref6) {
124
+ var ContextPanelWidth = _ref6.width;
125
+ return /*#__PURE__*/_react.default.createElement(_uiMenu.ToolbarArrowKeyNavigationProvider, {
126
+ editorView: editorView,
127
+ childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
128
+ isShortcutToFocusToolbar: isShortcutToFocusToolbar,
129
+ handleEscape: handleEscape,
130
+ intl: intl
131
+ }, /*#__PURE__*/_react.default.createElement(ToolbarPortal, null, /*#__PURE__*/_react.default.createElement(MainToolbarWrapper, {
132
+ testId: "ak-editor-main-toolbar",
133
+ showKeyline: showKeyline || ContextPanelWidth > 0
134
+ }, beforeIcon && /*#__PURE__*/_react.default.createElement("div", {
135
+ className: (0, _runtime.ax)([styles.mainToolbarIconBefore, styles.mainToolbarIconBeforeNew])
136
+ }, beforeIcon), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(FirstChildWrapper, null, /*#__PURE__*/_react.default.createElement(_ExcludeFromHydration.default, null, primaryToolbarDockingConfigEnabled && components && (0, _toolbar2.isToolbar)(toolbar) && ((0, _coreUtils.isSSR)() || editorView) && (!(0, _expValEquals.expValEquals)('platform_editor_toolbar_delay_render_fix', 'isEnabled', true) || !(0, _coreUtils.isSSR)()) && /*#__PURE__*/_react.default.createElement(_Toolbar.ToolbarNext, {
137
+ toolbar: toolbar,
138
+ components: components,
139
+ editorView: editorView,
140
+ editorAPI: editorAPI,
141
+ popupsMountPoint: mountPoint,
142
+ editorAppearance: "full-page",
143
+ isDisabled: disabled
144
+ }))), /*#__PURE__*/_react.default.createElement(SecondChildWrapper, null, /*#__PURE__*/_react.default.createElement("div", {
145
+ className: (0, _runtime.ax)([styles.customToolbarWrapperStyle])
146
+ }, !!customPrimaryToolbarComponents && 'before' in customPrimaryToolbarComponents && /*#__PURE__*/_react.default.createElement("div", {
147
+ "data-testid": 'before-primary-toolbar-components-plugin',
148
+ className: (0, _runtime.ax)([styles.beforePrimaryToolbarComponents])
149
+ }, customPrimaryToolbarComponents.before), !!customPrimaryToolbarComponents && 'after' in customPrimaryToolbarComponents ? customPrimaryToolbarComponents.after : customPrimaryToolbarComponents)), /*#__PURE__*/_react.default.createElement(_ToolbarPortal.ToolbarPortalMountPoint, null)))));
150
+ });
151
+ }
152
+ return /*#__PURE__*/_react.default.createElement(_contextPanel.ContextPanelConsumer, null, function (_ref7) {
153
+ var ContextPanelWidth = _ref7.width;
124
154
  return /*#__PURE__*/_react.default.createElement(_ExcludeFromHydration.default, {
125
155
  fallback: /*#__PURE__*/_react.default.createElement(ToolbarPlaceholder, null)
126
156
  }, /*#__PURE__*/_react.default.createElement(_uiMenu.ToolbarArrowKeyNavigationProvider, {
@@ -49,6 +49,7 @@ import { toolbarListsIndentationPlugin } from '@atlaskit/editor-plugins/toolbar-
49
49
  import { ufoPlugin } from '@atlaskit/editor-plugins/ufo';
50
50
  import { fg } from '@atlaskit/platform-feature-flags';
51
51
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
52
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
52
53
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
53
54
  import { isFullPage as fullPageCheck } from '../utils/is-full-page';
54
55
  import { version as coreVersion } from '../version-wrapper';
@@ -110,7 +111,7 @@ export default function createUniversalPresetInternal({
110
111
  const finalPreset = defaultPreset.add(ufoPlugin).add(dataConsumerPlugin).add(accessibilityUtilsPlugin).add(contentInsertionPlugin).add(batchAttributeUpdatesPlugin).maybeAdd([breakoutPlugin, {
111
112
  allowBreakoutButton: appearance === 'full-page',
112
113
  appearance: appearance
113
- }], Boolean(props.allowBreakout && isFullPage)).maybeAdd(alignmentPlugin, Boolean(props.allowTextAlignment)).maybeAdd([textColorPlugin, props.allowTextColor], Boolean(props.allowTextColor)).add(listPlugin).maybeAdd(rulePlugin, Boolean(props.allowRule)).maybeAdd([expandPlugin, {
114
+ }], Boolean(props.allowBreakout && (isFullPage || appearance === 'max' && (expValEqualsNoExposure('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEqualsNoExposure('confluence_max_width_content_appearance', 'isEnabled', true)) && fg('platform_editor_breakout_in_universal_preset')))).maybeAdd(alignmentPlugin, Boolean(props.allowTextAlignment)).maybeAdd([textColorPlugin, props.allowTextColor], Boolean(props.allowTextColor)).add(listPlugin).maybeAdd(rulePlugin, Boolean(props.allowRule)).maybeAdd([expandPlugin, {
114
115
  allowInsertion: isExpandInsertionEnabled(props),
115
116
  useLongPressSelection: false,
116
117
  appearance: appearance,
@@ -113,6 +113,35 @@ export const FullPageToolbarNext = ({
113
113
  return /*#__PURE__*/React.createElement(ToolbarPortal, null, null);
114
114
  }
115
115
  }
116
+ if (expValEquals('platform_editor_toolbar_two_stage_hydration', 'isEnabled', true)) {
117
+ return /*#__PURE__*/React.createElement(ContextPanelConsumer, null, ({
118
+ width: ContextPanelWidth
119
+ }) => /*#__PURE__*/React.createElement(ToolbarArrowKeyNavigationProvider, {
120
+ editorView: editorView,
121
+ childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
122
+ isShortcutToFocusToolbar: isShortcutToFocusToolbar,
123
+ handleEscape: handleEscape,
124
+ intl: intl
125
+ }, /*#__PURE__*/React.createElement(ToolbarPortal, null, /*#__PURE__*/React.createElement(MainToolbarWrapper, {
126
+ testId: "ak-editor-main-toolbar",
127
+ showKeyline: showKeyline || ContextPanelWidth > 0
128
+ }, beforeIcon && /*#__PURE__*/React.createElement("div", {
129
+ className: ax([styles.mainToolbarIconBefore, styles.mainToolbarIconBeforeNew])
130
+ }, beforeIcon), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FirstChildWrapper, null, /*#__PURE__*/React.createElement(ExcludeFromHydration, null, primaryToolbarDockingConfigEnabled && components && isToolbar(toolbar) && (isSSR() || editorView) && (!expValEquals('platform_editor_toolbar_delay_render_fix', 'isEnabled', true) || !isSSR()) && /*#__PURE__*/React.createElement(ToolbarNext, {
131
+ toolbar: toolbar,
132
+ components: components,
133
+ editorView: editorView,
134
+ editorAPI: editorAPI,
135
+ popupsMountPoint: mountPoint,
136
+ editorAppearance: "full-page",
137
+ isDisabled: disabled
138
+ }))), /*#__PURE__*/React.createElement(SecondChildWrapper, null, /*#__PURE__*/React.createElement("div", {
139
+ className: ax([styles.customToolbarWrapperStyle])
140
+ }, !!customPrimaryToolbarComponents && 'before' in customPrimaryToolbarComponents && /*#__PURE__*/React.createElement("div", {
141
+ "data-testid": 'before-primary-toolbar-components-plugin',
142
+ className: ax([styles.beforePrimaryToolbarComponents])
143
+ }, customPrimaryToolbarComponents.before), !!customPrimaryToolbarComponents && 'after' in customPrimaryToolbarComponents ? customPrimaryToolbarComponents.after : customPrimaryToolbarComponents)), /*#__PURE__*/React.createElement(ToolbarPortalMountPoint, null))))));
144
+ }
116
145
  return /*#__PURE__*/React.createElement(ContextPanelConsumer, null, ({
117
146
  width: ContextPanelWidth
118
147
  }) => /*#__PURE__*/React.createElement(ExcludeFromHydration, {
@@ -53,6 +53,7 @@ import { toolbarListsIndentationPlugin } from '@atlaskit/editor-plugins/toolbar-
53
53
  import { ufoPlugin } from '@atlaskit/editor-plugins/ufo';
54
54
  import { fg } from '@atlaskit/platform-feature-flags';
55
55
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
56
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
56
57
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
57
58
  import { isFullPage as fullPageCheck } from '../utils/is-full-page';
58
59
  import { version as coreVersion } from '../version-wrapper';
@@ -110,7 +111,7 @@ export default function createUniversalPresetInternal(_ref) {
110
111
  var finalPreset = defaultPreset.add(ufoPlugin).add(dataConsumerPlugin).add(accessibilityUtilsPlugin).add(contentInsertionPlugin).add(batchAttributeUpdatesPlugin).maybeAdd([breakoutPlugin, {
111
112
  allowBreakoutButton: appearance === 'full-page',
112
113
  appearance: appearance
113
- }], Boolean(props.allowBreakout && isFullPage)).maybeAdd(alignmentPlugin, Boolean(props.allowTextAlignment)).maybeAdd([textColorPlugin, props.allowTextColor], Boolean(props.allowTextColor)).add(listPlugin).maybeAdd(rulePlugin, Boolean(props.allowRule)).maybeAdd([expandPlugin, {
114
+ }], Boolean(props.allowBreakout && (isFullPage || appearance === 'max' && (expValEqualsNoExposure('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEqualsNoExposure('confluence_max_width_content_appearance', 'isEnabled', true)) && fg('platform_editor_breakout_in_universal_preset')))).maybeAdd(alignmentPlugin, Boolean(props.allowTextAlignment)).maybeAdd([textColorPlugin, props.allowTextColor], Boolean(props.allowTextColor)).add(listPlugin).maybeAdd(rulePlugin, Boolean(props.allowRule)).maybeAdd([expandPlugin, {
114
115
  allowInsertion: isExpandInsertionEnabled(props),
115
116
  useLongPressSelection: false,
116
117
  appearance: appearance,
@@ -110,8 +110,38 @@ export var FullPageToolbarNext = function FullPageToolbarNext(_ref4) {
110
110
  return /*#__PURE__*/React.createElement(ToolbarPortal, null, null);
111
111
  }
112
112
  }
113
- return /*#__PURE__*/React.createElement(ContextPanelConsumer, null, function (_ref6) {
114
- var ContextPanelWidth = _ref6.width;
113
+ if (expValEquals('platform_editor_toolbar_two_stage_hydration', 'isEnabled', true)) {
114
+ return /*#__PURE__*/React.createElement(ContextPanelConsumer, null, function (_ref6) {
115
+ var ContextPanelWidth = _ref6.width;
116
+ return /*#__PURE__*/React.createElement(ToolbarArrowKeyNavigationProvider, {
117
+ editorView: editorView,
118
+ childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
119
+ isShortcutToFocusToolbar: isShortcutToFocusToolbar,
120
+ handleEscape: handleEscape,
121
+ intl: intl
122
+ }, /*#__PURE__*/React.createElement(ToolbarPortal, null, /*#__PURE__*/React.createElement(MainToolbarWrapper, {
123
+ testId: "ak-editor-main-toolbar",
124
+ showKeyline: showKeyline || ContextPanelWidth > 0
125
+ }, beforeIcon && /*#__PURE__*/React.createElement("div", {
126
+ className: ax([styles.mainToolbarIconBefore, styles.mainToolbarIconBeforeNew])
127
+ }, beforeIcon), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FirstChildWrapper, null, /*#__PURE__*/React.createElement(ExcludeFromHydration, null, primaryToolbarDockingConfigEnabled && components && isToolbar(toolbar) && (isSSR() || editorView) && (!expValEquals('platform_editor_toolbar_delay_render_fix', 'isEnabled', true) || !isSSR()) && /*#__PURE__*/React.createElement(ToolbarNext, {
128
+ toolbar: toolbar,
129
+ components: components,
130
+ editorView: editorView,
131
+ editorAPI: editorAPI,
132
+ popupsMountPoint: mountPoint,
133
+ editorAppearance: "full-page",
134
+ isDisabled: disabled
135
+ }))), /*#__PURE__*/React.createElement(SecondChildWrapper, null, /*#__PURE__*/React.createElement("div", {
136
+ className: ax([styles.customToolbarWrapperStyle])
137
+ }, !!customPrimaryToolbarComponents && 'before' in customPrimaryToolbarComponents && /*#__PURE__*/React.createElement("div", {
138
+ "data-testid": 'before-primary-toolbar-components-plugin',
139
+ className: ax([styles.beforePrimaryToolbarComponents])
140
+ }, customPrimaryToolbarComponents.before), !!customPrimaryToolbarComponents && 'after' in customPrimaryToolbarComponents ? customPrimaryToolbarComponents.after : customPrimaryToolbarComponents)), /*#__PURE__*/React.createElement(ToolbarPortalMountPoint, null)))));
141
+ });
142
+ }
143
+ return /*#__PURE__*/React.createElement(ContextPanelConsumer, null, function (_ref7) {
144
+ var ContextPanelWidth = _ref7.width;
115
145
  return /*#__PURE__*/React.createElement(ExcludeFromHydration, {
116
146
  fallback: /*#__PURE__*/React.createElement(ToolbarPlaceholder, null)
117
147
  }, /*#__PURE__*/React.createElement(ToolbarArrowKeyNavigationProvider, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "217.5.0",
3
+ "version": "217.5.2",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -61,12 +61,12 @@
61
61
  "@atlaskit/icon": "^33.0.0",
62
62
  "@atlaskit/link": "^3.3.0",
63
63
  "@atlaskit/media-card": "^79.15.0",
64
- "@atlaskit/mention": "^24.5.0",
64
+ "@atlaskit/mention": "^24.6.0",
65
65
  "@atlaskit/platform-feature-flags": "^1.1.0",
66
66
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
67
67
  "@atlaskit/react-ufo": "^5.4.0",
68
68
  "@atlaskit/task-decision": "^19.3.0",
69
- "@atlaskit/tmp-editor-statsig": "^42.0.0",
69
+ "@atlaskit/tmp-editor-statsig": "^43.0.0",
70
70
  "@atlaskit/tokens": "^11.1.0",
71
71
  "@atlaskit/tooltip": "^21.0.0",
72
72
  "@atlaskit/width-detector": "^5.0.0",
@@ -313,6 +313,9 @@
313
313
  },
314
314
  "platform_editor_max_width_mode_resize_fix": {
315
315
  "type": "boolean"
316
+ },
317
+ "platform_editor_breakout_in_universal_preset": {
318
+ "type": "boolean"
316
319
  }
317
320
  },
318
321
  "stricter": {