@atlaskit/editor-plugin-card 6.1.1 → 6.1.3

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-card
2
2
 
3
+ ## 6.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#150558](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/150558)
8
+ [`2b8be3c33b348`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2b8be3c33b348) -
9
+ ED-27612: prevent infinite loop on card delete
10
+ - Updated dependencies
11
+
12
+ ## 6.1.2
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 6.1.1
4
19
 
5
20
  ### Patch Changes
package/compass.yml ADDED
@@ -0,0 +1,40 @@
1
+ name: '@atlaskit/editor-plugin-card'
2
+ description: |-
3
+ This is an editor plugin for Atlassian's rich text editor that enables support for "smart cards" and advanced linking features within the editor. It integrates with the Atlassian linking platform to allow users to insert, display, and interact with rich link previews (smart cards) directly in the editor surface.
4
+ This plugin is typically consumed via `@atlaskit/editor-core` as a plugin dependency and is essential for products that require embedding and managing smart links in their content.
5
+ configVersion: 1
6
+ typeId: LIBRARY
7
+ ownerId: 'ari:cloud:identity::team/9683a6ac-2d3f-44c8-a0fe-56128ca69e20'
8
+ fields:
9
+ tier: 4
10
+ lifecycle: Active
11
+ isMonorepoProject: true
12
+ labels:
13
+ - atlassian-platform
14
+ links:
15
+ - name: Bandicoots
16
+ type: PROJECT
17
+ url: 'https://product-fabric.atlassian.net/jira/software/c/projects/EDM/boards/5176'
18
+ - name: '#help-twg-linking-platform'
19
+ type: CHAT_CHANNEL
20
+ url: 'https://atlassian.enterprise.slack.com/archives/CFKGAQZRV'
21
+ - name: 'On-Call Schedule'
22
+ type: ON_CALL
23
+ url: 'https://atlassian.app.opsgenie.com/settings/schedule/detail/b9c8b313-dd6d-4a41-8eeb-d7a9df55be9d'
24
+ - name: source code
25
+ type: REPOSITORY
26
+ url: 'https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/editor/editor-plugin-card'
27
+ customFields:
28
+ - name: 'FinOps_COGS_Cost_Center'
29
+ type: single_select
30
+ value: 'a681c808-9c58-45e5-9b3a-b5cc330c4b3a'
31
+ - name: 'FinOps_R&D_Cost_Center'
32
+ type: single_select
33
+ value: 'd9c71b12-1c77-4c68-a769-ba0e26bc8cac'
34
+ - name: 'FinOps_Service_Group'
35
+ type: single_select
36
+ value: '9120e03c-440b-489d-ac42-07903a2c611d'
37
+ - name: 'business-unit'
38
+ type: text
39
+ value: 'Eng - X Product Collab'
40
+ relationships: {}
@@ -18,6 +18,7 @@ var _v = _interopRequireDefault(require("uuid/v4"));
18
18
  var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
19
19
  var _ui = require("@atlaskit/editor-common/ui");
20
20
  var _utils = require("@atlaskit/editor-common/utils");
21
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
22
  var _smartCard = require("@atlaskit/smart-card");
22
23
  var _datasource = require("../nodeviews/datasource");
23
24
  var _actions = require("../pm-plugins/actions");
@@ -125,6 +126,7 @@ var BlockCard = exports.BlockCard = /*#__PURE__*/function (_ReactNodeView) {
125
126
  (0, _defineProperty2.default)(_this2, "updateContentEditable", function (editorViewModeState, divElement) {
126
127
  divElement.contentEditable = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? 'false' : 'true';
127
128
  });
129
+ (0, _defineProperty2.default)(_this2, "removeCardDispatched", false);
128
130
  return _this2;
129
131
  }
130
132
  (0, _inherits2.default)(BlockCard, _ReactNodeView);
