@atlaskit/editor-plugin-toolbar 4.0.9 → 4.1.0
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 +20 -0
- package/afm-cc/tsconfig.json +0 -3
- package/afm-jira/tsconfig.json +1 -4
- package/afm-products/tsconfig.json +0 -3
- package/dist/cjs/ui/Section.js +2 -16
- package/dist/cjs/ui/SelectionToolbar/index.js +2 -29
- package/dist/cjs/ui/toolbar-components.js +2 -2
- package/dist/es2019/ui/Section.js +2 -15
- package/dist/es2019/ui/SelectionToolbar/index.js +2 -28
- package/dist/es2019/ui/toolbar-components.js +2 -2
- package/dist/esm/ui/Section.js +2 -16
- package/dist/esm/ui/SelectionToolbar/index.js +2 -29
- package/dist/esm/ui/toolbar-components.js +2 -2
- package/package.json +2 -6
- package/build/tsconfig.json +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-toolbar
|
|
2
2
|
|
|
3
|
+
## 4.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`6e8029473620b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6e8029473620b) -
|
|
8
|
+
[EDITOR-4496] clean up experiment platform_editor_toolbar_aifc_patch_3 and remove view-mode plugin
|
|
9
|
+
dependency from loom plugin
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 4.0.10
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`8708f328d5db6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8708f328d5db6) -
|
|
20
|
+
Clean up platform_editor_toolbar_aifc_overflow_menu_update feature gate
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 4.0.9
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
package/afm-jira/tsconfig.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "../../../../tsconfig.
|
|
2
|
+
"extends": "../../../../tsconfig.local-consumption.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"target": "es5",
|
|
5
5
|
"outDir": "../../../../../jira/tsDist/@atlaskit__editor-plugin-toolbar/app",
|
|
@@ -51,9 +51,6 @@
|
|
|
51
51
|
{
|
|
52
52
|
"path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
|
|
53
53
|
},
|
|
54
|
-
{
|
|
55
|
-
"path": "../../../platform/feature-flags-react/afm-jira/tsconfig.json"
|
|
56
|
-
},
|
|
57
54
|
{
|
|
58
55
|
"path": "../../tmp-editor-statsig/afm-jira/tsconfig.json"
|
|
59
56
|
},
|
package/dist/cjs/ui/Section.js
CHANGED
|
@@ -7,10 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.Section = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
10
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
11
10
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
12
11
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
-
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
14
12
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
13
|
var shouldShowSection = function shouldShowSection(editMode, toolbar, toolbarDocking, contextualFormattingEnabled) {
|
|
16
14
|
if (editMode === 'view') {
|
|
@@ -33,9 +31,7 @@ var shouldShowSection = function shouldShowSection(editMode, toolbar, toolbarDoc
|
|
|
33
31
|
}
|
|
34
32
|
return false;
|
|
35
33
|
};
|
|
36
|
-
var usePluginState =
|
|
37
|
-
return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
|
|
38
|
-
}, function (_api) {
|
|
34
|
+
var usePluginState = function usePluginState(_api) {
|
|
39
35
|
var _useEditorToolbar = (0, _toolbar.useEditorToolbar)(),
|
|
40
36
|
editorViewMode = _useEditorToolbar.editorViewMode,
|
|
41
37
|
editorToolbarDockingPreference = _useEditorToolbar.editorToolbarDockingPreference,
|
|
@@ -45,17 +41,7 @@ var usePluginState = (0, _platformFeatureFlagsReact.conditionalHooksFactory)(fun
|
|
|
45
41
|
editorToolbarDockingPreference: editorToolbarDockingPreference,
|
|
46
42
|
editorAppearance: editorAppearance
|
|
47
43
|
};
|
|
48
|
-
}
|
|
49
|
-
var editorViewMode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'editorViewMode.mode');
|
|
50
|
-
var editorToolbarDockingPreference = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'userPreferences.preferences.toolbarDockingPosition');
|
|
51
|
-
var _useEditorToolbar2 = (0, _toolbar.useEditorToolbar)(),
|
|
52
|
-
editorAppearance = _useEditorToolbar2.editorAppearance;
|
|
53
|
-
return {
|
|
54
|
-
editorViewMode: editorViewMode,
|
|
55
|
-
editorToolbarDockingPreference: editorToolbarDockingPreference,
|
|
56
|
-
editorAppearance: editorAppearance
|
|
57
|
-
};
|
|
58
|
-
});
|
|
44
|
+
};
|
|
59
45
|
var Section = exports.Section = function Section(_ref) {
|
|
60
46
|
var _api$toolbar$actions$, _api$toolbar;
|
|
61
47
|
var children = _ref.children,
|
|
@@ -14,14 +14,12 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
14
14
|
var _monitoring = require("@atlaskit/editor-common/monitoring");
|
|
15
15
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
16
16
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
17
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
18
17
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
19
18
|
var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
|
|
20
19
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
21
20
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
22
21
|
var _editorToolbarModel = require("@atlaskit/editor-toolbar-model");
|
|
23
22
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
24
|
-
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
25
23
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
26
24
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
27
25
|
var _consts = require("../consts");
|
|
@@ -31,9 +29,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
31
29
|
var isToolbarComponent = function isToolbarComponent(component) {
|
|
32
30
|
return component.type === 'toolbar' && component.key === 'inline-text-toolbar';
|
|
33
31
|
};
|
|
34
|
-
var usePluginState =
|
|
35
|
-
return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
|
|
36
|
-
}, function (api) {
|
|
32
|
+
var usePluginState = function usePluginState(api) {
|
|
37
33
|
return (0, _hooks.useSharedPluginStateWithSelector)(api, ['connectivity', 'userPreferences', 'toolbar', 'selection', 'userIntent', 'editorViewMode'], function (state) {
|
|
38
34
|
var _state$connectivitySt, _state$userPreference, _state$toolbarState, _state$toolbarState2, _state$selectionState, _state$userIntentStat, _state$editorViewMode;
|
|
39
35
|
return {
|
|
@@ -46,30 +42,7 @@ var usePluginState = (0, _platformFeatureFlagsReact.conditionalHooksFactory)(fun
|
|
|
46
42
|
editorViewMode: (_state$editorViewMode = state.editorViewModeState) === null || _state$editorViewMode === void 0 ? void 0 : _state$editorViewMode.mode
|
|
47
43
|
};
|
|
48
44
|
});
|
|
49
|
-
}
|
|
50
|
-
var connectivityStateMode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'connectivity.mode');
|
|
51
|
-
var editorToolbarDockingPreference = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'userPreferences.preferences.toolbarDockingPosition');
|
|
52
|
-
var currentUserIntent = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'userIntent.currentUserIntent');
|
|
53
|
-
var selection = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'selection.selection');
|
|
54
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['toolbar'], function (state) {
|
|
55
|
-
var _state$toolbarState3, _state$toolbarState4;
|
|
56
|
-
return {
|
|
57
|
-
shouldShowToolbar: (_state$toolbarState3 = state.toolbarState) === null || _state$toolbarState3 === void 0 ? void 0 : _state$toolbarState3.shouldShowToolbar,
|
|
58
|
-
selectedNode: (_state$toolbarState4 = state.toolbarState) === null || _state$toolbarState4 === void 0 ? void 0 : _state$toolbarState4.selectedNode
|
|
59
|
-
};
|
|
60
|
-
}),
|
|
61
|
-
shouldShowToolbar = _useSharedPluginState.shouldShowToolbar,
|
|
62
|
-
selectedNode = _useSharedPluginState.selectedNode;
|
|
63
|
-
return {
|
|
64
|
-
connectivityStateMode: connectivityStateMode,
|
|
65
|
-
editorToolbarDockingPreference: editorToolbarDockingPreference,
|
|
66
|
-
currentUserIntent: currentUserIntent,
|
|
67
|
-
shouldShowToolbar: shouldShowToolbar,
|
|
68
|
-
selection: selection,
|
|
69
|
-
editorViewMode: undefined,
|
|
70
|
-
selectedNode: selectedNode
|
|
71
|
-
};
|
|
72
|
-
});
|
|
45
|
+
};
|
|
73
46
|
var useOnPositionCalculated = function useOnPositionCalculated(editorView, cachedCalculateToolbarPosition) {
|
|
74
47
|
var onPositionCalculated = (0, _react.useCallback)(function (position) {
|
|
75
48
|
try {
|
|
@@ -213,7 +213,7 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
213
213
|
var children = _ref9.children;
|
|
214
214
|
return /*#__PURE__*/_react.default.createElement(_OverflowMenu.OverflowMenu, null, children);
|
|
215
215
|
}
|
|
216
|
-
}
|
|
216
|
+
}, {
|
|
217
217
|
type: _toolbar.OVERFLOW_EXTENSIONS_MENU_SECTION.type,
|
|
218
218
|
key: _toolbar.OVERFLOW_EXTENSIONS_MENU_SECTION.key,
|
|
219
219
|
parents: [{
|
|
@@ -222,7 +222,7 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
222
222
|
rank: _toolbar.OVERFLOW_MENU_RANK[_toolbar.OVERFLOW_EXTENSIONS_MENU_SECTION.key]
|
|
223
223
|
}],
|
|
224
224
|
component: _OverflowMenuSection.OverflowMenuSection
|
|
225
|
-
}
|
|
225
|
+
}, {
|
|
226
226
|
type: _toolbar.PIN_SECTION.type,
|
|
227
227
|
key: _toolbar.PIN_SECTION.key,
|
|
228
228
|
parents: [{
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TOOLBARS, useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
3
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
4
3
|
import { ToolbarSection, SeparatorPosition } from '@atlaskit/editor-toolbar';
|
|
5
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
|
|
7
5
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
6
|
const shouldShowSection = (editMode, toolbar, toolbarDocking, contextualFormattingEnabled) => {
|
|
9
7
|
if (editMode === 'view') {
|
|
@@ -26,7 +24,7 @@ const shouldShowSection = (editMode, toolbar, toolbarDocking, contextualFormatti
|
|
|
26
24
|
}
|
|
27
25
|
return false;
|
|
28
26
|
};
|
|
29
|
-
const usePluginState =
|
|
27
|
+
const usePluginState = _api => {
|
|
30
28
|
const {
|
|
31
29
|
editorViewMode,
|
|
32
30
|
editorToolbarDockingPreference,
|
|
@@ -37,18 +35,7 @@ const usePluginState = conditionalHooksFactory(() => expValEquals('platform_edit
|
|
|
37
35
|
editorToolbarDockingPreference,
|
|
38
36
|
editorAppearance
|
|
39
37
|
};
|
|
40
|
-
}
|
|
41
|
-
const editorViewMode = useSharedPluginStateSelector(api, 'editorViewMode.mode');
|
|
42
|
-
const editorToolbarDockingPreference = useSharedPluginStateSelector(api, 'userPreferences.preferences.toolbarDockingPosition');
|
|
43
|
-
const {
|
|
44
|
-
editorAppearance
|
|
45
|
-
} = useEditorToolbar();
|
|
46
|
-
return {
|
|
47
|
-
editorViewMode,
|
|
48
|
-
editorToolbarDockingPreference,
|
|
49
|
-
editorAppearance
|
|
50
|
-
};
|
|
51
|
-
});
|
|
38
|
+
};
|
|
52
39
|
export const Section = ({
|
|
53
40
|
children,
|
|
54
41
|
parents,
|
|
@@ -7,14 +7,12 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
7
7
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
8
8
|
import { EditorToolbarProvider, EditorToolbarUIProvider, shouldShowSelectionToolbar } from '@atlaskit/editor-common/toolbar';
|
|
9
9
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
10
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
11
10
|
import { calculateToolbarPositionTrackHead, calculateToolbarPositionOnCellSelection } from '@atlaskit/editor-common/utils';
|
|
12
11
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
13
12
|
import { AllSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
14
13
|
import { ToolbarSection, ToolbarButtonGroup, ToolbarDropdownItemSection, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
15
14
|
import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model';
|
|
16
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
-
import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
|
|
18
16
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
19
17
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
20
18
|
import { SELECTION_TOOLBAR_LABEL } from '../consts';
|
|
@@ -23,7 +21,7 @@ import { getDomRefFromSelection } from './utils';
|
|
|
23
21
|
const isToolbarComponent = component => {
|
|
24
22
|
return component.type === 'toolbar' && component.key === 'inline-text-toolbar';
|
|
25
23
|
};
|
|
26
|
-
const usePluginState =
|
|
24
|
+
const usePluginState = api => {
|
|
27
25
|
return useSharedPluginStateWithSelector(api, ['connectivity', 'userPreferences', 'toolbar', 'selection', 'userIntent', 'editorViewMode'], state => {
|
|
28
26
|
var _state$connectivitySt, _state$userPreference, _state$userPreference2, _state$toolbarState, _state$toolbarState2, _state$selectionState, _state$userIntentStat, _state$editorViewMode;
|
|
29
27
|
return {
|
|
@@ -36,31 +34,7 @@ const usePluginState = conditionalHooksFactory(() => expValEquals('platform_edit
|
|
|
36
34
|
editorViewMode: (_state$editorViewMode = state.editorViewModeState) === null || _state$editorViewMode === void 0 ? void 0 : _state$editorViewMode.mode
|
|
37
35
|
};
|
|
38
36
|
});
|
|
39
|
-
}
|
|
40
|
-
const connectivityStateMode = useSharedPluginStateSelector(api, 'connectivity.mode');
|
|
41
|
-
const editorToolbarDockingPreference = useSharedPluginStateSelector(api, 'userPreferences.preferences.toolbarDockingPosition');
|
|
42
|
-
const currentUserIntent = useSharedPluginStateSelector(api, 'userIntent.currentUserIntent');
|
|
43
|
-
const selection = useSharedPluginStateSelector(api, 'selection.selection');
|
|
44
|
-
const {
|
|
45
|
-
shouldShowToolbar,
|
|
46
|
-
selectedNode
|
|
47
|
-
} = useSharedPluginStateWithSelector(api, ['toolbar'], state => {
|
|
48
|
-
var _state$toolbarState3, _state$toolbarState4;
|
|
49
|
-
return {
|
|
50
|
-
shouldShowToolbar: (_state$toolbarState3 = state.toolbarState) === null || _state$toolbarState3 === void 0 ? void 0 : _state$toolbarState3.shouldShowToolbar,
|
|
51
|
-
selectedNode: (_state$toolbarState4 = state.toolbarState) === null || _state$toolbarState4 === void 0 ? void 0 : _state$toolbarState4.selectedNode
|
|
52
|
-
};
|
|
53
|
-
});
|
|
54
|
-
return {
|
|
55
|
-
connectivityStateMode,
|
|
56
|
-
editorToolbarDockingPreference,
|
|
57
|
-
currentUserIntent,
|
|
58
|
-
shouldShowToolbar,
|
|
59
|
-
selection,
|
|
60
|
-
editorViewMode: undefined,
|
|
61
|
-
selectedNode
|
|
62
|
-
};
|
|
63
|
-
});
|
|
37
|
+
};
|
|
64
38
|
const useOnPositionCalculated = (editorView, cachedCalculateToolbarPosition) => {
|
|
65
39
|
const onPositionCalculated = useCallback(position => {
|
|
66
40
|
try {
|
|
@@ -206,7 +206,7 @@ export const getToolbarComponents = (contextualFormattingEnabled, api, breakpoin
|
|
|
206
206
|
}) => {
|
|
207
207
|
return /*#__PURE__*/React.createElement(OverflowMenu, null, children);
|
|
208
208
|
}
|
|
209
|
-
},
|
|
209
|
+
}, {
|
|
210
210
|
type: OVERFLOW_EXTENSIONS_MENU_SECTION.type,
|
|
211
211
|
key: OVERFLOW_EXTENSIONS_MENU_SECTION.key,
|
|
212
212
|
parents: [{
|
|
@@ -215,7 +215,7 @@ export const getToolbarComponents = (contextualFormattingEnabled, api, breakpoin
|
|
|
215
215
|
rank: OVERFLOW_MENU_RANK[OVERFLOW_EXTENSIONS_MENU_SECTION.key]
|
|
216
216
|
}],
|
|
217
217
|
component: OverflowMenuSection
|
|
218
|
-
}
|
|
218
|
+
}, {
|
|
219
219
|
type: PIN_SECTION.type,
|
|
220
220
|
key: PIN_SECTION.key,
|
|
221
221
|
parents: [{
|
package/dist/esm/ui/Section.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TOOLBARS, useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
3
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
4
3
|
import { ToolbarSection, SeparatorPosition } from '@atlaskit/editor-toolbar';
|
|
5
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
|
|
7
5
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
6
|
var shouldShowSection = function shouldShowSection(editMode, toolbar, toolbarDocking, contextualFormattingEnabled) {
|
|
9
7
|
if (editMode === 'view') {
|
|
@@ -26,9 +24,7 @@ var shouldShowSection = function shouldShowSection(editMode, toolbar, toolbarDoc
|
|
|
26
24
|
}
|
|
27
25
|
return false;
|
|
28
26
|
};
|
|
29
|
-
var usePluginState =
|
|
30
|
-
return expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
|
|
31
|
-
}, function (_api) {
|
|
27
|
+
var usePluginState = function usePluginState(_api) {
|
|
32
28
|
var _useEditorToolbar = useEditorToolbar(),
|
|
33
29
|
editorViewMode = _useEditorToolbar.editorViewMode,
|
|
34
30
|
editorToolbarDockingPreference = _useEditorToolbar.editorToolbarDockingPreference,
|
|
@@ -38,17 +34,7 @@ var usePluginState = conditionalHooksFactory(function () {
|
|
|
38
34
|
editorToolbarDockingPreference: editorToolbarDockingPreference,
|
|
39
35
|
editorAppearance: editorAppearance
|
|
40
36
|
};
|
|
41
|
-
}
|
|
42
|
-
var editorViewMode = useSharedPluginStateSelector(api, 'editorViewMode.mode');
|
|
43
|
-
var editorToolbarDockingPreference = useSharedPluginStateSelector(api, 'userPreferences.preferences.toolbarDockingPosition');
|
|
44
|
-
var _useEditorToolbar2 = useEditorToolbar(),
|
|
45
|
-
editorAppearance = _useEditorToolbar2.editorAppearance;
|
|
46
|
-
return {
|
|
47
|
-
editorViewMode: editorViewMode,
|
|
48
|
-
editorToolbarDockingPreference: editorToolbarDockingPreference,
|
|
49
|
-
editorAppearance: editorAppearance
|
|
50
|
-
};
|
|
51
|
-
});
|
|
37
|
+
};
|
|
52
38
|
export var Section = function Section(_ref) {
|
|
53
39
|
var _api$toolbar$actions$, _api$toolbar;
|
|
54
40
|
var children = _ref.children,
|
|
@@ -7,14 +7,12 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
7
7
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
8
8
|
import { EditorToolbarProvider, EditorToolbarUIProvider, shouldShowSelectionToolbar } from '@atlaskit/editor-common/toolbar';
|
|
9
9
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
10
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
11
10
|
import { calculateToolbarPositionTrackHead, calculateToolbarPositionOnCellSelection } from '@atlaskit/editor-common/utils';
|
|
12
11
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
13
12
|
import { AllSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
14
13
|
import { ToolbarSection, ToolbarButtonGroup, ToolbarDropdownItemSection, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
15
14
|
import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model';
|
|
16
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
-
import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
|
|
18
16
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
19
17
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
20
18
|
import { SELECTION_TOOLBAR_LABEL } from '../consts';
|
|
@@ -23,9 +21,7 @@ import { getDomRefFromSelection } from './utils';
|
|
|
23
21
|
var isToolbarComponent = function isToolbarComponent(component) {
|
|
24
22
|
return component.type === 'toolbar' && component.key === 'inline-text-toolbar';
|
|
25
23
|
};
|
|
26
|
-
var usePluginState =
|
|
27
|
-
return expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
|
|
28
|
-
}, function (api) {
|
|
24
|
+
var usePluginState = function usePluginState(api) {
|
|
29
25
|
return useSharedPluginStateWithSelector(api, ['connectivity', 'userPreferences', 'toolbar', 'selection', 'userIntent', 'editorViewMode'], function (state) {
|
|
30
26
|
var _state$connectivitySt, _state$userPreference, _state$toolbarState, _state$toolbarState2, _state$selectionState, _state$userIntentStat, _state$editorViewMode;
|
|
31
27
|
return {
|
|
@@ -38,30 +34,7 @@ var usePluginState = conditionalHooksFactory(function () {
|
|
|
38
34
|
editorViewMode: (_state$editorViewMode = state.editorViewModeState) === null || _state$editorViewMode === void 0 ? void 0 : _state$editorViewMode.mode
|
|
39
35
|
};
|
|
40
36
|
});
|
|
41
|
-
}
|
|
42
|
-
var connectivityStateMode = useSharedPluginStateSelector(api, 'connectivity.mode');
|
|
43
|
-
var editorToolbarDockingPreference = useSharedPluginStateSelector(api, 'userPreferences.preferences.toolbarDockingPosition');
|
|
44
|
-
var currentUserIntent = useSharedPluginStateSelector(api, 'userIntent.currentUserIntent');
|
|
45
|
-
var selection = useSharedPluginStateSelector(api, 'selection.selection');
|
|
46
|
-
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['toolbar'], function (state) {
|
|
47
|
-
var _state$toolbarState3, _state$toolbarState4;
|
|
48
|
-
return {
|
|
49
|
-
shouldShowToolbar: (_state$toolbarState3 = state.toolbarState) === null || _state$toolbarState3 === void 0 ? void 0 : _state$toolbarState3.shouldShowToolbar,
|
|
50
|
-
selectedNode: (_state$toolbarState4 = state.toolbarState) === null || _state$toolbarState4 === void 0 ? void 0 : _state$toolbarState4.selectedNode
|
|
51
|
-
};
|
|
52
|
-
}),
|
|
53
|
-
shouldShowToolbar = _useSharedPluginState.shouldShowToolbar,
|
|
54
|
-
selectedNode = _useSharedPluginState.selectedNode;
|
|
55
|
-
return {
|
|
56
|
-
connectivityStateMode: connectivityStateMode,
|
|
57
|
-
editorToolbarDockingPreference: editorToolbarDockingPreference,
|
|
58
|
-
currentUserIntent: currentUserIntent,
|
|
59
|
-
shouldShowToolbar: shouldShowToolbar,
|
|
60
|
-
selection: selection,
|
|
61
|
-
editorViewMode: undefined,
|
|
62
|
-
selectedNode: selectedNode
|
|
63
|
-
};
|
|
64
|
-
});
|
|
37
|
+
};
|
|
65
38
|
var useOnPositionCalculated = function useOnPositionCalculated(editorView, cachedCalculateToolbarPosition) {
|
|
66
39
|
var onPositionCalculated = useCallback(function (position) {
|
|
67
40
|
try {
|
|
@@ -206,7 +206,7 @@ export var getToolbarComponents = function getToolbarComponents(contextualFormat
|
|
|
206
206
|
var children = _ref9.children;
|
|
207
207
|
return /*#__PURE__*/React.createElement(OverflowMenu, null, children);
|
|
208
208
|
}
|
|
209
|
-
}
|
|
209
|
+
}, {
|
|
210
210
|
type: OVERFLOW_EXTENSIONS_MENU_SECTION.type,
|
|
211
211
|
key: OVERFLOW_EXTENSIONS_MENU_SECTION.key,
|
|
212
212
|
parents: [{
|
|
@@ -215,7 +215,7 @@ export var getToolbarComponents = function getToolbarComponents(contextualFormat
|
|
|
215
215
|
rank: OVERFLOW_MENU_RANK[OVERFLOW_EXTENSIONS_MENU_SECTION.key]
|
|
216
216
|
}],
|
|
217
217
|
component: OverflowMenuSection
|
|
218
|
-
}
|
|
218
|
+
}, {
|
|
219
219
|
type: PIN_SECTION.type,
|
|
220
220
|
key: PIN_SECTION.key,
|
|
221
221
|
parents: [{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-toolbar",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,8 +39,7 @@
|
|
|
39
39
|
"@atlaskit/editor-toolbar": "^0.19.0",
|
|
40
40
|
"@atlaskit/editor-toolbar-model": "^0.3.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
42
|
-
"@atlaskit/
|
|
43
|
-
"@atlaskit/tmp-editor-statsig": "^16.25.0",
|
|
42
|
+
"@atlaskit/tmp-editor-statsig": "^16.30.0",
|
|
44
43
|
"@babel/runtime": "^7.0.0",
|
|
45
44
|
"bind-event-listener": "^3.0.0",
|
|
46
45
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -64,9 +63,6 @@
|
|
|
64
63
|
},
|
|
65
64
|
"platform_editor_toolbar_aifc_undo_redo_confluence": {
|
|
66
65
|
"type": "boolean"
|
|
67
|
-
},
|
|
68
|
-
"platform_editor_toolbar_aifc_overflow_menu_update": {
|
|
69
|
-
"type": "boolean"
|
|
70
66
|
}
|
|
71
67
|
},
|
|
72
68
|
"techstack": {
|
package/build/tsconfig.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "es5",
|
|
5
|
-
"paths": {}
|
|
6
|
-
},
|
|
7
|
-
"include": [
|
|
8
|
-
"../src/**/*.ts",
|
|
9
|
-
"../src/**/*.tsx"
|
|
10
|
-
],
|
|
11
|
-
"exclude": [
|
|
12
|
-
"../src/**/__tests__/*",
|
|
13
|
-
"../src/**/*.test.*",
|
|
14
|
-
"../src/**/test.*",
|
|
15
|
-
"../src/**/examples.*"
|
|
16
|
-
]
|
|
17
|
-
}
|