@atlaskit/editor-plugin-loom 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 +9 -0
- package/dist/cjs/ui/PrimaryToolbarButton.js +7 -6
- package/dist/cjs/ui/ToolbarButtonComponent.js +6 -4
- package/dist/es2019/ui/PrimaryToolbarButton.js +8 -7
- package/dist/es2019/ui/ToolbarButtonComponent.js +7 -5
- package/dist/esm/ui/PrimaryToolbarButton.js +8 -7
- package/dist/esm/ui/ToolbarButtonComponent.js +7 -5
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-loom
|
|
2
2
|
|
|
3
|
+
## 5.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#182839](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/182839)
|
|
8
|
+
[`81f1c3383bdab`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/81f1c3383bdab) -
|
|
9
|
+
refactor: use useSharedPluginStateWithSelector instead of useSharedPluginStateSelector
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 5.0.0
|
|
4
13
|
|
|
5
14
|
### Major Changes
|
|
@@ -11,7 +11,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
13
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
14
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
15
14
|
var _commands = require("../pm-plugins/commands");
|
|
16
15
|
var _ToolbarButtonComponent = _interopRequireDefault(require("./ToolbarButtonComponent"));
|
|
17
16
|
var _excluded = ["onClickBeforeInit", "isDisabled", "href"];
|
|
@@ -21,13 +20,15 @@ var _excluded = ["onClickBeforeInit", "isDisabled", "href"];
|
|
|
21
20
|
*/
|
|
22
21
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
23
22
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var connectivityMode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'connectivity.mode');
|
|
23
|
+
var selector = function selector(states) {
|
|
24
|
+
var _states$loomState, _states$connectivityS;
|
|
27
25
|
return {
|
|
28
|
-
loomEnabled:
|
|
29
|
-
connectivityMode:
|
|
26
|
+
loomEnabled: (_states$loomState = states.loomState) === null || _states$loomState === void 0 ? void 0 : _states$loomState.isEnabled,
|
|
27
|
+
connectivityMode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
|
|
30
28
|
};
|
|
29
|
+
};
|
|
30
|
+
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
31
|
+
return (0, _hooks.useSharedPluginStateWithSelector)(api, ['loom', 'connectivity'], selector);
|
|
31
32
|
}, function (api) {
|
|
32
33
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['loom', 'connectivity']),
|
|
33
34
|
loomState = _useSharedPluginState.loomState,
|
|
@@ -11,7 +11,6 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
11
11
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
12
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
13
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
14
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
15
14
|
var _video = _interopRequireDefault(require("@atlaskit/icon/core/video"));
|
|
16
15
|
/**
|
|
17
16
|
* @jsxRuntime classic
|
|
@@ -26,11 +25,14 @@ var LOOM_BUTTON_WIDTH_BREAKPOINT = 1076;
|
|
|
26
25
|
var iconMinWidthStyle = (0, _react2.css)({
|
|
27
26
|
minWidth: 24
|
|
28
27
|
});
|
|
29
|
-
var
|
|
30
|
-
var
|
|
28
|
+
var selector = function selector(states) {
|
|
29
|
+
var _states$widthState;
|
|
31
30
|
return {
|
|
32
|
-
width: width
|
|
31
|
+
width: (_states$widthState = states.widthState) === null || _states$widthState === void 0 ? void 0 : _states$widthState.width
|
|
33
32
|
};
|
|
33
|
+
};
|
|
34
|
+
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
35
|
+
return (0, _hooks.useSharedPluginStateWithSelector)(api, ['width'], selector);
|
|
34
36
|
}, function (api) {
|
|
35
37
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['width']),
|
|
36
38
|
widthState = _useSharedPluginState.widthState;
|
|
@@ -7,17 +7,18 @@ import React, { useCallback } from 'react';
|
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
11
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
10
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
12
11
|
import { executeRecordVideo } from '../pm-plugins/commands';
|
|
13
12
|
import ToolbarButtonComponent from './ToolbarButtonComponent';
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const connectivityMode = useSharedPluginStateSelector(api, 'connectivity.mode');
|
|
13
|
+
const selector = states => {
|
|
14
|
+
var _states$loomState, _states$connectivityS;
|
|
17
15
|
return {
|
|
18
|
-
loomEnabled,
|
|
19
|
-
connectivityMode
|
|
16
|
+
loomEnabled: (_states$loomState = states.loomState) === null || _states$loomState === void 0 ? void 0 : _states$loomState.isEnabled,
|
|
17
|
+
connectivityMode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
|
|
20
18
|
};
|
|
19
|
+
};
|
|
20
|
+
const useSharedState = sharedPluginStateHookMigratorFactory(api => {
|
|
21
|
+
return useSharedPluginStateWithSelector(api, ['loom', 'connectivity'], selector);
|
|
21
22
|
}, api => {
|
|
22
23
|
const {
|
|
23
24
|
loomState,
|
|
@@ -7,10 +7,9 @@ import React from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { jsx, css } from '@emotion/react';
|
|
9
9
|
import { injectIntl } from 'react-intl-next';
|
|
10
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
10
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
11
11
|
import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages';
|
|
12
12
|
import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
13
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
14
13
|
import VideoIcon from '@atlaskit/icon/core/video';
|
|
15
14
|
// This const is derived from the breakpoint where the toolbar hides its icons. It is used to hide the text in the AI button.
|
|
16
15
|
// Derived from values from platform/packages/editor/editor-core/src/ui/Appearance/FullPage/MainToolbar.tsx
|
|
@@ -18,11 +17,14 @@ const LOOM_BUTTON_WIDTH_BREAKPOINT = 1076;
|
|
|
18
17
|
const iconMinWidthStyle = css({
|
|
19
18
|
minWidth: 24
|
|
20
19
|
});
|
|
21
|
-
const
|
|
22
|
-
|
|
20
|
+
const selector = states => {
|
|
21
|
+
var _states$widthState;
|
|
23
22
|
return {
|
|
24
|
-
width
|
|
23
|
+
width: (_states$widthState = states.widthState) === null || _states$widthState === void 0 ? void 0 : _states$widthState.width
|
|
25
24
|
};
|
|
25
|
+
};
|
|
26
|
+
const useSharedState = sharedPluginStateHookMigratorFactory(api => {
|
|
27
|
+
return useSharedPluginStateWithSelector(api, ['width'], selector);
|
|
26
28
|
}, api => {
|
|
27
29
|
const {
|
|
28
30
|
widthState
|
|
@@ -9,17 +9,18 @@ import React, { useCallback } from 'react';
|
|
|
9
9
|
|
|
10
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
11
|
import { jsx } from '@emotion/react';
|
|
12
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
13
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
12
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
14
13
|
import { executeRecordVideo } from '../pm-plugins/commands';
|
|
15
14
|
import ToolbarButtonComponent from './ToolbarButtonComponent';
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var connectivityMode = useSharedPluginStateSelector(api, 'connectivity.mode');
|
|
15
|
+
var selector = function selector(states) {
|
|
16
|
+
var _states$loomState, _states$connectivityS;
|
|
19
17
|
return {
|
|
20
|
-
loomEnabled:
|
|
21
|
-
connectivityMode:
|
|
18
|
+
loomEnabled: (_states$loomState = states.loomState) === null || _states$loomState === void 0 ? void 0 : _states$loomState.isEnabled,
|
|
19
|
+
connectivityMode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
|
|
22
20
|
};
|
|
21
|
+
};
|
|
22
|
+
var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
23
|
+
return useSharedPluginStateWithSelector(api, ['loom', 'connectivity'], selector);
|
|
23
24
|
}, function (api) {
|
|
24
25
|
var _useSharedPluginState = useSharedPluginState(api, ['loom', 'connectivity']),
|
|
25
26
|
loomState = _useSharedPluginState.loomState,
|
|
@@ -7,10 +7,9 @@ import React from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { jsx, css } from '@emotion/react';
|
|
9
9
|
import { injectIntl } from 'react-intl-next';
|
|
10
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
10
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
11
11
|
import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages';
|
|
12
12
|
import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
13
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
14
13
|
import VideoIcon from '@atlaskit/icon/core/video';
|
|
15
14
|
// This const is derived from the breakpoint where the toolbar hides its icons. It is used to hide the text in the AI button.
|
|
16
15
|
// Derived from values from platform/packages/editor/editor-core/src/ui/Appearance/FullPage/MainToolbar.tsx
|
|
@@ -18,11 +17,14 @@ var LOOM_BUTTON_WIDTH_BREAKPOINT = 1076;
|
|
|
18
17
|
var iconMinWidthStyle = css({
|
|
19
18
|
minWidth: 24
|
|
20
19
|
});
|
|
21
|
-
var
|
|
22
|
-
var
|
|
20
|
+
var selector = function selector(states) {
|
|
21
|
+
var _states$widthState;
|
|
23
22
|
return {
|
|
24
|
-
width: width
|
|
23
|
+
width: (_states$widthState = states.widthState) === null || _states$widthState === void 0 ? void 0 : _states$widthState.width
|
|
25
24
|
};
|
|
25
|
+
};
|
|
26
|
+
var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
27
|
+
return useSharedPluginStateWithSelector(api, ['width'], selector);
|
|
26
28
|
}, function (api) {
|
|
27
29
|
var _useSharedPluginState = useSharedPluginState(api, ['width']),
|
|
28
30
|
widthState = _useSharedPluginState.widthState;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-loom",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Loom plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@atlaskit/editor-plugin-quick-insert": "^3.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-width": "^4.0.0",
|
|
44
44
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
45
|
-
"@atlaskit/icon": "^27.
|
|
45
|
+
"@atlaskit/icon": "^27.3.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
47
|
"@atlaskit/tokens": "^5.4.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@loomhq/record-sdk": "^2.36.18"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@atlaskit/editor-common": "^107.
|
|
53
|
+
"@atlaskit/editor-common": "^107.7.0",
|
|
54
54
|
"react": "^18.2.0",
|
|
55
55
|
"react-dom": "^18.2.0",
|
|
56
56
|
"react-intl-next": "npm:react-intl@^5.18.1"
|