@@ -190,6 +192,10 @@ var BlockCard = exports.BlockCard = /*#__PURE__*/function (_ReactNodeView) {
190
192
  }, {
191
193
  key: "removeCard",
192
194
  value: function removeCard() {
195
+ if (this.removeCardDispatched && (0, _platformFeatureFlags.fg)('platform_editor_cards_maxcallstackfix')) {
196
+ return;
197
+ }
198
+ this.removeCardDispatched = true;
193
199
  var tr = this.view.state.tr;
194
200
  (0, _actions.removeCard)({
195
201
  id: this.id
@@ -23,6 +23,7 @@ var _ui = require("@atlaskit/editor-common/ui");
23
23
  var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
24
24
  var _utils = require("@atlaskit/editor-common/utils");
25
25
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
26
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
26
27
  var _smartCard = require("@atlaskit/smart-card");
27
28
  var _actions = require("../pm-plugins/actions");
28
29
  var _ResizableEmbedCard = _interopRequireDefault(require("../ui/ResizableEmbedCard"));
@@ -364,6 +365,7 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
364
365
  (0, _defineProperty2.default)(_this2, "updateContentEditable", function (editorViewModeState, divElement) {
365
366
  divElement.contentEditable = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? 'false' : 'true';
366
367
  });
368
+ (0, _defineProperty2.default)(_this2, "removeCardDispatched", false);
367
369
  return _this2;
368
370
  }
369
371
  (0, _inherits2.default)(EmbedCard, _ReactNodeView);
@@ -424,6 +426,10 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
424
426
  }, {
425
427
  key: "removeCard",
426
428
  value: function removeCard() {
429
+ if (this.removeCardDispatched && (0, _platformFeatureFlags.fg)('platform_editor_cards_maxcallstackfix')) {
430
+ return;
431
+ }
432
+ this.removeCardDispatched = true;
427
433
  var tr = this.view.state.tr;
428
434
  (0, _actions.removeCard)({
429
435
  id: this.id
@@ -5,6 +5,7 @@ import uuid from 'uuid/v4';
5
5
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
6
6
  import { findOverflowScrollParent, UnsupportedBlock } from '@atlaskit/editor-common/ui';
7
7
  import { browser, canRenderDatasource } from '@atlaskit/editor-common/utils';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { Card as SmartCard } from '@atlaskit/smart-card';
9
10
  import { Datasource } from '../nodeviews/datasource';
10
11
  import { registerCard, removeCard } from '../pm-plugins/actions';
@@ -104,6 +105,7 @@ export class BlockCard extends ReactNodeView {
104
105
  _defineProperty(this, "updateContentEditable", (editorViewModeState, divElement) => {
105
106
  divElement.contentEditable = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? 'false' : 'true';
106
107
  });
108
+ _defineProperty(this, "removeCardDispatched", false);
107
109
  }
108
110
  createDomRef() {
109
111
  var _this$reactComponentP, _this$reactComponentP2, _this$reactComponentP3, _this$reactComponentP4;
@@ -152,6 +154,10 @@ export class BlockCard extends ReactNodeView {
152
154
  this.removeCard();
153
155
  }
154
156
  removeCard() {
157
+ if (this.removeCardDispatched && fg('platform_editor_cards_maxcallstackfix')) {
158
+ return;
159
+ }
160
+ this.removeCardDispatched = true;
155
161
  const {
156
162
  tr
157
163
  } = this.view.state;
@@ -10,6 +10,7 @@ import { findOverflowScrollParent, MediaSingle as RichMediaWrapper, UnsupportedB
10
10
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
11
11
  import { floatingLayouts, isRichMediaInsideOfBlockNode } from '@atlaskit/editor-common/utils';
12
12
  import { DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
13
+ import { fg } from '@atlaskit/platform-feature-flags';
13
14
  import { EmbedResizeMessageListener, Card as SmartCard } from '@atlaskit/smart-card';
14
15
  import { registerCard, removeCard } from '../pm-plugins/actions';
15
16
  import ResizableEmbedCard from '../ui/ResizableEmbedCard';
@@ -352,6 +353,7 @@ export class EmbedCard extends ReactNodeView {
352
353
  _defineProperty(this, "updateContentEditable", (editorViewModeState, divElement) => {
353
354
  divElement.contentEditable = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? 'false' : 'true';
354
355
  });
356
+ _defineProperty(this, "removeCardDispatched", false);
355
357
  }
356
358
  viewShouldUpdate(nextNode) {
357
359
  if (this.node.attrs !== nextNode.attrs) {
@@ -398,6 +400,10 @@ export class EmbedCard extends ReactNodeView {
398
400
  this.removeCard();
399
401
  }
400
402
  removeCard() {
403
+ if (this.removeCardDispatched && fg('platform_editor_cards_maxcallstackfix')) {
404
+ return;
405
+ }
406
+ this.removeCardDispatched = true;
401
407
  const {
402
408
  tr
403
409
  } = this.view.state;
@@ -14,6 +14,7 @@ import uuid from 'uuid/v4';
14
14
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
15
15
  import { findOverflowScrollParent, UnsupportedBlock } from '@atlaskit/editor-common/ui';
16
16
  import { browser, canRenderDatasource } from '@atlaskit/editor-common/utils';
17
+ import { fg } from '@atlaskit/platform-feature-flags';
17
18
  import { Card as SmartCard } from '@atlaskit/smart-card';
18
19
  import { Datasource } from '../nodeviews/datasource';
19
20
  import { registerCard, removeCard as _removeCard } from '../pm-plugins/actions';
@@ -119,6 +120,7 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
119
120
  _defineProperty(_this2, "updateContentEditable", function (editorViewModeState, divElement) {
120
121
  divElement.contentEditable = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? 'false' : 'true';
121
122
  });
123
+ _defineProperty(_this2, "removeCardDispatched", false);
122
124
  return _this2;
123
125
  }
124
126
  _inherits(BlockCard, _ReactNodeView);
@@ -184,6 +186,10 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
184
186
  }, {
185
187
  key: "removeCard",
186
188
  value: function removeCard() {
189
+ if (this.removeCardDispatched && fg('platform_editor_cards_maxcallstackfix')) {
190
+ return;
191
+ }
192
+ this.removeCardDispatched = true;
187
193
  var tr = this.view.state.tr;
188
194
  _removeCard({
189
195
  id: this.id
@@ -21,6 +21,7 @@ import { findOverflowScrollParent, MediaSingle as RichMediaWrapper, UnsupportedB
21
21
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
22
22
  import { floatingLayouts, isRichMediaInsideOfBlockNode } from '@atlaskit/editor-common/utils';
23
23
  import { DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
24
+ import { fg } from '@atlaskit/platform-feature-flags';
24
25
  import { EmbedResizeMessageListener, Card as SmartCard } from '@atlaskit/smart-card';
25
26
  import { registerCard, removeCard as _removeCard } from '../pm-plugins/actions';
26
27
  import ResizableEmbedCard from '../ui/ResizableEmbedCard';
@@ -357,6 +358,7 @@ export var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
357
358
  _defineProperty(_this2, "updateContentEditable", function (editorViewModeState, divElement) {
358
359
  divElement.contentEditable = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? 'false' : 'true';
359
360
  });
361
+ _defineProperty(_this2, "removeCardDispatched", false);
360
362
  return _this2;
361
363
  }
362
364
  _inherits(EmbedCard, _ReactNodeView);
@@ -417,6 +419,10 @@ export var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
417
419
  }, {
418
420
  key: "removeCard",
419
421
  value: function removeCard() {
422
+ if (this.removeCardDispatched && fg('platform_editor_cards_maxcallstackfix')) {
423
+ return;
424
+ }
425
+ this.removeCardDispatched = true;
420
426
  var tr = this.view.state.tr;
421
427
  _removeCard({
422
428
  id: this.id
@@ -32,6 +32,7 @@ export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
32
32
  update(node: Node, decorations: ReadonlyArray<Decoration>, _innerDecorations?: DecorationSource): boolean;
33
33
  render(): React.JSX.Element;
34
34
  destroy(): void;
35
+ private removeCardDispatched;
35
36
  private removeCard;
36
37
  }
37
38
  export interface BlockCardNodeViewProperties {
@@ -49,6 +49,7 @@ export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
49
49
  private updateContentEditable;
50
50
  render(): React.JSX.Element;
51
51
  destroy(): void;
52
+ private removeCardDispatched;
52
53
  private removeCard;
53
54
  }
54
55
  export interface EmbedCardNodeViewProperties {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
- import { EditorAppearance } from '@atlaskit/editor-common/types';
3
+ import type { EditorAppearance } from '@atlaskit/editor-common/types';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  export type OpenButtonOverlayProps = React.HTMLAttributes<HTMLSpanElement> & {
6
6
  isVisible?: boolean;
@@ -32,6 +32,7 @@ export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
32
32
  update(node: Node, decorations: ReadonlyArray<Decoration>, _innerDecorations?: DecorationSource): boolean;
33
33
  render(): React.JSX.Element;
34
34
  destroy(): void;
35
+ private removeCardDispatched;
35
36
  private removeCard;
36
37
  }
37
38
  export interface BlockCardNodeViewProperties {
@@ -49,6 +49,7 @@ export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
49
49
  private updateContentEditable;
50
50
  render(): React.JSX.Element;
51
51
  destroy(): void;
52
+ private removeCardDispatched;
52
53
  private removeCard;
53
54
  }
54
55
  export interface EmbedCardNodeViewProperties {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
- import { EditorAppearance } from '@atlaskit/editor-common/types';
3
+ import type { EditorAppearance } from '@atlaskit/editor-common/types';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  export type OpenButtonOverlayProps = React.HTMLAttributes<HTMLSpanElement> & {
6
6
  isVisible?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "6.1.1",
3
+ "version": "6.1.3",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,9 +35,9 @@
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^47.6.0",
37
37
  "@atlaskit/analytics-next": "^11.0.0",
38
- "@atlaskit/button": "^23.0.0",
38
+ "@atlaskit/button": "^23.2.0",
39
39
  "@atlaskit/custom-steps": "^0.11.0",
40
- "@atlaskit/editor-common": "^105.5.0",
40
+ "@atlaskit/editor-common": "^105.6.0",
41
41
  "@atlaskit/editor-plugin-analytics": "^2.3.0",
42
42
  "@atlaskit/editor-plugin-base": "^3.0.0",
43
43
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
@@ -51,19 +51,19 @@
51
51
  "@atlaskit/editor-prosemirror": "7.0.0",
52
52
  "@atlaskit/editor-shared-styles": "^3.4.0",
53
53
  "@atlaskit/frontend-utilities": "^3.0.0",
54
- "@atlaskit/icon": "^26.0.0",
54
+ "@atlaskit/icon": "^26.1.0",
55
55
  "@atlaskit/link-analytics": "^10.0.0",
56
56
  "@atlaskit/link-client-extension": "^5.0.0",
57
57
  "@atlaskit/link-datasource": "^4.10.0",
58
58
  "@atlaskit/linking-common": "^9.0.0",
59
59
  "@atlaskit/linking-types": "^9.10.0",
60
- "@atlaskit/menu": "^6.0.0",
60
+ "@atlaskit/menu": "^7.1.0",
61
61
  "@atlaskit/platform-feature-flags": "^1.1.0",
62
- "@atlaskit/primitives": "^14.7.0",
63
- "@atlaskit/smart-card": "^38.1.0",
62
+ "@atlaskit/primitives": "^14.8.0",
63
+ "@atlaskit/smart-card": "^38.2.0",
64
64
  "@atlaskit/theme": "^18.0.0",
65
65
  "@atlaskit/tmp-editor-statsig": "^4.22.0",
66
- "@atlaskit/tokens": "^4.8.0",
66
+ "@atlaskit/tokens": "^4.9.0",
67
67
  "@babel/runtime": "^7.0.0",
68
68
  "@emotion/react": "^11.7.1",
69
69
  "lodash": "^4.17.21",
@@ -157,6 +157,9 @@
157
157
  },
158
158
  "prompt_whiteboard_competitor_link_gate": {
159
159
  "type": "boolean"
160
+ },
161
+ "platform_editor_cards_maxcallstackfix": {
162
+ "type": "boolean"
160
163
  }
161
164
  },
162
165
  "stricter": {