@atlaskit/editor-plugin-loom 6.0.4 → 6.0.5

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,13 @@
1
1
  # @atlaskit/editor-plugin-loom
2
2
 
3
+ ## 6.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`0812ff5bd7bd1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0812ff5bd7bd1) -
8
+ Dont render menu sections in live view
9
+ - Updated dependencies
10
+
3
11
  ## 6.0.4
4
12
 
5
13
  ### Patch Changes
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.MenuSection = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
10
+ var _editorToolbar = require("@atlaskit/editor-toolbar");
11
+ var MenuSection = exports.MenuSection = function MenuSection(_ref) {
12
+ var children = _ref.children,
13
+ api = _ref.api;
14
+ var viewMode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'editorViewMode.mode');
15
+ var isEdit = viewMode === 'edit';
16
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
17
+ hasSeparator: isEdit
18
+ }, children);
19
+ };
@@ -8,7 +8,9 @@ exports.getToolbarComponents = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _toolbar = require("@atlaskit/editor-common/toolbar");
10
10
  var _editorToolbar = require("@atlaskit/editor-toolbar");
11
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
11
12
  var _LoomMenuItem = require("./LoomMenuItem");
13
+ var _MenuSection = require("./MenuSection");
12
14
  var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents(config, api) {
13
15
  return [{
14
16
  type: _toolbar.LOOM_MENU_SECTION.type,
@@ -24,6 +26,11 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
24
26
  }],
25
27
  component: function component(_ref) {
26
28
  var children = _ref.children;
29
+ if ((0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true)) {
30
+ return /*#__PURE__*/_react.default.createElement(_MenuSection.MenuSection, {
31
+ api: api
32
+ }, children);
33
+ }
27
34
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
28
35
  hasSeparator: true
29
36
  }, children);
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
3
+ import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
4
+ export const MenuSection = ({
5
+ children,
6
+ api
7
+ }) => {
8
+ const viewMode = useSharedPluginStateSelector(api, 'editorViewMode.mode');
9
+ const isEdit = viewMode === 'edit';
10
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
11
+ hasSeparator: isEdit
12
+ }, children);
13
+ };
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { LOOM_MENU_SECTION, OVERFLOW_MENU_RANK, OVERFLOW_MENU, LOOM_MENU_ITEM, LOOM_MENU_SECTION_RANK, OVERFLOW_MENU_PRIMARY_TOOLBAR_RANK, OVERFLOW_MENU_PRIMARY_TOOLBAR } from '@atlaskit/editor-common/toolbar';
3
3
  import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  import { LoomMenuItem } from './LoomMenuItem';
6
+ import { MenuSection } from './MenuSection';
5
7
  export const getToolbarComponents = (config, api) => {
6
8
  return [{
7
9
  type: LOOM_MENU_SECTION.type,
@@ -18,6 +20,11 @@ export const getToolbarComponents = (config, api) => {
18
20
  component: ({
19
21
  children
20
22
  }) => {
23
+ if (expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true)) {
24
+ return /*#__PURE__*/React.createElement(MenuSection, {
25
+ api: api
26
+ }, children);
27
+ }
21
28
  return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
22
29
  hasSeparator: true
23
30
  }, children);
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
3
+ import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
4
+ export var MenuSection = function MenuSection(_ref) {
5
+ var children = _ref.children,
6
+ api = _ref.api;
7
+ var viewMode = useSharedPluginStateSelector(api, 'editorViewMode.mode');
8
+ var isEdit = viewMode === 'edit';
9
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
10
+ hasSeparator: isEdit
11
+ }, children);
12
+ };
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { LOOM_MENU_SECTION, OVERFLOW_MENU_RANK, OVERFLOW_MENU, LOOM_MENU_ITEM, LOOM_MENU_SECTION_RANK, OVERFLOW_MENU_PRIMARY_TOOLBAR_RANK, OVERFLOW_MENU_PRIMARY_TOOLBAR } from '@atlaskit/editor-common/toolbar';
3
3
  import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  import { LoomMenuItem } from './LoomMenuItem';
