@atlaskit/editor-core 210.1.5 → 210.1.6

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,13 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 210.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4bc05c9f87780`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4bc05c9f87780) -
8
+ [ux] Fix toolbar blink CLS regression
9
+ - Updated dependencies
10
+
3
11
  ## 210.1.5
4
12
 
5
13
  ### Patch Changes
@@ -118,10 +118,6 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
118
118
  var toolbarDocking = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(editorAPI, 'selectionToolbar.toolbarDocking', {
119
119
  disabled: (0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin')
120
120
  });
121
- var _ref3 = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(editorAPI, 'userPreferences.preferences', {
122
- disabled: !(0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin')
123
- }) || {},
124
- toolbarDockingPosition = _ref3.toolbarDockingPosition;
125
121
  if (!(0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin')) {
126
122
  if (!toolbarDocking) {
127
123
  var _editorAPI$selectionT, _editorAPI$selectionT2;
@@ -132,6 +128,21 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
132
128
  toolbarDocking = (_editorAPI$selectionT = editorAPI === null || editorAPI === void 0 || (_editorAPI$selectionT2 = editorAPI.selectionToolbar) === null || _editorAPI$selectionT2 === void 0 || (_editorAPI$selectionT2 = _editorAPI$selectionT2.sharedState.currentState()) === null || _editorAPI$selectionT2 === void 0 ? void 0 : _editorAPI$selectionT2.toolbarDocking) !== null && _editorAPI$selectionT !== void 0 ? _editorAPI$selectionT : defaultDocking;
133
129
  }
134
130
  }
131
+ var _ref3 = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(editorAPI, 'userPreferences.preferences', {
132
+ disabled: !(0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin')
133
+ }) || {},
134
+ toolbarDockingPosition = _ref3.toolbarDockingPosition;
135
+ if ((0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin')) {
136
+ if (!toolbarDockingPosition) {
137
+ var _editorAPI$userPrefer, _editorAPI$userPrefer2;
138
+ // This is a workaround for the rendering issue with the selection toolbar
139
+ // when using useSharedPluginStateWithSelector the state is not yet
140
+ // available when the editor is first loaded.
141
+ // This causes the toolbar to blink creating a layout shift.
142
+ var defaultDockingPosition = props.__livePage ? 'none' : 'top';
143
+ toolbarDockingPosition = (_editorAPI$userPrefer = editorAPI === null || editorAPI === void 0 || (_editorAPI$userPrefer2 = editorAPI.userPreferences) === null || _editorAPI$userPrefer2 === void 0 || (_editorAPI$userPrefer2 = _editorAPI$userPrefer2.actions.getUserPreferences()) === null || _editorAPI$userPrefer2 === void 0 ? void 0 : _editorAPI$userPrefer2.toolbarDockingPosition) !== null && _editorAPI$userPrefer !== void 0 ? _editorAPI$userPrefer : defaultDockingPosition;
144
+ }
145
+ }
135
146
  var primaryToolbarComponents = props.primaryToolbarComponents;
136
147
  if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
137
148
  primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
@@ -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 = "210.1.4";
8
+ var version = exports.version = "210.1.5";
@@ -86,7 +86,7 @@ const useFullPageEditorPluginsStates = sharedPluginStateHookMigratorFactory(plug
86
86
  };
87
87
  });
88
88
  export const FullPageEditor = props => {
89
- var _scrollContentContain, _scrollContentContain2, _scrollContentContain3, _wrapperElementRef$cu;
89
+ var _scrollContentContain, _toolbarDockingPositi, _scrollContentContain2, _scrollContentContain3, _wrapperElementRef$cu;
90
90
  const wrapperElementRef = useMemo(() => props.innerRef, [props.innerRef]);
91
91
  const scrollContentContainerRef = useRef(null);
92
92
  const showKeyline = useShowKeyline(scrollContentContainerRef);
@@ -102,11 +102,6 @@ export const FullPageEditor = props => {
102
102
  let toolbarDocking = useSharedPluginStateSelector(editorAPI, 'selectionToolbar.toolbarDocking', {
103
103
  disabled: fg('platform_editor_use_preferences_plugin')
104
104
  });
105
- const {
106
- toolbarDockingPosition
107
- } = useSharedPluginStateSelector(editorAPI, 'userPreferences.preferences', {
108
- disabled: !fg('platform_editor_use_preferences_plugin')
109
- }) || {};
110
105
  if (!fg('platform_editor_use_preferences_plugin')) {
111
106
  if (!toolbarDocking) {
112
107
  var _editorAPI$selectionT, _editorAPI$selectionT2, _editorAPI$selectionT3;
@@ -117,6 +112,22 @@ export const FullPageEditor = props => {
117
112
  toolbarDocking = (_editorAPI$selectionT = editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$selectionT2 = editorAPI.selectionToolbar) === null || _editorAPI$selectionT2 === void 0 ? void 0 : (_editorAPI$selectionT3 = _editorAPI$selectionT2.sharedState.currentState()) === null || _editorAPI$selectionT3 === void 0 ? void 0 : _editorAPI$selectionT3.toolbarDocking) !== null && _editorAPI$selectionT !== void 0 ? _editorAPI$selectionT : defaultDocking;
118
113
  }
119
114
  }
115
+ let {
116
+ toolbarDockingPosition
117
+ } = useSharedPluginStateSelector(editorAPI, 'userPreferences.preferences', {
118
+ disabled: !fg('platform_editor_use_preferences_plugin')
119
+ }) || {};
120
+ if (fg('platform_editor_use_preferences_plugin')) {
121
+ if (!toolbarDockingPosition) {
122
+ var _editorAPI$userPrefer, _editorAPI$userPrefer2, _editorAPI$userPrefer3;
123
+ // This is a workaround for the rendering issue with the selection toolbar
124
+ // when using useSharedPluginStateWithSelector the state is not yet
125
+ // available when the editor is first loaded.
126
+ // This causes the toolbar to blink creating a layout shift.
127
+ const defaultDockingPosition = props.__livePage ? 'none' : 'top';
128
+ toolbarDockingPosition = (_editorAPI$userPrefer = editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$userPrefer2 = editorAPI.userPreferences) === null || _editorAPI$userPrefer2 === void 0 ? void 0 : (_editorAPI$userPrefer3 = _editorAPI$userPrefer2.actions.getUserPreferences()) === null || _editorAPI$userPrefer3 === void 0 ? void 0 : _editorAPI$userPrefer3.toolbarDockingPosition) !== null && _editorAPI$userPrefer !== void 0 ? _editorAPI$userPrefer : defaultDockingPosition;
129
+ }
130
+ }
120
131
  let primaryToolbarComponents = props.primaryToolbarComponents;
121
132
  if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
122
133
  primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
@@ -162,7 +173,7 @@ export const FullPageEditor = props => {
162
173
  }, !isEditorToolbarHidden && (expValEquals('platform_editor_toolbar_aifc', 'isEnabled', true) ? jsx(IntlProvider, {
163
174
  locale: "en"
164
175
  }, jsx(FullPageToolbarNext, {
165
- toolbarDockingPosition: toolbarDockingPosition !== null && toolbarDockingPosition !== void 0 ? toolbarDockingPosition : toolbarDocking,
176
+ toolbarDockingPosition: (_toolbarDockingPositi = toolbarDockingPosition) !== null && _toolbarDockingPositi !== void 0 ? _toolbarDockingPositi : toolbarDocking,
166
177
  beforeIcon: props.primaryToolbarIconBefore,
167
178
  editorAPI: editorAPI,
168
179
  editorView: props.editorView,
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "210.1.4";
2
+ export const version = "210.1.5";
@@ -108,10 +108,6 @@ export var FullPageEditor = function FullPageEditor(props) {
108
108
  var toolbarDocking = useSharedPluginStateSelector(editorAPI, 'selectionToolbar.toolbarDocking', {
109
109
  disabled: fg('platform_editor_use_preferences_plugin')
110
110
  });
111
- var _ref3 = useSharedPluginStateSelector(editorAPI, 'userPreferences.preferences', {
112
- disabled: !fg('platform_editor_use_preferences_plugin')
113
- }) || {},
114
- toolbarDockingPosition = _ref3.toolbarDockingPosition;
115
111
  if (!fg('platform_editor_use_preferences_plugin')) {
116
112
  if (!toolbarDocking) {
117
113
  var _editorAPI$selectionT, _editorAPI$selectionT2;
@@ -122,6 +118,21 @@ export var FullPageEditor = function FullPageEditor(props) {
122
118
  toolbarDocking = (_editorAPI$selectionT = editorAPI === null || editorAPI === void 0 || (_editorAPI$selectionT2 = editorAPI.selectionToolbar) === null || _editorAPI$selectionT2 === void 0 || (_editorAPI$selectionT2 = _editorAPI$selectionT2.sharedState.currentState()) === null || _editorAPI$selectionT2 === void 0 ? void 0 : _editorAPI$selectionT2.toolbarDocking) !== null && _editorAPI$selectionT !== void 0 ? _editorAPI$selectionT : defaultDocking;
123
119
  }
124
120
  }
121
+ var _ref3 = useSharedPluginStateSelector(editorAPI, 'userPreferences.preferences', {
122
+ disabled: !fg('platform_editor_use_preferences_plugin')
123
+ }) || {},
124
+ toolbarDockingPosition = _ref3.toolbarDockingPosition;
125
+ if (fg('platform_editor_use_preferences_plugin')) {
126
+ if (!toolbarDockingPosition) {
127
+ var _editorAPI$userPrefer, _editorAPI$userPrefer2;
128
+ // This is a workaround for the rendering issue with the selection toolbar
129
+ // when using useSharedPluginStateWithSelector the state is not yet
130
+ // available when the editor is first loaded.
131
+ // This causes the toolbar to blink creating a layout shift.
132
+ var defaultDockingPosition = props.__livePage ? 'none' : 'top';
133
+ toolbarDockingPosition = (_editorAPI$userPrefer = editorAPI === null || editorAPI === void 0 || (_editorAPI$userPrefer2 = editorAPI.userPreferences) === null || _editorAPI$userPrefer2 === void 0 || (_editorAPI$userPrefer2 = _editorAPI$userPrefer2.actions.getUserPreferences()) === null || _editorAPI$userPrefer2 === void 0 ? void 0 : _editorAPI$userPrefer2.toolbarDockingPosition) !== null && _editorAPI$userPrefer !== void 0 ? _editorAPI$userPrefer : defaultDockingPosition;
134
+ }
135
+ }
125
136
  var primaryToolbarComponents = props.primaryToolbarComponents;
126
137
  if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
127
138
  primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "210.1.4";
2
+ export var version = "210.1.5";
@@ -554,6 +554,7 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
554
554
  pluginConfiguration: import("@atlaskit/editor-plugin-user-preferences").UserPreferencesPluginOptions;
555
555
  actions: {
556
556
  updateUserPreference: (key: import("packages/editor/editor-plugin-user-preferences/dist/types/userPreferencesPluginType").PrefKey, value: import("@atlaskit/editor-common/user-preferences").ResolvedUserPreferences[import("packages/editor/editor-plugin-user-preferences/dist/types/userPreferencesPluginType").PrefKey]) => import("@atlaskit/editor-common/types").EditorCommand;
557
+ getUserPreferences: () => import("@atlaskit/editor-common/user-preferences").ResolvedUserPreferences | undefined;
557
558
  };
558
559
  sharedState: import("@atlaskit/editor-plugin-user-preferences").UserPreferencesSharedState;
559
560
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/analytics").AnalyticsPlugin>];
@@ -612,6 +612,7 @@ export default function createUniversalPresetInternal({ appearance, props, featu
612
612
  pluginConfiguration: import("@atlaskit/editor-plugin-user-preferences").UserPreferencesPluginOptions;
613
613
  actions: {
614
614
  updateUserPreference: (key: import("packages/editor/editor-plugin-user-preferences/dist/types/userPreferencesPluginType").PrefKey, value: import("@atlaskit/editor-common/user-preferences").ResolvedUserPreferences[import("packages/editor/editor-plugin-user-preferences/dist/types/userPreferencesPluginType").PrefKey]) => import("@atlaskit/editor-common/types").EditorCommand;
615
+ getUserPreferences: () => import("@atlaskit/editor-common/user-preferences").ResolvedUserPreferences | undefined;
615
616
  };
616
617
  sharedState: import("@atlaskit/editor-plugin-user-preferences").UserPreferencesSharedState;
617
618
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/analytics").AnalyticsPlugin>];
@@ -554,6 +554,7 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
554
554
  pluginConfiguration: import("@atlaskit/editor-plugin-user-preferences").UserPreferencesPluginOptions;
555
555
  actions: {
556
556
  updateUserPreference: (key: import("packages/editor/editor-plugin-user-preferences/dist/types/userPreferencesPluginType").PrefKey, value: import("@atlaskit/editor-common/user-preferences").ResolvedUserPreferences[import("packages/editor/editor-plugin-user-preferences/dist/types/userPreferencesPluginType").PrefKey]) => import("@atlaskit/editor-common/types").EditorCommand;
557
+ getUserPreferences: () => import("@atlaskit/editor-common/user-preferences").ResolvedUserPreferences | undefined;
557
558
  };
558
559
  sharedState: import("@atlaskit/editor-plugin-user-preferences").UserPreferencesSharedState;
559
560
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/analytics").AnalyticsPlugin>];
@@ -788,6 +788,7 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
788
788
  pluginConfiguration: import("@atlaskit/editor-plugin-user-preferences").UserPreferencesPluginOptions;
789
789
  actions: {
790
790
  updateUserPreference: (key: import("packages/editor/editor-plugin-user-preferences/dist/types/userPreferencesPluginType").PrefKey, value: import("@atlaskit/editor-common/user-preferences").ResolvedUserPreferences[import("packages/editor/editor-plugin-user-preferences/dist/types/userPreferencesPluginType").PrefKey]) => import("@atlaskit/editor-common/types").EditorCommand;
791
+ getUserPreferences: () => import("@atlaskit/editor-common/user-preferences").ResolvedUserPreferences | undefined;
791
792
  };
792
793
  sharedState: import("@atlaskit/editor-plugin-user-preferences").UserPreferencesSharedState;
793
794
  dependencies: [
@@ -846,6 +846,7 @@ export default function createUniversalPresetInternal({ appearance, props, featu
846
846
  pluginConfiguration: import("@atlaskit/editor-plugin-user-preferences").UserPreferencesPluginOptions;
847
847
  actions: {
848
848
  updateUserPreference: (key: import("packages/editor/editor-plugin-user-preferences/dist/types/userPreferencesPluginType").PrefKey, value: import("@atlaskit/editor-common/user-preferences").ResolvedUserPreferences[import("packages/editor/editor-plugin-user-preferences/dist/types/userPreferencesPluginType").PrefKey]) => import("@atlaskit/editor-common/types").EditorCommand;
849
+ getUserPreferences: () => import("@atlaskit/editor-common/user-preferences").ResolvedUserPreferences | undefined;
849
850
  };
850
851
  sharedState: import("@atlaskit/editor-plugin-user-preferences").UserPreferencesSharedState;
851
852
  dependencies: [
@@ -788,6 +788,7 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
788
788
  pluginConfiguration: import("@atlaskit/editor-plugin-user-preferences").UserPreferencesPluginOptions;
789
789
  actions: {
790
790
  updateUserPreference: (key: import("packages/editor/editor-plugin-user-preferences/dist/types/userPreferencesPluginType").PrefKey, value: import("@atlaskit/editor-common/user-preferences").ResolvedUserPreferences[import("packages/editor/editor-plugin-user-preferences/dist/types/userPreferencesPluginType").PrefKey]) => import("@atlaskit/editor-common/types").EditorCommand;
791
+ getUserPreferences: () => import("@atlaskit/editor-common/user-preferences").ResolvedUserPreferences | undefined;
791
792
  };
792
793
  sharedState: import("@atlaskit/editor-plugin-user-preferences").UserPreferencesSharedState;
793
794
  dependencies: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "210.1.5",
3
+ "version": "210.1.6",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -110,7 +110,6 @@
110
110
  "@atlaskit/synchrony-test-helpers": "workspace:^",
111
111
  "@atlaskit/toggle": "^15.1.0",
112
112
  "@atlaskit/util-data-test": "^18.1.0",
113
- "@atlaskit/visual-regression": "workspace:^",
114
113
  "@atlassian/adf-schema-json": "^1.31.0",
115
114
  "@atlassian/feature-flags-test-utils": "^0.3.0",
116
115
  "@atlassian/search-provider": "^4.0.0",