@atlaskit/editor-plugin-card 2.1.2 → 2.2.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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 2.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#115837](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115837)
8
+ [`370c68df9de67`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/370c68df9de67) -
9
+ [ux] EmbedCard - resize handles will be hidden on view mode in live pages
10
+ - Updated dependencies
11
+
12
+ ## 2.2.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#115247](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115247)
17
+ [`251d23ff9e6c8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/251d23ff9e6c8) -
18
+ upgrade adf-schema version to 38.0.0
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+
3
24
  ## 2.1.2
4
25
 
5
26
  ### Patch 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
- } = useSharedPluginState(pluginInjectionApi, ['width']);
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
@@ -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;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "2.1.2",
3
+ "version": "2.2.1",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,14 +32,15 @@
32
32
  ".": "./src/index.ts"
33
33
  },
34
34
  "dependencies": {
35
- "@atlaskit/adf-schema": "^37.0.0",
35
+ "@atlaskit/adf-schema": "^38.0.0",
36
36
  "@atlaskit/analytics-next": "^9.3.0",
37
37
  "@atlaskit/button": "^18.0.0",
38
- "@atlaskit/custom-steps": "^0.3.0",
38
+ "@atlaskit/custom-steps": "^0.4.0",
39
39
  "@atlaskit/dropdown-menu": "^12.13.0",
40
- "@atlaskit/editor-common": "^83.0.0",
41
- "@atlaskit/editor-plugin-analytics": "^1.3.0",
40
+ "@atlaskit/editor-common": "^83.4.0",
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",
@@ -51,13 +52,13 @@
51
52
  "@atlaskit/icon": "^22.5.0",
52
53
  "@atlaskit/link-analytics": "^8.3.0",
53
54
  "@atlaskit/link-client-extension": "^1.9.0",
54
- "@atlaskit/link-datasource": "^2.4.0",
55
+ "@atlaskit/link-datasource": "^2.5.0",
55
56
  "@atlaskit/linking-common": "^5.7.0",
56
57
  "@atlaskit/linking-types": "^8.9.0",
57
58
  "@atlaskit/menu": "2.5.2",
58
59
  "@atlaskit/platform-feature-flags": "^0.2.0",
59
60
  "@atlaskit/primitives": "^9.0.0",
60
- "@atlaskit/smart-card": "^27.7.0",
61
+ "@atlaskit/smart-card": "^27.8.0",
61
62
  "@atlaskit/theme": "^12.11.0",
62
63
  "@atlaskit/tokens": "^1.53.0",
63
64
  "@atlaskit/tooltip": "^18.5.0",