@atlaskit/editor-plugin-card 0.9.1 → 0.9.2
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 +6 -0
- package/dist/cjs/ui/DatasourceModal/ModalWithState.js +8 -3
- package/dist/cjs/ui/DatasourceModal/index.js +22 -6
- package/dist/cjs/ui/EditDatasourceButton.js +26 -64
- package/dist/cjs/ui/useFetchDatasourceInfo.js +86 -0
- package/dist/es2019/ui/DatasourceModal/ModalWithState.js +7 -3
- package/dist/es2019/ui/DatasourceModal/index.js +23 -6
- package/dist/es2019/ui/EditDatasourceButton.js +11 -15
- package/dist/es2019/ui/useFetchDatasourceInfo.js +45 -0
- package/dist/esm/ui/DatasourceModal/ModalWithState.js +8 -3
- package/dist/esm/ui/DatasourceModal/index.js +22 -6
- package/dist/esm/ui/EditDatasourceButton.js +18 -55
- package/dist/esm/ui/useFetchDatasourceInfo.js +78 -0
- package/dist/types/ui/DatasourceModal/index.d.ts +3 -1
- package/dist/types/ui/EditDatasourceButton.d.ts +1 -0
- package/dist/types/ui/useFetchDatasourceInfo.d.ts +14 -0
- package/dist/types-ts4.5/analytics/create-events-queue.d.ts +21 -0
- package/dist/types-ts4.5/analytics/events-from-tr.d.ts +19 -0
- package/dist/types-ts4.5/analytics/index.d.ts +2 -0
- package/dist/types-ts4.5/analytics/types.d.ts +66 -0
- package/dist/types-ts4.5/analytics/utils.d.ts +22 -0
- package/dist/types-ts4.5/datasourceErrorBoundary.d.ts +18 -0
- package/dist/types-ts4.5/index.d.ts +3 -0
- package/dist/types-ts4.5/messages.d.ts +22 -0
- package/dist/types-ts4.5/nodeviews/blockCard.d.ts +30 -0
- package/dist/types-ts4.5/nodeviews/datasource.d.ts +43 -0
- package/dist/types-ts4.5/nodeviews/embedCard.d.ts +46 -0
- package/dist/types-ts4.5/nodeviews/genericCard.d.ts +37 -0
- package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +23 -0
- package/dist/types-ts4.5/plugin.d.ts +29 -0
- package/dist/types-ts4.5/pm-plugins/actions.d.ts +22 -0
- package/dist/types-ts4.5/pm-plugins/doc.d.ts +27 -0
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/main.d.ts +6 -0
- package/dist/types-ts4.5/pm-plugins/mountHyperlink.d.ts +5 -0
- package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/reducers.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/shouldReplaceLink.d.ts +2 -0
- package/dist/types-ts4.5/pm-plugins/util/resolve.d.ts +8 -0
- package/dist/types-ts4.5/pm-plugins/util/state.d.ts +30 -0
- package/dist/types-ts4.5/toolbar.d.ts +9 -0
- package/dist/types-ts4.5/types.d.ts +133 -0
- package/dist/types-ts4.5/ui/CardContextProvider.d.ts +19 -0
- package/dist/types-ts4.5/ui/DatasourceModal/ModalWithState.d.ts +9 -0
- package/dist/types-ts4.5/ui/DatasourceModal/index.d.ts +13 -0
- package/dist/types-ts4.5/ui/EditDatasourceButton.d.ts +18 -0
- package/dist/types-ts4.5/ui/EditLinkToolbar.d.ts +41 -0
- package/dist/types-ts4.5/ui/EditorAnalyticsContext.d.ts +10 -0
- package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.d.ts +6 -0
- package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/LinkEvents.d.ts +6 -0
- package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/common.d.ts +20 -0
- package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/index.d.ts +9 -0
- package/dist/types-ts4.5/ui/EditorSmartCardEvents.d.ts +5 -0
- package/dist/types-ts4.5/ui/HyperlinkToolbarAppearance.d.ts +32 -0
- package/dist/types-ts4.5/ui/LayoutButton/index.d.ts +9 -0
- package/dist/types-ts4.5/ui/LayoutButton/types.d.ts +19 -0
- package/dist/types-ts4.5/ui/LayoutButton/utils.d.ts +5 -0
- package/dist/types-ts4.5/ui/LinkToolbarAppearance.d.ts +29 -0
- package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +61 -0
- package/dist/types-ts4.5/ui/ToolbarViewedEvent.d.ts +11 -0
- package/dist/types-ts4.5/ui/useFetchDatasourceInfo.d.ts +14 -0
- package/dist/types-ts4.5/utils.d.ts +19 -0
- package/package.json +4 -3
- package/tmp/api-report-tmp.d.ts +193 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@atlaskit/adf-schema": "^32.0.0",
|
|
35
35
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
36
36
|
"@atlaskit/custom-steps": "^0.0.2",
|
|
37
|
-
"@atlaskit/editor-common": "^76.
|
|
37
|
+
"@atlaskit/editor-common": "^76.10.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^0.2.0",
|
|
39
39
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
40
40
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
51
51
|
"@atlaskit/smart-card": "^26.34.0",
|
|
52
52
|
"@atlaskit/theme": "^12.6.0",
|
|
53
|
-
"@atlaskit/tokens": "^1.
|
|
53
|
+
"@atlaskit/tokens": "^1.26.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
55
55
|
"@emotion/react": "^11.7.1",
|
|
56
56
|
"lodash": "^4.17.21",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"@atlassian/feature-flags-test-utils": "*",
|
|
75
75
|
"@testing-library/dom": "^8.17.1",
|
|
76
76
|
"@testing-library/react": "^12.1.5",
|
|
77
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
77
78
|
"@testing-library/user-event": "^14.4.3",
|
|
78
79
|
"raf-stub": "^2.0.1",
|
|
79
80
|
"react-dom": "^16.8.0",
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/editor-plugin-card"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
8
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
9
|
+
import { CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
10
|
+
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
11
|
+
import type { CardPluginActions } from '@atlaskit/editor-common/card';
|
|
12
|
+
import { CardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
13
|
+
import type { CardReplacementInputMethod } from '@atlaskit/editor-common/card';
|
|
14
|
+
import type { DatasourceModalType } from '@atlaskit/editor-common/types';
|
|
15
|
+
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
16
|
+
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
17
|
+
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
18
|
+
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
19
|
+
import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
20
|
+
import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
|
|
21
|
+
import type { LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
22
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
23
|
+
import type { Node as Node_2 } from '@atlaskit/editor-prosemirror/model';
|
|
24
|
+
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
25
|
+
import { SmartLinkEvents } from '@atlaskit/smart-card';
|
|
26
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
27
|
+
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
28
|
+
|
|
29
|
+
// @public (undocumented)
|
|
30
|
+
type CardInfo = {
|
|
31
|
+
title?: string;
|
|
32
|
+
url?: string;
|
|
33
|
+
pos: number;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// @public (undocumented)
|
|
37
|
+
export type CardPlugin = NextEditorPlugin<'card', {
|
|
38
|
+
pluginConfiguration: CardPluginOptions;
|
|
39
|
+
dependencies: [
|
|
40
|
+
FeatureFlagsPlugin,
|
|
41
|
+
OptionalPlugin<AnalyticsPlugin>,
|
|
42
|
+
WidthPlugin,
|
|
43
|
+
DecorationsPlugin,
|
|
44
|
+
GridPlugin,
|
|
45
|
+
FloatingToolbarPlugin,
|
|
46
|
+
HyperlinkPlugin
|
|
47
|
+
];
|
|
48
|
+
sharedState: CardPluginState | null;
|
|
49
|
+
actions: CardPluginActions;
|
|
50
|
+
}>;
|
|
51
|
+
|
|
52
|
+
// @public
|
|
53
|
+
export const cardPlugin: CardPlugin;
|
|
54
|
+
|
|
55
|
+
// @public (undocumented)
|
|
56
|
+
type CardPluginEvent = DatasourceEvent | LinkEvent;
|
|
57
|
+
|
|
58
|
+
// @public (undocumented)
|
|
59
|
+
type CardPluginOptions = CardOptions & {
|
|
60
|
+
editorAppearance?: EditorAppearance;
|
|
61
|
+
platform: 'mobile' | 'web';
|
|
62
|
+
fullWidthMode?: boolean;
|
|
63
|
+
linkPicker?: LinkPickerOptions;
|
|
64
|
+
cardPluginEvents?: EditorCardPluginEvents<CardPluginEvent>;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// @public (undocumented)
|
|
68
|
+
type CardPluginState = {
|
|
69
|
+
requests: Request_2[];
|
|
70
|
+
provider: CardProvider | null;
|
|
71
|
+
cards: CardInfo[];
|
|
72
|
+
showLinkingToolbar: boolean;
|
|
73
|
+
smartLinkEvents?: SmartLinkEvents;
|
|
74
|
+
editorAppearance?: EditorAppearance;
|
|
75
|
+
showDatasourceModal: boolean;
|
|
76
|
+
datasourceModalType?: DatasourceModalType;
|
|
77
|
+
datasourceTableRef?: HTMLElement;
|
|
78
|
+
layout?: DatasourceTableLayout;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// @public (undocumented)
|
|
82
|
+
type DatasourceCreatedEvent = {
|
|
83
|
+
event: EVENT.CREATED;
|
|
84
|
+
subject: EVENT_SUBJECT.DATASOURCE;
|
|
85
|
+
data: Metadata_2;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// @public (undocumented)
|
|
89
|
+
type DatasourceDeletedEvent = {
|
|
90
|
+
event: EVENT.DELETED;
|
|
91
|
+
subject: EVENT_SUBJECT.DATASOURCE;
|
|
92
|
+
data: Metadata_2;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// @public (undocumented)
|
|
96
|
+
type DatasourceEvent = DatasourceCreatedEvent | DatasourceDeletedEvent | DatasourceUpdatedEvent;
|
|
97
|
+
|
|
98
|
+
// @public (undocumented)
|
|
99
|
+
type DatasourceTableLayout = 'center' | 'full-width' | 'wide';
|
|
100
|
+
|
|
101
|
+
// @public (undocumented)
|
|
102
|
+
type DatasourceUpdatedEvent = {
|
|
103
|
+
event: EVENT.UPDATED;
|
|
104
|
+
subject: EVENT_SUBJECT.DATASOURCE;
|
|
105
|
+
data: Metadata_2<UpdateMetadata>;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// @public (undocumented)
|
|
109
|
+
type EditorCardPluginEvents<T> = {
|
|
110
|
+
push: (...events: T[]) => void;
|
|
111
|
+
subscribe: (listener: Subscriber<T>) => () => void;
|
|
112
|
+
flush: () => void;
|
|
113
|
+
getSize: () => number;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// @public (undocumented)
|
|
117
|
+
enum EVENT {
|
|
118
|
+
// (undocumented)
|
|
119
|
+
CREATED = "created",
|
|
120
|
+
// (undocumented)
|
|
121
|
+
DELETED = "deleted",
|
|
122
|
+
// (undocumented)
|
|
123
|
+
UPDATED = "updated"
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// @public (undocumented)
|
|
127
|
+
enum EVENT_SUBJECT {
|
|
128
|
+
// (undocumented)
|
|
129
|
+
DATASOURCE = "datasource",
|
|
130
|
+
// (undocumented)
|
|
131
|
+
LINK = "link"
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// @public
|
|
135
|
+
type LinkCreatedEvent = {
|
|
136
|
+
event: EVENT.CREATED;
|
|
137
|
+
subject: EVENT_SUBJECT.LINK;
|
|
138
|
+
data: Metadata_2;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// @public (undocumented)
|
|
142
|
+
type LinkDeletedEvent = {
|
|
143
|
+
event: EVENT.DELETED;
|
|
144
|
+
subject: EVENT_SUBJECT.LINK;
|
|
145
|
+
data: Metadata_2;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// @public (undocumented)
|
|
149
|
+
type LinkEvent = LinkCreatedEvent | LinkDeletedEvent | LinkUpdatedEvent;
|
|
150
|
+
|
|
151
|
+
// @public (undocumented)
|
|
152
|
+
type LinkUpdatedEvent = {
|
|
153
|
+
event: EVENT.UPDATED;
|
|
154
|
+
subject: EVENT_SUBJECT.LINK;
|
|
155
|
+
data: Metadata_2<UpdateMetadata>;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// @public (undocumented)
|
|
159
|
+
type Metadata_2<T = {}> = {
|
|
160
|
+
node: Node_2;
|
|
161
|
+
isUndo?: boolean;
|
|
162
|
+
isRedo?: boolean;
|
|
163
|
+
action?: string;
|
|
164
|
+
inputMethod?: string;
|
|
165
|
+
sourceEvent?: unknown;
|
|
166
|
+
nodeContext?: string;
|
|
167
|
+
} & T;
|
|
168
|
+
|
|
169
|
+
// @public (undocumented)
|
|
170
|
+
type Request_2 = {
|
|
171
|
+
pos: number;
|
|
172
|
+
url: string;
|
|
173
|
+
appearance: CardAppearance;
|
|
174
|
+
compareLinkText: boolean;
|
|
175
|
+
source: CardReplacementInputMethod;
|
|
176
|
+
previousAppearance?: 'url' | CardAppearance;
|
|
177
|
+
analyticsAction?: ACTION;
|
|
178
|
+
shouldReplaceLink?: boolean;
|
|
179
|
+
sourceEvent?: UIAnalyticsEvent | null | undefined;
|
|
180
|
+
};
|
|
181
|
+
export { Request_2 as Request }
|
|
182
|
+
|
|
183
|
+
// @public (undocumented)
|
|
184
|
+
type Subscriber<T> = (event: T) => void;
|
|
185
|
+
|
|
186
|
+
// @public (undocumented)
|
|
187
|
+
type UpdateMetadata = {
|
|
188
|
+
previousDisplay?: string;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// (No @packageDocumentation comment for this package)
|
|
192
|
+
|
|
193
|
+
```
|