@atlaskit/editor-core 185.12.2 → 185.13.1

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 185.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`202f8c2ee69`](https://bitbucket.org/atlassian/atlassian-frontend/commits/202f8c2ee69) - The changes here adds support for datasource feature flag for rollout.
8
+
9
+ ## 185.13.0
10
+
11
+ ### Patch Changes
12
+
13
+ - [`36f667d92e5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/36f667d92e5) - Add data-testid to ToolbarBlockType
14
+
3
15
  ## 185.12.2
4
16
 
5
17
  ### Patch Changes
@@ -37,7 +37,8 @@ var BlockTypeButton = function BlockTypeButton(props) {
37
37
  "aria-haspopup": true,
38
38
  "aria-expanded": props['aria-expanded'],
39
39
  iconAfter: (0, _react2.jsx)("span", {
40
- css: [_styles.wrapperStyle, props.isSmall && _styles.wrapperSmallStyle]
40
+ css: [_styles.wrapperStyle, props.isSmall && _styles.wrapperSmallStyle],
41
+ "data-testid": "toolbar-block-type-text-styles-icon"
41
42
  }, props.isSmall && (0, _react2.jsx)(_textStyle.default, {
42
43
  label: labelTextStyles
43
44
  }), (0, _react2.jsx)("span", {
@@ -28,6 +28,7 @@ var _datasource = require("../nodeviews/datasource");
28
28
  var _styles = require("@atlaskit/editor-common/styles");
29
29
  var _actions = require("./actions");
30
30
  var _prosemirrorUtils = require("prosemirror-utils");
31
+ var _utils = require("@atlaskit/editor-common/utils");
31
32
  var createPlugin = function createPlugin(options, pluginInjectionApi) {
32
33
  return function (pmPluginFactoryParams) {
33
34
  var lpAnalyticsEventsNext = pmPluginFactoryParams.featureFlags.lpAnalyticsEventsNext;
@@ -39,6 +40,14 @@ var createPlugin = function createPlugin(options, pluginInjectionApi) {
39
40
  fullWidthMode = options.fullWidthMode,
40
41
  createAnalyticsEvent = options.createAnalyticsEvent,
41
42
  showServerActions = options.showServerActions;
43
+ var inlineCardViewProducer = (0, _reactNodeView.getInlineNodeViewProducer)({
44
+ pmPluginFactoryParams: pmPluginFactoryParams,
45
+ Component: _inlineCard.InlineCardNodeView,
46
+ extraComponentProps: {
47
+ useAlternativePreloader: useAlternativePreloader,
48
+ showServerActions: showServerActions
49
+ }
50
+ });
42
51
  return new _safePlugin.SafePlugin({
43
52
  state: {
44
53
  init: function init() {
@@ -151,15 +160,8 @@ var createPlugin = function createPlugin(options, pluginInjectionApi) {
151
160
  },
152
161
  props: {
153
162
  nodeViews: {
154
- inlineCard: (0, _reactNodeView.getInlineNodeViewProducer)({
155
- pmPluginFactoryParams: pmPluginFactoryParams,
156
- Component: _inlineCard.InlineCardNodeView,
157
- extraComponentProps: {
158
- useAlternativePreloader: useAlternativePreloader,
159
- showServerActions: showServerActions
160
- }
161
- }),
162
- blockCard: function blockCard(node, view, getPos) {
163
+ inlineCard: inlineCardViewProducer,
164
+ blockCard: function blockCard(node, view, getPos, decorations) {
163
165
  var _node$attrs3;
164
166
  var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
165
167
  eventDispatcher = pmPluginFactoryParams.eventDispatcher;
@@ -170,15 +172,20 @@ var createPlugin = function createPlugin(options, pluginInjectionApi) {
170
172
  var hasIntlContext = true;
171
173
  var isDatasource = !!(node !== null && node !== void 0 && (_node$attrs3 = node.attrs) !== null && _node$attrs3 !== void 0 && _node$attrs3.datasource);
172
174
  if (isDatasource) {
173
- return new _datasource.Datasource({
174
- node: node,
175
- view: view,
176
- getPos: getPos,
177
- portalProviderAPI: portalProviderAPI,
178
- eventDispatcher: eventDispatcher,
179
- hasIntlContext: hasIntlContext,
180
- pluginInjectionApi: pluginInjectionApi
181
- }).init();
175
+ var _node$attrs4;
176
+ if ((0, _utils.canRenderDatasource)(node === null || node === void 0 ? void 0 : (_node$attrs4 = node.attrs) === null || _node$attrs4 === void 0 ? void 0 : _node$attrs4.datasource)) {
177
+ return new _datasource.Datasource({
178
+ node: node,
179
+ view: view,
180
+ getPos: getPos,
181
+ portalProviderAPI: portalProviderAPI,
182
+ eventDispatcher: eventDispatcher,
183
+ hasIntlContext: hasIntlContext,
184
+ pluginInjectionApi: pluginInjectionApi
185
+ }).init();
186
+ } else {
187
+ return inlineCardViewProducer(node, view, getPos, decorations);
188
+ }
182
189
  }
183
190
  return new _blockCard.BlockCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, undefined, true, undefined, hasIntlContext).init();
184
191
  },
@@ -26,6 +26,7 @@ var _adfSchema = require("@atlaskit/adf-schema");
26
26
  var _LinkToolbarAppearance = require("./ui/LinkToolbarAppearance");
27
27
  var _analytics = require("@atlaskit/editor-common/analytics");
28
28
  var _SmallerEditIcon = require("./ui/SmallerEditIcon");
29
+ var _utils2 = require("@atlaskit/editor-common/utils");
29
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
30
31
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
32
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -173,7 +174,7 @@ var withToolbarMetadata = function withToolbarMetadata(command) {
173
174
  };
174
175
  var generateToolbarItems = function generateToolbarItems(state, featureFlags, intl, providerFactory, cardOptions, platform, linkPicker, pluginInjectionApi) {
175
176
  return function (node) {
176
- var _pluginInjectionApi$d, _pluginInjectionApi$d2, _pluginInjectionApi$d3, _pluginInjectionApi$d4, _pluginInjectionApi$d5, _node$attrs;
177
+ var _pluginInjectionApi$d, _pluginInjectionApi$d2, _pluginInjectionApi$d3, _pluginInjectionApi$d4, _pluginInjectionApi$d5, _node$attrs, _node$attrs2;
177
178
  var _titleUrlPairFromNode2 = (0, _utils.titleUrlPairFromNode)(node),
178
179
  url = _titleUrlPairFromNode2.url;
179
180
  var _ref = (_pluginInjectionApi$d = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.analytics) !== null && _pluginInjectionApi$d !== void 0 ? _pluginInjectionApi$d : {},
@@ -194,6 +195,9 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
194
195
  var _ref2 = (_pluginInjectionApi$d3 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d4 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d4 === void 0 ? void 0 : (_pluginInjectionApi$d5 = _pluginInjectionApi$d4.decorations) === null || _pluginInjectionApi$d5 === void 0 ? void 0 : _pluginInjectionApi$d5.actions) !== null && _pluginInjectionApi$d3 !== void 0 ? _pluginInjectionApi$d3 : {},
195
196
  hoverDecoration = _ref2.hoverDecoration;
196
197
  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);
198
+ var shouldRenderDatasourceToolbar = isDatasource &&
199
+ // not showing toolbar in mobile for now since not sure what our plans are for it
200
+ platform !== 'mobile' && (0, _utils2.canRenderDatasource)(node === null || node === void 0 ? void 0 : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.datasource);
197
201
 
198
202
  /* mobile builds toolbar natively using toolbarItems */
199
203
  if (pluginState !== null && pluginState !== void 0 && pluginState.showLinkingToolbar && platform !== 'mobile') {
@@ -210,8 +214,7 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
210
214
  node: node,
211
215
  editorAnalyticsApi: editorAnalyticsApi
212
216
  })];
213
- // not showing toolbar in mobile for now since not sure what our plans are for it
214
- } else if (isDatasource && platform !== 'mobile') {
217
+ } else if (shouldRenderDatasourceToolbar) {
215
218
  return getDatasourceButtonGroup(state, metadata, intl, editorAnalyticsApi, node, hoverDecoration);
216
219
  } else {
217
220
  var inlineCard = state.schema.nodes.inlineCard;
@@ -325,7 +328,7 @@ var getSettingsButtonGroup = function getSettingsButtonGroup(state, featureFlags
325
328
  }] : [];
326
329
  };
327
330
  var getDatasourceButtonGroup = function getDatasourceButtonGroup(state, metadata, intl, editorAnalyticsApi, node, hoverDecoration) {
328
- var _node$attrs2;
331
+ var _node$attrs3;
329
332
  var toolbarItems = [{
330
333
  id: 'editor.edit.datasource',
331
334
  type: 'button',
@@ -335,7 +338,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(state, metadata
335
338
  title: intl.formatMessage(_messages.linkToolbarMessages.editDatasource),
336
339
  onClick: (0, _EditLinkToolbar.editDatasource)(editorAnalyticsApi)
337
340
  }];
338
- if (node !== null && node !== void 0 && (_node$attrs2 = node.attrs) !== null && _node$attrs2 !== void 0 && _node$attrs2.url) {
341
+ if (node !== null && node !== void 0 && (_node$attrs3 = node.attrs) !== null && _node$attrs3 !== void 0 && _node$attrs3.url) {
339
342
  toolbarItems.push({
340
343
  type: 'separator'
341
344
  }, {
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "185.12.2";
9
+ var version = "185.13.1";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.12.2",
3
+ "version": "185.13.1",
4
4
  "sideEffects": false
5
5
  }
@@ -28,7 +28,8 @@ export const BlockTypeButton = props => {
28
28
  "aria-haspopup": true,
29
29
  "aria-expanded": props['aria-expanded'],
30
30
  iconAfter: jsx("span", {
31
- css: [wrapperStyle, props.isSmall && wrapperSmallStyle]
31
+ css: [wrapperStyle, props.isSmall && wrapperSmallStyle],
32
+ "data-testid": "toolbar-block-type-text-styles-icon"
32
33
  }, props.isSmall && jsx(TextStyleIcon, {
33
34
  label: labelTextStyles
34
35
  }), jsx("span", {
@@ -15,6 +15,7 @@ import { DATASOURCE_INNER_CONTAINER_CLASSNAME } from '@atlaskit/editor-common/st
15
15
  import { setDatasourceTableRef, setCardLayoutAndDatasourceTableRef } from './actions';
16
16
  import { findDomRefAtPos } from 'prosemirror-utils';
17
17
  export { pluginKey } from './plugin-key';
18
+ import { canRenderDatasource } from '@atlaskit/editor-common/utils';
18
19
  export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryParams => {
19
20
  const {
20
21
  lpAnalyticsEventsNext
@@ -29,6 +30,14 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
29
30
  createAnalyticsEvent,
30
31
  showServerActions
31
32
  } = options;
33
+ const inlineCardViewProducer = getInlineNodeViewProducer({
34
+ pmPluginFactoryParams,
35
+ Component: InlineCardNodeView,
36
+ extraComponentProps: {
37
+ useAlternativePreloader,
38
+ showServerActions
39
+ }
40
+ });
32
41
  return new SafePlugin({
33
42
  state: {
34
43
  init() {
@@ -145,15 +154,8 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
145
154
  },
146
155
  props: {
147
156
  nodeViews: {
148
- inlineCard: getInlineNodeViewProducer({
149
- pmPluginFactoryParams,
150
- Component: InlineCardNodeView,
151
- extraComponentProps: {
152
- useAlternativePreloader,
153
- showServerActions
154
- }
155
- }),
156
- blockCard: (node, view, getPos) => {
157
+ inlineCard: inlineCardViewProducer,
158
+ blockCard: (node, view, getPos, decorations) => {
157
159
  var _node$attrs3;
158
160
  const {
159
161
  portalProviderAPI,
@@ -166,15 +168,20 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
166
168
  const hasIntlContext = true;
167
169
  const isDatasource = !!(node !== null && node !== void 0 && (_node$attrs3 = node.attrs) !== null && _node$attrs3 !== void 0 && _node$attrs3.datasource);
168
170
  if (isDatasource) {
169
- return new Datasource({
170
- node,
171
- view,
172
- getPos,
173
- portalProviderAPI,
174
- eventDispatcher,
175
- hasIntlContext,
176
- pluginInjectionApi
177
- }).init();
171
+ var _node$attrs4;
172
+ if (canRenderDatasource(node === null || node === void 0 ? void 0 : (_node$attrs4 = node.attrs) === null || _node$attrs4 === void 0 ? void 0 : _node$attrs4.datasource)) {
173
+ return new Datasource({
174
+ node,
175
+ view,
176
+ getPos,
177
+ portalProviderAPI,
178
+ eventDispatcher,
179
+ hasIntlContext,
180
+ pluginInjectionApi
181
+ }).init();
182
+ } else {
183
+ return inlineCardViewProducer(node, view, getPos, decorations);
184
+ }
178
185
  }
179
186
  return new BlockCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, undefined, true, undefined, hasIntlContext).init();
180
187
  },
@@ -19,6 +19,7 @@ import { cardMessages as messages } from '@atlaskit/editor-common/messages';
19
19
  import { FLOATING_TOOLBAR_LINKPICKER_CLASSNAME } from '@atlaskit/editor-common/styles';
20
20
  import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, buildOpenedSettingsPayload, buildVisitedLinkPayload } from '@atlaskit/editor-common/analytics';
21
21
  import { SmallerEditIcon } from './ui/SmallerEditIcon';
22
+ import { canRenderDatasource } from '@atlaskit/editor-common/utils';
22
23
  export const removeCard = editorAnalyticsApi => commandWithMetadata((state, dispatch) => {
23
24
  if (!(state.selection instanceof NodeSelection)) {
24
25
  return false;
@@ -164,7 +165,7 @@ const withToolbarMetadata = command => commandWithMetadata(command, {
164
165
  inputMethod: INPUT_METHOD.FLOATING_TB
165
166
  });
166
167
  const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOptions, platform, linkPicker, pluginInjectionApi) => node => {
167
- var _pluginInjectionApi$d, _pluginInjectionApi$d2, _pluginInjectionApi$d3, _pluginInjectionApi$d4, _pluginInjectionApi$d5, _node$attrs;
168
+ var _pluginInjectionApi$d, _pluginInjectionApi$d2, _pluginInjectionApi$d3, _pluginInjectionApi$d4, _pluginInjectionApi$d5, _node$attrs, _node$attrs2;
168
169
  const {
169
170
  url
170
171
  } = titleUrlPairFromNode(node);
@@ -189,6 +190,9 @@ const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOp
189
190
  hoverDecoration
190
191
  } = (_pluginInjectionApi$d3 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d4 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d4 === void 0 ? void 0 : (_pluginInjectionApi$d5 = _pluginInjectionApi$d4.decorations) === null || _pluginInjectionApi$d5 === void 0 ? void 0 : _pluginInjectionApi$d5.actions) !== null && _pluginInjectionApi$d3 !== void 0 ? _pluginInjectionApi$d3 : {};
191
192
  const isDatasource = currentAppearance === 'block' && (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.datasource);
193
+ const shouldRenderDatasourceToolbar = isDatasource &&
194
+ // not showing toolbar in mobile for now since not sure what our plans are for it
195
+ platform !== 'mobile' && canRenderDatasource(node === null || node === void 0 ? void 0 : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.datasource);
192
196
 
193
197
  /* mobile builds toolbar natively using toolbarItems */
194
198
  if (pluginState !== null && pluginState !== void 0 && pluginState.showLinkingToolbar && platform !== 'mobile') {
@@ -205,8 +209,7 @@ const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOp
205
209
  node,
206
210
  editorAnalyticsApi
207
211
  })];
208
- // not showing toolbar in mobile for now since not sure what our plans are for it
209
- } else if (isDatasource && platform !== 'mobile') {
212
+ } else if (shouldRenderDatasourceToolbar) {
210
213
  return getDatasourceButtonGroup(state, metadata, intl, editorAnalyticsApi, node, hoverDecoration);
211
214
  } else {
212
215
  const {
@@ -323,7 +326,7 @@ const getSettingsButtonGroup = (state, featureFlags, intl, editorAnalyticsApi) =
323
326
  }] : [];
324
327
  };
325
328
  const getDatasourceButtonGroup = (state, metadata, intl, editorAnalyticsApi, node, hoverDecoration) => {
326
- var _node$attrs2;
329
+ var _node$attrs3;
327
330
  const toolbarItems = [{
328
331
  id: 'editor.edit.datasource',
329
332
  type: 'button',
@@ -333,7 +336,7 @@ const getDatasourceButtonGroup = (state, metadata, intl, editorAnalyticsApi, nod
333
336
  title: intl.formatMessage(linkToolbarMessages.editDatasource),
334
337
  onClick: editDatasource(editorAnalyticsApi)
335
338
  }];
336
- if (node !== null && node !== void 0 && (_node$attrs2 = node.attrs) !== null && _node$attrs2 !== void 0 && _node$attrs2.url) {
339
+ if (node !== null && node !== void 0 && (_node$attrs3 = node.attrs) !== null && _node$attrs3 !== void 0 && _node$attrs3.url) {
337
340
  toolbarItems.push({
338
341
  type: 'separator'
339
342
  }, {
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "185.12.2";
2
+ export const version = "185.13.1";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.12.2",
3
+ "version": "185.13.1",
4
4
  "sideEffects": false
5
5
  }
@@ -28,7 +28,8 @@ export var BlockTypeButton = function BlockTypeButton(props) {
28
28
  "aria-haspopup": true,
29
29
  "aria-expanded": props['aria-expanded'],
30
30
  iconAfter: jsx("span", {
31
- css: [wrapperStyle, props.isSmall && wrapperSmallStyle]
31
+ css: [wrapperStyle, props.isSmall && wrapperSmallStyle],
32
+ "data-testid": "toolbar-block-type-text-styles-icon"
32
33
  }, props.isSmall && jsx(TextStyleIcon, {
33
34
  label: labelTextStyles
34
35
  }), jsx("span", {
@@ -16,6 +16,7 @@ import { DATASOURCE_INNER_CONTAINER_CLASSNAME } from '@atlaskit/editor-common/st
16
16
  import { setDatasourceTableRef, setCardLayoutAndDatasourceTableRef } from './actions';
17
17
  import { findDomRefAtPos } from 'prosemirror-utils';
18
18
  export { pluginKey } from './plugin-key';
19
+ import { canRenderDatasource } from '@atlaskit/editor-common/utils';
19
20
  export var createPlugin = function createPlugin(options, pluginInjectionApi) {
20
21
  return function (pmPluginFactoryParams) {
21
22
  var lpAnalyticsEventsNext = pmPluginFactoryParams.featureFlags.lpAnalyticsEventsNext;
@@ -27,6 +28,14 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
27
28
  fullWidthMode = options.fullWidthMode,
28
29
  createAnalyticsEvent = options.createAnalyticsEvent,
29
30
  showServerActions = options.showServerActions;
31
+ var inlineCardViewProducer = getInlineNodeViewProducer({
32
+ pmPluginFactoryParams: pmPluginFactoryParams,
33
+ Component: InlineCardNodeView,
34
+ extraComponentProps: {
35
+ useAlternativePreloader: useAlternativePreloader,
36
+ showServerActions: showServerActions
37
+ }
38
+ });
30
39
  return new SafePlugin({
31
40
  state: {
32
41
  init: function init() {
@@ -139,15 +148,8 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
139
148
  },
140
149
  props: {
141
150
  nodeViews: {
142
- inlineCard: getInlineNodeViewProducer({
143
- pmPluginFactoryParams: pmPluginFactoryParams,
144
- Component: InlineCardNodeView,
145
- extraComponentProps: {
146
- useAlternativePreloader: useAlternativePreloader,
147
- showServerActions: showServerActions
148
- }
149
- }),
150
- blockCard: function blockCard(node, view, getPos) {
151
+ inlineCard: inlineCardViewProducer,
152
+ blockCard: function blockCard(node, view, getPos, decorations) {
151
153
  var _node$attrs3;
152
154
  var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
153
155
  eventDispatcher = pmPluginFactoryParams.eventDispatcher;
@@ -158,15 +160,20 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
158
160
  var hasIntlContext = true;
159
161
  var isDatasource = !!(node !== null && node !== void 0 && (_node$attrs3 = node.attrs) !== null && _node$attrs3 !== void 0 && _node$attrs3.datasource);
160
162
  if (isDatasource) {
161
- return new Datasource({
162
- node: node,
163
- view: view,
164
- getPos: getPos,
165
- portalProviderAPI: portalProviderAPI,
166
- eventDispatcher: eventDispatcher,
167
- hasIntlContext: hasIntlContext,
168
- pluginInjectionApi: pluginInjectionApi
169
- }).init();
163
+ var _node$attrs4;
164
+ if (canRenderDatasource(node === null || node === void 0 ? void 0 : (_node$attrs4 = node.attrs) === null || _node$attrs4 === void 0 ? void 0 : _node$attrs4.datasource)) {
165
+ return new Datasource({
166
+ node: node,
167
+ view: view,
168
+ getPos: getPos,
169
+ portalProviderAPI: portalProviderAPI,
170
+ eventDispatcher: eventDispatcher,
171
+ hasIntlContext: hasIntlContext,
172
+ pluginInjectionApi: pluginInjectionApi
173
+ }).init();
174
+ } else {
175
+ return inlineCardViewProducer(node, view, getPos, decorations);
176
+ }
170
177
  }
171
178
  return new BlockCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, undefined, true, undefined, hasIntlContext).init();
172
179
  },
@@ -23,6 +23,7 @@ import { cardMessages as messages } from '@atlaskit/editor-common/messages';
23
23
  import { FLOATING_TOOLBAR_LINKPICKER_CLASSNAME } from '@atlaskit/editor-common/styles';
24
24
  import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, buildOpenedSettingsPayload, buildVisitedLinkPayload } from '@atlaskit/editor-common/analytics';
25
25
  import { SmallerEditIcon } from './ui/SmallerEditIcon';
26
+ import { canRenderDatasource } from '@atlaskit/editor-common/utils';
26
27
  export var removeCard = function removeCard(editorAnalyticsApi) {
27
28
  return commandWithMetadata(function (state, dispatch) {
28
29
  if (!(state.selection instanceof NodeSelection)) {
@@ -162,7 +163,7 @@ var withToolbarMetadata = function withToolbarMetadata(command) {
162
163
  };
163
164
  var generateToolbarItems = function generateToolbarItems(state, featureFlags, intl, providerFactory, cardOptions, platform, linkPicker, pluginInjectionApi) {
164
165
  return function (node) {
165
- var _pluginInjectionApi$d, _pluginInjectionApi$d2, _pluginInjectionApi$d3, _pluginInjectionApi$d4, _pluginInjectionApi$d5, _node$attrs;
166
+ var _pluginInjectionApi$d, _pluginInjectionApi$d2, _pluginInjectionApi$d3, _pluginInjectionApi$d4, _pluginInjectionApi$d5, _node$attrs, _node$attrs2;
166
167
  var _titleUrlPairFromNode2 = titleUrlPairFromNode(node),
167
168
  url = _titleUrlPairFromNode2.url;
168
169
  var _ref = (_pluginInjectionApi$d = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.analytics) !== null && _pluginInjectionApi$d !== void 0 ? _pluginInjectionApi$d : {},
@@ -183,6 +184,9 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
183
184
  var _ref2 = (_pluginInjectionApi$d3 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d4 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d4 === void 0 ? void 0 : (_pluginInjectionApi$d5 = _pluginInjectionApi$d4.decorations) === null || _pluginInjectionApi$d5 === void 0 ? void 0 : _pluginInjectionApi$d5.actions) !== null && _pluginInjectionApi$d3 !== void 0 ? _pluginInjectionApi$d3 : {},
184
185
  hoverDecoration = _ref2.hoverDecoration;
185
186
  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);
187
+ var shouldRenderDatasourceToolbar = isDatasource &&
188
+ // not showing toolbar in mobile for now since not sure what our plans are for it
189
+ platform !== 'mobile' && canRenderDatasource(node === null || node === void 0 ? void 0 : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.datasource);
186
190
 
187
191
  /* mobile builds toolbar natively using toolbarItems */
188
192
  if (pluginState !== null && pluginState !== void 0 && pluginState.showLinkingToolbar && platform !== 'mobile') {
@@ -199,8 +203,7 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
199
203
  node: node,
200
204
  editorAnalyticsApi: editorAnalyticsApi
201
205
  })];
202
- // not showing toolbar in mobile for now since not sure what our plans are for it
203
- } else if (isDatasource && platform !== 'mobile') {
206
+ } else if (shouldRenderDatasourceToolbar) {
204
207
  return getDatasourceButtonGroup(state, metadata, intl, editorAnalyticsApi, node, hoverDecoration);
205
208
  } else {
206
209
  var inlineCard = state.schema.nodes.inlineCard;
@@ -314,7 +317,7 @@ var getSettingsButtonGroup = function getSettingsButtonGroup(state, featureFlags
314
317
  }] : [];
315
318
  };
316
319
  var getDatasourceButtonGroup = function getDatasourceButtonGroup(state, metadata, intl, editorAnalyticsApi, node, hoverDecoration) {
317
- var _node$attrs2;
320
+ var _node$attrs3;
318
321
  var toolbarItems = [{
319
322
  id: 'editor.edit.datasource',
320
323
  type: 'button',
@@ -324,7 +327,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(state, metadata
324
327
  title: intl.formatMessage(linkToolbarMessages.editDatasource),
325
328
  onClick: editDatasource(editorAnalyticsApi)
326
329
  }];
327
- if (node !== null && node !== void 0 && (_node$attrs2 = node.attrs) !== null && _node$attrs2 !== void 0 && _node$attrs2.url) {
330
+ if (node !== null && node !== void 0 && (_node$attrs3 = node.attrs) !== null && _node$attrs3 !== void 0 && _node$attrs3.url) {
328
331
  toolbarItems.push({
329
332
  type: 'separator'
330
333
  }, {
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "185.12.2";
2
+ export var version = "185.13.1";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.12.2",
3
+ "version": "185.13.1",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.12.2",
3
+ "version": "185.13.1",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -148,7 +148,7 @@
148
148
  "@af/editor-libra": "*",
149
149
  "@af/integration-testing": "*",
150
150
  "@atlaskit/code": "^14.6.0",
151
- "@atlaskit/collab-provider": "9.6.1",
151
+ "@atlaskit/collab-provider": "9.6.2",
152
152
  "@atlaskit/dropdown-menu": "^11.10.0",
153
153
  "@atlaskit/editor-extension-dropbox": "^0.4.0",
154
154
  "@atlaskit/editor-plugin-table": "^2.0.0",
@@ -253,6 +253,9 @@
253
253
  "platform.design-system-team.border-checkbox_nyoiu": {
254
254
  "type": "boolean",
255
255
  "referenceOnly": "true"
256
+ },
257
+ "platform.linking-platform.datasource-jira_issues": {
258
+ "type": "boolean"
256
259
  }
257
260
  }
258
261
  }