@atlaskit/editor-plugin-card 0.16.4 → 0.16.6

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/nodeviews/blockCard.js +4 -1
  3. package/dist/cjs/nodeviews/embedCard.js +6 -3
  4. package/dist/cjs/nodeviews/inlineCard.js +5 -0
  5. package/dist/cjs/nodeviews/inlineCardWithAwareness.js +3 -1
  6. package/dist/cjs/pm-plugins/main.js +6 -1
  7. package/dist/es2019/nodeviews/blockCard.js +4 -1
  8. package/dist/es2019/nodeviews/embedCard.js +6 -3
  9. package/dist/es2019/nodeviews/inlineCard.js +5 -0
  10. package/dist/es2019/nodeviews/inlineCardWithAwareness.js +3 -1
  11. package/dist/es2019/pm-plugins/main.js +6 -1
  12. package/dist/esm/nodeviews/blockCard.js +4 -1
  13. package/dist/esm/nodeviews/embedCard.js +6 -3
  14. package/dist/esm/nodeviews/inlineCard.js +5 -0
  15. package/dist/esm/nodeviews/inlineCardWithAwareness.js +3 -1
  16. package/dist/esm/pm-plugins/main.js +6 -1
  17. package/dist/types/datasourceErrorBoundary.d.ts +3 -2
  18. package/dist/types/nodeviews/blockCard.d.ts +1 -1
  19. package/dist/types/nodeviews/embedCard.d.ts +1 -1
  20. package/dist/types/nodeviews/genericCard.d.ts +7 -1
  21. package/dist/types/nodeviews/inlineCard.d.ts +1 -1
  22. package/dist/types/nodeviews/inlineCardWithAwareness.d.ts +1 -1
  23. package/dist/types-ts4.5/datasourceErrorBoundary.d.ts +3 -2
  24. package/dist/types-ts4.5/nodeviews/blockCard.d.ts +1 -1
  25. package/dist/types-ts4.5/nodeviews/embedCard.d.ts +1 -1
  26. package/dist/types-ts4.5/nodeviews/genericCard.d.ts +7 -1
  27. package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +1 -1
  28. package/dist/types-ts4.5/nodeviews/inlineCardWithAwareness.d.ts +1 -1
  29. package/package.json +13 -26
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 0.16.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#68535](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68535) [`9d9c89e4ff0c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9d9c89e4ff0c) - Implement smart-card actionOptions prop within editor and expose prop to editor and renderer
8
+ - Updated dependencies
9
+
10
+ ## 0.16.5
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 0.16.4
4
17
 
5
18
  ### Patch Changes
@@ -95,6 +95,7 @@ var BlockCardComponent = exports.BlockCardComponent = /*#__PURE__*/function (_Re
95
95
  node = _this$props2.node,
96
96
  cardContext = _this$props2.cardContext,
97
97
  platform = _this$props2.platform,
98
+ actionOptions = _this$props2.actionOptions,
98
99
  showServerActions = _this$props2.showServerActions;
99
100
  var _node$attrs = node.attrs,
100
101
  url = _node$attrs.url,
@@ -108,8 +109,8 @@ var BlockCardComponent = exports.BlockCardComponent = /*#__PURE__*/function (_Re
108
109
  onClick: this.onClick,
109
110
  onResolve: this.onResolve,
110
111
  onError: this.onError,
111
- showActions: platform === 'web',
112
112
  platform: platform,
113
+ actionOptions: actionOptions,
113
114
  showServerActions: showServerActions
114
115
  }), this.gapCursorSpan());
