@atlaskit/editor-plugin-card 1.14.4 → 1.15.0
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/.eslintrc.js +12 -12
- package/CHANGELOG.md +692 -681
- package/LICENSE.md +6 -8
- package/dist/cjs/nodeviews/datasource.js +1 -0
- package/dist/cjs/nodeviews/inlineCardWithAwareness.js +4 -1
- package/dist/cjs/pm-plugins/doc.js +21 -1
- package/dist/cjs/toolbar.js +36 -6
- package/dist/cjs/ui/AwarenessWrapper/index.js +20 -18
- package/dist/cjs/ui/DatasourceModal/index.js +4 -5
- package/dist/cjs/ui/EditDatasourceButton.js +5 -26
- package/dist/cjs/ui/EditToolbarButton.js +139 -0
- package/dist/cjs/ui/InlineCardOverlay/index.js +9 -3
- package/dist/cjs/ui/{NewInlineCardOverlay → LeftIconOverlay}/index.js +60 -101
- package/dist/cjs/ui/ResizableEmbedCard.js +3 -0
- package/dist/cjs/utils.js +4 -1
- package/dist/es2019/nodeviews/datasource.js +1 -0
- package/dist/es2019/nodeviews/inlineCardWithAwareness.js +4 -1
- package/dist/es2019/pm-plugins/doc.js +22 -2
- package/dist/es2019/toolbar.js +33 -7
- package/dist/es2019/ui/AwarenessWrapper/index.js +20 -18
- package/dist/es2019/ui/DatasourceModal/index.js +4 -5
- package/dist/es2019/ui/EditDatasourceButton.js +1 -22
- package/dist/es2019/ui/EditToolbarButton.js +123 -0
- package/dist/es2019/ui/InlineCardOverlay/index.js +9 -3
- package/dist/es2019/ui/{NewInlineCardOverlay → LeftIconOverlay}/index.js +51 -94
- package/dist/es2019/ui/ResizableEmbedCard.js +4 -0
- package/dist/es2019/utils.js +3 -0
- package/dist/esm/nodeviews/datasource.js +1 -0
- package/dist/esm/nodeviews/inlineCardWithAwareness.js +4 -1
- package/dist/esm/pm-plugins/doc.js +22 -2
- package/dist/esm/toolbar.js +38 -8
- package/dist/esm/ui/AwarenessWrapper/index.js +20 -18
- package/dist/esm/ui/DatasourceModal/index.js +4 -5
- package/dist/esm/ui/EditDatasourceButton.js +1 -22
- package/dist/esm/ui/EditToolbarButton.js +131 -0
- package/dist/esm/ui/InlineCardOverlay/index.js +9 -3
- package/dist/esm/ui/{NewInlineCardOverlay → LeftIconOverlay}/index.js +62 -103
- package/dist/esm/ui/ResizableEmbedCard.js +3 -0
- package/dist/esm/utils.js +3 -0
- package/dist/types/pm-plugins/doc.d.ts +1 -0
- package/dist/types/ui/EditDatasourceButton.d.ts +0 -2
- package/dist/types/ui/EditToolbarButton.d.ts +15 -0
- package/dist/types/ui/EditorAnalyticsContext.d.ts +1 -1
- package/dist/types/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.d.ts +1 -1
- package/dist/types/ui/EditorLinkingPlatformAnalytics/LinkEvents.d.ts +1 -1
- package/dist/types/ui/EditorSmartCardEvents.d.ts +1 -1
- package/dist/types/ui/LeftIconOverlay/index.d.ts +10 -0
- package/dist/types/utils.d.ts +2 -0
- package/dist/types-ts4.5/pm-plugins/doc.d.ts +1 -0
- package/dist/types-ts4.5/ui/EditDatasourceButton.d.ts +0 -2
- package/dist/types-ts4.5/ui/EditToolbarButton.d.ts +15 -0
- package/dist/types-ts4.5/ui/EditorAnalyticsContext.d.ts +1 -1
- package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.d.ts +1 -1
- package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/LinkEvents.d.ts +1 -1
- package/dist/types-ts4.5/ui/EditorSmartCardEvents.d.ts +1 -1
- package/dist/types-ts4.5/ui/LeftIconOverlay/index.d.ts +10 -0
- package/dist/types-ts4.5/utils.d.ts +2 -0
- package/package.json +9 -6
- package/report.api.md +94 -96
- package/dist/types/ui/NewInlineCardOverlay/index.d.ts +0 -6
- package/dist/types-ts4.5/ui/NewInlineCardOverlay/index.d.ts +0 -6
|
@@ -2,6 +2,7 @@ import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
|
2
2
|
import type { Node, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { CardContext } from '@atlaskit/link-provider';
|
|
5
|
+
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
5
6
|
import type { CardInfo, DatasourceNode } from './types';
|
|
6
7
|
export declare const appearanceForNodeType: (spec: NodeType) => CardAppearance | undefined;
|
|
7
8
|
export declare const selectedCardAppearance: (state: EditorState) => CardAppearance | undefined;
|
|
@@ -22,6 +23,7 @@ export declare const isEmbedSupportedAtPosition: (currentNodePosition: number, e
|
|
|
22
23
|
export declare const isBlockSupportedAtPosition: (currentNodePosition: number, editorState: EditorState, currentAppearance?: CardAppearance) => boolean;
|
|
23
24
|
export declare const getResolvedAttributesFromStore: (url: string, display: string | null, store?: CardContext['store']) => {};
|
|
24
25
|
export declare const isDatasourceConfigEditable: (datasourceId: string) => boolean;
|
|
26
|
+
export declare const isEditDropdownEnabled: (platform?: CardPlatform) => boolean;
|
|
25
27
|
/**
|
|
26
28
|
* Typeguard that checks node attributes are datasource node attributes
|
|
27
29
|
* ** WARNING ** Typeguards are not a guarantee, if the asserted type changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@atlaskit/adf-schema": "^36.10.7",
|
|
36
36
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
37
37
|
"@atlaskit/custom-steps": "^0.2.0",
|
|
38
|
-
"@atlaskit/editor-common": "^81.
|
|
38
|
+
"@atlaskit/editor-common": "^81.2.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
|
40
40
|
"@atlaskit/editor-plugin-decorations": "^1.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-editor-viewmode": "^1.1.0",
|
|
@@ -53,11 +53,13 @@
|
|
|
53
53
|
"@atlaskit/link-datasource": "^2.3.0",
|
|
54
54
|
"@atlaskit/linking-common": "^5.7.0",
|
|
55
55
|
"@atlaskit/linking-types": "^8.9.0",
|
|
56
|
+
"@atlaskit/menu": "2.3.0",
|
|
56
57
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
57
|
-
"@atlaskit/primitives": "^6.
|
|
58
|
-
"@atlaskit/smart-card": "^27.
|
|
58
|
+
"@atlaskit/primitives": "^6.4.0",
|
|
59
|
+
"@atlaskit/smart-card": "^27.4.0",
|
|
59
60
|
"@atlaskit/theme": "^12.8.0",
|
|
60
61
|
"@atlaskit/tokens": "^1.49.0",
|
|
62
|
+
"@atlaskit/tooltip": "^18.4.0",
|
|
61
63
|
"@babel/runtime": "^7.0.0",
|
|
62
64
|
"@emotion/react": "^11.7.1",
|
|
63
65
|
"lodash": "^4.17.21",
|
|
@@ -70,7 +72,6 @@
|
|
|
70
72
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
71
73
|
},
|
|
72
74
|
"devDependencies": {
|
|
73
|
-
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
74
75
|
"typescript": "~5.4.2"
|
|
75
76
|
},
|
|
76
77
|
"techstack": {
|
|
@@ -103,8 +104,10 @@
|
|
|
103
104
|
]
|
|
104
105
|
}
|
|
105
106
|
},
|
|
106
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
|
|
107
107
|
"platform-feature-flags": {
|
|
108
|
+
"platform.linking-platform.enable-datasource-edit-dropdown-toolbar": {
|
|
109
|
+
"type": "boolean"
|
|
110
|
+
},
|
|
108
111
|
"platform.linking-platform.smart-links-in-live-pages": {
|
|
109
112
|
"type": "boolean"
|
|
110
113
|
},
|
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/editor-plugin-card"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -39,28 +40,28 @@ import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
|
39
40
|
|
|
40
41
|
// @public (undocumented)
|
|
41
42
|
type CardInfo = {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
title?: string;
|
|
44
|
+
url?: string;
|
|
45
|
+
pos: number;
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
// @public (undocumented)
|
|
48
49
|
export type CardPlugin = NextEditorPlugin<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
'card',
|
|
51
|
+
{
|
|
52
|
+
pluginConfiguration: CardPluginOptions;
|
|
53
|
+
dependencies: [
|
|
54
|
+
OptionalPlugin<FeatureFlagsPlugin>,
|
|
55
|
+
OptionalPlugin<AnalyticsPlugin>,
|
|
56
|
+
WidthPlugin,
|
|
57
|
+
DecorationsPlugin,
|
|
58
|
+
GridPlugin,
|
|
59
|
+
FloatingToolbarPlugin,
|
|
60
|
+
HyperlinkPlugin,
|
|
61
|
+
];
|
|
62
|
+
sharedState: CardPluginState | null;
|
|
63
|
+
actions: CardPluginActions;
|
|
64
|
+
}
|
|
64
65
|
>;
|
|
65
66
|
|
|
66
67
|
// @public
|
|
@@ -71,101 +72,98 @@ type CardPluginEvent = DatasourceEvent | LinkEvent;
|
|
|
71
72
|
|
|
72
73
|
// @public (undocumented)
|
|
73
74
|
type CardPluginOptions = CardOptions & {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
editorAppearance?: EditorAppearance;
|
|
76
|
+
platform: 'mobile' | 'web';
|
|
77
|
+
fullWidthMode?: boolean;
|
|
78
|
+
linkPicker?: LinkPickerOptions;
|
|
79
|
+
cardPluginEvents?: EditorCardPluginEvents<CardPluginEvent>;
|
|
79
80
|
};
|
|
80
81
|
|
|
81
82
|
// @public (undocumented)
|
|
82
83
|
type CardPluginState = {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
84
|
+
requests: Request_2[];
|
|
85
|
+
provider: CardProvider | null;
|
|
86
|
+
cards: CardInfo[];
|
|
87
|
+
showLinkingToolbar: boolean;
|
|
88
|
+
smartLinkEvents?: SmartLinkEvents;
|
|
89
|
+
editorAppearance?: EditorAppearance;
|
|
90
|
+
showDatasourceModal: boolean;
|
|
91
|
+
datasourceModalType?: DatasourceModalType;
|
|
92
|
+
datasourceTableRef?: HTMLElement;
|
|
93
|
+
layout?: DatasourceTableLayout;
|
|
94
|
+
inlineCardAwarenessCandidatePosition?: number;
|
|
95
|
+
overlayCandidatePosition?: number;
|
|
96
|
+
removeOverlay?: () => void;
|
|
97
|
+
selectedInlineLinkPosition?: number;
|
|
98
|
+
allowEmbeds?: boolean;
|
|
99
|
+
allowBlockCards?: boolean;
|
|
99
100
|
};
|
|
100
101
|
|
|
101
102
|
// @public (undocumented)
|
|
102
103
|
type DatasourceCreatedEvent = {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
event: EVENT.CREATED;
|
|
105
|
+
subject: EVENT_SUBJECT.DATASOURCE;
|
|
106
|
+
data: Metadata_2;
|
|
106
107
|
};
|
|
107
108
|
|
|
108
109
|
// @public (undocumented)
|
|
109
110
|
type DatasourceDeletedEvent = {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
event: EVENT.DELETED;
|
|
112
|
+
subject: EVENT_SUBJECT.DATASOURCE;
|
|
113
|
+
data: Metadata_2;
|
|
113
114
|
};
|
|
114
115
|
|
|
115
116
|
// @public (undocumented)
|
|
116
|
-
type DatasourceEvent =
|
|
117
|
-
| DatasourceCreatedEvent
|
|
118
|
-
| DatasourceDeletedEvent
|
|
119
|
-
| DatasourceUpdatedEvent;
|
|
117
|
+
type DatasourceEvent = DatasourceCreatedEvent | DatasourceDeletedEvent | DatasourceUpdatedEvent;
|
|
120
118
|
|
|
121
119
|
// @public (undocumented)
|
|
122
120
|
type DatasourceTableLayout = 'center' | 'full-width' | 'wide';
|
|
123
121
|
|
|
124
122
|
// @public (undocumented)
|
|
125
123
|
type DatasourceUpdatedEvent = {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
event: EVENT.UPDATED;
|
|
125
|
+
subject: EVENT_SUBJECT.DATASOURCE;
|
|
126
|
+
data: Metadata_2<UpdateMetadata>;
|
|
129
127
|
};
|
|
130
128
|
|
|
131
129
|
// @public (undocumented)
|
|
132
130
|
type EditorCardPluginEvents<T> = {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
push: (...events: T[]) => void;
|
|
132
|
+
subscribe: (listener: Subscriber<T>) => () => void;
|
|
133
|
+
flush: () => void;
|
|
134
|
+
getSize: () => number;
|
|
137
135
|
};
|
|
138
136
|
|
|
139
137
|
// @public (undocumented)
|
|
140
138
|
enum EVENT {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
139
|
+
// (undocumented)
|
|
140
|
+
CREATED = 'created',
|
|
141
|
+
// (undocumented)
|
|
142
|
+
DELETED = 'deleted',
|
|
143
|
+
// (undocumented)
|
|
144
|
+
UPDATED = 'updated',
|
|
147
145
|
}
|
|
148
146
|
|
|
149
147
|
// @public (undocumented)
|
|
150
148
|
enum EVENT_SUBJECT {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
149
|
+
// (undocumented)
|
|
150
|
+
DATASOURCE = 'datasource',
|
|
151
|
+
// (undocumented)
|
|
152
|
+
LINK = 'link',
|
|
155
153
|
}
|
|
156
154
|
|
|
157
155
|
// @public
|
|
158
156
|
type LinkCreatedEvent = {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
157
|
+
event: EVENT.CREATED;
|
|
158
|
+
subject: EVENT_SUBJECT.LINK;
|
|
159
|
+
data: Metadata_2;
|
|
162
160
|
};
|
|
163
161
|
|
|
164
162
|
// @public (undocumented)
|
|
165
163
|
type LinkDeletedEvent = {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
event: EVENT.DELETED;
|
|
165
|
+
subject: EVENT_SUBJECT.LINK;
|
|
166
|
+
data: Metadata_2;
|
|
169
167
|
};
|
|
170
168
|
|
|
171
169
|
// @public (undocumented)
|
|
@@ -173,33 +171,33 @@ type LinkEvent = LinkCreatedEvent | LinkDeletedEvent | LinkUpdatedEvent;
|
|
|
173
171
|
|
|
174
172
|
// @public (undocumented)
|
|
175
173
|
type LinkUpdatedEvent = {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
event: EVENT.UPDATED;
|
|
175
|
+
subject: EVENT_SUBJECT.LINK;
|
|
176
|
+
data: Metadata_2<UpdateMetadata>;
|
|
179
177
|
};
|
|
180
178
|
|
|
181
179
|
// @public (undocumented)
|
|
182
180
|
type Metadata_2<T = {}> = {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
181
|
+
node: Node_2;
|
|
182
|
+
isUndo?: boolean;
|
|
183
|
+
isRedo?: boolean;
|
|
184
|
+
action?: string;
|
|
185
|
+
inputMethod?: string;
|
|
186
|
+
sourceEvent?: unknown;
|
|
187
|
+
nodeContext?: string;
|
|
190
188
|
} & T;
|
|
191
189
|
|
|
192
190
|
// @public (undocumented)
|
|
193
191
|
type Request_2 = {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
192
|
+
pos: number;
|
|
193
|
+
url: string;
|
|
194
|
+
appearance: CardAppearance;
|
|
195
|
+
compareLinkText: boolean;
|
|
196
|
+
source: CardReplacementInputMethod;
|
|
197
|
+
previousAppearance?: 'url' | CardAppearance;
|
|
198
|
+
analyticsAction?: ACTION;
|
|
199
|
+
shouldReplaceLink?: boolean;
|
|
200
|
+
sourceEvent?: UIAnalyticsEvent | null | undefined;
|
|
203
201
|
};
|
|
204
202
|
export { Request_2 as Request };
|
|
205
203
|
|
|
@@ -208,7 +206,7 @@ type Subscriber<T> = (event: T) => void;
|
|
|
208
206
|
|
|
209
207
|
// @public (undocumented)
|
|
210
208
|
type UpdateMetadata = {
|
|
211
|
-
|
|
209
|
+
previousDisplay?: string;
|
|
212
210
|
};
|
|
213
211
|
|
|
214
212
|
// (No @packageDocumentation comment for this package)
|
|
@@ -222,9 +220,9 @@ type UpdateMetadata = {
|
|
|
222
220
|
|
|
223
221
|
```json
|
|
224
222
|
{
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
223
|
+
"@atlaskit/link-provider": "^1.6.2",
|
|
224
|
+
"react": "^16.8.0",
|
|
225
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
228
226
|
}
|
|
229
227
|
```
|
|
230
228
|
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
|
-
import type { InlineCardOverlayProps } from '../InlineCardOverlay/types';
|
|
5
|
-
declare const NarrowInlineCardOverlay: ({ children, isSelected, isVisible, testId, url, ...props }: React.PropsWithChildren<InlineCardOverlayProps>) => jsx.JSX.Element;
|
|
6
|
-
export default NarrowInlineCardOverlay;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
|
-
import type { InlineCardOverlayProps } from '../InlineCardOverlay/types';
|
|
5
|
-
declare const NarrowInlineCardOverlay: ({ children, isSelected, isVisible, testId, url, ...props }: React.PropsWithChildren<InlineCardOverlayProps>) => jsx.JSX.Element;
|
|
6
|
-
export default NarrowInlineCardOverlay;
|