@atlaskit/editor-core 214.1.1 → 214.1.3

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,21 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 214.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`6331abb3b4a0e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6331abb3b4a0e) -
8
+ ED-29470 Fix toolbar disabled state for offline mode
9
+ - Updated dependencies
10
+
11
+ ## 214.1.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [`a3254a75cdfb7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a3254a75cdfb7) -
16
+ [ED-29448] clean up experiment platform_editor_toolbar_aifc_patch_2
17
+ - Updated dependencies
18
+
3
19
  ## 214.1.1
4
20
 
5
21
  ### Patch Changes
@@ -19,6 +19,7 @@ var _messages = _interopRequireDefault(require("@atlaskit/editor-common/messages
19
19
  var _ui = require("@atlaskit/editor-common/ui");
20
20
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
21
21
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
22
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
22
23
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
23
24
  var _ClickAreaBlock = _interopRequireDefault(require("../../Addon/ClickAreaBlock"));
24
25
  var _contentComponentWrapper = require("../../Addon/ClickAreaBlock/contentComponentWrapper");
@@ -173,6 +174,7 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
173
174
  css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew]
174
175
  }, customPrimaryToolbarComponents);
175
176
  var isToolbarAIFCEnabled = Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar) && (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true);
177
+ var patch6Enabled = (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
176
178
  return (0, _react2.jsx)(_WithFlash.default, {
177
179
  animate: maxContentSizeReached
178
180
  }, (0, _react2.jsx)(_ui.WidthProvider, null, (0, _react2.jsx)("div", {
@@ -193,8 +195,9 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
193
195
  }, isToolbarAIFCEnabled ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_CommentToolbar.CommentToolbar, {
194
196
  editorAPI: editorAPI,
195
197
  editorView: editorView,
196
- editorAppearance: appearance
197
- }), (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc_patch_2', true) ? customPrimaryToolbarComponents ? customToolbarSlot : null : customToolbarSlot) : (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
198
+ editorAppearance: appearance,
199
+ disabled: patch6Enabled ? !!disabled : undefined
200
+ }), customPrimaryToolbarComponents ? customToolbarSlot : null) : (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
198
201
  editorView: editorView,
199
202
  childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
200
203
  isShortcutToFocusToolbar: isShortcutToFocusToolbar,
@@ -16,7 +16,8 @@ var CommentToolbar = exports.CommentToolbar = function CommentToolbar(_ref) {
16
16
  var _editorAPI$toolbar;
17
17
  var editorAPI = _ref.editorAPI,
18
18
  editorView = _ref.editorView,
19
- editorAppearance = _ref.editorAppearance;
19
+ editorAppearance = _ref.editorAppearance,
20
+ disabled = _ref.disabled;
20
21
  var components = editorAPI === null || editorAPI === void 0 || (_editorAPI$toolbar = editorAPI.toolbar) === null || _editorAPI$toolbar === void 0 ? void 0 : _editorAPI$toolbar.actions.getComponents();
21
22
  var toolbar = components === null || components === void 0 ? void 0 : components.find(function (component) {
22
23
  return component.key === _toolbar.TOOLBARS.PRIMARY_TOOLBAR;
@@ -29,6 +30,7 @@ var CommentToolbar = exports.CommentToolbar = function CommentToolbar(_ref) {
29
30
  components: components,
30
31
  editorView: editorView,
31
32
  editorAPI: editorAPI,
32
- editorAppearance: editorAppearance
33
+ editorAppearance: editorAppearance,
34
+ isDisabled: disabled
33
35
  });
34
36
  };
@@ -78,7 +78,9 @@ var ToolbarNext = exports.ToolbarNext = function ToolbarNext(_ref) {
78
78
  connectivityStateMode = _usePluginState.connectivityStateMode,
79
79
  editorViewMode = _usePluginState.editorViewMode,
80
80
  editorToolbarDockingPreference = _usePluginState.editorToolbarDockingPreference;
81
+ // remove offline check when patch6Enabled is cleaned up
81
82
  var isOffline = connectivityStateMode === 'offline';
83
+ var patch6Enabled = (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
82
84
  return /*#__PURE__*/_react.default.createElement(_toolbar.EditorToolbarProvider, {
83
85
  editorView: editorView !== null && editorView !== void 0 ? editorView : null,
84
86
  editorAppearance: editorAppearance,
@@ -86,7 +88,7 @@ var ToolbarNext = exports.ToolbarNext = function ToolbarNext(_ref) {
86
88
  editorToolbarDockingPreference: editorToolbarDockingPreference
87
89
  }, /*#__PURE__*/_react.default.createElement(_toolbar.EditorToolbarUIProvider, {
88
90
  api: editorAPI,
89
- isDisabled: isOffline || isDisabled,
91
+ isDisabled: patch6Enabled ? isDisabled : isOffline || isDisabled,
90
92
  popupsMountPoint: popupsMountPoint,
91
93
  popupsBoundariesElement: popupsBoundariesElement,
92
94
  popupsScrollableElement: popupsScrollableElement
@@ -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 = "214.1.0";
8
+ var version = exports.version = "214.1.2";
@@ -15,6 +15,7 @@ import messages from '@atlaskit/editor-common/messages';
15
15
  import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/ui';
16
16
  import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
17
17
  import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
18
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
18
19
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
19
20
  // Ignored via go/ees005
20
21
  // eslint-disable-next-line import/no-named-as-default
@@ -161,6 +162,7 @@ export const CommentEditorWithIntl = props => {
161
162
  css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew]
162
163
  }, customPrimaryToolbarComponents);
163
164
  const isToolbarAIFCEnabled = Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar) && editorExperiment('platform_editor_toolbar_aifc', true);
165
+ const patch6Enabled = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
164
166
  return jsx(WithFlash, {
165
167
  animate: maxContentSizeReached
166
168
  }, jsx(WidthProvider, null, jsx("div", {
@@ -181,8 +183,9 @@ export const CommentEditorWithIntl = props => {
181
183
  }, isToolbarAIFCEnabled ? jsx(React.Fragment, null, jsx(CommentToolbar, {
182
184
  editorAPI: editorAPI,
183
185
  editorView: editorView,
184
- editorAppearance: appearance
185
- }), editorExperiment('platform_editor_toolbar_aifc_patch_2', true) ? customPrimaryToolbarComponents ? customToolbarSlot : null : customToolbarSlot) : jsx(ToolbarArrowKeyNavigationProvider, {
186
+ editorAppearance: appearance,
187
+ disabled: patch6Enabled ? !!disabled : undefined
188
+ }), customPrimaryToolbarComponents ? customToolbarSlot : null) : jsx(ToolbarArrowKeyNavigationProvider, {
186
189
  editorView: editorView,
187
190
  childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
188
191
  isShortcutToFocusToolbar: isShortcutToFocusToolbar,
@@ -8,7 +8,8 @@ import { ToolbarNext } from '../../Toolbar/Toolbar';
8
8
  export const CommentToolbar = ({
9
9
  editorAPI,
10
10
  editorView,
11
- editorAppearance
11
+ editorAppearance,
12
+ disabled
12
13
  }) => {
13
14
  var _editorAPI$toolbar;
14
15
  const components = editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$toolbar = editorAPI.toolbar) === null || _editorAPI$toolbar === void 0 ? void 0 : _editorAPI$toolbar.actions.getComponents();
@@ -21,6 +22,7 @@ export const CommentToolbar = ({
21
22
  components: components,
22
23
  editorView: editorView,
23
24
  editorAPI: editorAPI,
24
- editorAppearance: editorAppearance
25
+ editorAppearance: editorAppearance,
26
+ isDisabled: disabled
25
27
  });
26
28
  };
@@ -72,7 +72,9 @@ export const ToolbarNext = ({
72
72
  editorViewMode,
73
73
  editorToolbarDockingPreference
74
74
  } = usePluginState(editorAPI);
75
+ // remove offline check when patch6Enabled is cleaned up
75
76
  const isOffline = connectivityStateMode === 'offline';
77
+ const patch6Enabled = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
76
78
  return /*#__PURE__*/React.createElement(EditorToolbarProvider, {
77
79
  editorView: editorView !== null && editorView !== void 0 ? editorView : null,
78
80
  editorAppearance: editorAppearance,
@@ -80,7 +82,7 @@ export const ToolbarNext = ({
80
82
  editorToolbarDockingPreference: editorToolbarDockingPreference
81
83
  }, /*#__PURE__*/React.createElement(EditorToolbarUIProvider, {
82
84
  api: editorAPI,
83
- isDisabled: isOffline || isDisabled,
85
+ isDisabled: patch6Enabled ? isDisabled : isOffline || isDisabled,
84
86
  popupsMountPoint: popupsMountPoint,
85
87
  popupsBoundariesElement: popupsBoundariesElement,
86
88
  popupsScrollableElement: popupsScrollableElement
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "214.1.0";
2
+ export const version = "214.1.2";
@@ -17,6 +17,7 @@ import messages from '@atlaskit/editor-common/messages';
17
17
  import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/ui';
18
18
  import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
19
19
  import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
20
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
20
21
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
21
22
  // Ignored via go/ees005
22
23
  // eslint-disable-next-line import/no-named-as-default
@@ -162,6 +163,7 @@ export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
162
163
  css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew]
163
164
  }, customPrimaryToolbarComponents);
164
165
  var isToolbarAIFCEnabled = Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar) && editorExperiment('platform_editor_toolbar_aifc', true);
166
+ var patch6Enabled = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
165
167
  return jsx(WithFlash, {
166
168
  animate: maxContentSizeReached
167
169
  }, jsx(WidthProvider, null, jsx("div", {
@@ -182,8 +184,9 @@ export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
182
184
  }, isToolbarAIFCEnabled ? jsx(React.Fragment, null, jsx(CommentToolbar, {
183
185
  editorAPI: editorAPI,
184
186
  editorView: editorView,
185
- editorAppearance: appearance
186
- }), editorExperiment('platform_editor_toolbar_aifc_patch_2', true) ? customPrimaryToolbarComponents ? customToolbarSlot : null : customToolbarSlot) : jsx(ToolbarArrowKeyNavigationProvider, {
187
+ editorAppearance: appearance,
188
+ disabled: patch6Enabled ? !!disabled : undefined
189
+ }), customPrimaryToolbarComponents ? customToolbarSlot : null) : jsx(ToolbarArrowKeyNavigationProvider, {
187
190
  editorView: editorView,
188
191
  childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
189
192
  isShortcutToFocusToolbar: isShortcutToFocusToolbar,
@@ -9,7 +9,8 @@ export var CommentToolbar = function CommentToolbar(_ref) {
9
9
  var _editorAPI$toolbar;
10
10
  var editorAPI = _ref.editorAPI,
11
11
  editorView = _ref.editorView,
12
- editorAppearance = _ref.editorAppearance;
12
+ editorAppearance = _ref.editorAppearance,
13
+ disabled = _ref.disabled;
13
14
  var components = editorAPI === null || editorAPI === void 0 || (_editorAPI$toolbar = editorAPI.toolbar) === null || _editorAPI$toolbar === void 0 ? void 0 : _editorAPI$toolbar.actions.getComponents();
14
15
  var toolbar = components === null || components === void 0 ? void 0 : components.find(function (component) {
15
16
  return component.key === TOOLBARS.PRIMARY_TOOLBAR;
@@ -22,6 +23,7 @@ export var CommentToolbar = function CommentToolbar(_ref) {
22
23
  components: components,
23
24
  editorView: editorView,
24
25
  editorAPI: editorAPI,
25
- editorAppearance: editorAppearance
26
+ editorAppearance: editorAppearance,
27
+ isDisabled: disabled
26
28
  });
27
29
  };
@@ -72,7 +72,9 @@ export var ToolbarNext = function ToolbarNext(_ref) {
72
72
  connectivityStateMode = _usePluginState.connectivityStateMode,
73
73
  editorViewMode = _usePluginState.editorViewMode,
74
74
  editorToolbarDockingPreference = _usePluginState.editorToolbarDockingPreference;
75
+ // remove offline check when patch6Enabled is cleaned up
75
76
  var isOffline = connectivityStateMode === 'offline';
77
+ var patch6Enabled = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
76
78
  return /*#__PURE__*/React.createElement(EditorToolbarProvider, {
77
79
  editorView: editorView !== null && editorView !== void 0 ? editorView : null,
78
80
  editorAppearance: editorAppearance,
@@ -80,7 +82,7 @@ export var ToolbarNext = function ToolbarNext(_ref) {
80
82
  editorToolbarDockingPreference: editorToolbarDockingPreference
81
83
  }, /*#__PURE__*/React.createElement(EditorToolbarUIProvider, {
82
84
  api: editorAPI,
83
- isDisabled: isOffline || isDisabled,
85
+ isDisabled: patch6Enabled ? isDisabled : isOffline || isDisabled,
84
86
  popupsMountPoint: popupsMountPoint,
85
87
  popupsBoundariesElement: popupsBoundariesElement,
86
88
  popupsScrollableElement: popupsScrollableElement
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "214.1.0";
2
+ export var version = "214.1.2";
@@ -4,6 +4,7 @@ import type { ToolbarPlugin } from '@atlaskit/editor-plugins/toolbar';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  type ToolbarEditorPlugins = [OptionalPlugin<ToolbarPlugin>];
6
6
  type CommentToolbarProps = {
7
+ disabled?: boolean;
7
8
  editorAPI?: PublicPluginAPI<ToolbarEditorPlugins>;
8
9
  editorAppearance: EditorAppearance;
9
10
  editorView?: EditorView;
@@ -11,5 +12,5 @@ type CommentToolbarProps = {
11
12
  /**
12
13
  * Primary toolbar driven by components registered by `editor-plugin-toolbar`, introduced in `platform_editor_toolbar_aifc`.
13
14
  */
14
- export declare const CommentToolbar: ({ editorAPI, editorView, editorAppearance, }: CommentToolbarProps) => React.JSX.Element | null;
15
+ export declare const CommentToolbar: ({ editorAPI, editorView, editorAppearance, disabled, }: CommentToolbarProps) => React.JSX.Element | null;
15
16
  export {};
@@ -6,6 +6,7 @@ type ToolbarEditorPlugins = [
6
6
  OptionalPlugin<ToolbarPlugin>
7
7
  ];
8
8
  type CommentToolbarProps = {
9
+ disabled?: boolean;
9
10
  editorAPI?: PublicPluginAPI<ToolbarEditorPlugins>;
10
11
  editorAppearance: EditorAppearance;
11
12
  editorView?: EditorView;
@@ -13,5 +14,5 @@ type CommentToolbarProps = {
13
14
  /**
14
15
  * Primary toolbar driven by components registered by `editor-plugin-toolbar`, introduced in `platform_editor_toolbar_aifc`.
15
16
  */
16
- export declare const CommentToolbar: ({ editorAPI, editorView, editorAppearance, }: CommentToolbarProps) => React.JSX.Element | null;
17
+ export declare const CommentToolbar: ({ editorAPI, editorView, editorAppearance, disabled, }: CommentToolbarProps) => React.JSX.Element | null;
17
18
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "214.1.1",
3
+ "version": "214.1.3",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -53,10 +53,10 @@
53
53
  "@atlaskit/editor-plugins": "^10.6.0",
54
54
  "@atlaskit/editor-prosemirror": "7.0.0",
55
55
  "@atlaskit/editor-shared-styles": "^3.6.0",
56
- "@atlaskit/editor-toolbar": "^0.12.0",
56
+ "@atlaskit/editor-toolbar": "^0.13.0",
57
57
  "@atlaskit/editor-toolbar-model": "^0.2.0",
58
58
  "@atlaskit/emoji": "^69.5.0",
59
- "@atlaskit/icon": "^28.3.0",
59
+ "@atlaskit/icon": "^28.4.0",
60
60
  "@atlaskit/link": "^3.2.0",
61
61
  "@atlaskit/media-card": "^79.5.0",
62
62
  "@atlaskit/mention": "^24.2.0",
@@ -64,7 +64,7 @@
64
64
  "@atlaskit/platform-feature-flags-react": "^0.3.0",
65
65
  "@atlaskit/react-ufo": "^4.11.0",
66
66
  "@atlaskit/task-decision": "^19.2.0",
67
- "@atlaskit/tmp-editor-statsig": "^13.1.0",
67
+ "@atlaskit/tmp-editor-statsig": "^13.2.0",
68
68
  "@atlaskit/tokens": "^6.4.0",
69
69
  "@atlaskit/tooltip": "^20.5.0",
70
70
  "@atlaskit/width-detector": "^5.0.0",