115
116
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
@@ -168,12 +169,14 @@ var BlockCard = exports.BlockCard = /*#__PURE__*/function (_ReactNodeView) {
168
169
  value: function render() {
169
170
  var _this$reactComponentP = this.reactComponentProps,
170
171
  platform = _this$reactComponentP.platform,
172
+ actionOptions = _this$reactComponentP.actionOptions,
171
173
  showServerActions = _this$reactComponentP.showServerActions;
172
174
  return /*#__PURE__*/_react.default.createElement(WrappedBlockCard, {
173
175
  node: this.node,
174
176
  view: this.view,
175
177
  getPos: this.getPos,
176
178
  platform: platform,
179
+ actionOptions: actionOptions,
177
180
  showServerActions: showServerActions
178
181
  });
179
182
  }
@@ -269,7 +269,9 @@ var EmbedCardComponent = exports.EmbedCardComponent = /*#__PURE__*/function (_Re
269
269
  view = _this$props.view,
270
270
  dispatchAnalyticsEvent = _this$props.dispatchAnalyticsEvent,
271
271
  getPos = _this$props.getPos,
272
- pluginInjectionApi = _this$props.pluginInjectionApi;
272
+ pluginInjectionApi = _this$props.pluginInjectionApi,
273
+ actionOptions = _this$props.actionOptions,
274
+ showServerActions = _this$props.showServerActions;
273
275
  var _node$attrs = node.attrs,
274
276
  url = _node$attrs.url,
275
277
  pctWidth = _node$attrs.width,
@@ -303,12 +305,13 @@ var EmbedCardComponent = exports.EmbedCardComponent = /*#__PURE__*/function (_Re
303
305
  onClick: this.onClick,
304
306
  onResolve: this.onResolve,
305
307
  onError: this.onError,
306
- showActions: platform === 'web',
307
308
  frameStyle: "show",
308
309
  inheritDimensions: true,
309
310
  platform: platform,
310
311
  container: this.scrollContainer,
311
- embedIframeRef: this.embedIframeRef
312
+ embedIframeRef: this.embedIframeRef,
313
+ actionOptions: actionOptions,
314
+ showServerActions: showServerActions
312
315
  });
313
316
  var cardInner = /*#__PURE__*/_react.default.createElement(_smartCard.EmbedResizeMessageListener, {
314
317
  embedIframeRef: this.embedIframeRef,
@@ -90,6 +90,7 @@ var InlineCardComponent = exports.InlineCardComponent = /*#__PURE__*/function (_
90
90
  var _this$props2 = this.props,
91
91
  node = _this$props2.node,
92
92
  cardContext = _this$props2.cardContext,
93
+ actionOptions = _this$props2.actionOptions,
93
94
  showServerActions = _this$props2.showServerActions,
94
95
  useAlternativePreloader = _this$props2.useAlternativePreloader;
95
96
  var _node$attrs = node.attrs,
@@ -107,6 +108,7 @@ var InlineCardComponent = exports.InlineCardComponent = /*#__PURE__*/function (_
107
108
  onResolve: this.onResolve,
108
109
  onError: this.onError,
109
110
  inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
111
+ actionOptions: actionOptions,
110
112
  showServerActions: showServerActions
111
113
  }));
112
114
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
@@ -128,6 +130,7 @@ function InlineCardNodeView(props) {
128
130
  node = props.node,
129
131
  view = props.view,
130
132
  getPos = props.getPos,
133
+ actionOptions = props.actionOptions,
131
134
  showServerActions = props.showServerActions,
132
135
  allowEmbeds = props.allowEmbeds,
133
136
  allowBlockCards = props.allowBlockCards,
@@ -138,6 +141,7 @@ function InlineCardNodeView(props) {
138
141
  node: node,
139
142
  view: view,
140
143
  getPos: getPos,
144
+ actionOptions: actionOptions,
141
145
  showServerActions: showServerActions,
142
146
  useAlternativePreloader: useAlternativePreloader
143
147
  });
@@ -146,6 +150,7 @@ function InlineCardNodeView(props) {
146
150
  node: node,
147
151
  view: view,
148
152
  getPos: getPos,
153
+ actionOptions: actionOptions,
149
154
  showServerActions: showServerActions,
150
155
  useAlternativePreloader: useAlternativePreloader,
151
156
  pluginInjectionApi: pluginInjectionApi
@@ -18,6 +18,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
18
18
  var InlineCard = function InlineCard(_ref) {
19
19
  var node = _ref.node,
20
20
  cardContext = _ref.cardContext,
21
+ actionOptions = _ref.actionOptions,
21
22
  showServerActions = _ref.showServerActions,
22
23
  useAlternativePreloader = _ref.useAlternativePreloader,
23
24
  view = _ref.view,
@@ -109,10 +110,11 @@ var InlineCard = function InlineCard(_ref) {
109
110
  onResolve: onResolve,
110
111
  onError: onError,
111
112
  inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
113
+ actionOptions: actionOptions,
112
114
  showServerActions: showServerActions,
113
115
  isHovered: isHovered
114
116
  });
115
- }, [data, isHovered, onError, onResolve, scrollContainer, showServerActions, url, useAlternativePreloader]);
117
+ }, [data, isHovered, onError, onResolve, scrollContainer, url, useAlternativePreloader, actionOptions, showServerActions]);
116
118
  var card = (0, _react.useMemo)(function () {
117
119
  return isOverlayEnabled || isPulseEnabled ? /*#__PURE__*/_react.default.createElement(_AwarenessWrapper.AwarenessWrapper, {
118
120
  isOverlayEnabled: isOverlayEnabled,
@@ -54,6 +54,7 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
54
54
  allowResizing = options.allowResizing,
55
55
  useAlternativePreloader = options.useAlternativePreloader,
56
56
  fullWidthMode = options.fullWidthMode,
57
+ actionOptions = options.actionOptions,
57
58
  showServerActions = options.showServerActions,
58
59
  cardPluginEvents = options.cardPluginEvents,
59
60
  showUpgradeDiscoverability = options.showUpgradeDiscoverability,
@@ -66,6 +67,7 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
66
67
  Component: _inlineCard.InlineCardNodeView,
67
68
  extraComponentProps: {
68
69
  useAlternativePreloader: useAlternativePreloader,
70
+ actionOptions: actionOptions,
69
71
  showServerActions: showServerActions,
70
72
  enableInlineUpgradeFeatures: enableInlineUpgradeFeatures,
71
73
  allowEmbeds: allowEmbeds,
@@ -220,6 +222,7 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
220
222
  eventDispatcher = pmPluginFactoryParams.eventDispatcher;
221
223
  var reactComponentProps = {
222
224
  platform: platform,
225
+ actionOptions: actionOptions,
223
226
  showServerActions: showServerActions
224
227
  };
225
228
  var hasIntlContext = true;
@@ -256,7 +259,9 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
256
259
  platform: platform,
257
260
  fullWidthMode: fullWidthMode,
258
261
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
259
- pluginInjectionApi: pluginInjectionApi
262
+ pluginInjectionApi: pluginInjectionApi,
263
+ actionOptions: actionOptions,
264
+ showServerActions: showServerActions
260
265
  };
261
266
  var hasIntlContext = true;
262
267
  return new _embedCard.EmbedCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, undefined, true, undefined, hasIntlContext).init();
@@ -74,6 +74,7 @@ export class BlockCardComponent extends React.PureComponent {
74
74
  node,
75
75
  cardContext,
76
76
  platform,
77
+ actionOptions,
77
78
  showServerActions
78
79
  } = this.props;
79
80
  const {
@@ -89,8 +90,8 @@ export class BlockCardComponent extends React.PureComponent {
89
90
  onClick: this.onClick,
90
91
  onResolve: this.onResolve,
91
92
  onError: this.onError,
92
- showActions: platform === 'web',
93
93
  platform: platform,
94
+ actionOptions: actionOptions,
94
95
  showServerActions: showServerActions
95
96
  }), this.gapCursorSpan());
96
97
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
@@ -133,6 +134,7 @@ export class BlockCard extends ReactNodeView {
133
134
  render() {
134
135
  const {
135
136
  platform,
137
+ actionOptions,
136
138
  showServerActions
137
139
  } = this.reactComponentProps;
138
140
  return /*#__PURE__*/React.createElement(WrappedBlockCard, {
@@ -140,6 +142,7 @@ export class BlockCard extends ReactNodeView {
140
142
  view: this.view,
141
143
  getPos: this.getPos,
142
144
  platform: platform,
145
+ actionOptions: actionOptions,
143
146
  showServerActions: showServerActions
144
147
  });
145
148
  }
@@ -255,7 +255,9 @@ export class EmbedCardComponent extends React.PureComponent {
255
255
  view,
256
256
  dispatchAnalyticsEvent,
257
257
  getPos,
258
- pluginInjectionApi
258
+ pluginInjectionApi,
259
+ actionOptions,
260
+ showServerActions
259
261
  } = this.props;
260
262
  let {
261
263
  url,
@@ -292,12 +294,13 @@ export class EmbedCardComponent extends React.PureComponent {
292
294
  onClick: this.onClick,
293
295
  onResolve: this.onResolve,
294
296
  onError: this.onError,
295
- showActions: platform === 'web',
296
297
  frameStyle: "show",
297
298
  inheritDimensions: true,
298
299
  platform: platform,
299
300
  container: this.scrollContainer,
300
- embedIframeRef: this.embedIframeRef
301
+ embedIframeRef: this.embedIframeRef,
302
+ actionOptions: actionOptions,
303
+ showServerActions: showServerActions
301
304
  });
302
305
  const cardInner = /*#__PURE__*/React.createElement(EmbedResizeMessageListener, {
303
306
  embedIframeRef: this.embedIframeRef,
@@ -70,6 +70,7 @@ export class InlineCardComponent extends React.PureComponent {
70
70
  const {
71
71
  node,
72
72
  cardContext,
73
+ actionOptions,
73
74
  showServerActions,
74
75
  useAlternativePreloader
75
76
  } = this.props;
@@ -89,6 +90,7 @@ export class InlineCardComponent extends React.PureComponent {
89
90
  onResolve: this.onResolve,
90
91
  onError: this.onError,
91
92
  inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
93
+ actionOptions: actionOptions,
92
94
  showServerActions: showServerActions
93
95
  }));
94
96
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
@@ -109,6 +111,7 @@ export function InlineCardNodeView(props) {
109
111
  node,
110
112
  view,
111
113
  getPos,
114
+ actionOptions,
112
115
  showServerActions,
113
116
  allowEmbeds,
114
117
  allowBlockCards,
@@ -120,6 +123,7 @@ export function InlineCardNodeView(props) {
120
123
  node: node,
121
124
  view: view,
122
125
  getPos: getPos,
126
+ actionOptions: actionOptions,
123
127
  showServerActions: showServerActions,
124
128
  useAlternativePreloader: useAlternativePreloader
125
129
  });
@@ -128,6 +132,7 @@ export function InlineCardNodeView(props) {
128
132
  node: node,
129
133
  view: view,
130
134
  getPos: getPos,
135
+ actionOptions: actionOptions,
131
136
  showServerActions: showServerActions,
132
137
  useAlternativePreloader: useAlternativePreloader,
133
138
  pluginInjectionApi: pluginInjectionApi
@@ -7,6 +7,7 @@ import { AwarenessWrapper } from '../ui/AwarenessWrapper';
7
7
  const InlineCard = ({
8
8
  node,
9
9
  cardContext,
10
+ actionOptions,
10
11
  showServerActions,
11
12
  useAlternativePreloader,
12
13
  view,
@@ -89,9 +90,10 @@ const InlineCard = ({
89
90
  onResolve: onResolve,
90
91
  onError: onError,
91
92
  inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
93
+ actionOptions: actionOptions,
92
94
  showServerActions: showServerActions,
93
95
  isHovered: isHovered
94
- }), [data, isHovered, onError, onResolve, scrollContainer, showServerActions, url, useAlternativePreloader]);
96
+ }), [data, isHovered, onError, onResolve, scrollContainer, url, useAlternativePreloader, actionOptions, showServerActions]);
95
97
  const card = useMemo(() => {
96
98
  return isOverlayEnabled || isPulseEnabled ? /*#__PURE__*/React.createElement(AwarenessWrapper, {
97
99
  isOverlayEnabled: isOverlayEnabled,
@@ -38,6 +38,7 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
38
38
  allowResizing,
39
39
  useAlternativePreloader,
40
40
  fullWidthMode,
41
+ actionOptions,
41
42
  showServerActions,
42
43
  cardPluginEvents,
43
44
  showUpgradeDiscoverability,
@@ -51,6 +52,7 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
51
52
  Component: InlineCardNodeView,
52
53
  extraComponentProps: {
53
54
  useAlternativePreloader,
55
+ actionOptions,
54
56
  showServerActions,
55
57
  enableInlineUpgradeFeatures,
56
58
  allowEmbeds,
@@ -211,6 +213,7 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
211
213
  } = pmPluginFactoryParams;
212
214
  const reactComponentProps = {
213
215
  platform,
216
+ actionOptions,
214
217
  showServerActions
215
218
  };
216
219
  const hasIntlContext = true;
@@ -249,7 +252,9 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
249
252
  platform,
250
253
  fullWidthMode,
251
254
  dispatchAnalyticsEvent,
252
- pluginInjectionApi
255
+ pluginInjectionApi,
256
+ actionOptions,
257
+ showServerActions
253
258
  };
254
259
  const hasIntlContext = true;
255
260
  return new EmbedCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, undefined, true, undefined, hasIntlContext).init();
@@ -89,6 +89,7 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
89
89
  node = _this$props2.node,
90
90
  cardContext = _this$props2.cardContext,
91
91
  platform = _this$props2.platform,
92
+ actionOptions = _this$props2.actionOptions,
92
93
  showServerActions = _this$props2.showServerActions;
93
94
  var _node$attrs = node.attrs,
94
95
  url = _node$attrs.url,
@@ -102,8 +103,8 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
102
103
  onClick: this.onClick,
103
104
  onResolve: this.onResolve,
104
105
  onError: this.onError,
105
- showActions: platform === 'web',
106
106
  platform: platform,
107
+ actionOptions: actionOptions,
107
108
  showServerActions: showServerActions
108
109
  }), this.gapCursorSpan());
109
110
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
@@ -162,12 +163,14 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
162
163
  value: function render() {
163
164
  var _this$reactComponentP = this.reactComponentProps,
164
165
  platform = _this$reactComponentP.platform,
166
+ actionOptions = _this$reactComponentP.actionOptions,
165
167
  showServerActions = _this$reactComponentP.showServerActions;
166
168
  return /*#__PURE__*/React.createElement(WrappedBlockCard, {
167
169
  node: this.node,
168
170
  view: this.view,
169
171
  getPos: this.getPos,
170
172
  platform: platform,
173
+ actionOptions: actionOptions,
171
174
  showServerActions: showServerActions
172
175
  });
173
176
  }
@@ -262,7 +262,9 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
262
262
  view = _this$props.view,
263
263
  dispatchAnalyticsEvent = _this$props.dispatchAnalyticsEvent,
264
264
  getPos = _this$props.getPos,
265
- pluginInjectionApi = _this$props.pluginInjectionApi;
265
+ pluginInjectionApi = _this$props.pluginInjectionApi,
266
+ actionOptions = _this$props.actionOptions,
267
+ showServerActions = _this$props.showServerActions;
266
268
  var _node$attrs = node.attrs,
267
269
  url = _node$attrs.url,
268
270
  pctWidth = _node$attrs.width,
@@ -296,12 +298,13 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
296
298
  onClick: this.onClick,
297
299
  onResolve: this.onResolve,
298
300
  onError: this.onError,
299
- showActions: platform === 'web',
300
301
  frameStyle: "show",
301
302
  inheritDimensions: true,
302
303
  platform: platform,
303
304
  container: this.scrollContainer,
304
- embedIframeRef: this.embedIframeRef
305
+ embedIframeRef: this.embedIframeRef,
306
+ actionOptions: actionOptions,
307
+ showServerActions: showServerActions
305
308
  });
306
309
  var cardInner = /*#__PURE__*/React.createElement(EmbedResizeMessageListener, {
307
310
  embedIframeRef: this.embedIframeRef,
@@ -83,6 +83,7 @@ export var InlineCardComponent = /*#__PURE__*/function (_React$PureComponent) {
83
83
  var _this$props2 = this.props,
84
84
  node = _this$props2.node,
85
85
  cardContext = _this$props2.cardContext,
86
+ actionOptions = _this$props2.actionOptions,
86
87
  showServerActions = _this$props2.showServerActions,
87
88
  useAlternativePreloader = _this$props2.useAlternativePreloader;
88
89
  var _node$attrs = node.attrs,
@@ -100,6 +101,7 @@ export var InlineCardComponent = /*#__PURE__*/function (_React$PureComponent) {
100
101
  onResolve: this.onResolve,
101
102
  onError: this.onError,
102
103
  inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
104
+ actionOptions: actionOptions,
103
105
  showServerActions: showServerActions
104
106
  }));
105
107
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
@@ -121,6 +123,7 @@ export function InlineCardNodeView(props) {
121
123
  node = props.node,
122
124
  view = props.view,
123
125
  getPos = props.getPos,
126
+ actionOptions = props.actionOptions,
124
127
  showServerActions = props.showServerActions,
125
128
  allowEmbeds = props.allowEmbeds,
126
129
  allowBlockCards = props.allowBlockCards,
@@ -131,6 +134,7 @@ export function InlineCardNodeView(props) {
131
134
  node: node,
132
135
  view: view,
133
136
  getPos: getPos,
137
+ actionOptions: actionOptions,
134
138
  showServerActions: showServerActions,
135
139
  useAlternativePreloader: useAlternativePreloader
136
140
  });
@@ -139,6 +143,7 @@ export function InlineCardNodeView(props) {
139
143
  node: node,
140
144
  view: view,
141
145
  getPos: getPos,
146
+ actionOptions: actionOptions,
142
147
  showServerActions: showServerActions,
143
148
  useAlternativePreloader: useAlternativePreloader,
144
149
  pluginInjectionApi: pluginInjectionApi
@@ -8,6 +8,7 @@ import { AwarenessWrapper } from '../ui/AwarenessWrapper';
8
8
  var InlineCard = function InlineCard(_ref) {
9
9
  var node = _ref.node,
10
10
  cardContext = _ref.cardContext,
11
+ actionOptions = _ref.actionOptions,
11
12
  showServerActions = _ref.showServerActions,
12
13
  useAlternativePreloader = _ref.useAlternativePreloader,
13
14
  view = _ref.view,
@@ -99,10 +100,11 @@ var InlineCard = function InlineCard(_ref) {
99
100
  onResolve: onResolve,
100
101
  onError: onError,
101
102
  inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
103
+ actionOptions: actionOptions,
102
104
  showServerActions: showServerActions,
103
105
  isHovered: isHovered
104
106
  });
105
- }, [data, isHovered, onError, onResolve, scrollContainer, showServerActions, url, useAlternativePreloader]);
107
+ }, [data, isHovered, onError, onResolve, scrollContainer, url, useAlternativePreloader, actionOptions, showServerActions]);
106
108
  var card = useMemo(function () {
107
109
  return isOverlayEnabled || isPulseEnabled ? /*#__PURE__*/React.createElement(AwarenessWrapper, {
108
110
  isOverlayEnabled: isOverlayEnabled,
@@ -42,6 +42,7 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
42
42
  allowResizing = options.allowResizing,
43
43
  useAlternativePreloader = options.useAlternativePreloader,
44
44
  fullWidthMode = options.fullWidthMode,
45
+ actionOptions = options.actionOptions,
45
46
  showServerActions = options.showServerActions,
46
47
  cardPluginEvents = options.cardPluginEvents,
47
48
  showUpgradeDiscoverability = options.showUpgradeDiscoverability,
@@ -54,6 +55,7 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
54
55
  Component: InlineCardNodeView,
55
56
  extraComponentProps: {
56
57
  useAlternativePreloader: useAlternativePreloader,
58
+ actionOptions: actionOptions,
57
59
  showServerActions: showServerActions,
58
60
  enableInlineUpgradeFeatures: enableInlineUpgradeFeatures,
59
61
  allowEmbeds: allowEmbeds,
@@ -208,6 +210,7 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
208
210
  eventDispatcher = pmPluginFactoryParams.eventDispatcher;
209
211
  var reactComponentProps = {
210
212
  platform: platform,
213
+ actionOptions: actionOptions,
211
214
  showServerActions: showServerActions
212
215
  };
213
216
  var hasIntlContext = true;
@@ -244,7 +247,9 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
244
247
  platform: platform,
245
248
  fullWidthMode: fullWidthMode,
246
249
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
247
- pluginInjectionApi: pluginInjectionApi
250
+ pluginInjectionApi: pluginInjectionApi,
251
+ actionOptions: actionOptions,
252
+ showServerActions: showServerActions
248
253
  };
249
254
  var hasIntlContext = true;
250
255
  return new EmbedCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, undefined, true, undefined, hasIntlContext).init();
@@ -1,12 +1,13 @@
1
1
  import React from 'react';
2
2
  import type { APIError } from '@atlaskit/smart-card';
3
3
  import type { DatasourceProps } from './nodeviews/datasource';
4
- export declare class DatasourceErrorBoundary extends React.Component<{
4
+ export type DatasourceErrorBoundaryProps = {
5
5
  url?: string;
6
6
  unsupportedComponent?: React.ComponentType;
7
7
  handleError?: () => void;
8
8
  view: DatasourceProps['view'];
9
- }> {
9
+ };
10
+ export declare class DatasourceErrorBoundary extends React.Component<DatasourceErrorBoundaryProps> {
10
11
  state: {
11
12
  isError: boolean;
12
13
  };
@@ -21,7 +21,7 @@ export declare class BlockCardComponent extends React.PureComponent<SmartCardPro
21
21
  }) => void;
22
22
  render(): JSX.Element;
23
23
  }
24
- export type BlockCardNodeViewProps = Pick<SmartCardProps, 'platform' | 'showServerActions'>;
24
+ export type BlockCardNodeViewProps = Pick<SmartCardProps, 'platform' | 'actionOptions' | 'showServerActions'>;
25
25
  export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
26
26
  createDomRef(): HTMLElement;
27
27
  validUpdate(currentNode: Node, newNode: Node): boolean;
@@ -38,7 +38,7 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
38
38
  }) => void;
