@atlaskit/editor-plugin-card 13.1.17 → 13.1.18

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,13 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 13.1.18
4
+
5
+ ### Patch Changes
6
+
7
+ - [`82c0224977f47`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/82c0224977f47) -
8
+ Update README.md and 0-intro.tsx
9
+ - Updated dependencies
10
+
3
11
  ## 13.1.17
4
12
 
5
13
  ### Patch Changes
package/README.md CHANGED
@@ -1,10 +1,23 @@
1
- # Editor plugin card
1
+ # Editor Plugin Card
2
2
 
3
3
  Card plugin for @atlaskit/editor-core
4
4
 
5
5
  **Note:** This component is designed for internal Atlassian development.
6
6
  External contributors will be able to use this component but will not be able to submit issues.
7
7
 
8
+ ## Overview
9
+
10
+ The Card plugin enables smart card rendering and link resolution in the Atlassian Editor. It provides support for multiple card appearances (inline, block, embed), datasource rendering, and interactive link toolbars with rich customization options.
11
+
12
+ ## Key features
13
+
14
+ - **Card appearances** - Support for inline, block, and embed card renderings with configurable layouts
15
+ - **Link resolution** - Automatic resolution and upgrading of links to smart cards via the card provider
16
+ - **Datasource support** - Integration with datasource modals for Jira, Confluence, and Assets
17
+ - **Link toolbar** - Interactive toolbar for editing links and managing card appearances
18
+ - **Analytics integration** - Comprehensive event tracking for card interactions and view changes
19
+ - **Configurable options** - Flexible options for enabling/disabling features like block cards, embeds, resizing, and alignment
20
+
8
21
  ## Install
9
22
  ---
10
23
  - **Install** - *yarn add @atlaskit/editor-plugin-card*
