@atlaskit/editor-plugin-card 0.4.7 → 0.4.9
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 +36 -0
- package/dist/cjs/nodeviews/datasource.js +2 -2
- package/dist/cjs/nodeviews/embedCard.js +2 -2
- package/dist/cjs/nodeviews/genericCard.js +2 -2
- package/dist/cjs/plugin.js +14 -12
- package/dist/cjs/pm-plugins/main.js +2 -2
- package/dist/cjs/pm-plugins/mountHyperlink.js +7 -7
- package/dist/cjs/toolbar.js +6 -6
- package/dist/cjs/ui/EditLinkToolbar.js +6 -6
- package/dist/es2019/nodeviews/datasource.js +2 -2
- package/dist/es2019/nodeviews/embedCard.js +2 -2
- package/dist/es2019/nodeviews/genericCard.js +2 -2
- package/dist/es2019/plugin.js +6 -3
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/es2019/pm-plugins/mountHyperlink.js +7 -7
- package/dist/es2019/toolbar.js +6 -6
- package/dist/es2019/ui/EditLinkToolbar.js +6 -6
- package/dist/esm/nodeviews/datasource.js +2 -2
- package/dist/esm/nodeviews/embedCard.js +2 -2
- package/dist/esm/nodeviews/genericCard.js +2 -2
- package/dist/esm/plugin.js +14 -12
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/pm-plugins/mountHyperlink.js +7 -7
- package/dist/esm/toolbar.js +6 -6
- package/dist/esm/ui/EditLinkToolbar.js +6 -6
- package/dist/types/index.d.ts +1 -0
- package/dist/types/nodeviews/datasource.d.ts +6 -5
- package/dist/types/nodeviews/embedCard.d.ts +3 -3
- package/dist/types/nodeviews/genericCard.d.ts +7 -7
- package/dist/types/plugin.d.ts +14 -13
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/pm-plugins/mountHyperlink.d.ts +1 -1
- package/dist/types/toolbar.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/nodeviews/datasource.d.ts +6 -5
- package/dist/types-ts4.5/nodeviews/embedCard.d.ts +3 -3
- package/dist/types-ts4.5/nodeviews/genericCard.d.ts +7 -7
- package/dist/types-ts4.5/plugin.d.ts +14 -13
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/mountHyperlink.d.ts +1 -1
- package/dist/types-ts4.5/toolbar.d.ts +1 -1
- package/package.json +4 -5
- package/report.api.md +16 -13
- package/tmp/api-report-tmp.d.ts +16 -13
package/dist/esm/plugin.js
CHANGED
|
@@ -19,9 +19,11 @@ import DatasourceModalWithState from './ui/DatasourceModal/ModalWithState';
|
|
|
19
19
|
import { EditorLinkingPlatformAnalytics } from './ui/EditorLinkingPlatformAnalytics';
|
|
20
20
|
import { EditorSmartCardEvents } from './ui/EditorSmartCardEvents';
|
|
21
21
|
import LayoutButton from './ui/LayoutButton';
|
|
22
|
-
export var cardPlugin = function cardPlugin(
|
|
23
|
-
var _api$
|
|
24
|
-
var
|
|
22
|
+
export var cardPlugin = function cardPlugin(_ref) {
|
|
23
|
+
var _api$featureFlags;
|
|
24
|
+
var options = _ref.config,
|
|
25
|
+
api = _ref.api;
|
|
26
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
25
27
|
var cardPluginEvents = featureFlags !== null && featureFlags !== void 0 && featureFlags.lpAnalyticsEventsNext ? createEventsQueue() : undefined;
|
|
26
28
|
return {
|
|
27
29
|
name: 'card',
|
|
@@ -74,18 +76,18 @@ export var cardPlugin = function cardPlugin(options, api) {
|
|
|
74
76
|
}];
|
|
75
77
|
plugins.push({
|
|
76
78
|
name: 'cardKeymap',
|
|
77
|
-
plugin: function plugin(
|
|
78
|
-
var featureFlags =
|
|
79
|
+
plugin: function plugin(_ref2) {
|
|
80
|
+
var featureFlags = _ref2.featureFlags;
|
|
79
81
|
return cardKeymap(featureFlags);
|
|
80
82
|
}
|
|
81
83
|
});
|
|
82
84
|
return plugins;
|
|
83
85
|
},
|
|
84
|
-
contentComponent: function contentComponent(
|
|
85
|
-
var editorView =
|
|
86
|
-
popupsMountPoint =
|
|
87
|
-
popupsScrollableElement =
|
|
88
|
-
popupsBoundariesElement =
|
|
86
|
+
contentComponent: function contentComponent(_ref3) {
|
|
87
|
+
var editorView = _ref3.editorView,
|
|
88
|
+
popupsMountPoint = _ref3.popupsMountPoint,
|
|
89
|
+
popupsScrollableElement = _ref3.popupsScrollableElement,
|
|
90
|
+
popupsBoundariesElement = _ref3.popupsBoundariesElement;
|
|
89
91
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EditorSmartCardEvents, {
|
|
90
92
|
editorView: editorView
|
|
91
93
|
}), cardPluginEvents && /*#__PURE__*/React.createElement(EditorLinkingPlatformAnalytics, {
|
|
@@ -110,8 +112,8 @@ export var cardPlugin = function cardPlugin(options, api) {
|
|
|
110
112
|
},
|
|
111
113
|
pluginsOptions: {
|
|
112
114
|
floatingToolbar: floatingToolbar(options, featureFlags, options.platform, options.linkPicker, api),
|
|
113
|
-
quickInsert: function quickInsert(
|
|
114
|
-
var formatMessage =
|
|
115
|
+
quickInsert: function quickInsert(_ref4) {
|
|
116
|
+
var formatMessage = _ref4.formatMessage;
|
|
115
117
|
var quickInsertArray = [];
|
|
116
118
|
if (!options.allowDatasource) {
|
|
117
119
|
return quickInsertArray;
|
|
@@ -123,8 +123,8 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
123
123
|
* other tasks as per common implementations of the JavaScript event loop in browsers.
|
|
124
124
|
*/
|
|
125
125
|
var invoke = rafSchedule(function () {
|
|
126
|
-
var _pluginInjectionApi$
|
|
127
|
-
return resolveWithProvider(view, provider, request, options, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
126
|
+
var _pluginInjectionApi$a, _pluginInjectionApi$a2, _pluginInjectionApi$a3, _pluginInjectionApi$a4;
|
|
127
|
+
return resolveWithProvider(view, provider, request, options, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions, (_pluginInjectionApi$a2 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : (_pluginInjectionApi$a4 = _pluginInjectionApi$a3.sharedState.currentState()) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.createAnalyticsEvent) !== null && _pluginInjectionApi$a2 !== void 0 ? _pluginInjectionApi$a2 : undefined);
|
|
128
128
|
});
|
|
129
129
|
rafCancellationCallbacks.push(invoke.cancel);
|
|
130
130
|
invoke();
|
|
@@ -25,14 +25,14 @@ export var mountHyperlinkPlugin = function mountHyperlinkPlugin(pluginInjectionA
|
|
|
25
25
|
return new SafePlugin({
|
|
26
26
|
view: function view(editorView) {
|
|
27
27
|
requestAnimationFrame(function () {
|
|
28
|
-
var _pluginInjectionApi$
|
|
29
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
28
|
+
var _pluginInjectionApi$h, _pluginInjectionApi$h2;
|
|
29
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$h = pluginInjectionApi.hyperlink) === null || _pluginInjectionApi$h === void 0 ? void 0 : (_pluginInjectionApi$h2 = _pluginInjectionApi$h.actions) === null || _pluginInjectionApi$h2 === void 0 ? void 0 : _pluginInjectionApi$h2.prependToolbarButtons({
|
|
30
30
|
items: function items(state, intl, providerFactory, link) {
|
|
31
31
|
return [].concat(_toConsumableArray(getToolbarViewedItem(link)), [{
|
|
32
32
|
type: 'custom',
|
|
33
33
|
fallback: [],
|
|
34
34
|
render: function render(editorView) {
|
|
35
|
-
var _pluginInjectionApi$
|
|
35
|
+
var _pluginInjectionApi$a, _pluginInjectionApi$c;
|
|
36
36
|
return /*#__PURE__*/React.createElement(HyperlinkToolbarAppearance, {
|
|
37
37
|
key: "link-appearance",
|
|
38
38
|
url: link,
|
|
@@ -42,14 +42,14 @@ export var mountHyperlinkPlugin = function mountHyperlinkPlugin(pluginInjectionA
|
|
|
42
42
|
cardOptions: options,
|
|
43
43
|
providerFactory: providerFactory,
|
|
44
44
|
platform: options === null || options === void 0 ? void 0 : options.platform,
|
|
45
|
-
editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
46
|
-
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
45
|
+
editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions,
|
|
46
|
+
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.card) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
}]);
|
|
50
50
|
},
|
|
51
|
-
onEscapeCallback: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
52
|
-
onInsertLinkCallback: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
51
|
+
onEscapeCallback: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions.hideLinkToolbar,
|
|
52
|
+
onInsertLinkCallback: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions.queueCardsFromChangedTr,
|
|
53
53
|
view: editorView
|
|
54
54
|
});
|
|
55
55
|
});
|
package/dist/esm/toolbar.js
CHANGED
|
@@ -182,10 +182,10 @@ var getToolbarViewedItem = function getToolbarViewedItem(url, display) {
|
|
|
182
182
|
};
|
|
183
183
|
var generateToolbarItems = function generateToolbarItems(state, featureFlags, intl, providerFactory, cardOptions, platform, linkPicker, pluginInjectionApi) {
|
|
184
184
|
return function (node) {
|
|
185
|
-
var _pluginInjectionApi$
|
|
185
|
+
var _pluginInjectionApi$a, _pluginInjectionApi$d, _pluginInjectionApi$d2, _node$attrs, _node$attrs2, _node$attrs2$datasour;
|
|
186
186
|
var _titleUrlPairFromNode2 = titleUrlPairFromNode(node),
|
|
187
187
|
url = _titleUrlPairFromNode2.url;
|
|
188
|
-
var _ref = (_pluginInjectionApi$
|
|
188
|
+
var _ref = (_pluginInjectionApi$a = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.analytics) !== null && _pluginInjectionApi$a !== void 0 ? _pluginInjectionApi$a : {},
|
|
189
189
|
editorAnalyticsApi = _ref.actions;
|
|
190
190
|
var metadata = {};
|
|
191
191
|
if (url && !isSafeUrl(url)) {
|
|
@@ -200,7 +200,7 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
|
|
|
200
200
|
}
|
|
201
201
|
var pluginState = pluginKey.getState(state);
|
|
202
202
|
var currentAppearance = appearanceForNodeType(node.type);
|
|
203
|
-
var _ref2 = (_pluginInjectionApi$
|
|
203
|
+
var _ref2 = (_pluginInjectionApi$d = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.decorations) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions) !== null && _pluginInjectionApi$d !== void 0 ? _pluginInjectionApi$d : {},
|
|
204
204
|
hoverDecoration = _ref2.hoverDecoration;
|
|
205
205
|
var isDatasource = currentAppearance === 'block' && (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.datasource);
|
|
206
206
|
var shouldRenderDatasourceToolbar = isDatasource &&
|
|
@@ -264,8 +264,8 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
|
|
|
264
264
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
265
265
|
}]);
|
|
266
266
|
if (currentAppearance === 'embed') {
|
|
267
|
-
var _pluginInjectionApi$
|
|
268
|
-
var alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 :
|
|
267
|
+
var _pluginInjectionApi$a2;
|
|
268
|
+
var alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions, cardOptions);
|
|
269
269
|
if (alignmentOptions.length) {
|
|
270
270
|
alignmentOptions.push({
|
|
271
271
|
type: 'separator'
|
|
@@ -294,7 +294,7 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
|
|
|
294
294
|
allowBlockCards: allowBlockCards,
|
|
295
295
|
platform: platform,
|
|
296
296
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
297
|
-
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
297
|
+
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions
|
|
298
298
|
});
|
|
299
299
|
}
|
|
300
300
|
}, {
|
|
@@ -111,7 +111,7 @@ export var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
111
111
|
},
|
|
112
112
|
onEscapeCallback: function onEscapeCallback(state, dispatch) {
|
|
113
113
|
var tr = state.tr;
|
|
114
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
114
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.hyperlink.actions.hideLinkToolbar(tr);
|
|
115
115
|
_hideLinkToolbar(tr);
|
|
116
116
|
forceFocusSelector === null || forceFocusSelector === void 0 ? void 0 : forceFocusSelector("[aria-label=\"".concat(linkToolbarMessages.editLink.defaultMessage, "\"]"))(tr);
|
|
117
117
|
if (dispatch) {
|
|
@@ -122,7 +122,7 @@ export var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
122
122
|
},
|
|
123
123
|
onClickAwayCallback: function onClickAwayCallback(state, dispatch) {
|
|
124
124
|
var tr = state.tr;
|
|
125
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
125
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.hyperlink.actions.hideLinkToolbar(tr);
|
|
126
126
|
if (dispatch) {
|
|
127
127
|
dispatch(tr);
|
|
128
128
|
return true;
|
|
@@ -161,7 +161,7 @@ export var buildEditLinkToolbar = function buildEditLinkToolbar(_ref2) {
|
|
|
161
161
|
disableArrowNavigation: true,
|
|
162
162
|
fallback: [],
|
|
163
163
|
render: function render(view, idx) {
|
|
164
|
-
var _pluginInjectionApi$
|
|
164
|
+
var _pluginInjectionApi$f;
|
|
165
165
|
if (!view || !providerFactory) {
|
|
166
166
|
return null;
|
|
167
167
|
}
|
|
@@ -176,7 +176,7 @@ export var buildEditLinkToolbar = function buildEditLinkToolbar(_ref2) {
|
|
|
176
176
|
text: displayInfo.title || '',
|
|
177
177
|
node: node,
|
|
178
178
|
featureFlags: featureFlags,
|
|
179
|
-
forceFocusSelector: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
179
|
+
forceFocusSelector: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar.actions) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.forceFocusSelector,
|
|
180
180
|
onSubmit: function onSubmit(newHref, newText, inputMethod, analytic) {
|
|
181
181
|
var urlChanged = newHref !== displayInfo.url;
|
|
182
182
|
var titleChanged = newText !== displayInfo.title;
|
|
@@ -184,8 +184,8 @@ export var buildEditLinkToolbar = function buildEditLinkToolbar(_ref2) {
|
|
|
184
184
|
// If the title is changed in a smartlink, convert to standard blue hyperlink
|
|
185
185
|
// (even if the url was also changed) - we don't want to lose the custom title.
|
|
186
186
|
if (titleChanged) {
|
|
187
|
-
var _pluginInjectionApi$
|
|
188
|
-
return commandWithMetadata(changeSelectedCardToLink(newText, newHref, undefined, undefined, undefined, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
187
|
+
var _pluginInjectionApi$a;
|
|
188
|
+
return commandWithMetadata(changeSelectedCardToLink(newText, newHref, undefined, undefined, undefined, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions), {
|
|
189
189
|
action: ACTION.UPDATED,
|
|
190
190
|
inputMethod: inputMethod,
|
|
191
191
|
sourceEvent: analytic
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
5
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
6
6
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import type { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
8
|
+
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
9
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
10
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
11
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
12
|
import type { cardPlugin } from '../index';
|
|
12
13
|
export interface DatasourceProps extends ReactComponentProps {
|
|
13
14
|
node: PMNode;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
4
4
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
5
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
-
import { SmartCardProps } from './genericCard';
|
|
5
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
+
import type { SmartCardProps } from './genericCard';
|
|
7
7
|
export type EmbedCardState = {
|
|
8
8
|
hasPreview: boolean;
|
|
9
9
|
liveHeight?: number;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
-
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
-
import { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
6
|
-
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import { SmartCardContext } from '@atlaskit/link-provider';
|
|
10
|
-
import { CardPlatform } from '@atlaskit/smart-card';
|
|
4
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
+
import type { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
6
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
+
import type { SmartCardContext } from '@atlaskit/link-provider';
|
|
10
|
+
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
11
11
|
import type { cardPlugin } from '../index';
|
|
12
12
|
export type EditorContext<T> = React.Context<T> & {
|
|
13
13
|
value: T;
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import type { CardPluginActions } from '@atlaskit/editor-common/card';
|
|
2
2
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type
|
|
3
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
+
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
|
+
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
6
6
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
7
|
+
import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
8
|
+
import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
|
|
9
|
+
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
10
10
|
import type { CardPluginOptions, CardPluginState } from './types';
|
|
11
|
-
export
|
|
11
|
+
export type CardPlugin = NextEditorPlugin<'card', {
|
|
12
12
|
pluginConfiguration: CardPluginOptions;
|
|
13
13
|
dependencies: [
|
|
14
|
-
|
|
15
|
-
OptionalPlugin<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
FeatureFlagsPlugin,
|
|
15
|
+
OptionalPlugin<AnalyticsPlugin>,
|
|
16
|
+
WidthPlugin,
|
|
17
|
+
DecorationsPlugin,
|
|
18
|
+
GridPlugin,
|
|
19
19
|
FloatingToolbarPlugin,
|
|
20
|
-
|
|
20
|
+
HyperlinkPlugin
|
|
21
21
|
];
|
|
22
22
|
sharedState: CardPluginState | null;
|
|
23
23
|
actions: CardPluginActions;
|
|
24
24
|
}>;
|
|
25
|
+
export declare const cardPlugin: CardPlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { cardPlugin } from '../index';
|
|
4
|
-
import { CardPluginOptions, CardPluginState } from '../types';
|
|
4
|
+
import type { CardPluginOptions, CardPluginState } from '../types';
|
|
5
5
|
export { pluginKey } from './plugin-key';
|
|
6
6
|
export declare const createPlugin: (options: CardPluginOptions, pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (pmPluginFactoryParams: PMPluginFactoryParams) => SafePlugin<CardPluginState>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { cardPlugin } from '../index';
|
|
4
|
-
import { CardPluginOptions } from '../types';
|
|
4
|
+
import type { CardPluginOptions } from '../types';
|
|
5
5
|
export declare const mountHyperlinkPlugin: (pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined, options: CardPluginOptions) => SafePlugin<any>;
|
package/dist/types/toolbar.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
3
3
|
import type { Command, ExtractInjectionAPI, FeatureFlags, FloatingToolbarHandler, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
4
|
-
import { CardPlatform } from '@atlaskit/smart-card';
|
|
4
|
+
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
5
5
|
import type { cardPlugin } from './index';
|
|
6
6
|
export declare const removeCard: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
7
7
|
export declare const visitCardLink: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
5
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
6
6
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import type { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
8
|
+
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
9
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
10
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
11
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
12
|
import type { cardPlugin } from '../index';
|
|
12
13
|
export interface DatasourceProps extends ReactComponentProps {
|
|
13
14
|
node: PMNode;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
4
4
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
5
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
-
import { SmartCardProps } from './genericCard';
|
|
5
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
+
import type { SmartCardProps } from './genericCard';
|
|
7
7
|
export type EmbedCardState = {
|
|
8
8
|
hasPreview: boolean;
|
|
9
9
|
liveHeight?: number;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
-
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
-
import { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
6
|
-
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import { SmartCardContext } from '@atlaskit/link-provider';
|
|
10
|
-
import { CardPlatform } from '@atlaskit/smart-card';
|
|
4
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
+
import type { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
6
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
+
import type { SmartCardContext } from '@atlaskit/link-provider';
|
|
10
|
+
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
11
11
|
import type { cardPlugin } from '../index';
|
|
12
12
|
export type EditorContext<T> = React.Context<T> & {
|
|
13
13
|
value: T;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import type { CardPluginActions } from '@atlaskit/editor-common/card';
|
|
2
2
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type
|
|
3
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
+
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
|
+
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
6
6
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
7
|
+
import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
8
|
+
import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
|
|
9
|
+
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
10
10
|
import type { CardPluginOptions, CardPluginState } from './types';
|
|
11
|
-
export
|
|
11
|
+
export type CardPlugin = NextEditorPlugin<'card', {
|
|
12
12
|
pluginConfiguration: CardPluginOptions;
|
|
13
13
|
dependencies: [
|
|
14
|
-
|
|
15
|
-
OptionalPlugin<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
FeatureFlagsPlugin,
|
|
15
|
+
OptionalPlugin<AnalyticsPlugin>,
|
|
16
|
+
WidthPlugin,
|
|
17
|
+
DecorationsPlugin,
|
|
18
|
+
GridPlugin,
|
|
19
19
|
FloatingToolbarPlugin,
|
|
20
|
-
|
|
20
|
+
HyperlinkPlugin
|
|
21
21
|
];
|
|
22
22
|
sharedState: CardPluginState | null;
|
|
23
23
|
actions: CardPluginActions;
|
|
24
24
|
}>;
|
|
25
|
+
export declare const cardPlugin: CardPlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { cardPlugin } from '../index';
|
|
4
|
-
import { CardPluginOptions, CardPluginState } from '../types';
|
|
4
|
+
import type { CardPluginOptions, CardPluginState } from '../types';
|
|
5
5
|
export { pluginKey } from './plugin-key';
|
|
6
6
|
export declare const createPlugin: (options: CardPluginOptions, pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (pmPluginFactoryParams: PMPluginFactoryParams) => SafePlugin<CardPluginState>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { cardPlugin } from '../index';
|
|
4
|
-
import { CardPluginOptions } from '../types';
|
|
4
|
+
import type { CardPluginOptions } from '../types';
|
|
5
5
|
export declare const mountHyperlinkPlugin: (pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined, options: CardPluginOptions) => SafePlugin<any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
3
3
|
import type { Command, ExtractInjectionAPI, FeatureFlags, FloatingToolbarHandler, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
4
|
-
import { CardPlatform } from '@atlaskit/smart-card';
|
|
4
|
+
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
5
5
|
import type { cardPlugin } from './index';
|
|
6
6
|
export declare const removeCard: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
7
7
|
export declare const visitCardLink: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "28.1.2",
|
|
35
35
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
36
|
-
"@atlaskit/editor-common": "^74.
|
|
36
|
+
"@atlaskit/editor-common": "^74.53.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^0.1.0",
|
|
38
38
|
"@atlaskit/editor-plugin-decorations": "^0.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-feature-flags": "^0.1.0",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"@atlaskit/link-analytics": "^8.2.0",
|
|
48
48
|
"@atlaskit/link-datasource": "^1.0.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
50
|
-
"@atlaskit/smart-card": "^26.
|
|
50
|
+
"@atlaskit/smart-card": "^26.16.0",
|
|
51
51
|
"@atlaskit/theme": "^12.5.0",
|
|
52
|
-
"@atlaskit/tokens": "^1.
|
|
52
|
+
"@atlaskit/tokens": "^1.17.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@emotion/react": "^11.7.1",
|
|
55
55
|
"lodash": "^4.17.21",
|
|
@@ -63,7 +63,6 @@
|
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@atlaskit/activity-provider": "^2.4.0",
|
|
66
|
-
"@atlaskit/editor-test-helpers": "^18.11.0",
|
|
67
66
|
"@atlaskit/link-test-helpers": "^6.0.0",
|
|
68
67
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
69
68
|
"@atlaskit/ssr": "*",
|
package/report.api.md
CHANGED
|
@@ -16,26 +16,26 @@
|
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
18
|
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
19
|
-
import type {
|
|
19
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
20
20
|
import { CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
21
21
|
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
22
22
|
import type { CardPluginActions } from '@atlaskit/editor-common/card';
|
|
23
23
|
import { CardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
24
24
|
import type { CardReplacementInputMethod } from '@atlaskit/editor-common/card';
|
|
25
25
|
import type { DatasourceModalType } from '@atlaskit/editor-common/types';
|
|
26
|
-
import type {
|
|
26
|
+
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
27
27
|
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
28
|
-
import type
|
|
28
|
+
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
29
29
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
30
|
-
import type {
|
|
31
|
-
import type {
|
|
30
|
+
import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
31
|
+
import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
|
|
32
32
|
import type { LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
33
33
|
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
34
34
|
import { Node as Node_2 } from '@atlaskit/editor-prosemirror/model';
|
|
35
35
|
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
36
36
|
import { SmartLinkEvents } from '@atlaskit/smart-card';
|
|
37
37
|
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
38
|
-
import type {
|
|
38
|
+
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
39
39
|
|
|
40
40
|
// @public (undocumented)
|
|
41
41
|
type CardInfo = {
|
|
@@ -45,24 +45,27 @@ type CardInfo = {
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
// @public (undocumented)
|
|
48
|
-
export
|
|
48
|
+
export type CardPlugin = NextEditorPlugin<
|
|
49
49
|
'card',
|
|
50
50
|
{
|
|
51
51
|
pluginConfiguration: CardPluginOptions;
|
|
52
52
|
dependencies: [
|
|
53
|
-
|
|
54
|
-
OptionalPlugin<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
FeatureFlagsPlugin,
|
|
54
|
+
OptionalPlugin<AnalyticsPlugin>,
|
|
55
|
+
WidthPlugin,
|
|
56
|
+
DecorationsPlugin,
|
|
57
|
+
GridPlugin,
|
|
58
58
|
FloatingToolbarPlugin,
|
|
59
|
-
|
|
59
|
+
HyperlinkPlugin,
|
|
60
60
|
];
|
|
61
61
|
sharedState: CardPluginState | null;
|
|
62
62
|
actions: CardPluginActions;
|
|
63
63
|
}
|
|
64
64
|
>;
|
|
65
65
|
|
|
66
|
+
// @public (undocumented)
|
|
67
|
+
export const cardPlugin: CardPlugin;
|
|
68
|
+
|
|
66
69
|
// @public (undocumented)
|
|
67
70
|
type CardPluginEvent = DatasourceEvent | LinkEvent;
|
|
68
71
|
|