39
39
  render(): JSX.Element;
40
40
  }
41
- export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'platform' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi'>;
41
+ export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'platform' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi' | 'actionOptions' | 'showServerActions'>;
42
42
  export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
43
43
  viewShouldUpdate(nextNode: PMNode): boolean;
44
44
  createDomRef(): HTMLElement;
@@ -7,7 +7,7 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
7
7
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
8
8
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
9
9
  import type { CardContext } from '@atlaskit/link-provider';
10
- import type { CardPlatform } from '@atlaskit/smart-card';
10
+ import type { CardProps as BaseCardProps, 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;
@@ -28,7 +28,13 @@ export interface CardProps extends CardNodeViewProps {
28
28
  allowResizing?: boolean;
29
29
  fullWidthMode?: boolean;
30
30
  useAlternativePreloader?: boolean;
31
+ /**
32
+ * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-6348 Internal documentation for deprecation (no external access)}
33
+ *
34
+ * Prefer `actionOptions` prop.
35
+ */
31
36
  showServerActions?: boolean;
37
+ actionOptions?: BaseCardProps['actionOptions'];
32
38
  pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
33
39
  isOverlayEnabled?: boolean;
34
40
  isPulseEnabled?: boolean;
@@ -19,7 +19,7 @@ export declare class InlineCardComponent extends React.PureComponent<SmartCardPr
19
19
  }) => void;
