@atlaskit/editor-core 228.1.12 → 228.1.13
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 +11 -0
- package/dist/cjs/create-editor/ReactEditorView.js +1 -1
- package/dist/cjs/presets/default.js +2 -5
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +15 -42
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +1 -1
- package/dist/es2019/presets/default.js +2 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +16 -43
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +1 -1
- package/dist/esm/presets/default.js +2 -5
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +15 -42
- package/dist/esm/version-wrapper.js +1 -1
- package/package.json +7 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 228.1.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0920715a6b9fc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0920715a6b9fc) -
|
|
8
|
+
Clean up feature gate `platform_editor_use_preferences_plugin`
|
|
9
|
+
- [`df3b4a62decdd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/df3b4a62decdd) -
|
|
10
|
+
Replace the `fix_editor_blur_issue` feature gate with the `fix_editor_blur_issue_exp` experiment
|
|
11
|
+
for blur selection clearing, including updated experiment-based unit test coverage.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 228.1.12
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -307,7 +307,7 @@ function ReactEditorView(props) {
|
|
|
307
307
|
// @ts-expect-error
|
|
308
308
|
var sel = viewRef.current.root.getSelection();
|
|
309
309
|
if (sel) {
|
|
310
|
-
if (!(0,
|
|
310
|
+
if (!(0, _isExperimentEnabled.isExperimentEnabled)('fix_editor_blur_issue_exp')) {
|
|
311
311
|
sel.removeAllRanges();
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
@@ -44,7 +44,6 @@ var _unsupportedContent = require("@atlaskit/editor-plugins/unsupported-content"
|
|
|
44
44
|
var _userIntent = require("@atlaskit/editor-plugins/user-intent");
|
|
45
45
|
var _width = require("@atlaskit/editor-plugins/width");
|
|
46
46
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
47
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
48
47
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
49
48
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
50
49
|
var _isFullPage = require("../utils/is-full-page");
|
|
@@ -66,13 +65,11 @@ function createDefaultPreset(options) {
|
|
|
66
65
|
performanceTracking: options.performanceTracking
|
|
67
66
|
}], Boolean(options.allowAnalyticsGASV3)).add(_betterTypeHistory.betterTypeHistoryPlugin).add([_paste.pastePlugin, _objectSpread(_objectSpread({}, options === null || options === void 0 ? void 0 : options.paste), {}, {
|
|
68
67
|
isFullPage: isFullPage
|
|
69
|
-
})]).add(_clipboard.clipboardPlugin).add(_focus.focusPlugin).
|
|
68
|
+
})]).add(_clipboard.clipboardPlugin).add(_focus.focusPlugin).add([_editorPluginUserPreferences.userPreferencesPlugin, {
|
|
70
69
|
initialUserPreferences: {
|
|
71
70
|
toolbarDockingPosition: isFullPage ? 'none' : 'top'
|
|
72
71
|
}
|
|
73
|
-
}],
|
|
74
|
-
return (0, _fg.fg)('platform_editor_use_preferences_plugin');
|
|
75
|
-
}).maybeAdd(_interaction.interactionPlugin, Boolean(options === null || options === void 0 ? void 0 : options.__livePage) || (0, _expValEquals.expValEquals)('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)).add(_composition.compositionPlugin).add([_contextIdentifier.contextIdentifierPlugin, {
|
|
72
|
+
}]).maybeAdd(_interaction.interactionPlugin, Boolean(options === null || options === void 0 ? void 0 : options.__livePage) || (0, _expValEquals.expValEquals)('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)).add(_composition.compositionPlugin).add([_contextIdentifier.contextIdentifierPlugin, {
|
|
76
73
|
contextIdentifierProvider: options.contextIdentifierProvider
|
|
77
74
|
}]).add([_base.basePlugin, options.base]).add(_decorations.decorationsPlugin).add([_typeAhead.typeAheadPlugin, options.typeAhead]).maybeAdd(_history.historyPlugin, Boolean(options.allowUndoRedoButtons)).add(_userIntent.userIntentPlugin).maybeAdd([_toolbar.toolbarPlugin, options.toolbar || {}], Boolean((_options$toolbar = options.toolbar) === null || _options$toolbar === void 0 ? void 0 : _options$toolbar.enableNewToolbarExperience)).add([_primaryToolbar.primaryToolbarPlugin, {
|
|
78
75
|
contextualFormattingEnabled: isFullPage
|
|
@@ -15,7 +15,6 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
15
15
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
16
16
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
17
17
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
18
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
19
18
|
var _componentWithCondition = require("@atlaskit/platform-feature-flags-react/component-with-condition");
|
|
20
19
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
21
20
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
@@ -96,33 +95,16 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
|
|
|
96
95
|
var interactionState = state.interactionState;
|
|
97
96
|
var primaryToolbarState = (0, _getPrimaryToolbarComponents.getPrimaryToolbarComponents)(editorAPI, state.primaryToolbarComponents);
|
|
98
97
|
var hasHadInteraction = interactionState !== 'hasNotHadInteraction';
|
|
99
|
-
var
|
|
100
|
-
disabled: (0, _fg.fg)('platform_editor_use_preferences_plugin')
|
|
101
|
-
});
|
|
102
|
-
if (!(0, _fg.fg)('platform_editor_use_preferences_plugin')) {
|
|
103
|
-
if (!toolbarDocking) {
|
|
104
|
-
var _editorAPI$selectionT, _editorAPI$selectionT2;
|
|
105
|
-
// This is a workaround for the rendering issue with the selection toolbar
|
|
106
|
-
// where using useSharedPluginStateSelector or useSharedPluginState the state are not
|
|
107
|
-
// available when the editor is first loaded. and cause the toolbar to blink.
|
|
108
|
-
var defaultDocking = props.__livePage ? 'none' : 'top';
|
|
109
|
-
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;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
var _ref3 = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(editorAPI, 'userPreferences.preferences', {
|
|
113
|
-
disabled: !(0, _fg.fg)('platform_editor_use_preferences_plugin')
|
|
114
|
-
}) || {},
|
|
98
|
+
var _ref3 = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(editorAPI, 'userPreferences.preferences') || {},
|
|
115
99
|
toolbarDockingPosition = _ref3.toolbarDockingPosition;
|
|
116
|
-
if (
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
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;
|
|
125
|
-
}
|
|
100
|
+
if (!toolbarDockingPosition) {
|
|
101
|
+
var _editorAPI$userPrefer, _editorAPI$userPrefer2;
|
|
102
|
+
// This is a workaround for the rendering issue with the selection toolbar
|
|
103
|
+
// when using useSharedPluginStateWithSelector the state is not yet
|
|
104
|
+
// available when the editor is first loaded.
|
|
105
|
+
// This causes the toolbar to blink creating a layout shift.
|
|
106
|
+
var defaultDockingPosition = props.__livePage ? 'none' : 'top';
|
|
107
|
+
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;
|
|
126
108
|
}
|
|
127
109
|
var primaryToolbarComponents = props.primaryToolbarComponents;
|
|
128
110
|
if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
|
|
@@ -133,20 +115,11 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
|
|
|
133
115
|
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1', {
|
|
134
116
|
exposure: true
|
|
135
117
|
})) {
|
|
136
|
-
if
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
isEditorToolbarHidden = true;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
} else {
|
|
145
|
-
if (toolbarDocking === 'none' && !forcePrimaryToolbarPinned) {
|
|
146
|
-
primaryToolbarComponents = [];
|
|
147
|
-
if (!hasCustomComponents(customPrimaryToolbarComponents)) {
|
|
148
|
-
isEditorToolbarHidden = true;
|
|
149
|
-
}
|
|
118
|
+
// need to check if the toolbarDockingPosition is set to 'none' or 'top'
|
|
119
|
+
if (toolbarDockingPosition === 'none' && !forcePrimaryToolbarPinned) {
|
|
120
|
+
primaryToolbarComponents = [];
|
|
121
|
+
if (!hasCustomComponents(customPrimaryToolbarComponents)) {
|
|
122
|
+
isEditorToolbarHidden = true;
|
|
150
123
|
}
|
|
151
124
|
}
|
|
152
125
|
}
|
|
@@ -173,7 +146,7 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
|
|
|
173
146
|
}, !isEditorToolbarHidden && (isToolbarAIFCEnabled ? /*#__PURE__*/_react.default.createElement(_FullPageToolbarNext.FullPageToolbarNext, {
|
|
174
147
|
disabled: (0, _expValEquals.expValEquals)('platform_editor_ssr_toolbar_optimistic', 'isEnabled', true) ? !hasHadInteraction ? false : !!props.disabled : !!props.disabled || !hasHadInteraction && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_default_toolbar_state'),
|
|
175
148
|
disabledWithoutInteractionLogic: !!props.disabled,
|
|
176
|
-
toolbarDockingPosition: toolbarDockingPosition
|
|
149
|
+
toolbarDockingPosition: toolbarDockingPosition,
|
|
177
150
|
beforeIcon: props.primaryToolbarIconBefore,
|
|
178
151
|
editorAPI: editorAPI,
|
|
179
152
|
editorView: props.editorView,
|
|
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.name = void 0;
|
|
7
7
|
var name = exports.name = "@atlaskit/editor-core";
|
|
8
8
|
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
9
|
-
var version = exports.version = "228.1.
|
|
9
|
+
var version = exports.version = "228.1.12";
|
|
@@ -269,7 +269,7 @@ export function ReactEditorView(props) {
|
|
|
269
269
|
// @ts-expect-error
|
|
270
270
|
const sel = viewRef.current.root.getSelection();
|
|
271
271
|
if (sel) {
|
|
272
|
-
if (!
|
|
272
|
+
if (!isExperimentEnabled('fix_editor_blur_issue_exp')) {
|
|
273
273
|
sel.removeAllRanges();
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
@@ -37,7 +37,6 @@ import { unsupportedContentPlugin } from '@atlaskit/editor-plugins/unsupported-c
|
|
|
37
37
|
import { userIntentPlugin } from '@atlaskit/editor-plugins/user-intent';
|
|
38
38
|
import { widthPlugin } from '@atlaskit/editor-plugins/width';
|
|
39
39
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
40
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
41
40
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
42
41
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
43
42
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
@@ -59,11 +58,11 @@ export function createDefaultPreset(options) {
|
|
|
59
58
|
}], Boolean(options.allowAnalyticsGASV3)).add(betterTypeHistoryPlugin).add([pastePlugin, {
|
|
60
59
|
...(options === null || options === void 0 ? void 0 : options.paste),
|
|
61
60
|
isFullPage
|
|
62
|
-
}]).add(clipboardPlugin).add(focusPlugin).
|
|
61
|
+
}]).add(clipboardPlugin).add(focusPlugin).add([userPreferencesPlugin, {
|
|
63
62
|
initialUserPreferences: {
|
|
64
63
|
toolbarDockingPosition: isFullPage ? 'none' : 'top'
|
|
65
64
|
}
|
|
66
|
-
}]
|
|
65
|
+
}]).maybeAdd(interactionPlugin, Boolean(options === null || options === void 0 ? void 0 : options.__livePage) || expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)).add(compositionPlugin).add([contextIdentifierPlugin, {
|
|
67
66
|
contextIdentifierProvider: options.contextIdentifierProvider
|
|
68
67
|
}]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead]).maybeAdd(historyPlugin, Boolean(options.allowUndoRedoButtons)).add(userIntentPlugin).maybeAdd([toolbarPlugin, options.toolbar || {}], Boolean((_options$toolbar = options.toolbar) === null || _options$toolbar === void 0 ? void 0 : _options$toolbar.enableNewToolbarExperience)).add([primaryToolbarPlugin, {
|
|
69
68
|
contextualFormattingEnabled: isFullPage
|
|
@@ -6,7 +6,6 @@ import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
|
|
|
6
6
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
7
7
|
import { FULL_PAGE_EDITOR_TOOLBAR_HEIGHT } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
9
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react/component-with-condition';
|
|
11
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
12
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
@@ -53,7 +52,7 @@ const hasCustomComponents = components => {
|
|
|
53
52
|
return true;
|
|
54
53
|
};
|
|
55
54
|
export const FullPageEditor = props => {
|
|
56
|
-
var _scrollContentContain,
|
|
55
|
+
var _scrollContentContain, _scrollContentContain2, _scrollContentContain3, _wrapperElementRef$cu;
|
|
57
56
|
// Should be always the first statement in the component
|
|
58
57
|
const firstRenderStartTimestampRef = useRef(performance.now());
|
|
59
58
|
const wrapperElementRef = useMemo(() => props.innerRef, [props.innerRef]);
|
|
@@ -77,34 +76,17 @@ export const FullPageEditor = props => {
|
|
|
77
76
|
const interactionState = state.interactionState;
|
|
78
77
|
const primaryToolbarState = getPrimaryToolbarComponents(editorAPI, state.primaryToolbarComponents);
|
|
79
78
|
const hasHadInteraction = interactionState !== 'hasNotHadInteraction';
|
|
80
|
-
let toolbarDocking = useSharedPluginStateSelector(editorAPI, 'selectionToolbar.toolbarDocking', {
|
|
81
|
-
disabled: fg('platform_editor_use_preferences_plugin')
|
|
82
|
-
});
|
|
83
|
-
if (!fg('platform_editor_use_preferences_plugin')) {
|
|
84
|
-
if (!toolbarDocking) {
|
|
85
|
-
var _editorAPI$selectionT, _editorAPI$selectionT2, _editorAPI$selectionT3;
|
|
86
|
-
// This is a workaround for the rendering issue with the selection toolbar
|
|
87
|
-
// where using useSharedPluginStateSelector or useSharedPluginState the state are not
|
|
88
|
-
// available when the editor is first loaded. and cause the toolbar to blink.
|
|
89
|
-
const defaultDocking = props.__livePage ? 'none' : 'top';
|
|
90
|
-
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;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
79
|
let {
|
|
94
80
|
toolbarDockingPosition
|
|
95
|
-
} = useSharedPluginStateSelector(editorAPI, 'userPreferences.preferences'
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
// This causes the toolbar to blink creating a layout shift.
|
|
105
|
-
const defaultDockingPosition = props.__livePage ? 'none' : 'top';
|
|
106
|
-
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;
|
|
107
|
-
}
|
|
81
|
+
} = useSharedPluginStateSelector(editorAPI, 'userPreferences.preferences') || {};
|
|
82
|
+
if (!toolbarDockingPosition) {
|
|
83
|
+
var _editorAPI$userPrefer, _editorAPI$userPrefer2, _editorAPI$userPrefer3;
|
|
84
|
+
// This is a workaround for the rendering issue with the selection toolbar
|
|
85
|
+
// when using useSharedPluginStateWithSelector the state is not yet
|
|
86
|
+
// available when the editor is first loaded.
|
|
87
|
+
// This causes the toolbar to blink creating a layout shift.
|
|
88
|
+
const defaultDockingPosition = props.__livePage ? 'none' : 'top';
|
|
89
|
+
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;
|
|
108
90
|
}
|
|
109
91
|
let primaryToolbarComponents = props.primaryToolbarComponents;
|
|
110
92
|
if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
|
|
@@ -117,20 +99,11 @@ export const FullPageEditor = props => {
|
|
|
117
99
|
if (editorExperiment('platform_editor_controls', 'variant1', {
|
|
118
100
|
exposure: true
|
|
119
101
|
})) {
|
|
120
|
-
if
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
isEditorToolbarHidden = true;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
} else {
|
|
129
|
-
if (toolbarDocking === 'none' && !forcePrimaryToolbarPinned) {
|
|
130
|
-
primaryToolbarComponents = [];
|
|
131
|
-
if (!hasCustomComponents(customPrimaryToolbarComponents)) {
|
|
132
|
-
isEditorToolbarHidden = true;
|
|
133
|
-
}
|
|
102
|
+
// need to check if the toolbarDockingPosition is set to 'none' or 'top'
|
|
103
|
+
if (toolbarDockingPosition === 'none' && !forcePrimaryToolbarPinned) {
|
|
104
|
+
primaryToolbarComponents = [];
|
|
105
|
+
if (!hasCustomComponents(customPrimaryToolbarComponents)) {
|
|
106
|
+
isEditorToolbarHidden = true;
|
|
134
107
|
}
|
|
135
108
|
}
|
|
136
109
|
}
|
|
@@ -157,7 +130,7 @@ export const FullPageEditor = props => {
|
|
|
157
130
|
}, !isEditorToolbarHidden && (isToolbarAIFCEnabled ? /*#__PURE__*/React.createElement(FullPageToolbarNext, {
|
|
158
131
|
disabled: expValEquals('platform_editor_ssr_toolbar_optimistic', 'isEnabled', true) ? !hasHadInteraction ? false : !!props.disabled : !!props.disabled || !hasHadInteraction && isExperimentEnabled('platform_editor_default_toolbar_state'),
|
|
159
132
|
disabledWithoutInteractionLogic: !!props.disabled,
|
|
160
|
-
toolbarDockingPosition:
|
|
133
|
+
toolbarDockingPosition: toolbarDockingPosition,
|
|
161
134
|
beforeIcon: props.primaryToolbarIconBefore,
|
|
162
135
|
editorAPI: editorAPI,
|
|
163
136
|
editorView: props.editorView,
|
|
@@ -298,7 +298,7 @@ export function ReactEditorView(props) {
|
|
|
298
298
|
// @ts-expect-error
|
|
299
299
|
var sel = viewRef.current.root.getSelection();
|
|
300
300
|
if (sel) {
|
|
301
|
-
if (!
|
|
301
|
+
if (!isExperimentEnabled('fix_editor_blur_issue_exp')) {
|
|
302
302
|
sel.removeAllRanges();
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
@@ -40,7 +40,6 @@ import { unsupportedContentPlugin } from '@atlaskit/editor-plugins/unsupported-c
|
|
|
40
40
|
import { userIntentPlugin } from '@atlaskit/editor-plugins/user-intent';
|
|
41
41
|
import { widthPlugin } from '@atlaskit/editor-plugins/width';
|
|
42
42
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
43
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
44
43
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
45
44
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
46
45
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
@@ -61,13 +60,11 @@ export function createDefaultPreset(options) {
|
|
|
61
60
|
performanceTracking: options.performanceTracking
|
|
62
61
|
}], Boolean(options.allowAnalyticsGASV3)).add(betterTypeHistoryPlugin).add([pastePlugin, _objectSpread(_objectSpread({}, options === null || options === void 0 ? void 0 : options.paste), {}, {
|
|
63
62
|
isFullPage: isFullPage
|
|
64
|
-
})]).add(clipboardPlugin).add(focusPlugin).
|
|
63
|
+
})]).add(clipboardPlugin).add(focusPlugin).add([userPreferencesPlugin, {
|
|
65
64
|
initialUserPreferences: {
|
|
66
65
|
toolbarDockingPosition: isFullPage ? 'none' : 'top'
|
|
67
66
|
}
|
|
68
|
-
}],
|
|
69
|
-
return fg('platform_editor_use_preferences_plugin');
|
|
70
|
-
}).maybeAdd(interactionPlugin, Boolean(options === null || options === void 0 ? void 0 : options.__livePage) || expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)).add(compositionPlugin).add([contextIdentifierPlugin, {
|
|
67
|
+
}]).maybeAdd(interactionPlugin, Boolean(options === null || options === void 0 ? void 0 : options.__livePage) || expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)).add(compositionPlugin).add([contextIdentifierPlugin, {
|
|
71
68
|
contextIdentifierProvider: options.contextIdentifierProvider
|
|
72
69
|
}]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead]).maybeAdd(historyPlugin, Boolean(options.allowUndoRedoButtons)).add(userIntentPlugin).maybeAdd([toolbarPlugin, options.toolbar || {}], Boolean((_options$toolbar = options.toolbar) === null || _options$toolbar === void 0 ? void 0 : _options$toolbar.enableNewToolbarExperience)).add([primaryToolbarPlugin, {
|
|
73
70
|
contextualFormattingEnabled: isFullPage
|
|
@@ -7,7 +7,6 @@ import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
|
|
|
7
7
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
8
8
|
import { FULL_PAGE_EDITOR_TOOLBAR_HEIGHT } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
11
10
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react/component-with-condition';
|
|
12
11
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
12
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
@@ -87,33 +86,16 @@ export var FullPageEditor = function FullPageEditor(props) {
|
|
|
87
86
|
var interactionState = state.interactionState;
|
|
88
87
|
var primaryToolbarState = getPrimaryToolbarComponents(editorAPI, state.primaryToolbarComponents);
|
|
89
88
|
var hasHadInteraction = interactionState !== 'hasNotHadInteraction';
|
|
90
|
-
var
|
|
91
|
-
disabled: fg('platform_editor_use_preferences_plugin')
|
|
92
|
-
});
|
|
93
|
-
if (!fg('platform_editor_use_preferences_plugin')) {
|
|
94
|
-
if (!toolbarDocking) {
|
|
95
|
-
var _editorAPI$selectionT, _editorAPI$selectionT2;
|
|
96
|
-
// This is a workaround for the rendering issue with the selection toolbar
|
|
97
|
-
// where using useSharedPluginStateSelector or useSharedPluginState the state are not
|
|
98
|
-
// available when the editor is first loaded. and cause the toolbar to blink.
|
|
99
|
-
var defaultDocking = props.__livePage ? 'none' : 'top';
|
|
100
|
-
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;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
var _ref3 = useSharedPluginStateSelector(editorAPI, 'userPreferences.preferences', {
|
|
104
|
-
disabled: !fg('platform_editor_use_preferences_plugin')
|
|
105
|
-
}) || {},
|
|
89
|
+
var _ref3 = useSharedPluginStateSelector(editorAPI, 'userPreferences.preferences') || {},
|
|
106
90
|
toolbarDockingPosition = _ref3.toolbarDockingPosition;
|
|
107
|
-
if (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
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;
|
|
116
|
-
}
|
|
91
|
+
if (!toolbarDockingPosition) {
|
|
92
|
+
var _editorAPI$userPrefer, _editorAPI$userPrefer2;
|
|
93
|
+
// This is a workaround for the rendering issue with the selection toolbar
|
|
94
|
+
// when using useSharedPluginStateWithSelector the state is not yet
|
|
95
|
+
// available when the editor is first loaded.
|
|
96
|
+
// This causes the toolbar to blink creating a layout shift.
|
|
97
|
+
var defaultDockingPosition = props.__livePage ? 'none' : 'top';
|
|
98
|
+
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;
|
|
117
99
|
}
|
|
118
100
|
var primaryToolbarComponents = props.primaryToolbarComponents;
|
|
119
101
|
if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
|
|
@@ -124,20 +106,11 @@ export var FullPageEditor = function FullPageEditor(props) {
|
|
|
124
106
|
if (editorExperiment('platform_editor_controls', 'variant1', {
|
|
125
107
|
exposure: true
|
|
126
108
|
})) {
|
|
127
|
-
if
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
isEditorToolbarHidden = true;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
} else {
|
|
136
|
-
if (toolbarDocking === 'none' && !forcePrimaryToolbarPinned) {
|
|
137
|
-
primaryToolbarComponents = [];
|
|
138
|
-
if (!hasCustomComponents(customPrimaryToolbarComponents)) {
|
|
139
|
-
isEditorToolbarHidden = true;
|
|
140
|
-
}
|
|
109
|
+
// need to check if the toolbarDockingPosition is set to 'none' or 'top'
|
|
110
|
+
if (toolbarDockingPosition === 'none' && !forcePrimaryToolbarPinned) {
|
|
111
|
+
primaryToolbarComponents = [];
|
|
112
|
+
if (!hasCustomComponents(customPrimaryToolbarComponents)) {
|
|
113
|
+
isEditorToolbarHidden = true;
|
|
141
114
|
}
|
|
142
115
|
}
|
|
143
116
|
}
|
|
@@ -164,7 +137,7 @@ export var FullPageEditor = function FullPageEditor(props) {
|
|
|
164
137
|
}, !isEditorToolbarHidden && (isToolbarAIFCEnabled ? /*#__PURE__*/React.createElement(FullPageToolbarNext, {
|
|
165
138
|
disabled: expValEquals('platform_editor_ssr_toolbar_optimistic', 'isEnabled', true) ? !hasHadInteraction ? false : !!props.disabled : !!props.disabled || !hasHadInteraction && isExperimentEnabled('platform_editor_default_toolbar_state'),
|
|
166
139
|
disabledWithoutInteractionLogic: !!props.disabled,
|
|
167
|
-
toolbarDockingPosition: toolbarDockingPosition
|
|
140
|
+
toolbarDockingPosition: toolbarDockingPosition,
|
|
168
141
|
beforeIcon: props.primaryToolbarIconBefore,
|
|
169
142
|
editorAPI: editorAPI,
|
|
170
143
|
editorView: props.editorView,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "228.1.
|
|
3
|
+
"version": "228.1.13",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
"team": "Editor: Lego",
|
|
28
28
|
"singleton": true,
|
|
29
29
|
"website": {
|
|
30
|
+
"tags": [
|
|
31
|
+
"platform-labs"
|
|
32
|
+
],
|
|
30
33
|
"name": "Editor Core"
|
|
31
34
|
},
|
|
32
35
|
"integrationTests": {
|
|
@@ -49,7 +52,7 @@
|
|
|
49
52
|
"@atlaskit/editor-json-transformer": "^9.8.0",
|
|
50
53
|
"@atlaskit/editor-plugin-block-menu": "^17.0.0",
|
|
51
54
|
"@atlaskit/editor-plugin-connectivity": "^18.0.0",
|
|
52
|
-
"@atlaskit/editor-plugin-quick-insert": "^18.
|
|
55
|
+
"@atlaskit/editor-plugin-quick-insert": "^18.1.0",
|
|
53
56
|
"@atlaskit/editor-plugin-selection-extension": "^21.0.0",
|
|
54
57
|
"@atlaskit/editor-plugin-user-preferences": "^16.0.0",
|
|
55
58
|
"@atlaskit/editor-plugins": "^16.1.0",
|
|
@@ -92,7 +95,7 @@
|
|
|
92
95
|
"uuid": "^11.1.1"
|
|
93
96
|
},
|
|
94
97
|
"peerDependencies": {
|
|
95
|
-
"@atlaskit/editor-common": "^122.
|
|
98
|
+
"@atlaskit/editor-common": "^122.11.0",
|
|
96
99
|
"@atlaskit/link-provider": "^5.7.0",
|
|
97
100
|
"@atlaskit/media-core": "^38.2.0",
|
|
98
101
|
"react": "^18.2.0 || ^19.2.0",
|
|
@@ -150,7 +153,7 @@
|
|
|
150
153
|
"@atlaskit/media-test-helpers": "^42.4.0",
|
|
151
154
|
"@atlaskit/media-ui": "^30.16.0",
|
|
152
155
|
"@atlaskit/modal-dialog": "^16.6.0",
|
|
153
|
-
"@atlaskit/navigation-system": "^10.
|
|
156
|
+
"@atlaskit/navigation-system": "^10.17.0",
|
|
154
157
|
"@atlaskit/popper": "^9.4.0",
|
|
155
158
|
"@atlaskit/portal": "^7.0.0",
|
|
156
159
|
"@atlaskit/profilecard": "^26.24.0",
|
|
@@ -215,10 +218,6 @@
|
|
|
215
218
|
"type": "boolean",
|
|
216
219
|
"referenceOnly": true
|
|
217
220
|
},
|
|
218
|
-
"platform_editor_use_preferences_plugin": {
|
|
219
|
-
"type": "boolean",
|
|
220
|
-
"referenceOnly": true
|
|
221
|
-
},
|
|
222
221
|
"platform_editor_media_block_default": {
|
|
223
222
|
"type": "boolean",
|
|
224
223
|
"referenceOnly": true
|
|
@@ -288,9 +287,6 @@
|
|
|
288
287
|
},
|
|
289
288
|
"platform_editor_lovability_resize_exts_gracefully": {
|
|
290
289
|
"type": "boolean"
|
|
291
|
-
},
|
|
292
|
-
"fix_editor_blur_issue": {
|
|
293
|
-
"type": "boolean"
|
|
294
290
|
}
|
|
295
291
|
}
|
|
296
292
|
}
|