6
+ import { MenuSection } from './MenuSection';
5
7
  export var getToolbarComponents = function getToolbarComponents(config, api) {
6
8
  return [{
7
9
  type: LOOM_MENU_SECTION.type,
@@ -17,6 +19,11 @@ export var getToolbarComponents = function getToolbarComponents(config, api) {
17
19
  }],
18
20
  component: function component(_ref) {
19
21
  var children = _ref.children;
22
+ if (expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true)) {
23
+ return /*#__PURE__*/React.createElement(MenuSection, {
24
+ api: api
25
+ }, children);
26
+ }
20
27
  return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
21
28
  hasSeparator: true
22
29
  }, children);
@@ -3,6 +3,7 @@ import { type INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
4
4
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
5
  import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
6
+ import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
6
7
  import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
7
8
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
8
9
  import { type QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
@@ -41,7 +42,8 @@ export type LoomPlugin = NextEditorPlugin<'loom', {
41
42
  OptionalPlugin<PrimaryToolbarPlugin>,
42
43
  OptionalPlugin<QuickInsertPlugin>,
43
44
  OptionalPlugin<ConnectivityPlugin>,
44
- OptionalPlugin<ToolbarPlugin>
45
+ OptionalPlugin<ToolbarPlugin>,
46
+ OptionalPlugin<EditorViewModePlugin>
45
47
  ];
46
48
  pluginConfiguration: LoomPluginOptions;
47
49
  sharedState: LoomPluginState | undefined;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { LoomPlugin } from '../loomPluginType';
4
+ type MenuSectionProps = {
5
+ api: ExtractInjectionAPI<LoomPlugin> | undefined;
6
+ children: React.ReactNode;
7
+ };
8
+ export declare const MenuSection: ({ children, api }: MenuSectionProps) => React.JSX.Element;
9
+ export {};
@@ -3,6 +3,7 @@ import { type INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
4
4
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
5
  import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
6
+ import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
6
7
  import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
7
8
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
8
9
  import { type QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
@@ -41,7 +42,8 @@ export type LoomPlugin = NextEditorPlugin<'loom', {
41
42
  OptionalPlugin<PrimaryToolbarPlugin>,
42
43
  OptionalPlugin<QuickInsertPlugin>,
43
44
  OptionalPlugin<ConnectivityPlugin>,
44
- OptionalPlugin<ToolbarPlugin>
45
+ OptionalPlugin<ToolbarPlugin>,
46
+ OptionalPlugin<EditorViewModePlugin>
45
47
  ];
46
48
  pluginConfiguration: LoomPluginOptions;
47
49
  sharedState: LoomPluginState | undefined;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { LoomPlugin } from '../loomPluginType';
4
+ type MenuSectionProps = {
5
+ api: ExtractInjectionAPI<LoomPlugin> | undefined;
6
+ children: React.ReactNode;
7
+ };
8
+ export declare const MenuSection: ({ children, api }: MenuSectionProps) => React.JSX.Element;
9
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-loom",
3
- "version": "6.0.4",
3
+ "version": "6.0.5",
4
4
  "description": "Loom plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,6 +34,7 @@
34
34
  "dependencies": {
35
35
  "@atlaskit/button": "^23.4.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^4.0.0",
37
+ "@atlaskit/editor-plugin-editor-viewmode": "^6.0.0",
37
38
  "@atlaskit/editor-plugin-hyperlink": "^6.0.0",
38
39
  "@atlaskit/editor-plugin-primary-toolbar": "^5.0.0",
39
40
  "@atlaskit/editor-plugin-quick-insert": "^4.0.0",
@@ -43,14 +44,14 @@
43
44
  "@atlaskit/editor-toolbar": "^0.8.0",
44
45
  "@atlaskit/icon": "^28.1.0",
45
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
46
- "@atlaskit/tmp-editor-statsig": "^12.5.0",
47
- "@atlaskit/tokens": "^6.2.0",
47
+ "@atlaskit/tmp-editor-statsig": "^12.7.0",
48
+ "@atlaskit/tokens": "^6.3.0",
48
49
  "@babel/runtime": "^7.0.0",
49
50
  "@emotion/react": "^11.7.1",
50
51
  "@loomhq/record-sdk": "^2.36.18"
51
52
  },
52
53
  "peerDependencies": {
53
- "@atlaskit/editor-common": "^108.5.0",
54
+ "@atlaskit/editor-common": "^108.6.0",
54
55
  "react": "^18.2.0",
55
56
  "react-dom": "^18.2.0",
56
57
  "react-intl-next": "npm:react-intl@^5.18.1"