20
20
  render(): JSX.Element | null;
21
21
  }
22
- export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi'>;
22
+ export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi'>;
23
23
  type InlineCardWithAwarenessProps = {
24
24
  allowEmbeds?: boolean;
25
25
  allowBlockCards?: boolean;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import type { SmartCardProps } from './genericCard';
3
- export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, showServerActions, useAlternativePreloader, view, getPos, isOverlayEnabled, isPulseEnabled, pluginInjectionApi, isSelected, }: SmartCardProps) => JSX.Element | null>;
3
+ export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, actionOptions, showServerActions, useAlternativePreloader, view, getPos, isOverlayEnabled, isPulseEnabled, pluginInjectionApi, isSelected, }: SmartCardProps) => JSX.Element | null>;
@@ -1,12 +1,13 @@
1
1
  import React from 'react';
2
2
  import type { APIError } from '@atlaskit/smart-card';
3
3
  import type { DatasourceProps } from './nodeviews/datasource';
4
- export declare class DatasourceErrorBoundary extends React.Component<{
4
+ export type DatasourceErrorBoundaryProps = {
5
5
  url?: string;
6
6
  unsupportedComponent?: React.ComponentType;
7
7
  handleError?: () => void;
8
8
  view: DatasourceProps['view'];
9
- }> {
9
+ };
10
+ export declare class DatasourceErrorBoundary extends React.Component<DatasourceErrorBoundaryProps> {
10
11
  state: {
11
12
  isError: boolean;
12
13
  };
@@ -21,7 +21,7 @@ export declare class BlockCardComponent extends React.PureComponent<SmartCardPro
21
21
  }) => void;
