@atlaskit/editor-plugin-card 13.1.16 → 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 +14 -0
- package/README.md +16 -2
- package/dist/cjs/ui/analytics/events-from-tr.js +20 -2
- package/dist/es2019/ui/analytics/events-from-tr.js +20 -2
- package/dist/esm/ui/analytics/events-from-tr.js +20 -2
- package/dist/types/pm-plugins/utils.d.ts +1 -1
- package/dist/types/ui/analytics/events-from-tr.d.ts +1 -1
- package/dist/types/ui/datasourceErrorBoundary.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils.d.ts +1 -1
- package/dist/types-ts4.5/ui/analytics/events-from-tr.d.ts +1 -1
- package/dist/types-ts4.5/ui/datasourceErrorBoundary.d.ts +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
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
|
+
|
|
11
|
+
## 13.1.17
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 13.1.16
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
# Editor
|
|
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
|
-
|
|
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
|
};
|
|
@@ -42,7 +42,7 @@ export declare const isDatasourceNode: (node?: Node) => node is DatasourceNode;
|
|
|
42
42
|
*/
|
|
43
43
|
export declare const focusEditorView: (editorView: EditorView) => void;
|
|
44
44
|
export declare const getAwarenessProps: (editorState: EditorState, getPos: getPosHandler, allowEmbeds?: boolean, allowBlockCards?: boolean, disableOverlay?: boolean) => {
|
|
45
|
-
isPulseEnabled: boolean;
|
|
46
45
|
isOverlayEnabled: boolean;
|
|
46
|
+
isPulseEnabled: boolean;
|
|
47
47
|
isSelected: boolean;
|
|
48
48
|
};
|
|
@@ -4,8 +4,8 @@ import type { CardPluginEvent, Entity } from './types';
|
|
|
4
4
|
* Find the links, smartLinks, datasources that were changed in a transaction
|
|
5
5
|
*/
|
|
6
6
|
export declare const findChanged: (tr: Transaction | ReadonlyTransaction, state: EditorState) => {
|
|
7
|
-
removed: Entity[];
|
|
8
7
|
inserted: Entity[];
|
|
8
|
+
removed: Entity[];
|
|
9
9
|
updated: ({
|
|
10
10
|
inserted: Entity;
|
|
11
11
|
removed: Entity;
|
|
@@ -16,8 +16,8 @@ export declare class DatasourceErrorBoundary extends React.Component<DatasourceE
|
|
|
16
16
|
error: null;
|
|
17
17
|
};
|
|
18
18
|
static getDerivedStateFromError(error: Error | APIError): {
|
|
19
|
-
isError: boolean;
|
|
20
19
|
error: Error | APIError;
|
|
20
|
+
isError: boolean;
|
|
21
21
|
};
|
|
22
22
|
componentDidCatch(error: Error | APIError): void;
|
|
23
23
|
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
@@ -42,7 +42,7 @@ export declare const isDatasourceNode: (node?: Node) => node is DatasourceNode;
|
|
|
42
42
|
*/
|
|
43
43
|
export declare const focusEditorView: (editorView: EditorView) => void;
|
|
44
44
|
export declare const getAwarenessProps: (editorState: EditorState, getPos: getPosHandler, allowEmbeds?: boolean, allowBlockCards?: boolean, disableOverlay?: boolean) => {
|
|
45
|
-
isPulseEnabled: boolean;
|
|
46
45
|
isOverlayEnabled: boolean;
|
|
46
|
+
isPulseEnabled: boolean;
|
|
47
47
|
isSelected: boolean;
|
|
48
48
|
};
|
|
@@ -4,8 +4,8 @@ import type { CardPluginEvent, Entity } from './types';
|
|
|
4
4
|
* Find the links, smartLinks, datasources that were changed in a transaction
|
|
5
5
|
*/
|
|
6
6
|
export declare const findChanged: (tr: Transaction | ReadonlyTransaction, state: EditorState) => {
|
|
7
|
-
removed: Entity[];
|
|
8
7
|
inserted: Entity[];
|
|
8
|
+
removed: Entity[];
|
|
9
9
|
updated: ({
|
|
10
10
|
inserted: Entity;
|
|
11
11
|
removed: Entity;
|
|
@@ -16,8 +16,8 @@ export declare class DatasourceErrorBoundary extends React.Component<DatasourceE
|
|
|
16
16
|
error: null;
|
|
17
17
|
};
|
|
18
18
|
static getDerivedStateFromError(error: Error | APIError): {
|
|
19
|
-
isError: boolean;
|
|
20
19
|
error: Error | APIError;
|
|
20
|
+
isError: boolean;
|
|
21
21
|
};
|
|
22
22
|
componentDidCatch(error: Error | APIError): void;
|
|
23
23
|
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "13.1.
|
|
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",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/editor-smart-link-draggable": "^0.4.0",
|
|
49
49
|
"@atlaskit/frontend-utilities": "^3.2.0",
|
|
50
50
|
"@atlaskit/icon": "^34.0.0",
|
|
51
|
-
"@atlaskit/link": "^3.
|
|
51
|
+
"@atlaskit/link": "^3.4.0",
|
|
52
52
|
"@atlaskit/link-analytics": "^11.0.0",
|
|
53
53
|
"@atlaskit/link-client-extension": "^6.0.0",
|
|
54
54
|
"@atlaskit/link-datasource": "^4.34.0",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
61
61
|
"@atlaskit/primitives": "^18.1.0",
|
|
62
62
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
63
|
-
"@atlaskit/smart-card": "^43.
|
|
64
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
63
|
+
"@atlaskit/smart-card": "^43.31.0",
|
|
64
|
+
"@atlaskit/tmp-editor-statsig": "^55.0.0",
|
|
65
65
|
"@atlaskit/tokens": "^11.4.0",
|
|
66
66
|
"@babel/runtime": "^7.0.0",
|
|
67
67
|
"@emotion/react": "^11.7.1",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"uuid": "^3.1.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@atlaskit/editor-common": "^112.
|
|
74
|
+
"@atlaskit/editor-common": "^112.18.0",
|
|
75
75
|
"@atlaskit/link-provider": "^4.3.0",
|
|
76
76
|
"react": "^18.2.0",
|
|
77
77
|
"react-intl-next": "npm:react-intl@^5.18.1"
|