@atlaskit/editor-plugin-floating-toolbar 4.1.8 → 4.1.10
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,35 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 4.1.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#159655](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159655)
|
|
8
|
+
[`24f8c627d50f2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24f8c627d50f2) - ##
|
|
9
|
+
WHAT? Remove experimental graceful edit mode from view mode plugin and associated props.
|
|
10
|
+
|
|
11
|
+
## WHY?
|
|
12
|
+
|
|
13
|
+
This experiment is being cleaned up and we are no longer proceeding in this direction.
|
|
14
|
+
|
|
15
|
+
## HOW to adjust?
|
|
16
|
+
|
|
17
|
+
This experiment was only enabled for Confluence and should not have been enabled in other places.
|
|
18
|
+
If for some reason any of the following props/state/methdos were used please remove them:
|
|
19
|
+
|
|
20
|
+
- isConsumption
|
|
21
|
+
- contentMode
|
|
22
|
+
- initialContentMode
|
|
23
|
+
- updateContentMode
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
27
|
+
## 4.1.9
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
|
|
3
33
|
## 4.1.8
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -31,7 +31,6 @@ var _plugin = require("./pm-plugins/toolbar-data/plugin");
|
|
|
31
31
|
var _pluginKey = require("./pm-plugins/toolbar-data/plugin-key");
|
|
32
32
|
var _utils2 = require("./pm-plugins/utils");
|
|
33
33
|
var _ConfirmationModal = require("./ui/ConfirmationModal");
|
|
34
|
-
var _ExpandButton = require("./ui/ExpandButton");
|
|
35
34
|
var _ToolbarLoader = require("./ui/ToolbarLoader");
|
|
36
35
|
var _utils3 = require("./ui/utils");
|
|
37
36
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -225,8 +224,6 @@ var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (
|
|
|
225
224
|
|
|
226
225
|
// editorViewMode
|
|
227
226
|
var mode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'editorViewMode.mode');
|
|
228
|
-
var contentMode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'editorViewMode.contentMode');
|
|
229
|
-
var isConsumption = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'editorViewMode.isConsumption');
|
|
230
227
|
|
|
231
228
|
// userIntent
|
|
232
229
|
var currentUserIntent = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'userIntent.currentUserIntent');
|
|
@@ -244,8 +241,6 @@ var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (
|
|
|
244
241
|
floatingToolbarData: floatingToolbarData,
|
|
245
242
|
editorDisabled: editorDisabledState,
|
|
246
243
|
mode: mode,
|
|
247
|
-
contentMode: contentMode,
|
|
248
|
-
isConsumption: isConsumption,
|
|
249
244
|
currentUserIntent: currentUserIntent,
|
|
250
245
|
isDragging: isDragging,
|
|
251
246
|
isMenuOpen: isMenuOpen
|
|
@@ -264,8 +259,6 @@ var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (
|
|
|
264
259
|
floatingToolbarData: floatingToolbarState === null || floatingToolbarState === void 0 ? void 0 : floatingToolbarState.floatingToolbarData,
|
|
265
260
|
editorDisabled: editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled,
|
|
266
261
|
mode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode,
|
|
267
|
-
contentMode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.contentMode,
|
|
268
|
-
isConsumption: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.isConsumption,
|
|
269
262
|
currentUserIntent: userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent,
|
|
270
263
|
isDragging: blockControlsState === null || blockControlsState === void 0 ? void 0 : blockControlsState.isDragging,
|
|
271
264
|
isMenuOpen: blockControlsState === null || blockControlsState === void 0 ? void 0 : blockControlsState.isMenuOpen
|
|
@@ -282,11 +275,9 @@ function ContentComponent(_ref5) {
|
|
|
282
275
|
dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent;
|
|
283
276
|
var _useSharedState = useSharedState(pluginInjectionApi),
|
|
284
277
|
configWithNodeInfo = _useSharedState.configWithNodeInfo,
|
|
285
|
-
contentMode = _useSharedState.contentMode,
|
|
286
278
|
currentUserIntent = _useSharedState.currentUserIntent,
|
|
287
279
|
editorDisabled = _useSharedState.editorDisabled,
|
|
288
280
|
floatingToolbarData = _useSharedState.floatingToolbarData,
|
|
289
|
-
isConsumption = _useSharedState.isConsumption,
|
|
290
281
|
isDragging = _useSharedState.isDragging,
|
|
291
282
|
isMenuOpen = _useSharedState.isMenuOpen,
|
|
292
283
|
mode = _useSharedState.mode;
|
|
@@ -386,39 +377,6 @@ function ContentComponent(_ref5) {
|
|
|
386
377
|
}
|
|
387
378
|
var customPositionCalculation;
|
|
388
379
|
var toolbarItems = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.copyButton) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.processCopyButtonItems(editorView.state)(Array.isArray(items) ? items : items(node), pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$d = pluginInjectionApi.decorations) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions.hoverDecoration);
|
|
389
|
-
var viewModeToolbarEntry = (0, _experiments.unstable_editorExperimentParam)('live_pages_graceful_edit', 'toolbar-entry', {
|
|
390
|
-
defaultValue: 'none',
|
|
391
|
-
typeGuard: function typeGuard(value) {
|
|
392
|
-
return typeof value === 'string' && ['text', 'nodes'].includes(value);
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
if (!(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control') && viewModeToolbarEntry !== 'none') {
|
|
396
|
-
if (contentMode === 'live-edit' && isConsumption) {
|
|
397
|
-
var hasOtherToolbarItems = toolbarItems && toolbarItems.length !== 0;
|
|
398
|
-
var shouldAddToolbarItems = viewModeToolbarEntry === 'expand-existing-only' ? hasOtherToolbarItems : true;
|
|
399
|
-
if (shouldAddToolbarItems) {
|
|
400
|
-
if (toolbarItems && toolbarItems.length > 0) {
|
|
401
|
-
toolbarItems.unshift({
|
|
402
|
-
type: 'separator'
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
toolbarItems === null || toolbarItems === void 0 || toolbarItems.unshift({
|
|
406
|
-
type: 'button',
|
|
407
|
-
title: 'Edit',
|
|
408
|
-
onClick: function onClick() {
|
|
409
|
-
var _pluginInjectionApi$c2, _pluginInjectionApi$e;
|
|
410
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.core) === null || _pluginInjectionApi$c2 === void 0 || (_pluginInjectionApi$c2 = _pluginInjectionApi$c2.actions) === null || _pluginInjectionApi$c2 === void 0 || _pluginInjectionApi$c2.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.commands.updateContentMode({
|
|
411
|
-
type: 'intent-to-edit'
|
|
412
|
-
}));
|
|
413
|
-
return false;
|
|
414
|
-
},
|
|
415
|
-
icon: function icon() {
|
|
416
|
-
return /*#__PURE__*/_react.default.createElement(_ExpandButton.ExpandButton, null);
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
380
|
if (onPositionCalculated) {
|
|
423
381
|
customPositionCalculation = function customPositionCalculation(nextPos) {
|
|
424
382
|
return onPositionCalculated(editorView, nextPos);
|
|
@@ -10,7 +10,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
10
10
|
import { AllSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
-
import { editorExperiment
|
|
13
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
14
14
|
import { copyNode } from './pm-plugins/commands';
|
|
15
15
|
import forceFocusPlugin, { forceFocusSelector } from './pm-plugins/force-focus';
|
|
16
16
|
import { hideConfirmDialog } from './pm-plugins/toolbar-data/commands';
|
|
@@ -18,7 +18,6 @@ import { createPlugin as floatingToolbarDataPluginFactory } from './pm-plugins/t
|
|
|
18
18
|
import { pluginKey as dataPluginKey } from './pm-plugins/toolbar-data/plugin-key';
|
|
19
19
|
import { findNode } from './pm-plugins/utils';
|
|
20
20
|
import { ConfirmationModal } from './ui/ConfirmationModal';
|
|
21
|
-
import { ExpandButton } from './ui/ExpandButton';
|
|
22
21
|
import { ToolbarLoader } from './ui/ToolbarLoader';
|
|
23
22
|
import { consolidateOverflowDropdownItems } from './ui/utils';
|
|
24
23
|
|
|
@@ -208,8 +207,6 @@ const useSharedState = sharedPluginStateHookMigratorFactory(pluginInjectionApi =
|
|
|
208
207
|
|
|
209
208
|
// editorViewMode
|
|
210
209
|
const mode = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
|
|
211
|
-
const contentMode = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.contentMode');
|
|
212
|
-
const isConsumption = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.isConsumption');
|
|
213
210
|
|
|
214
211
|
// userIntent
|
|
215
212
|
const currentUserIntent = useSharedPluginStateSelector(pluginInjectionApi, 'userIntent.currentUserIntent');
|
|
@@ -227,8 +224,6 @@ const useSharedState = sharedPluginStateHookMigratorFactory(pluginInjectionApi =
|
|
|
227
224
|
floatingToolbarData,
|
|
228
225
|
editorDisabled: editorDisabledState,
|
|
229
226
|
mode,
|
|
230
|
-
contentMode,
|
|
231
|
-
isConsumption,
|
|
232
227
|
currentUserIntent,
|
|
233
228
|
isDragging,
|
|
234
229
|
isMenuOpen
|
|
@@ -249,8 +244,6 @@ const useSharedState = sharedPluginStateHookMigratorFactory(pluginInjectionApi =
|
|
|
249
244
|
floatingToolbarData: floatingToolbarState === null || floatingToolbarState === void 0 ? void 0 : floatingToolbarState.floatingToolbarData,
|
|
250
245
|
editorDisabled: editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled,
|
|
251
246
|
mode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode,
|
|
252
|
-
contentMode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.contentMode,
|
|
253
|
-
isConsumption: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.isConsumption,
|
|
254
247
|
currentUserIntent: userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent,
|
|
255
248
|
isDragging: blockControlsState === null || blockControlsState === void 0 ? void 0 : blockControlsState.isDragging,
|
|
256
249
|
isMenuOpen: blockControlsState === null || blockControlsState === void 0 ? void 0 : blockControlsState.isMenuOpen
|
|
@@ -268,11 +261,9 @@ export function ContentComponent({
|
|
|
268
261
|
var _configWithNodeInfo$c, _configWithNodeInfo$c2, _items, _pluginInjectionApi$c, _pluginInjectionApi$d;
|
|
269
262
|
const {
|
|
270
263
|
configWithNodeInfo,
|
|
271
|
-
contentMode,
|
|
272
264
|
currentUserIntent,
|
|
273
265
|
editorDisabled,
|
|
274
266
|
floatingToolbarData,
|
|
275
|
-
isConsumption,
|
|
276
267
|
isDragging,
|
|
277
268
|
isMenuOpen,
|
|
278
269
|
mode
|
|
@@ -368,35 +359,6 @@ export function ContentComponent({
|
|
|
368
359
|
}
|
|
369
360
|
let customPositionCalculation;
|
|
370
361
|
const toolbarItems = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.copyButton) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.processCopyButtonItems(editorView.state)(Array.isArray(items) ? items : items(node), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.decorations) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions.hoverDecoration);
|
|
371
|
-
const viewModeToolbarEntry = unstable_editorExperimentParam('live_pages_graceful_edit', 'toolbar-entry', {
|
|
372
|
-
defaultValue: 'none',
|
|
373
|
-
typeGuard: value => typeof value === 'string' && ['text', 'nodes'].includes(value)
|
|
374
|
-
});
|
|
375
|
-
if (!editorExperiment('live_pages_graceful_edit', 'control') && viewModeToolbarEntry !== 'none') {
|
|
376
|
-
if (contentMode === 'live-edit' && isConsumption) {
|
|
377
|
-
const hasOtherToolbarItems = toolbarItems && toolbarItems.length !== 0;
|
|
378
|
-
const shouldAddToolbarItems = viewModeToolbarEntry === 'expand-existing-only' ? hasOtherToolbarItems : true;
|
|
379
|
-
if (shouldAddToolbarItems) {
|
|
380
|
-
if (toolbarItems && toolbarItems.length > 0) {
|
|
381
|
-
toolbarItems.unshift({
|
|
382
|
-
type: 'separator'
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
toolbarItems === null || toolbarItems === void 0 ? void 0 : toolbarItems.unshift({
|
|
386
|
-
type: 'button',
|
|
387
|
-
title: 'Edit',
|
|
388
|
-
onClick: () => {
|
|
389
|
-
var _pluginInjectionApi$c2, _pluginInjectionApi$c3, _pluginInjectionApi$e;
|
|
390
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c2 = pluginInjectionApi.core) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : (_pluginInjectionApi$c3 = _pluginInjectionApi$c2.actions) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : _pluginInjectionApi$c3.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.commands.updateContentMode({
|
|
391
|
-
type: 'intent-to-edit'
|
|
392
|
-
}));
|
|
393
|
-
return false;
|
|
394
|
-
},
|
|
395
|
-
icon: () => /*#__PURE__*/React.createElement(ExpandButton, null)
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
362
|
if (onPositionCalculated) {
|
|
401
363
|
customPositionCalculation = nextPos => {
|
|
402
364
|
return onPositionCalculated(editorView, nextPos);
|
|
@@ -14,7 +14,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
14
14
|
import { AllSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
15
15
|
import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
16
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
-
import { editorExperiment
|
|
17
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
18
18
|
import { copyNode as _copyNode } from './pm-plugins/commands';
|
|
19
19
|
import forceFocusPlugin, { forceFocusSelector } from './pm-plugins/force-focus';
|
|
20
20
|
import { hideConfirmDialog } from './pm-plugins/toolbar-data/commands';
|
|
@@ -22,7 +22,6 @@ import { createPlugin as floatingToolbarDataPluginFactory } from './pm-plugins/t
|
|
|
22
22
|
import { pluginKey as dataPluginKey } from './pm-plugins/toolbar-data/plugin-key';
|
|
23
23
|
import { findNode } from './pm-plugins/utils';
|
|
24
24
|
import { ConfirmationModal } from './ui/ConfirmationModal';
|
|
25
|
-
import { ExpandButton } from './ui/ExpandButton';
|
|
26
25
|
import { ToolbarLoader } from './ui/ToolbarLoader';
|
|
27
26
|
import { consolidateOverflowDropdownItems } from './ui/utils';
|
|
28
27
|
|
|
@@ -213,8 +212,6 @@ var useSharedState = sharedPluginStateHookMigratorFactory(function (pluginInject
|
|
|
213
212
|
|
|
214
213
|
// editorViewMode
|
|
215
214
|
var mode = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
|
|
216
|
-
var contentMode = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.contentMode');
|
|
217
|
-
var isConsumption = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.isConsumption');
|
|
218
215
|
|
|
219
216
|
// userIntent
|
|
220
217
|
var currentUserIntent = useSharedPluginStateSelector(pluginInjectionApi, 'userIntent.currentUserIntent');
|
|
@@ -232,8 +229,6 @@ var useSharedState = sharedPluginStateHookMigratorFactory(function (pluginInject
|
|
|
232
229
|
floatingToolbarData: floatingToolbarData,
|
|
233
230
|
editorDisabled: editorDisabledState,
|
|
234
231
|
mode: mode,
|
|
235
|
-
contentMode: contentMode,
|
|
236
|
-
isConsumption: isConsumption,
|
|
237
232
|
currentUserIntent: currentUserIntent,
|
|
238
233
|
isDragging: isDragging,
|
|
239
234
|
isMenuOpen: isMenuOpen
|
|
@@ -252,8 +247,6 @@ var useSharedState = sharedPluginStateHookMigratorFactory(function (pluginInject
|
|
|
252
247
|
floatingToolbarData: floatingToolbarState === null || floatingToolbarState === void 0 ? void 0 : floatingToolbarState.floatingToolbarData,
|
|
253
248
|
editorDisabled: editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled,
|
|
254
249
|
mode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode,
|
|
255
|
-
contentMode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.contentMode,
|
|
256
|
-
isConsumption: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.isConsumption,
|
|
257
250
|
currentUserIntent: userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent,
|
|
258
251
|
isDragging: blockControlsState === null || blockControlsState === void 0 ? void 0 : blockControlsState.isDragging,
|
|
259
252
|
isMenuOpen: blockControlsState === null || blockControlsState === void 0 ? void 0 : blockControlsState.isMenuOpen
|
|
@@ -270,11 +263,9 @@ export function ContentComponent(_ref5) {
|
|
|
270
263
|
dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent;
|
|
271
264
|
var _useSharedState = useSharedState(pluginInjectionApi),
|
|
272
265
|
configWithNodeInfo = _useSharedState.configWithNodeInfo,
|
|
273
|
-
contentMode = _useSharedState.contentMode,
|
|
274
266
|
currentUserIntent = _useSharedState.currentUserIntent,
|
|
275
267
|
editorDisabled = _useSharedState.editorDisabled,
|
|
276
268
|
floatingToolbarData = _useSharedState.floatingToolbarData,
|
|
277
|
-
isConsumption = _useSharedState.isConsumption,
|
|
278
269
|
isDragging = _useSharedState.isDragging,
|
|
279
270
|
isMenuOpen = _useSharedState.isMenuOpen,
|
|
280
271
|
mode = _useSharedState.mode;
|
|
@@ -374,39 +365,6 @@ export function ContentComponent(_ref5) {
|
|
|
374
365
|
}
|
|
375
366
|
var customPositionCalculation;
|
|
376
367
|
var toolbarItems = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.copyButton) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.processCopyButtonItems(editorView.state)(Array.isArray(items) ? items : items(node), pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$d = pluginInjectionApi.decorations) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions.hoverDecoration);
|
|
377
|
-
var viewModeToolbarEntry = unstable_editorExperimentParam('live_pages_graceful_edit', 'toolbar-entry', {
|
|
378
|
-
defaultValue: 'none',
|
|
379
|
-
typeGuard: function typeGuard(value) {
|
|
380
|
-
return typeof value === 'string' && ['text', 'nodes'].includes(value);
|
|
381
|
-
}
|
|
382
|
-
});
|
|
383
|
-
if (!editorExperiment('live_pages_graceful_edit', 'control') && viewModeToolbarEntry !== 'none') {
|
|
384
|
-
if (contentMode === 'live-edit' && isConsumption) {
|
|
385
|
-
var hasOtherToolbarItems = toolbarItems && toolbarItems.length !== 0;
|
|
386
|
-
var shouldAddToolbarItems = viewModeToolbarEntry === 'expand-existing-only' ? hasOtherToolbarItems : true;
|
|
387
|
-
if (shouldAddToolbarItems) {
|
|
388
|
-
if (toolbarItems && toolbarItems.length > 0) {
|
|
389
|
-
toolbarItems.unshift({
|
|
390
|
-
type: 'separator'
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
toolbarItems === null || toolbarItems === void 0 || toolbarItems.unshift({
|
|
394
|
-
type: 'button',
|
|
395
|
-
title: 'Edit',
|
|
396
|
-
onClick: function onClick() {
|
|
397
|
-
var _pluginInjectionApi$c2, _pluginInjectionApi$e;
|
|
398
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.core) === null || _pluginInjectionApi$c2 === void 0 || (_pluginInjectionApi$c2 = _pluginInjectionApi$c2.actions) === null || _pluginInjectionApi$c2 === void 0 || _pluginInjectionApi$c2.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.commands.updateContentMode({
|
|
399
|
-
type: 'intent-to-edit'
|
|
400
|
-
}));
|
|
401
|
-
return false;
|
|
402
|
-
},
|
|
403
|
-
icon: function icon() {
|
|
404
|
-
return /*#__PURE__*/React.createElement(ExpandButton, null);
|
|
405
|
-
}
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
368
|
if (onPositionCalculated) {
|
|
411
369
|
customPositionCalculation = function customPositionCalculation(nextPos) {
|
|
412
370
|
return onPositionCalculated(editorView, nextPos);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.10",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,32 +25,32 @@
|
|
|
25
25
|
".": "./src/index.ts"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@atlaskit/adf-utils": "^19.
|
|
28
|
+
"@atlaskit/adf-utils": "^19.20.0",
|
|
29
29
|
"@atlaskit/button": "^23.2.0",
|
|
30
30
|
"@atlaskit/checkbox": "^17.1.0",
|
|
31
|
-
"@atlaskit/editor-common": "^105.
|
|
31
|
+
"@atlaskit/editor-common": "^105.10.0",
|
|
32
32
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
34
34
|
"@atlaskit/editor-plugin-context-panel": "^4.1.0",
|
|
35
35
|
"@atlaskit/editor-plugin-copy-button": "^2.0.0",
|
|
36
36
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
38
|
-
"@atlaskit/editor-plugin-editor-viewmode": "^
|
|
39
|
-
"@atlaskit/editor-plugin-emoji": "^3.
|
|
38
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
|
|
39
|
+
"@atlaskit/editor-plugin-emoji": "^3.7.0",
|
|
40
40
|
"@atlaskit/editor-plugin-extension": "^5.4.0",
|
|
41
41
|
"@atlaskit/editor-plugin-interaction": "^1.1.0",
|
|
42
|
-
"@atlaskit/editor-plugin-table": "^10.
|
|
42
|
+
"@atlaskit/editor-plugin-table": "^10.11.0",
|
|
43
43
|
"@atlaskit/editor-plugin-user-intent": "^0.1.0",
|
|
44
44
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
45
45
|
"@atlaskit/emoji": "^69.2.0",
|
|
46
|
-
"@atlaskit/icon": "^26.
|
|
47
|
-
"@atlaskit/menu": "^
|
|
46
|
+
"@atlaskit/icon": "^26.3.0",
|
|
47
|
+
"@atlaskit/menu": "^8.0.0",
|
|
48
48
|
"@atlaskit/modal-dialog": "^14.2.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
50
50
|
"@atlaskit/primitives": "^14.8.0",
|
|
51
51
|
"@atlaskit/select": "^20.6.0",
|
|
52
52
|
"@atlaskit/theme": "^18.0.0",
|
|
53
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
53
|
+
"@atlaskit/tmp-editor-statsig": "^5.0.0",
|
|
54
54
|
"@atlaskit/tokens": "^4.9.0",
|
|
55
55
|
"@atlaskit/tooltip": "^20.0.0",
|
|
56
56
|
"@babel/runtime": "^7.0.0",
|