22
22
  render(): JSX.Element;
23
23
  }
24
- export type BlockCardNodeViewProps = Pick<SmartCardProps, 'platform' | 'showServerActions'>;
24
+ export type BlockCardNodeViewProps = Pick<SmartCardProps, 'platform' | 'actionOptions' | 'showServerActions'>;
25
25
  export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
26
26
  createDomRef(): HTMLElement;
27
27
  validUpdate(currentNode: Node, newNode: Node): boolean;
@@ -38,7 +38,7 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
38
38
  }) => void;
39
39
  render(): JSX.Element;
40
40
  }
41
- export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'platform' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi'>;
41
+ export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'platform' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi' | 'actionOptions' | 'showServerActions'>;
42
42
  export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
43
43
  viewShouldUpdate(nextNode: PMNode): boolean;
44
44
  createDomRef(): HTMLElement;
@@ -7,7 +7,7 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
7
7
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
8
8
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
9
9
  import type { CardContext } from '@atlaskit/link-provider';
10
- import type { CardPlatform } from '@atlaskit/smart-card';
10
+ import type { CardProps as BaseCardProps, 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;
@@ -28,7 +28,13 @@ export interface CardProps extends CardNodeViewProps {
28
28
  allowResizing?: boolean;
29
29
  fullWidthMode?: boolean;
30
30
  useAlternativePreloader?: boolean;
31
+ /**
32
+ * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-6348 Internal documentation for deprecation (no external access)}
33
+ *
34
+ * Prefer `actionOptions` prop.
35
+ */
31
36
  showServerActions?: boolean;
37
+ actionOptions?: BaseCardProps['actionOptions'];
32
38
  pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
33
39
  isOverlayEnabled?: boolean;
34
40
  isPulseEnabled?: boolean;
@@ -19,7 +19,7 @@ export declare class InlineCardComponent extends React.PureComponent<SmartCardPr
19
19
  }) => void;
