@atlaskit/editor-plugin-card 2.2.0 → 2.2.2
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 +18 -0
- package/dist/cjs/nodeviews/embedCard.js +4 -3
- package/dist/es2019/nodeviews/embedCard.js +4 -3
- package/dist/esm/nodeviews/embedCard.js +4 -3
- package/dist/types/plugin.d.ts +3 -1
- package/dist/types/ui/DatasourceModal/ModalWithState.d.ts +1 -1
- package/dist/types-ts4.5/plugin.d.ts +3 -1
- package/dist/types-ts4.5/ui/DatasourceModal/ModalWithState.d.ts +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 2.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#114993](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114993)
|
|
8
|
+
[`06ddfaec64a7d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/06ddfaec64a7d) -
|
|
9
|
+
Fix import - export ConfigModalProps between link-datasource and editor-plugin-card
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 2.2.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#115837](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115837)
|
|
17
|
+
[`370c68df9de67`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/370c68df9de67) -
|
|
18
|
+
[ux] EmbedCard - resize handles will be hidden on view mode in live pages
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 2.2.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -46,8 +46,9 @@ var CardInner = function CardInner(_ref) {
|
|
|
46
46
|
heightAlone = _ref.heightAlone,
|
|
47
47
|
cardProps = _ref.cardProps,
|
|
48
48
|
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
49
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['width']),
|
|
50
|
-
widthState = _useSharedPluginState.widthState
|
|
49
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['width', 'editorDisabled']),
|
|
50
|
+
widthState = _useSharedPluginState.widthState,
|
|
51
|
+
editorDisabledState = _useSharedPluginState.editorDisabledState;
|
|
51
52
|
var widthStateLineLength = (widthState === null || widthState === void 0 ? void 0 : widthState.lineLength) || 0;
|
|
52
53
|
var widthStateWidth = (widthState === null || widthState === void 0 ? void 0 : widthState.width) || 0;
|
|
53
54
|
var pos = getPosSafely();
|
|
@@ -56,7 +57,7 @@ var CardInner = function CardInner(_ref) {
|
|
|
56
57
|
}
|
|
57
58
|
var lineLength = getLineLength(view, pos, widthStateLineLength);
|
|
58
59
|
var containerWidth = (0, _utils.isRichMediaInsideOfBlockNode)(view, pos) ? lineLength : widthStateWidth;
|
|
59
|
-
if (!allowResizing || !hasPreview) {
|
|
60
|
+
if (!allowResizing || !hasPreview || editorDisabledState !== null && editorDisabledState !== void 0 && editorDisabledState.editorDisabled) {
|
|
60
61
|
// There are two ways `width` and `height` can be defined here:
|
|
61
62
|
// 1) Either as `heightAlone` as height value and no width
|
|
62
63
|
// 2) or as `1` for height and aspectRation (defined or a default one) as a width
|
|
@@ -30,8 +30,9 @@ const CardInner = ({
|
|
|
30
30
|
dispatchAnalyticsEvent
|
|
31
31
|
}) => {
|
|
32
32
|
const {
|
|
33
|
-
widthState
|
|
34
|
-
|
|
33
|
+
widthState,
|
|
34
|
+
editorDisabledState
|
|
35
|
+
} = useSharedPluginState(pluginInjectionApi, ['width', 'editorDisabled']);
|
|
35
36
|
const widthStateLineLength = (widthState === null || widthState === void 0 ? void 0 : widthState.lineLength) || 0;
|
|
36
37
|
const widthStateWidth = (widthState === null || widthState === void 0 ? void 0 : widthState.width) || 0;
|
|
37
38
|
const pos = getPosSafely();
|
|
@@ -40,7 +41,7 @@ const CardInner = ({
|
|
|
40
41
|
}
|
|
41
42
|
const lineLength = getLineLength(view, pos, widthStateLineLength);
|
|
42
43
|
const containerWidth = isRichMediaInsideOfBlockNode(view, pos) ? lineLength : widthStateWidth;
|
|
43
|
-
if (!allowResizing || !hasPreview) {
|
|
44
|
+
if (!allowResizing || !hasPreview || editorDisabledState !== null && editorDisabledState !== void 0 && editorDisabledState.editorDisabled) {
|
|
44
45
|
// There are two ways `width` and `height` can be defined here:
|
|
45
46
|
// 1) Either as `heightAlone` as height value and no width
|
|
46
47
|
// 2) or as `1` for height and aspectRation (defined or a default one) as a width
|
|
@@ -39,8 +39,9 @@ var CardInner = function CardInner(_ref) {
|
|
|
39
39
|
heightAlone = _ref.heightAlone,
|
|
40
40
|
cardProps = _ref.cardProps,
|
|
41
41
|
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
42
|
-
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['width']),
|
|
43
|
-
widthState = _useSharedPluginState.widthState
|
|
42
|
+
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['width', 'editorDisabled']),
|
|
43
|
+
widthState = _useSharedPluginState.widthState,
|
|
44
|
+
editorDisabledState = _useSharedPluginState.editorDisabledState;
|
|
44
45
|
var widthStateLineLength = (widthState === null || widthState === void 0 ? void 0 : widthState.lineLength) || 0;
|
|
45
46
|
var widthStateWidth = (widthState === null || widthState === void 0 ? void 0 : widthState.width) || 0;
|
|
46
47
|
var pos = getPosSafely();
|
|
@@ -49,7 +50,7 @@ var CardInner = function CardInner(_ref) {
|
|
|
49
50
|
}
|
|
50
51
|
var lineLength = getLineLength(view, pos, widthStateLineLength);
|
|
51
52
|
var containerWidth = isRichMediaInsideOfBlockNode(view, pos) ? lineLength : widthStateWidth;
|
|
52
|
-
if (!allowResizing || !hasPreview) {
|
|
53
|
+
if (!allowResizing || !hasPreview || editorDisabledState !== null && editorDisabledState !== void 0 && editorDisabledState.editorDisabled) {
|
|
53
54
|
// There are two ways `width` and `height` can be defined here:
|
|
54
55
|
// 1) Either as `heightAlone` as height value and no width
|
|
55
56
|
// 2) or as `1` for height and aspectRation (defined or a default one) as a width
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { CardPluginActions } from '@atlaskit/editor-common/card';
|
|
|
2
2
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
4
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
|
+
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
5
6
|
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
6
7
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
7
8
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
@@ -17,7 +18,8 @@ export type CardPlugin = NextEditorPlugin<'card', {
|
|
|
17
18
|
WidthPlugin,
|
|
18
19
|
DecorationsPlugin,
|
|
19
20
|
GridPlugin,
|
|
20
|
-
FloatingToolbarPlugin
|
|
21
|
+
FloatingToolbarPlugin,
|
|
22
|
+
OptionalPlugin<EditorDisabledPlugin>
|
|
21
23
|
];
|
|
22
24
|
sharedState: CardPluginState | null;
|
|
23
25
|
actions: CardPluginActions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DatasourceModalType, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { ConfigModalProps } from '@atlaskit/link-datasource
|
|
4
|
+
import type { ConfigModalProps } from '@atlaskit/link-datasource';
|
|
5
5
|
import type { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common';
|
|
6
6
|
import type { DatasourceParameters } from '@atlaskit/linking-types';
|
|
7
7
|
import type { cardPlugin } from '../../plugin';
|
|
@@ -2,6 +2,7 @@ import type { CardPluginActions } from '@atlaskit/editor-common/card';
|
|
|
2
2
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
4
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
|
+
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
5
6
|
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
6
7
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
7
8
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
@@ -17,7 +18,8 @@ export type CardPlugin = NextEditorPlugin<'card', {
|
|
|
17
18
|
WidthPlugin,
|
|
18
19
|
DecorationsPlugin,
|
|
19
20
|
GridPlugin,
|
|
20
|
-
FloatingToolbarPlugin
|
|
21
|
+
FloatingToolbarPlugin,
|
|
22
|
+
OptionalPlugin<EditorDisabledPlugin>
|
|
21
23
|
];
|
|
22
24
|
sharedState: CardPluginState | null;
|
|
23
25
|
actions: CardPluginActions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DatasourceModalType, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { ConfigModalProps } from '@atlaskit/link-datasource
|
|
4
|
+
import type { ConfigModalProps } from '@atlaskit/link-datasource';
|
|
5
5
|
import type { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common';
|
|
6
6
|
import type { DatasourceParameters } from '@atlaskit/linking-types';
|
|
7
7
|
import type { cardPlugin } from '../../plugin';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,9 +37,10 @@
|
|
|
37
37
|
"@atlaskit/button": "^18.0.0",
|
|
38
38
|
"@atlaskit/custom-steps": "^0.4.0",
|
|
39
39
|
"@atlaskit/dropdown-menu": "^12.13.0",
|
|
40
|
-
"@atlaskit/editor-common": "^83.
|
|
40
|
+
"@atlaskit/editor-common": "^83.4.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
42
42
|
"@atlaskit/editor-plugin-decorations": "^1.1.0",
|
|
43
|
+
"@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
|
|
43
44
|
"@atlaskit/editor-plugin-editor-viewmode": "^2.0.0",
|
|
44
45
|
"@atlaskit/editor-plugin-feature-flags": "^1.1.0",
|
|
45
46
|
"@atlaskit/editor-plugin-floating-toolbar": "^1.7.0",
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
"@atlaskit/link-datasource": "^2.5.0",
|
|
55
56
|
"@atlaskit/linking-common": "^5.7.0",
|
|
56
57
|
"@atlaskit/linking-types": "^8.9.0",
|
|
57
|
-
"@atlaskit/menu": "2.
|
|
58
|
+
"@atlaskit/menu": "2.6.0",
|
|
58
59
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
59
60
|
"@atlaskit/primitives": "^9.0.0",
|
|
60
61
|
"@atlaskit/smart-card": "^27.8.0",
|