@@ -25,6 +38,7 @@ Please see [Atlaskit - Editor plugin card](https://atlaskit.atlassian.com/packag
25
38
  ## Support
26
39
  ---
27
40
  For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
41
+
28
42
  ## License
29
43
  ---
30
- Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.
44
+ Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.
@@ -34,6 +34,7 @@ var findChanged = exports.findChanged = function findChanged(tr, state) {
34
34
  var updated = [];
35
35
  var queuedForUpgrade = isTransactionQueuedForUpgrade(tr);
36
36
  var isResolveReplace = isTransactionResolveReplace(tr);
37
+ var isAutoConvert = isAutoConvertTr(tr);
37
38
 
38
39
  // History
39
40
  var historyMeta = tr.getMeta(_utils.pmHistoryPluginKey);
@@ -118,9 +119,12 @@ var findChanged = exports.findChanged = function findChanged(tr, state) {
118
119
  * Skip "deletions" when the transaction is relating to
119
120
  * replacing links queued for upgrade to cards,
120
121
  * because the "deleted" link has not actually been
121
- * tracked as "created" yet
122
+ * tracked as "created" yet.
123
+ * Also skip when the transaction is an auto-convert
124
+ * (e.g. a pasted link being converted to a native embed extension),
125
+ * because the link is being converted, not deleted by the user.
122
126
  */
123
- if (!isResolveReplace) {
127
+ if (!isResolveReplace && !isAutoConvert) {
124
128
  removed.push.apply(removed, removedInStep);
125
129
  }
126
130
  inserted.push.apply(inserted, (0, _toConsumableArray2.default)(omitRequestsForUpgrade(insertedInStep)));
@@ -242,6 +246,20 @@ var isTransactionResolveReplace = function isTransactionResolveReplace(tr) {
242
246
  var pluginMeta = tr.getMeta(_pluginKey.pluginKey);
243
247
  return isMetadataResolve(pluginMeta);
244
248
  };
249
+
250
+ /**
251
+ * Checks if the transaction is an auto-convert action
252
+ * (e.g. a pasted link being converted to a native embed extension node).
253
+ * In this case the link removal should not be tracked as a deletion.
254
+ */
255
+ var isAutoConvertTr = function isAutoConvertTr(tr) {
256
+ return !!tr.steps.find(function (step) {
257
+ if (!(step instanceof _steps.LinkMetaStep)) {
258
+ return false;
259
+ }
260
+ return step.getMetadata().cardAction === 'AUTO_CONVERT';
261
+ });
262
+ };
245
263
  var isMetadataResolve = function isMetadataResolve(metaData) {
246
264
  return hasType(metaData) && metaData.type === 'RESOLVE';
247
265
  };
@@ -25,6 +25,7 @@ export const findChanged = (tr, state) => {
25
25
  const updated = [];
26
26
  const queuedForUpgrade = isTransactionQueuedForUpgrade(tr);
27
27
  const isResolveReplace = isTransactionResolveReplace(tr);
28
+ const isAutoConvert = isAutoConvertTr(tr);
28
29
 
29
30
  // History
30
31
  const historyMeta = tr.getMeta(pmHistoryPluginKey);
@@ -103,9 +104,12 @@ export const findChanged = (tr, state) => {
103
104
  * Skip "deletions" when the transaction is relating to
104
105
  * replacing links queued for upgrade to cards,
105
106
  * because the "deleted" link has not actually been
106
- * tracked as "created" yet
107
+ * tracked as "created" yet.
108
+ * Also skip when the transaction is an auto-convert
109
+ * (e.g. a pasted link being converted to a native embed extension),
110
+ * because the link is being converted, not deleted by the user.
107
111
  */
108
- if (!isResolveReplace) {
112
+ if (!isResolveReplace && !isAutoConvert) {
109
113
  removed.push(...removedInStep);
110
114
  }
111
115
  inserted.push(...omitRequestsForUpgrade(insertedInStep));
@@ -226,6 +230,20 @@ const isTransactionResolveReplace = tr => {
226
230
  const pluginMeta = tr.getMeta(pluginKey);
227
231
  return isMetadataResolve(pluginMeta);
228
232
  };
233
+
234
+ /**
235
+ * Checks if the transaction is an auto-convert action
236
+ * (e.g. a pasted link being converted to a native embed extension node).
237
+ * In this case the link removal should not be tracked as a deletion.
238
+ */
239
+ const isAutoConvertTr = tr => {
240
+ return !!tr.steps.find(step => {
241
+ if (!(step instanceof LinkMetaStep)) {
242
+ return false;
243
+ }
244
+ return step.getMetadata().cardAction === 'AUTO_CONVERT';
245
+ });
246
+ };
229
247
  const isMetadataResolve = metaData => {
230
248
  return hasType(metaData) && metaData.type === 'RESOLVE';
231
249
  };
@@ -27,6 +27,7 @@ export var findChanged = function findChanged(tr, state) {
27
27
  var updated = [];
28
28
  var queuedForUpgrade = isTransactionQueuedForUpgrade(tr);
29
29
  var isResolveReplace = isTransactionResolveReplace(tr);
30
+ var isAutoConvert = isAutoConvertTr(tr);
30
31
 
31
32
  // History
32
33
  var historyMeta = tr.getMeta(pmHistoryPluginKey);
@@ -111,9 +112,12 @@ export var findChanged = function findChanged(tr, state) {
111
112
  * Skip "deletions" when the transaction is relating to
112
113
  * replacing links queued for upgrade to cards,
113
114
  * because the "deleted" link has not actually been
114
- * tracked as "created" yet
115
+ * tracked as "created" yet.
116
+ * Also skip when the transaction is an auto-convert
117
+ * (e.g. a pasted link being converted to a native embed extension),
118
+ * because the link is being converted, not deleted by the user.
115
119
  */
116
- if (!isResolveReplace) {
120
+ if (!isResolveReplace && !isAutoConvert) {
117
121
  removed.push.apply(removed, removedInStep);
118
122
  }
119
123
  inserted.push.apply(inserted, _toConsumableArray(omitRequestsForUpgrade(insertedInStep)));
@@ -235,6 +239,20 @@ var isTransactionResolveReplace = function isTransactionResolveReplace(tr) {
235
239
  var pluginMeta = tr.getMeta(pluginKey);
236
240
  return isMetadataResolve(pluginMeta);
237
241
  };
242
+
243
+ /**
244
+ * Checks if the transaction is an auto-convert action
245
+ * (e.g. a pasted link being converted to a native embed extension node).
246
+ * In this case the link removal should not be tracked as a deletion.
247
+ */
248
+ var isAutoConvertTr = function isAutoConvertTr(tr) {
249
+ return !!tr.steps.find(function (step) {
250
+ if (!(step instanceof LinkMetaStep)) {
251
+ return false;
252
+ }
253
+ return step.getMetadata().cardAction === 'AUTO_CONVERT';
254
+ });
255
+ };
238
256
  var isMetadataResolve = function isMetadataResolve(metaData) {
239
257
  return hasType(metaData) && metaData.type === 'RESOLVE';
240
258
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "13.1.17",
3
+ "version": "13.1.18",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",