20
20
  render(): JSX.Element | null;
21
21
  }
22
- export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi'>;
22
+ export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi'>;
23
23
  type InlineCardWithAwarenessProps = {
24
24
  allowEmbeds?: boolean;
25
25
  allowBlockCards?: boolean;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import type { SmartCardProps } from './genericCard';
3
- export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, showServerActions, useAlternativePreloader, view, getPos, isOverlayEnabled, isPulseEnabled, pluginInjectionApi, isSelected, }: SmartCardProps) => JSX.Element | null>;
3
+ export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, actionOptions, showServerActions, useAlternativePreloader, view, getPos, isOverlayEnabled, isPulseEnabled, pluginInjectionApi, isSelected, }: SmartCardProps) => JSX.Element | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "0.16.4",
3
+ "version": "0.16.6",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,11 +35,11 @@
35
35
  "@atlaskit/adf-schema": "^35.3.0",
36
36
  "@atlaskit/analytics-next": "^9.1.0",
37
37
  "@atlaskit/custom-steps": "^0.0.11",
38
- "@atlaskit/editor-common": "^77.0.0",
38
+ "@atlaskit/editor-common": "^77.1.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^0.4.0",
40
40
  "@atlaskit/editor-plugin-decorations": "^0.2.0",
41
41
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
42
- "@atlaskit/editor-plugin-floating-toolbar": "^0.7.0",
42
+ "@atlaskit/editor-plugin-floating-toolbar": "^0.8.0",
43
43
  "@atlaskit/editor-plugin-grid": "^0.3.0",
