@atlaskit/editor-plugin-loom 2.2.9 → 2.2.11

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,20 @@
1
1
  # @atlaskit/editor-plugin-loom
2
2
 
3
+ ## 2.2.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 2.2.10
10
+
11
+ ### Patch Changes
12
+
13
+ - [#109923](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109923)
14
+ [`ed20be4a6f5d5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ed20be4a6f5d5) -
15
+ ED-23511 fix loom and it button responsive
16
+ - Updated dependencies
17
+
3
18
  ## 2.2.9
4
19
 
5
20
  ### Patch Changes
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = void 0;
8
- var _react = _interopRequireDefault(require("react"));
7
+ var _react = require("@emotion/react");
9
8
  var _reactIntlNext = require("react-intl-next");
10
9
  var _analytics = require("@atlaskit/editor-common/analytics");
11
10
  var _hooks = require("@atlaskit/editor-common/hooks");
@@ -14,7 +13,9 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
14
13
  var _logo = require("@atlaskit/logo");
15
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
15
  var _commands = require("../commands");
17
- var _useWindowWidth = require("../hooks/useWindowWidth");
16
+ /** @jsx jsx */
17
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
18
+
18
19
  // This const is derived from the breakpoint where the toolbar hides its icons. It is used to hide the text in the AI button.
19
20
  // Derived from values from platform/packages/editor/editor-core/src/ui/Appearance/FullPage/MainToolbar.tsx
20
21
  var LOOM_BUTTON_WIDTH_BREAKPOINT = 1076;
@@ -23,14 +24,14 @@ var LoomToolbarButton = function LoomToolbarButton(_ref) {
23
24
  api = _ref.api,
24
25
  appearance = _ref.appearance,
25
26
  formatMessage = _ref.intl.formatMessage;
26
- var width = (0, _useWindowWidth.useWindowWidth)();
27
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['loom']),
28
- loomState = _useSharedPluginState.loomState;
27
+ var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['loom', 'width']),
28
+ loomState = _useSharedPluginState.loomState,
29
+ widthState = _useSharedPluginState.widthState;
29
30
  if (!loomState) {
30
31
  return null;
31
32
  }
32
33
  var label = formatMessage(appearance === 'comment' ? _messages.toolbarInsertBlockMessages.addLoomVideoComment : _messages.toolbarInsertBlockMessages.addLoomVideo);
33
- return /*#__PURE__*/_react.default.createElement(_uiMenu.ToolbarButton, {
34
+ return (0, _react.jsx)(_uiMenu.ToolbarButton, {
34
35
  buttonId: _uiMenu.TOOLBAR_BUTTON.RECORD_VIDEO,
35
36
  onClick: function onClick() {
36
37
  var _api$core, _api$analytics;
@@ -43,10 +44,10 @@ var LoomToolbarButton = function LoomToolbarButton(_ref) {
43
44
  ,
44
45
  disabled: disabled || !(loomState !== null && loomState !== void 0 && loomState.isEnabled),
45
46
  title: label,
46
- iconBefore: /*#__PURE__*/_react.default.createElement(_logo.LoomIcon, {
47
+ iconBefore: (0, _react.jsx)(_logo.LoomIcon, {
47
48
  label: label,
48
49
  size: "small"
49
50
  })
50
- }, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.plugin.loom.responsive-menu_4at4a') && width >= LOOM_BUTTON_WIDTH_BREAKPOINT && /*#__PURE__*/_react.default.createElement("span", null, formatMessage(_messages.toolbarInsertBlockMessages.recordLoomShortTitle)));
51
+ }, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.plugin.loom.responsive-menu_4at4a') && ((widthState === null || widthState === void 0 ? void 0 : widthState.width) || 0) > LOOM_BUTTON_WIDTH_BREAKPOINT && (0, _react.jsx)("span", null, formatMessage(_messages.toolbarInsertBlockMessages.recordLoomShortTitle)));
51
52
  };
52
53
  var _default = exports.default = (0, _reactIntlNext.injectIntl)(LoomToolbarButton);
@@ -1,4 +1,6 @@
1
- import React from 'react';
1
+ /** @jsx jsx */
2
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
+ import { jsx } from '@emotion/react';
2
4
  import { injectIntl } from 'react-intl-next';
3
5
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
6
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
@@ -7,7 +9,6 @@ import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
7
9
  import { LoomIcon } from '@atlaskit/logo';
8
10
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
11
  import { recordVideo } from '../commands';
10
- import { useWindowWidth } from '../hooks/useWindowWidth';
11
12
  // This const is derived from the breakpoint where the toolbar hides its icons. It is used to hide the text in the AI button.
12
13
  // Derived from values from platform/packages/editor/editor-core/src/ui/Appearance/FullPage/MainToolbar.tsx
13
14
  const LOOM_BUTTON_WIDTH_BREAKPOINT = 1076;
@@ -19,15 +20,15 @@ const LoomToolbarButton = ({
19
20
  formatMessage
20
21
  }
21
22
  }) => {
22
- const width = useWindowWidth();
23
23
  const {
24
- loomState
25
- } = useSharedPluginState(api, ['loom']);
24
+ loomState,
25
+ widthState
26
+ } = useSharedPluginState(api, ['loom', 'width']);
26
27
  if (!loomState) {
27
28
  return null;
28
29
  }
29
30
  const label = formatMessage(appearance === 'comment' ? toolbarInsertBlockMessages.addLoomVideoComment : toolbarInsertBlockMessages.addLoomVideo);
30
- return /*#__PURE__*/React.createElement(ToolbarButton, {
31
+ return jsx(ToolbarButton, {
31
32
  buttonId: TOOLBAR_BUTTON.RECORD_VIDEO,
32
33
  onClick: () => {
33
34
  var _api$core, _api$analytics;
@@ -40,10 +41,10 @@ const LoomToolbarButton = ({
40
41
  ,
41
42
  disabled: disabled || !(loomState !== null && loomState !== void 0 && loomState.isEnabled),
42
43
  title: label,
43
- iconBefore: /*#__PURE__*/React.createElement(LoomIcon, {
44
+ iconBefore: jsx(LoomIcon, {
44
45
  label: label,
45
46
  size: "small"
46
47
  })
47
- }, getBooleanFF('platform.editor.plugin.loom.responsive-menu_4at4a') && width >= LOOM_BUTTON_WIDTH_BREAKPOINT && /*#__PURE__*/React.createElement("span", null, formatMessage(toolbarInsertBlockMessages.recordLoomShortTitle)));
48
+ }, getBooleanFF('platform.editor.plugin.loom.responsive-menu_4at4a') && ((widthState === null || widthState === void 0 ? void 0 : widthState.width) || 0) > LOOM_BUTTON_WIDTH_BREAKPOINT && jsx("span", null, formatMessage(toolbarInsertBlockMessages.recordLoomShortTitle)));
48
49
  };
49
50
  export default injectIntl(LoomToolbarButton);
@@ -1,4 +1,6 @@
1
- import React from 'react';
1
+ /** @jsx jsx */
2
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
+ import { jsx } from '@emotion/react';
2
4
  import { injectIntl } from 'react-intl-next';
3
5
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
6
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
@@ -7,7 +9,6 @@ import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
7
9
  import { LoomIcon } from '@atlaskit/logo';
8
10
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
11
  import { recordVideo } from '../commands';
10
- import { useWindowWidth } from '../hooks/useWindowWidth';
11
12
  // This const is derived from the breakpoint where the toolbar hides its icons. It is used to hide the text in the AI button.
12
13
  // Derived from values from platform/packages/editor/editor-core/src/ui/Appearance/FullPage/MainToolbar.tsx
13
14
  var LOOM_BUTTON_WIDTH_BREAKPOINT = 1076;
@@ -16,14 +17,14 @@ var LoomToolbarButton = function LoomToolbarButton(_ref) {
16
17
  api = _ref.api,
17
18
  appearance = _ref.appearance,
18
19
  formatMessage = _ref.intl.formatMessage;
19
- var width = useWindowWidth();
20
- var _useSharedPluginState = useSharedPluginState(api, ['loom']),
21
- loomState = _useSharedPluginState.loomState;
20
+ var _useSharedPluginState = useSharedPluginState(api, ['loom', 'width']),
21
+ loomState = _useSharedPluginState.loomState,
22
+ widthState = _useSharedPluginState.widthState;
22
23
  if (!loomState) {
23
24
  return null;
24
25
  }
25
26
  var label = formatMessage(appearance === 'comment' ? toolbarInsertBlockMessages.addLoomVideoComment : toolbarInsertBlockMessages.addLoomVideo);
26
- return /*#__PURE__*/React.createElement(ToolbarButton, {
27
+ return jsx(ToolbarButton, {
27
28
  buttonId: TOOLBAR_BUTTON.RECORD_VIDEO,
28
29
  onClick: function onClick() {
29
30
  var _api$core, _api$analytics;
@@ -36,10 +37,10 @@ var LoomToolbarButton = function LoomToolbarButton(_ref) {
36
37
  ,
37
38
  disabled: disabled || !(loomState !== null && loomState !== void 0 && loomState.isEnabled),
38
39
  title: label,
39
- iconBefore: /*#__PURE__*/React.createElement(LoomIcon, {
40
+ iconBefore: jsx(LoomIcon, {
40
41
  label: label,
41
42
  size: "small"
42
43
  })
43
- }, getBooleanFF('platform.editor.plugin.loom.responsive-menu_4at4a') && width >= LOOM_BUTTON_WIDTH_BREAKPOINT && /*#__PURE__*/React.createElement("span", null, formatMessage(toolbarInsertBlockMessages.recordLoomShortTitle)));
44
+ }, getBooleanFF('platform.editor.plugin.loom.responsive-menu_4at4a') && ((widthState === null || widthState === void 0 ? void 0 : widthState.width) || 0) > LOOM_BUTTON_WIDTH_BREAKPOINT && jsx("span", null, formatMessage(toolbarInsertBlockMessages.recordLoomShortTitle)));
44
45
  };
45
46
  export default injectIntl(LoomToolbarButton);
@@ -3,12 +3,14 @@ import { 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 { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
6
+ import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
6
7
  import type { LoomPluginState } from './pm-plugin';
7
8
  import type { LoomPluginOptions } from './types';
8
9
  export type LoomPlugin = NextEditorPlugin<'loom', {
9
10
  pluginConfiguration: LoomPluginOptions;
10
11
  dependencies: [
11
12
  OptionalPlugin<AnalyticsPlugin>,
13
+ WidthPlugin,
12
14
  HyperlinkPlugin
13
15
  ];
14
16
  sharedState: LoomPluginState | undefined;