@atlaskit/editor-plugin-toolbar 9.0.33 → 9.0.34
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 +9 -0
- package/dist/cjs/toolbarPlugin.js +1 -2
- package/dist/cjs/ui/Section.js +1 -3
- package/dist/cjs/ui/SelectionToolbar/index.js +1 -3
- package/dist/es2019/toolbarPlugin.js +1 -2
- package/dist/es2019/ui/Section.js +1 -3
- package/dist/es2019/ui/SelectionToolbar/index.js +1 -3
- package/dist/esm/toolbarPlugin.js +1 -2
- package/dist/esm/ui/Section.js +1 -3
- package/dist/esm/ui/SelectionToolbar/index.js +1 -3
- package/package.json +4 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-toolbar
|
|
2
2
|
|
|
3
|
+
## 9.0.34
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2bf1a4ceaf0a4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2bf1a4ceaf0a4) -
|
|
8
|
+
Clean up stale feature gates platform_editor_fix_md_empty_list_roundtrip,
|
|
9
|
+
platform_editor_md-mode-use-content-reconciler, platform_editor_toolbar_mode_override,
|
|
10
|
+
platform_editor_markdown_mode_hide_source_toolbar
|
|
11
|
+
|
|
3
12
|
## 9.0.33
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -14,7 +14,6 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
14
14
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
15
15
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
16
16
|
var _editorToolbarModel = require("@atlaskit/editor-toolbar-model");
|
|
17
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
17
|
var _selectionToolbarOpenExperience = require("./pm-plugins/experiences/selection-toolbar-open-experience");
|
|
19
18
|
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
20
19
|
var _consts = require("./ui/consts");
|
|
@@ -175,7 +174,7 @@ var toolbarPlugin = exports.toolbarPlugin = function toolbarPlugin(_ref) {
|
|
|
175
174
|
// from the view() listeners) destructure it as `undefined`
|
|
176
175
|
// and would otherwise wipe a previously-set override on
|
|
177
176
|
// every interaction.
|
|
178
|
-
newPluginState = _objectSpread(_objectSpread(_objectSpread({}, newPluginState), rest), 'contextualFormattingModeOverride' in meta
|
|
177
|
+
newPluginState = _objectSpread(_objectSpread(_objectSpread({}, newPluginState), rest), 'contextualFormattingModeOverride' in meta ? {
|
|
179
178
|
contextualFormattingModeOverride: contextualFormattingModeOverride
|
|
180
179
|
} : {});
|
|
181
180
|
}
|
package/dist/cjs/ui/Section.js
CHANGED
|
@@ -9,7 +9,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
10
10
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
11
11
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
var shouldShowSection = function shouldShowSection(editMode, toolbar, toolbarDocking, contextualFormattingEnabled) {
|
|
14
13
|
if (editMode === 'view') {
|
|
15
14
|
return false;
|
|
@@ -53,8 +52,7 @@ var Section = exports.Section = function Section(_ref) {
|
|
|
53
52
|
var toolbar = parents.find(function (parent) {
|
|
54
53
|
return parent.type === 'toolbar';
|
|
55
54
|
});
|
|
56
|
-
var
|
|
57
|
-
var contextualFormattingEnabled = (_ref2 = effectiveRuntimeOverride !== null && effectiveRuntimeOverride !== void 0 ? effectiveRuntimeOverride : api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.contextualFormattingMode()) !== null && _ref2 !== void 0 ? _ref2 : 'always-pinned';
|
|
55
|
+
var contextualFormattingEnabled = (_ref2 = runtimeOverride !== null && runtimeOverride !== void 0 ? runtimeOverride : api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.contextualFormattingMode()) !== null && _ref2 !== void 0 ? _ref2 : 'always-pinned';
|
|
58
56
|
if (isSharedSection && !shouldShowSection(editorViewMode, toolbar, editorToolbarDockingPreference, contextualFormattingEnabled)) {
|
|
59
57
|
return null;
|
|
60
58
|
}
|
|
@@ -20,7 +20,6 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
20
20
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
21
21
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
22
22
|
var _editorToolbarModel = require("@atlaskit/editor-toolbar-model");
|
|
23
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
24
23
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
25
24
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
26
25
|
var _consts = require("../consts");
|
|
@@ -77,8 +76,7 @@ var SelectionToolbar = exports.SelectionToolbar = function SelectionToolbar(_ref
|
|
|
77
76
|
shouldShowToolbar = _usePluginState.shouldShowToolbar,
|
|
78
77
|
editorViewMode = _usePluginState.editorViewMode,
|
|
79
78
|
contextualFormattingModeOverride = _usePluginState.contextualFormattingModeOverride;
|
|
80
|
-
var
|
|
81
|
-
var contextualFormattingEnabled = (_ref2 = effectiveRuntimeOverride !== null && effectiveRuntimeOverride !== void 0 ? effectiveRuntimeOverride : api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.contextualFormattingMode()) !== null && _ref2 !== void 0 ? _ref2 : 'always-pinned';
|
|
79
|
+
var contextualFormattingEnabled = (_ref2 = contextualFormattingModeOverride !== null && contextualFormattingModeOverride !== void 0 ? contextualFormattingModeOverride : api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.contextualFormattingMode()) !== null && _ref2 !== void 0 ? _ref2 : 'always-pinned';
|
|
82
80
|
var selectionToolbarConfigEnabled = (0, _toolbar.shouldShowSelectionToolbar)(contextualFormattingEnabled, editorToolbarDockingPreference);
|
|
83
81
|
var intl = (0, _reactIntl.useIntl)();
|
|
84
82
|
var components = api === null || api === void 0 || (_api$toolbar2 = api.toolbar) === null || _api$toolbar2 === void 0 ? void 0 : _api$toolbar2.actions.getComponents();
|
|
@@ -4,7 +4,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
4
4
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import { createComponentRegistry } from '@atlaskit/editor-toolbar-model';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { getSelectionToolbarOpenExperiencePlugin } from './pm-plugins/experiences/selection-toolbar-open-experience';
|
|
9
8
|
import { editorToolbarPluginKey } from './pm-plugins/plugin-key';
|
|
10
9
|
import { DEFAULT_POPUP_SELECTORS } from './ui/consts';
|
|
@@ -166,7 +165,7 @@ export const toolbarPlugin = ({
|
|
|
166
165
|
newPluginState = {
|
|
167
166
|
...newPluginState,
|
|
168
167
|
...rest,
|
|
169
|
-
...('contextualFormattingModeOverride' in meta
|
|
168
|
+
...('contextualFormattingModeOverride' in meta ? {
|
|
170
169
|
contextualFormattingModeOverride
|
|
171
170
|
} : {})
|
|
172
171
|
};
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { TOOLBARS, useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
4
4
|
import { ToolbarSection, SeparatorPosition } from '@atlaskit/editor-toolbar';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
const shouldShowSection = (editMode, toolbar, toolbarDocking, contextualFormattingEnabled) => {
|
|
7
6
|
if (editMode === 'view') {
|
|
8
7
|
return false;
|
|
@@ -46,8 +45,7 @@ export const Section = ({
|
|
|
46
45
|
return (_states$toolbarState = states.toolbarState) === null || _states$toolbarState === void 0 ? void 0 : _states$toolbarState.contextualFormattingModeOverride;
|
|
47
46
|
});
|
|
48
47
|
const toolbar = parents.find(parent => parent.type === 'toolbar');
|
|
49
|
-
const
|
|
50
|
-
const contextualFormattingEnabled = (_ref = effectiveRuntimeOverride !== null && effectiveRuntimeOverride !== void 0 ? effectiveRuntimeOverride : api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.contextualFormattingMode()) !== null && _ref !== void 0 ? _ref : 'always-pinned';
|
|
48
|
+
const contextualFormattingEnabled = (_ref = runtimeOverride !== null && runtimeOverride !== void 0 ? runtimeOverride : api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.contextualFormattingMode()) !== null && _ref !== void 0 ? _ref : 'always-pinned';
|
|
51
49
|
if (isSharedSection && !shouldShowSection(editorViewMode, toolbar, editorToolbarDockingPreference, contextualFormattingEnabled)) {
|
|
52
50
|
return null;
|
|
53
51
|
}
|
|
@@ -13,7 +13,6 @@ import { AllSelection, TextSelection } from '@atlaskit/editor-prosemirror/state'
|
|
|
13
13
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
14
14
|
import { ToolbarSection, ToolbarButtonGroup, ToolbarDropdownItemSection, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
15
15
|
import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model';
|
|
16
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
17
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
19
18
|
import { SELECTION_TOOLBAR_LABEL } from '../consts';
|
|
@@ -71,8 +70,7 @@ export const SelectionToolbar = ({
|
|
|
71
70
|
editorViewMode,
|
|
72
71
|
contextualFormattingModeOverride
|
|
73
72
|
} = usePluginState(api);
|
|
74
|
-
const
|
|
75
|
-
const contextualFormattingEnabled = (_ref = effectiveRuntimeOverride !== null && effectiveRuntimeOverride !== void 0 ? effectiveRuntimeOverride : api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.contextualFormattingMode()) !== null && _ref !== void 0 ? _ref : 'always-pinned';
|
|
73
|
+
const contextualFormattingEnabled = (_ref = contextualFormattingModeOverride !== null && contextualFormattingModeOverride !== void 0 ? contextualFormattingModeOverride : api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.contextualFormattingMode()) !== null && _ref !== void 0 ? _ref : 'always-pinned';
|
|
76
74
|
const selectionToolbarConfigEnabled = shouldShowSelectionToolbar(contextualFormattingEnabled, editorToolbarDockingPreference);
|
|
77
75
|
const intl = useIntl();
|
|
78
76
|
const components = api === null || api === void 0 ? void 0 : (_api$toolbar2 = api.toolbar) === null || _api$toolbar2 === void 0 ? void 0 : _api$toolbar2.actions.getComponents();
|
|
@@ -10,7 +10,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
10
10
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
12
12
|
import { createComponentRegistry } from '@atlaskit/editor-toolbar-model';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
13
|
import { getSelectionToolbarOpenExperiencePlugin } from './pm-plugins/experiences/selection-toolbar-open-experience';
|
|
15
14
|
import { editorToolbarPluginKey } from './pm-plugins/plugin-key';
|
|
16
15
|
import { DEFAULT_POPUP_SELECTORS } from './ui/consts';
|
|
@@ -168,7 +167,7 @@ export var toolbarPlugin = function toolbarPlugin(_ref) {
|
|
|
168
167
|
// from the view() listeners) destructure it as `undefined`
|
|
169
168
|
// and would otherwise wipe a previously-set override on
|
|
170
169
|
// every interaction.
|
|
171
|
-
newPluginState = _objectSpread(_objectSpread(_objectSpread({}, newPluginState), rest), 'contextualFormattingModeOverride' in meta
|
|
170
|
+
newPluginState = _objectSpread(_objectSpread(_objectSpread({}, newPluginState), rest), 'contextualFormattingModeOverride' in meta ? {
|
|
172
171
|
contextualFormattingModeOverride: contextualFormattingModeOverride
|
|
173
172
|
} : {});
|
|
174
173
|
}
|
package/dist/esm/ui/Section.js
CHANGED
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { TOOLBARS, useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
4
4
|
import { ToolbarSection, SeparatorPosition } from '@atlaskit/editor-toolbar';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
var shouldShowSection = function shouldShowSection(editMode, toolbar, toolbarDocking, contextualFormattingEnabled) {
|
|
7
6
|
if (editMode === 'view') {
|
|
8
7
|
return false;
|
|
@@ -46,8 +45,7 @@ export var Section = function Section(_ref) {
|
|
|
46
45
|
var toolbar = parents.find(function (parent) {
|
|
47
46
|
return parent.type === 'toolbar';
|
|
48
47
|
});
|
|
49
|
-
var
|
|
50
|
-
var contextualFormattingEnabled = (_ref2 = effectiveRuntimeOverride !== null && effectiveRuntimeOverride !== void 0 ? effectiveRuntimeOverride : api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.contextualFormattingMode()) !== null && _ref2 !== void 0 ? _ref2 : 'always-pinned';
|
|
48
|
+
var contextualFormattingEnabled = (_ref2 = runtimeOverride !== null && runtimeOverride !== void 0 ? runtimeOverride : api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.contextualFormattingMode()) !== null && _ref2 !== void 0 ? _ref2 : 'always-pinned';
|
|
51
49
|
if (isSharedSection && !shouldShowSection(editorViewMode, toolbar, editorToolbarDockingPreference, contextualFormattingEnabled)) {
|
|
52
50
|
return null;
|
|
53
51
|
}
|
|
@@ -13,7 +13,6 @@ import { AllSelection, TextSelection } from '@atlaskit/editor-prosemirror/state'
|
|
|
13
13
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
14
14
|
import { ToolbarSection, ToolbarButtonGroup, ToolbarDropdownItemSection, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
15
15
|
import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model';
|
|
16
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
17
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
19
18
|
import { SELECTION_TOOLBAR_LABEL } from '../consts';
|
|
@@ -69,8 +68,7 @@ export var SelectionToolbar = function SelectionToolbar(_ref) {
|
|
|
69
68
|
shouldShowToolbar = _usePluginState.shouldShowToolbar,
|
|
70
69
|
editorViewMode = _usePluginState.editorViewMode,
|
|
71
70
|
contextualFormattingModeOverride = _usePluginState.contextualFormattingModeOverride;
|
|
72
|
-
var
|
|
73
|
-
var contextualFormattingEnabled = (_ref2 = effectiveRuntimeOverride !== null && effectiveRuntimeOverride !== void 0 ? effectiveRuntimeOverride : api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.contextualFormattingMode()) !== null && _ref2 !== void 0 ? _ref2 : 'always-pinned';
|
|
71
|
+
var contextualFormattingEnabled = (_ref2 = contextualFormattingModeOverride !== null && contextualFormattingModeOverride !== void 0 ? contextualFormattingModeOverride : api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.contextualFormattingMode()) !== null && _ref2 !== void 0 ? _ref2 : 'always-pinned';
|
|
74
72
|
var selectionToolbarConfigEnabled = shouldShowSelectionToolbar(contextualFormattingEnabled, editorToolbarDockingPreference);
|
|
75
73
|
var intl = useIntl();
|
|
76
74
|
var components = api === null || api === void 0 || (_api$toolbar2 = api.toolbar) === null || _api$toolbar2 === void 0 ? void 0 : _api$toolbar2.actions.getComponents();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-toolbar",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.34",
|
|
4
4
|
"description": "Toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,20 +32,16 @@
|
|
|
32
32
|
"@atlaskit/editor-toolbar": "^2.3.0",
|
|
33
33
|
"@atlaskit/editor-toolbar-model": "^1.1.0",
|
|
34
34
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
35
|
-
"@atlaskit/tmp-editor-statsig": "^135.
|
|
35
|
+
"@atlaskit/tmp-editor-statsig": "^135.5.0",
|
|
36
36
|
"@babel/runtime": "^7.0.0",
|
|
37
37
|
"bind-event-listener": "^3.0.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@atlaskit/editor-common": "^116.
|
|
40
|
+
"@atlaskit/editor-common": "^116.44.0",
|
|
41
41
|
"react": "^18.2.0",
|
|
42
42
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
43
43
|
},
|
|
44
|
-
"platform-feature-flags": {
|
|
45
|
-
"platform_editor_toolbar_mode_override": {
|
|
46
|
-
"type": "boolean"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
44
|
+
"platform-feature-flags": {},
|
|
49
45
|
"techstack": {
|
|
50
46
|
"@atlassian/frontend": {
|
|
51
47
|
"code-structure": [
|