44
44
  "@atlaskit/editor-plugin-hyperlink": "^0.8.0",
45
45
  "@atlaskit/editor-plugin-width": "^0.2.0",
@@ -51,12 +51,12 @@
51
51
  "@atlaskit/link-client-extension": "^1.8.0",
52
52
  "@atlaskit/link-datasource": "^1.19.0",
53
53
  "@atlaskit/linking-common": "^5.3.0",
54
- "@atlaskit/linking-types": "^8.5.0",
54
+ "@atlaskit/linking-types": "^8.6.0",
55
55
  "@atlaskit/platform-feature-flags": "^0.2.0",
56
- "@atlaskit/primitives": "^1.18.0",
57
- "@atlaskit/smart-card": "^26.45.0",
56
+ "@atlaskit/primitives": "^1.20.0",
57
+ "@atlaskit/smart-card": "^26.46.0",
58
58
  "@atlaskit/theme": "^12.6.0",
59
- "@atlaskit/tokens": "^1.34.0",
59
+ "@atlaskit/tokens": "^1.35.0",
60
60
  "@babel/runtime": "^7.0.0",
61
61
  "@emotion/react": "^11.7.1",
62
62
  "lodash": "^4.17.21",
@@ -69,23 +69,8 @@
69
69
  "react-intl-next": "npm:react-intl@^5.18.1"
