@atlaskit/editor-plugin-selection-extension 5.0.0 → 5.0.1
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 +6 -0
- package/dist/cjs/ui/toolbar-components/ToolbarButton.js +23 -2
- package/dist/cjs/ui/toolbar-components/ToolbarMenu.js +20 -2
- package/dist/es2019/ui/toolbar-components/ToolbarButton.js +23 -2
- package/dist/es2019/ui/toolbar-components/ToolbarMenu.js +20 -2
- package/dist/esm/ui/toolbar-components/ToolbarButton.js +23 -2
- package/dist/esm/ui/toolbar-components/ToolbarMenu.js +20 -2
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -6,13 +6,34 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.ToolbarButton = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
9
10
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
10
11
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
12
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
13
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
|
+
/**
|
|
15
|
+
* !! When removing platform_editor_toolbar_aifc_patch_3 also remove package dependency on `@atlaskit/editor-plugin-view-mode`.
|
|
16
|
+
*/
|
|
17
|
+
var usePluginState = (0, _platformFeatureFlagsReact.conditionalHooksFactory)(function () {
|
|
18
|
+
return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
|
|
19
|
+
}, function (api) {
|
|
20
|
+
var _useEditorToolbar = (0, _toolbar.useEditorToolbar)(),
|
|
21
|
+
editorToolbarDockingPreference = _useEditorToolbar.editorToolbarDockingPreference;
|
|
22
|
+
return {
|
|
23
|
+
editorToolbarDockingPreference: editorToolbarDockingPreference
|
|
24
|
+
};
|
|
25
|
+
}, function (api) {
|
|
26
|
+
var editorToolbarDockingPreference = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'userPreferences.preferences.toolbarDockingPosition');
|
|
27
|
+
return {
|
|
28
|
+
editorToolbarDockingPreference: editorToolbarDockingPreference
|
|
29
|
+
};
|
|
30
|
+
});
|
|
11
31
|
var ToolbarButton = exports.ToolbarButton = function ToolbarButton(_ref) {
|
|
12
32
|
var api = _ref.api,
|
|
13
33
|
config = _ref.config;
|
|
14
|
-
var
|
|
15
|
-
|
|
34
|
+
var _usePluginState = usePluginState(api),
|
|
35
|
+
editorToolbarDockingPreference = _usePluginState.editorToolbarDockingPreference;
|
|
36
|
+
var isDockedAtTop = editorToolbarDockingPreference === 'top';
|
|
16
37
|
if (isDockedAtTop) {
|
|
17
38
|
return null;
|
|
18
39
|
}
|
|
@@ -6,14 +6,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.ToolbarMenu = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
9
10
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
10
11
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
12
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
13
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
|
+
var usePluginState = (0, _platformFeatureFlagsReact.conditionalHooksFactory)(function () {
|
|
15
|
+
return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
|
|
16
|
+
}, function (api) {
|
|
17
|
+
var _useEditorToolbar = (0, _toolbar.useEditorToolbar)(),
|
|
18
|
+
editorToolbarDockingPreference = _useEditorToolbar.editorToolbarDockingPreference;
|
|
19
|
+
return {
|
|
20
|
+
editorToolbarDockingPreference: editorToolbarDockingPreference
|
|
21
|
+
};
|
|
22
|
+
}, function (api) {
|
|
23
|
+
var editorToolbarDockingPreference = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'userPreferences.preferences.toolbarDockingPosition');
|
|
24
|
+
return {
|
|
25
|
+
editorToolbarDockingPreference: editorToolbarDockingPreference
|
|
26
|
+
};
|
|
27
|
+
});
|
|
11
28
|
var ToolbarMenu = exports.ToolbarMenu = function ToolbarMenu(_ref) {
|
|
12
29
|
var api = _ref.api,
|
|
13
30
|
config = _ref.config,
|
|
14
31
|
children = _ref.children;
|
|
15
|
-
var
|
|
16
|
-
|
|
32
|
+
var _usePluginState = usePluginState(api),
|
|
33
|
+
editorToolbarDockingPreference = _usePluginState.editorToolbarDockingPreference;
|
|
34
|
+
var isDockedAtTop = editorToolbarDockingPreference === 'top';
|
|
17
35
|
if (isDockedAtTop) {
|
|
18
36
|
return null;
|
|
19
37
|
}
|
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
2
3
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
3
4
|
import { ToolbarTooltip, ToolbarButton as BaseToolbarButton } from '@atlaskit/editor-toolbar';
|
|
5
|
+
import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
|
+
/**
|
|
8
|
+
* !! When removing platform_editor_toolbar_aifc_patch_3 also remove package dependency on `@atlaskit/editor-plugin-view-mode`.
|
|
9
|
+
*/
|
|
10
|
+
const usePluginState = conditionalHooksFactory(() => expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true), api => {
|
|
11
|
+
const {
|
|
12
|
+
editorToolbarDockingPreference
|
|
13
|
+
} = useEditorToolbar();
|
|
14
|
+
return {
|
|
15
|
+
editorToolbarDockingPreference
|
|
16
|
+
};
|
|
17
|
+
}, api => {
|
|
18
|
+
const editorToolbarDockingPreference = useSharedPluginStateSelector(api, 'userPreferences.preferences.toolbarDockingPosition');
|
|
19
|
+
return {
|
|
20
|
+
editorToolbarDockingPreference
|
|
21
|
+
};
|
|
22
|
+
});
|
|
4
23
|
export const ToolbarButton = ({
|
|
5
24
|
api,
|
|
6
25
|
config
|
|
7
26
|
}) => {
|
|
8
|
-
const
|
|
9
|
-
|
|
27
|
+
const {
|
|
28
|
+
editorToolbarDockingPreference
|
|
29
|
+
} = usePluginState(api);
|
|
30
|
+
const isDockedAtTop = editorToolbarDockingPreference === 'top';
|
|
10
31
|
if (isDockedAtTop) {
|
|
11
32
|
return null;
|
|
12
33
|
}
|
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
2
3
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
3
4
|
import { ToolbarTooltip, ToolbarDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
5
|
+
import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
|
+
const usePluginState = conditionalHooksFactory(() => expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true), api => {
|
|
8
|
+
const {
|
|
9
|
+
editorToolbarDockingPreference
|
|
10
|
+
} = useEditorToolbar();
|
|
11
|
+
return {
|
|
12
|
+
editorToolbarDockingPreference
|
|
13
|
+
};
|
|
14
|
+
}, api => {
|
|
15
|
+
const editorToolbarDockingPreference = useSharedPluginStateSelector(api, 'userPreferences.preferences.toolbarDockingPosition');
|
|
16
|
+
return {
|
|
17
|
+
editorToolbarDockingPreference
|
|
18
|
+
};
|
|
19
|
+
});
|
|
4
20
|
export const ToolbarMenu = ({
|
|
5
21
|
api,
|
|
6
22
|
config,
|
|
7
23
|
children
|
|
8
24
|
}) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
25
|
+
const {
|
|
26
|
+
editorToolbarDockingPreference
|
|
27
|
+
} = usePluginState(api);
|
|
28
|
+
const isDockedAtTop = editorToolbarDockingPreference === 'top';
|
|
11
29
|
if (isDockedAtTop) {
|
|
12
30
|
return null;
|
|
13
31
|
}
|
|
@@ -1,11 +1,32 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
2
3
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
3
4
|
import { ToolbarTooltip, ToolbarButton as BaseToolbarButton } from '@atlaskit/editor-toolbar';
|
|
5
|
+
import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
|
+
/**
|
|
8
|
+
* !! When removing platform_editor_toolbar_aifc_patch_3 also remove package dependency on `@atlaskit/editor-plugin-view-mode`.
|
|
9
|
+
*/
|
|
10
|
+
var usePluginState = conditionalHooksFactory(function () {
|
|
11
|
+
return expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
|
|
12
|
+
}, function (api) {
|
|
13
|
+
var _useEditorToolbar = useEditorToolbar(),
|
|
14
|
+
editorToolbarDockingPreference = _useEditorToolbar.editorToolbarDockingPreference;
|
|
15
|
+
return {
|
|
16
|
+
editorToolbarDockingPreference: editorToolbarDockingPreference
|
|
17
|
+
};
|
|
18
|
+
}, function (api) {
|
|
19
|
+
var editorToolbarDockingPreference = useSharedPluginStateSelector(api, 'userPreferences.preferences.toolbarDockingPosition');
|
|
20
|
+
return {
|
|
21
|
+
editorToolbarDockingPreference: editorToolbarDockingPreference
|
|
22
|
+
};
|
|
23
|
+
});
|
|
4
24
|
export var ToolbarButton = function ToolbarButton(_ref) {
|
|
5
25
|
var api = _ref.api,
|
|
6
26
|
config = _ref.config;
|
|
7
|
-
var
|
|
8
|
-
|
|
27
|
+
var _usePluginState = usePluginState(api),
|
|
28
|
+
editorToolbarDockingPreference = _usePluginState.editorToolbarDockingPreference;
|
|
29
|
+
var isDockedAtTop = editorToolbarDockingPreference === 'top';
|
|
9
30
|
if (isDockedAtTop) {
|
|
10
31
|
return null;
|
|
11
32
|
}
|
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
2
3
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
3
4
|
import { ToolbarTooltip, ToolbarDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
5
|
+
import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
|
+
var usePluginState = conditionalHooksFactory(function () {
|
|
8
|
+
return expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
|
|
9
|
+
}, function (api) {
|
|
10
|
+
var _useEditorToolbar = useEditorToolbar(),
|
|
11
|
+
editorToolbarDockingPreference = _useEditorToolbar.editorToolbarDockingPreference;
|
|
12
|
+
return {
|
|
13
|
+
editorToolbarDockingPreference: editorToolbarDockingPreference
|
|
14
|
+
};
|
|
15
|
+
}, function (api) {
|
|
16
|
+
var editorToolbarDockingPreference = useSharedPluginStateSelector(api, 'userPreferences.preferences.toolbarDockingPosition');
|
|
17
|
+
return {
|
|
18
|
+
editorToolbarDockingPreference: editorToolbarDockingPreference
|
|
19
|
+
};
|
|
20
|
+
});
|
|
4
21
|
export var ToolbarMenu = function ToolbarMenu(_ref) {
|
|
5
22
|
var api = _ref.api,
|
|
6
23
|
config = _ref.config,
|
|
7
24
|
children = _ref.children;
|
|
8
|
-
var
|
|
9
|
-
|
|
25
|
+
var _usePluginState = usePluginState(api),
|
|
26
|
+
editorToolbarDockingPreference = _usePluginState.editorToolbarDockingPreference;
|
|
27
|
+
var isDockedAtTop = editorToolbarDockingPreference === 'top';
|
|
10
28
|
if (isDockedAtTop) {
|
|
11
29
|
return null;
|
|
12
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-extension",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"@atlaskit/adf-utils": "^19.21.0",
|
|
36
36
|
"@atlaskit/editor-json-transformer": "^8.27.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^5.0.0",
|
|
38
|
-
"@atlaskit/editor-plugin-block-menu": "^
|
|
38
|
+
"@atlaskit/editor-plugin-block-menu": "^3.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-viewmode": "^7.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-primary-toolbar": "^6.0.0",
|
|
41
|
-
"@atlaskit/editor-plugin-selection-toolbar": "^6.
|
|
42
|
-
"@atlaskit/editor-plugin-toolbar": "^2.
|
|
41
|
+
"@atlaskit/editor-plugin-selection-toolbar": "^6.1.0",
|
|
42
|
+
"@atlaskit/editor-plugin-toolbar": "^2.1.0",
|
|
43
43
|
"@atlaskit/editor-plugin-user-preferences": "^3.0.0",
|
|
44
44
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
45
45
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
@@ -47,15 +47,16 @@
|
|
|
47
47
|
"@atlaskit/editor-toolbar": "^0.8.0",
|
|
48
48
|
"@atlaskit/icon": "^28.1.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
50
|
+
"@atlaskit/platform-feature-flags-react": "^0.3.0",
|
|
50
51
|
"@atlaskit/primitives": "^14.14.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
52
|
+
"@atlaskit/tmp-editor-statsig": "^12.11.0",
|
|
52
53
|
"@babel/runtime": "^7.0.0",
|
|
53
54
|
"lodash": "^4.17.21",
|
|
54
55
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
55
56
|
"uuid": "^3.1.0"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
|
-
"@atlaskit/editor-common": "^109.
|
|
59
|
+
"@atlaskit/editor-common": "^109.1.0",
|
|
59
60
|
"react": "^18.2.0"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|