@atlaskit/editor-plugin-loom 7.0.0 → 7.1.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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/editor-plugin-loom
2
2
 
3
+ ## 7.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7e4750e649998`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7e4750e649998) -
8
+ Hide Menu section for loom and pinning when in view mode
9
+ - Updated dependencies
10
+
11
+ ## 7.1.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`4edb2aee0da9c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4edb2aee0da9c) -
16
+ Add conditionalHooksFactory and migrate usage of useSharedPluginStateSelector to useEditorToolbar
17
+ and useSharedPluginStateWithSelector
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 7.0.0
4
24
 
5
25
  ### Patch Changes
@@ -6,13 +6,37 @@ 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 viewMode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'editorViewMode.mode');
15
- var isEdit = viewMode === 'edit';
34
+ var _usePluginState = usePluginState(api),
35
+ editorViewMode = _usePluginState.editorViewMode;
36
+ var isEdit = editorViewMode === 'edit';
37
+ if (!isEdit) {
38
+ return null;
39
+ }
16
40
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
17
41
  hasSeparator: isEdit
18
42
  }, children);
@@ -1,12 +1,36 @@
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 viewMode = useSharedPluginStateSelector(api, 'editorViewMode.mode');
9
- const isEdit = viewMode === 'edit';
27
+ const {
28
+ editorViewMode
29
+ } = usePluginState(api);
30
+ const isEdit = editorViewMode === 'edit';
31
+ if (!isEdit) {
32
+ return null;
33
+ }
10
34
  return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
11
35
  hasSeparator: isEdit
12
36
  }, children);
@@ -1,11 +1,35 @@
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 viewMode = useSharedPluginStateSelector(api, 'editorViewMode.mode');
8
- var isEdit = viewMode === 'edit';
27
+ var _usePluginState = usePluginState(api),
28
+ editorViewMode = _usePluginState.editorViewMode;
29
+ var isEdit = editorViewMode === 'edit';
30
+ if (!isEdit) {
31
+ return null;
32
+ }
9
33
  return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
10
34
  hasSeparator: isEdit
11
35
  }, children);
@@ -5,5 +5,5 @@ type MenuSectionProps = {
5
5
  api: ExtractInjectionAPI<LoomPlugin> | undefined;
6
6
  children: React.ReactNode;
7
7
  };
8
- export declare const MenuSection: ({ children, api }: MenuSectionProps) => React.JSX.Element;
8
+ export declare const MenuSection: ({ children, api }: MenuSectionProps) => React.JSX.Element | null;
9
9
  export {};
@@ -5,5 +5,5 @@ type MenuSectionProps = {
5
5
  api: ExtractInjectionAPI<LoomPlugin> | undefined;
6
6
  children: React.ReactNode;
7
7
  };
8
- export declare const MenuSection: ({ children, api }: MenuSectionProps) => React.JSX.Element;
8
+ export declare const MenuSection: ({ children, api }: MenuSectionProps) => React.JSX.Element | null;
9
9
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-loom",
3
- "version": "7.0.0",
3
+ "version": "7.1.1",
4
4
  "description": "Loom plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,32 +33,33 @@
33
33
  "atlaskit:src": "src/index.ts",
34
34
  "dependencies": {
35
35
  "@atlaskit/button": "^23.4.0",
36
- "@atlaskit/editor-plugin-analytics": "^5.0.0",
36
+ "@atlaskit/editor-plugin-analytics": "^5.1.0",
37
37
  "@atlaskit/editor-plugin-editor-viewmode": "^7.0.0",
38
- "@atlaskit/editor-plugin-hyperlink": "^7.0.0",
38
+ "@atlaskit/editor-plugin-hyperlink": "^7.2.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.0.0",
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/tmp-editor-statsig": "^12.9.0",
47
+ "@atlaskit/platform-feature-flags-react": "^0.3.0",
48
+ "@atlaskit/tmp-editor-statsig": "^12.17.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.0.0",
55
+ "@atlaskit/editor-common": "^109.3.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"
58
59
  },
59
60
  "devDependencies": {
60
- "@atlaskit/editor-plugin-base": "^6.0.0",
61
- "@atlaskit/editor-plugin-card": "^9.0.0",
61
+ "@atlaskit/editor-plugin-base": "^6.1.0",
62
+ "@atlaskit/editor-plugin-card": "^9.1.0",
62
63
  "@atlaskit/editor-plugin-copy-button": "^5.0.0",
63
64
  "@atlaskit/editor-plugin-decorations": "^5.0.0",
64
65
  "@atlaskit/editor-plugin-editor-disabled": "^5.0.0",