70
70
  },
71
71
  "devDependencies": {
72
- "@atlaskit/activity-provider": "^2.4.0",
73
- "@atlaskit/link-test-helpers": "^6.2.0",
74
- "@atlaskit/media-test-helpers": "^33.0.0",
75
- "@atlaskit/ssr": "*",
76
- "@atlaskit/util-data-test": "^17.8.0",
77
- "@atlaskit/visual-regression": "*",
78
72
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
79
- "@atlassian/feature-flags-test-utils": "*",
80
- "@emotion/jest": "^11.8.0",
81
- "@testing-library/dom": "^8.17.1",
82
- "@testing-library/react": "^12.1.5",
83
- "@testing-library/react-hooks": "^8.0.1",
84
- "@testing-library/user-event": "^14.4.3",
85
- "raf-stub": "^2.0.1",
86
- "react-dom": "^16.8.0",
87
- "typescript": "~4.9.5",
88
- "wait-for-expect": "^1.2.0"
73
+ "typescript": "~4.9.5"
89
74
  },
90
75
  "techstack": {
91
76
  "@atlassian/frontend": {
@@ -121,9 +106,6 @@
121
106
  },
122
107
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
123
108
  "platform-feature-flags": {
124
- "platform.linking-platform.datasource-jira_issues": {
125
- "type": "boolean"
126
- },
127
109
  "platform.linking-platform.datasource.show-jlol-basic-filters": {
128
110
  "type": "boolean",
129
111
  "referenceOnly": "true"
@@ -134,5 +116,10 @@
134
116
  "platform.editor.show-embed-card-frame-renderer": {
135
117
  "type": "boolean"
136
118
  }
119
+ },
120
+ "stricter": {
121
+ "no-unused-dependencies": {
122
+ "checkDevDependencies": true
123
+ }
137
124
  }
138
125
  }