@atlaskit/editor-plugin-loom 5.1.4 → 5.1.6
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 +14 -0
- package/dist/cjs/ui/PrimaryToolbarButton.js +6 -17
- package/dist/cjs/ui/ToolbarButtonComponent.js +2 -11
- package/dist/es2019/ui/PrimaryToolbarButton.js +3 -15
- package/dist/es2019/ui/ToolbarButtonComponent.js +2 -12
- package/dist/esm/ui/PrimaryToolbarButton.js +7 -18
- package/dist/esm/ui/ToolbarButtonComponent.js +3 -12
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-loom
|
|
2
2
|
|
|
3
|
+
## 5.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 5.1.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`a024ea6d25dc1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a024ea6d25dc1) -
|
|
14
|
+
[ED-29106] cleans up usages of sharedPluginStateHookMigratorFactory
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 5.1.4
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -27,17 +27,6 @@ var selector = function selector(states) {
|
|
|
27
27
|
connectivityMode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
31
|
-
return (0, _hooks.useSharedPluginStateWithSelector)(api, ['loom', 'connectivity'], selector);
|
|
32
|
-
}, function (api) {
|
|
33
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['loom', 'connectivity']),
|
|
34
|
-
loomState = _useSharedPluginState.loomState,
|
|
35
|
-
connectivityState = _useSharedPluginState.connectivityState;
|
|
36
|
-
return {
|
|
37
|
-
loomEnabled: loomState === null || loomState === void 0 ? void 0 : loomState.isEnabled,
|
|
38
|
-
connectivityMode: connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
30
|
var CustomisableLoomToolbarButton = function CustomisableLoomToolbarButton(disabled, appearance, api) {
|
|
42
31
|
return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
43
32
|
var onClickBeforeInit = props.onClickBeforeInit,
|
|
@@ -45,9 +34,9 @@ var CustomisableLoomToolbarButton = function CustomisableLoomToolbarButton(disab
|
|
|
45
34
|
isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
|
|
46
35
|
href = props.href,
|
|
47
36
|
restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
48
|
-
var
|
|
49
|
-
loomEnabled =
|
|
50
|
-
connectivityMode =
|
|
37
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['loom', 'connectivity'], selector),
|
|
38
|
+
loomEnabled = _useSharedPluginState.loomEnabled,
|
|
39
|
+
connectivityMode = _useSharedPluginState.connectivityMode;
|
|
51
40
|
var isLoomEnabled = !!loomEnabled;
|
|
52
41
|
var handleOnClick = (0, _react.useCallback)(function (e) {
|
|
53
42
|
if (isLoomEnabled) {
|
|
@@ -80,9 +69,9 @@ var LoomToolbarButtonWrapper = function LoomToolbarButtonWrapper(_ref) {
|
|
|
80
69
|
var handleOnClick = (0, _react.useCallback)(function () {
|
|
81
70
|
return (0, _commands.executeRecordVideo)(api);
|
|
82
71
|
}, [api]);
|
|
83
|
-
var
|
|
84
|
-
loomEnabled =
|
|
85
|
-
connectivityMode =
|
|
72
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginStateWithSelector)(api, ['loom', 'connectivity'], selector),
|
|
73
|
+
loomEnabled = _useSharedPluginState2.loomEnabled,
|
|
74
|
+
connectivityMode = _useSharedPluginState2.connectivityMode;
|
|
86
75
|
if (loomEnabled === undefined) {
|
|
87
76
|
return null;
|
|
88
77
|
}
|
|
@@ -31,15 +31,6 @@ var selector = function selector(states) {
|
|
|
31
31
|
width: (_states$widthState = states.widthState) === null || _states$widthState === void 0 ? void 0 : _states$widthState.width
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
35
|
-
return (0, _hooks.useSharedPluginStateWithSelector)(api, ['width'], selector);
|
|
36
|
-
}, function (api) {
|
|
37
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['width']),
|
|
38
|
-
widthState = _useSharedPluginState.widthState;
|
|
39
|
-
return {
|
|
40
|
-
width: widthState === null || widthState === void 0 ? void 0 : widthState.width
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
34
|
var LoomToolbarButtonInternal = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
44
35
|
var disabled = _ref.disabled,
|
|
45
36
|
api = _ref.api,
|
|
@@ -60,8 +51,8 @@ var LoomToolbarButtonInternal = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
60
51
|
target = _ref.target,
|
|
61
52
|
hideTooltip = _ref.hideTooltip,
|
|
62
53
|
rel = _ref.rel;
|
|
63
|
-
var
|
|
64
|
-
width =
|
|
54
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['width'], selector),
|
|
55
|
+
width = _useSharedPluginState.width;
|
|
65
56
|
var label = formatMessage(appearance === 'comment' ? _messages.toolbarInsertBlockMessages.addLoomVideoComment : _messages.toolbarInsertBlockMessages.addLoomVideo);
|
|
66
57
|
var shouldShowRecordText = (width || 0) > LOOM_BUTTON_WIDTH_BREAKPOINT;
|
|
67
58
|
return (0, _react2.jsx)(_uiMenu.ToolbarButton, {
|
|
@@ -7,7 +7,7 @@ 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 {
|
|
10
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
11
11
|
import { executeRecordVideo } from '../pm-plugins/commands';
|
|
12
12
|
import ToolbarButtonComponent from './ToolbarButtonComponent';
|
|
13
13
|
const selector = states => {
|
|
@@ -17,18 +17,6 @@ const selector = states => {
|
|
|
17
17
|
connectivityMode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
const useSharedState = sharedPluginStateHookMigratorFactory(api => {
|
|
21
|
-
return useSharedPluginStateWithSelector(api, ['loom', 'connectivity'], selector);
|
|
22
|
-
}, api => {
|
|
23
|
-
const {
|
|
24
|
-
loomState,
|
|
25
|
-
connectivityState
|
|
26
|
-
} = useSharedPluginState(api, ['loom', 'connectivity']);
|
|
27
|
-
return {
|
|
28
|
-
loomEnabled: loomState === null || loomState === void 0 ? void 0 : loomState.isEnabled,
|
|
29
|
-
connectivityMode: connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
20
|
const CustomisableLoomToolbarButton = (disabled, appearance, api) => /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
33
21
|
const {
|
|
34
22
|
onClickBeforeInit,
|
|
@@ -39,7 +27,7 @@ const CustomisableLoomToolbarButton = (disabled, appearance, api) => /*#__PURE__
|
|
|
39
27
|
const {
|
|
40
28
|
loomEnabled,
|
|
41
29
|
connectivityMode
|
|
42
|
-
} =
|
|
30
|
+
} = useSharedPluginStateWithSelector(api, ['loom', 'connectivity'], selector);
|
|
43
31
|
const isLoomEnabled = !!loomEnabled;
|
|
44
32
|
const handleOnClick = useCallback(e => {
|
|
45
33
|
if (isLoomEnabled) {
|
|
@@ -71,7 +59,7 @@ const LoomToolbarButtonWrapper = ({
|
|
|
71
59
|
const {
|
|
72
60
|
loomEnabled,
|
|
73
61
|
connectivityMode
|
|
74
|
-
} =
|
|
62
|
+
} = useSharedPluginStateWithSelector(api, ['loom', 'connectivity'], selector);
|
|
75
63
|
if (loomEnabled === undefined) {
|
|
76
64
|
return null;
|
|
77
65
|
}
|
|
@@ -7,7 +7,7 @@ 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 {
|
|
10
|
+
import { 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
13
|
import VideoIcon from '@atlaskit/icon/core/video';
|
|
@@ -23,16 +23,6 @@ const selector = states => {
|
|
|
23
23
|
width: (_states$widthState = states.widthState) === null || _states$widthState === void 0 ? void 0 : _states$widthState.width
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
const useSharedState = sharedPluginStateHookMigratorFactory(api => {
|
|
27
|
-
return useSharedPluginStateWithSelector(api, ['width'], selector);
|
|
28
|
-
}, api => {
|
|
29
|
-
const {
|
|
30
|
-
widthState
|
|
31
|
-
} = useSharedPluginState(api, ['width']);
|
|
32
|
-
return {
|
|
33
|
-
width: widthState === null || widthState === void 0 ? void 0 : widthState.width
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
26
|
const LoomToolbarButtonInternal = /*#__PURE__*/React.forwardRef(({
|
|
37
27
|
disabled,
|
|
38
28
|
api,
|
|
@@ -58,7 +48,7 @@ const LoomToolbarButtonInternal = /*#__PURE__*/React.forwardRef(({
|
|
|
58
48
|
}, ref) => {
|
|
59
49
|
const {
|
|
60
50
|
width
|
|
61
|
-
} =
|
|
51
|
+
} = useSharedPluginStateWithSelector(api, ['width'], selector);
|
|
62
52
|
const label = formatMessage(appearance === 'comment' ? toolbarInsertBlockMessages.addLoomVideoComment : toolbarInsertBlockMessages.addLoomVideo);
|
|
63
53
|
const shouldShowRecordText = (width || 0) > LOOM_BUTTON_WIDTH_BREAKPOINT;
|
|
64
54
|
return jsx(ToolbarButton, {
|
|
@@ -9,7 +9,7 @@ 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 {
|
|
12
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
13
13
|
import { executeRecordVideo } from '../pm-plugins/commands';
|
|
14
14
|
import ToolbarButtonComponent from './ToolbarButtonComponent';
|
|
15
15
|
var selector = function selector(states) {
|
|
@@ -19,17 +19,6 @@ var selector = function selector(states) {
|
|
|
19
19
|
connectivityMode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
23
|
-
return useSharedPluginStateWithSelector(api, ['loom', 'connectivity'], selector);
|
|
24
|
-
}, function (api) {
|
|
25
|
-
var _useSharedPluginState = useSharedPluginState(api, ['loom', 'connectivity']),
|
|
26
|
-
loomState = _useSharedPluginState.loomState,
|
|
27
|
-
connectivityState = _useSharedPluginState.connectivityState;
|
|
28
|
-
return {
|
|
29
|
-
loomEnabled: loomState === null || loomState === void 0 ? void 0 : loomState.isEnabled,
|
|
30
|
-
connectivityMode: connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
22
|
var CustomisableLoomToolbarButton = function CustomisableLoomToolbarButton(disabled, appearance, api) {
|
|
34
23
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
35
24
|
var onClickBeforeInit = props.onClickBeforeInit,
|
|
@@ -37,9 +26,9 @@ var CustomisableLoomToolbarButton = function CustomisableLoomToolbarButton(disab
|
|
|
37
26
|
isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
|
|
38
27
|
href = props.href,
|
|
39
28
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
40
|
-
var
|
|
41
|
-
loomEnabled =
|
|
42
|
-
connectivityMode =
|
|
29
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['loom', 'connectivity'], selector),
|
|
30
|
+
loomEnabled = _useSharedPluginState.loomEnabled,
|
|
31
|
+
connectivityMode = _useSharedPluginState.connectivityMode;
|
|
43
32
|
var isLoomEnabled = !!loomEnabled;
|
|
44
33
|
var handleOnClick = useCallback(function (e) {
|
|
45
34
|
if (isLoomEnabled) {
|
|
@@ -72,9 +61,9 @@ var LoomToolbarButtonWrapper = function LoomToolbarButtonWrapper(_ref) {
|
|
|
72
61
|
var handleOnClick = useCallback(function () {
|
|
73
62
|
return executeRecordVideo(api);
|
|
74
63
|
}, [api]);
|
|
75
|
-
var
|
|
76
|
-
loomEnabled =
|
|
77
|
-
connectivityMode =
|
|
64
|
+
var _useSharedPluginState2 = useSharedPluginStateWithSelector(api, ['loom', 'connectivity'], selector),
|
|
65
|
+
loomEnabled = _useSharedPluginState2.loomEnabled,
|
|
66
|
+
connectivityMode = _useSharedPluginState2.connectivityMode;
|
|
78
67
|
if (loomEnabled === undefined) {
|
|
79
68
|
return null;
|
|
80
69
|
}
|
|
@@ -7,7 +7,7 @@ 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 {
|
|
10
|
+
import { 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
13
|
import VideoIcon from '@atlaskit/icon/core/video';
|
|
@@ -23,15 +23,6 @@ var selector = function selector(states) {
|
|
|
23
23
|
width: (_states$widthState = states.widthState) === null || _states$widthState === void 0 ? void 0 : _states$widthState.width
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
27
|
-
return useSharedPluginStateWithSelector(api, ['width'], selector);
|
|
28
|
-
}, function (api) {
|
|
29
|
-
var _useSharedPluginState = useSharedPluginState(api, ['width']),
|
|
30
|
-
widthState = _useSharedPluginState.widthState;
|
|
31
|
-
return {
|
|
32
|
-
width: widthState === null || widthState === void 0 ? void 0 : widthState.width
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
26
|
var LoomToolbarButtonInternal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
36
27
|
var disabled = _ref.disabled,
|
|
37
28
|
api = _ref.api,
|
|
@@ -52,8 +43,8 @@ var LoomToolbarButtonInternal = /*#__PURE__*/React.forwardRef(function (_ref, re
|
|
|
52
43
|
target = _ref.target,
|
|
53
44
|
hideTooltip = _ref.hideTooltip,
|
|
54
45
|
rel = _ref.rel;
|
|
55
|
-
var
|
|
56
|
-
width =
|
|
46
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['width'], selector),
|
|
47
|
+
width = _useSharedPluginState.width;
|
|
57
48
|
var label = formatMessage(appearance === 'comment' ? toolbarInsertBlockMessages.addLoomVideoComment : toolbarInsertBlockMessages.addLoomVideo);
|
|
58
49
|
var shouldShowRecordText = (width || 0) > LOOM_BUTTON_WIDTH_BREAKPOINT;
|
|
59
50
|
return jsx(ToolbarButton, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-loom",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.6",
|
|
4
4
|
"description": "Loom plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,24 +40,24 @@
|
|
|
40
40
|
"@atlaskit/editor-plugin-toolbar": "^0.4.0",
|
|
41
41
|
"@atlaskit/editor-plugin-width": "^4.0.0",
|
|
42
42
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
43
|
-
"@atlaskit/editor-toolbar": "^0.
|
|
43
|
+
"@atlaskit/editor-toolbar": "^0.6.0",
|
|
44
44
|
"@atlaskit/icon": "^28.1.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^11.11.0",
|
|
47
47
|
"@atlaskit/tokens": "^6.1.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
49
|
"@emotion/react": "^11.7.1",
|
|
50
50
|
"@loomhq/record-sdk": "^2.36.18"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@atlaskit/editor-common": "^107.
|
|
53
|
+
"@atlaskit/editor-common": "^107.34.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"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@atlaskit/editor-plugin-base": "^4.1.0",
|
|
60
|
-
"@atlaskit/editor-plugin-card": "^7.
|
|
60
|
+
"@atlaskit/editor-plugin-card": "^7.7.0",
|
|
61
61
|
"@atlaskit/editor-plugin-copy-button": "^3.0.0",
|
|
62
62
|
"@atlaskit/editor-plugin-decorations": "^3.1.0",
|
|
63
63
|
"@atlaskit/editor-plugin-editor-disabled": "^3.0.0",
|