@atlaskit/editor-plugin-loom 7.0.0 → 7.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 +12 -0
- package/dist/cjs/ui/MenuSection.js +23 -2
- package/dist/es2019/ui/MenuSection.js +23 -2
- package/dist/esm/ui/MenuSection.js +23 -2
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-loom
|
|
2
2
|
|
|
3
|
+
## 7.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`4edb2aee0da9c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4edb2aee0da9c) -
|
|
8
|
+
Add conditionalHooksFactory and migrate usage of useSharedPluginStateSelector to useEditorToolbar
|
|
9
|
+
and useSharedPluginStateWithSelector
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 7.0.0
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -6,13 +6,34 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.MenuSection = 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
|
+
editorViewMode = _useEditorToolbar.editorViewMode;
|
|
22
|
+
return {
|
|
23
|
+
editorViewMode: editorViewMode
|
|
24
|
+
};
|
|
25
|
+
}, function (api) {
|
|
26
|
+
var editorViewMode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'editorViewMode.mode');
|
|
27
|
+
return {
|
|
28
|
+
editorViewMode: editorViewMode
|
|
29
|
+
};
|
|
30
|
+
});
|
|
11
31
|
var MenuSection = exports.MenuSection = function MenuSection(_ref) {
|
|
12
32
|
var children = _ref.children,
|
|
13
33
|
api = _ref.api;
|
|
14
|
-
var
|
|
15
|
-
|
|
34
|
+
var _usePluginState = usePluginState(api),
|
|
35
|
+
editorViewMode = _usePluginState.editorViewMode;
|
|
36
|
+
var isEdit = editorViewMode === 'edit';
|
|
16
37
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
|
|
17
38
|
hasSeparator: isEdit
|
|
18
39
|
}, children);
|
|
@@ -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 { ToolbarDropdownItemSection } 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
|
+
editorViewMode
|
|
13
|
+
} = useEditorToolbar();
|
|
14
|
+
return {
|
|
15
|
+
editorViewMode
|
|
16
|
+
};
|
|
17
|
+
}, api => {
|
|
18
|
+
const editorViewMode = useSharedPluginStateSelector(api, 'editorViewMode.mode');
|
|
19
|
+
return {
|
|
20
|
+
editorViewMode
|
|
21
|
+
};
|
|
22
|
+
});
|
|
4
23
|
export const MenuSection = ({
|
|
5
24
|
children,
|
|
6
25
|
api
|
|
7
26
|
}) => {
|
|
8
|
-
const
|
|
9
|
-
|
|
27
|
+
const {
|
|
28
|
+
editorViewMode
|
|
29
|
+
} = usePluginState(api);
|
|
30
|
+
const isEdit = editorViewMode === 'edit';
|
|
10
31
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
11
32
|
hasSeparator: isEdit
|
|
12
33
|
}, children);
|
|
@@ -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 { ToolbarDropdownItemSection } 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
|
+
editorViewMode = _useEditorToolbar.editorViewMode;
|
|
15
|
+
return {
|
|
16
|
+
editorViewMode: editorViewMode
|
|
17
|
+
};
|
|
18
|
+
}, function (api) {
|
|
19
|
+
var editorViewMode = useSharedPluginStateSelector(api, 'editorViewMode.mode');
|
|
20
|
+
return {
|
|
21
|
+
editorViewMode: editorViewMode
|
|
22
|
+
};
|
|
23
|
+
});
|
|
4
24
|
export var MenuSection = function MenuSection(_ref) {
|
|
5
25
|
var children = _ref.children,
|
|
6
26
|
api = _ref.api;
|
|
7
|
-
var
|
|
8
|
-
|
|
27
|
+
var _usePluginState = usePluginState(api),
|
|
28
|
+
editorViewMode = _usePluginState.editorViewMode;
|
|
29
|
+
var isEdit = editorViewMode === 'edit';
|
|
9
30
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
10
31
|
hasSeparator: isEdit
|
|
11
32
|
}, children);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-loom",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Loom plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,20 +38,21 @@
|
|
|
38
38
|
"@atlaskit/editor-plugin-hyperlink": "^7.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-primary-toolbar": "^6.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-quick-insert": "^5.0.0",
|
|
41
|
-
"@atlaskit/editor-plugin-toolbar": "^2.
|
|
41
|
+
"@atlaskit/editor-plugin-toolbar": "^2.1.0",
|
|
42
42
|
"@atlaskit/editor-plugin-width": "^6.0.0",
|
|
43
43
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
44
44
|
"@atlaskit/editor-toolbar": "^0.8.0",
|
|
45
45
|
"@atlaskit/icon": "^28.1.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
|
-
"@atlaskit/
|
|
47
|
+
"@atlaskit/platform-feature-flags-react": "^0.3.0",
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^12.10.0",
|
|
48
49
|
"@atlaskit/tokens": "^6.3.0",
|
|
49
50
|
"@babel/runtime": "^7.0.0",
|
|
50
51
|
"@emotion/react": "^11.7.1",
|
|
51
52
|
"@loomhq/record-sdk": "^2.36.18"
|
|
52
53
|
},
|
|
53
54
|
"peerDependencies": {
|
|
54
|
-
"@atlaskit/editor-common": "^109.
|
|
55
|
+
"@atlaskit/editor-common": "^109.1.0",
|
|
55
56
|
"react": "^18.2.0",
|
|
56
57
|
"react-dom": "^18.2.0",
|
|
57
58
|
"react-intl-next": "npm:react-intl@^5.18.1"
|