@atlaskit/editor-plugin-card 1.4.4 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 1.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#88000](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88000) [`61b44e565851`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/61b44e565851) - [ux] FF clean up platform.editor.show-embed-card-frame-renderer
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 1.5.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#87262](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87262) [`a30a91a62f03`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a30a91a62f03) - Add slash command for confluence search datasource creation
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 1.4.4
4
24
 
5
25
  ### Patch Changes
@@ -25,6 +25,7 @@ var _ModalWithState = _interopRequireDefault(require("./ui/DatasourceModal/Modal
25
25
  var _EditorLinkingPlatformAnalytics = require("./ui/EditorLinkingPlatformAnalytics");
26
26
  var _EditorSmartCardEvents = require("./ui/EditorSmartCardEvents");
27
27
  var _LayoutButton = _interopRequireDefault(require("./ui/LayoutButton"));
28
+ var _utils2 = require("./utils");
28
29
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
29
30
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
30
31
  /**
@@ -165,6 +166,24 @@ var cardPlugin = exports.cardPlugin = function cardPlugin(_ref) {
165
166
  }
166
167
  });
167
168
  }
169
+ if ((0, _utils2.isDatasourceConfigEditable)(_linkDatasource.CONFLUENCE_SEARCH_DATASOURCE_ID)) {
170
+ quickInsertArray.push({
171
+ id: 'datasource',
172
+ title: formatMessage(_messages.cardMessages.datasourceConfluenceSearch),
173
+ description: formatMessage(_messages.cardMessages.datasourceConfluenceSearchDescription),
174
+ categories: ['external-content', 'development'],
175
+ keywords: ['confluence'],
176
+ featured: true,
177
+ icon: function icon() {
178
+ return /*#__PURE__*/_react.default.createElement(_quickInsert.IconDatasourceConfluenceSearch, null);
179
+ },
180
+ action: function action(insert) {
181
+ var tr = insert(undefined);
182
+ (0, _actions.showDatasourceModal)('confluence-search')(tr);
183
+ return tr;
184
+ }
185
+ });
186
+ }
168
187
  return quickInsertArray;
169
188
  }
170
189
  }
@@ -162,6 +162,8 @@ var DatasourceModal = exports.DatasourceModal = function DatasourceModal(_ref) {
162
162
  onInsert: onInsert
163
163
  }));
164
164
  }
165
+
166
+ // TODO: further refactor in https://product-fabric.atlassian.net/browse/EDM-9637
165
167
  if (modalType === 'confluence-search') {
166
168
  var _existingNode7, _tableView2$propertie, _existingNode8;
167
169
  if (!ready) {
@@ -208,7 +210,6 @@ var DatasourceModal = exports.DatasourceModal = function DatasourceModal(_ref) {
208
210
  "data-testid": "confluence-search-config-modal"
209
211
  }, /*#__PURE__*/_react.default.createElement(_linkDatasource.ConfluenceSearchConfigModal, {
210
212
  datasourceId: _datasourceId2,
211
- viewMode: 'issue',
212
213
  visibleColumnKeys: _visibleColumnKeys2,
213
214
  parameters: _parameters2,
214
215
  url: (_existingNode8 = existingNode) === null || _existingNode8 === void 0 ? void 0 : _existingNode8.attrs.url,
@@ -15,11 +15,9 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
16
  var _react = _interopRequireDefault(require("react"));
17
17
  var _react2 = require("@emotion/react");
18
- var _styles = require("@atlaskit/editor-common/styles");
19
18
  var _ui = require("@atlaskit/editor-common/ui");
20
19
  var _utils = require("@atlaskit/editor-prosemirror/utils");
21
20
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
22
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
21
  var _smartCard = require("@atlaskit/smart-card");
24
22
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
23
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -333,12 +331,9 @@ var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Compone
333
331
  containerWidth = _this$props6.containerWidth,
334
332
  fullWidthMode = _this$props6.fullWidthMode,
335
333
  children = _this$props6.children;
336
- var resizerProps = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.show-embed-card-frame-renderer') ? {
334
+ var resizerProps = {
337
335
  width: this.calcPxWidth(),
338
336
  innerPadding: _editorSharedStyles.akEditorMediaResizeHandlerPadding
339
- } : {
340
- width: this.calcPxWidth() - _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide,
341
- innerPadding: _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide
342
337
  };
343
338
  var enable = {};
344
339
  _ui.handleSides.forEach(function (side) {
@@ -366,7 +361,6 @@ var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Compone
366
361
 
367
362
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
368
363
  return (0, _react2.jsx)("div", {
369
- css: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.show-embed-card-frame-renderer') ? {} : _styles.embedSpacingStyles,
370
364
  "data-testid": "resizable-embed-card-spacing"
371
365
  }, (0, _react2.jsx)("div", {
372
366
  css: (0, _ui.wrapperStyle)({
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { blockCard, embedCard, inlineCard } from '@atlaskit/adf-schema';
3
3
  import { cardMessages as messages } from '@atlaskit/editor-common/messages';
4
- import { IconDatasourceAssetsObjects, IconDatasourceJiraIssue } from '@atlaskit/editor-common/quick-insert';
4
+ import { IconDatasourceAssetsObjects, IconDatasourceConfluenceSearch, IconDatasourceJiraIssue } from '@atlaskit/editor-common/quick-insert';
5
5
  import { canRenderDatasource } from '@atlaskit/editor-common/utils';
6
- import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource';
6
+ import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID, CONFLUENCE_SEARCH_DATASOURCE_ID } from '@atlaskit/link-datasource';
7
7
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
8
8
  import { createEventsQueue } from './analytics/create-events-queue';
9
9
  import { hideLinkToolbar, showDatasourceModal } from './pm-plugins/actions';
@@ -17,6 +17,7 @@ import DatasourceModalWithState from './ui/DatasourceModal/ModalWithState';
17
17
  import { EditorLinkingPlatformAnalytics } from './ui/EditorLinkingPlatformAnalytics';
18
18
  import { EditorSmartCardEvents } from './ui/EditorSmartCardEvents';
19
19
  import LayoutButton from './ui/LayoutButton';
20
+ import { isDatasourceConfigEditable } from './utils';
20
21
  /**
21
22
  * Card plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
22
23
  * from `@atlaskit/editor-core`.
@@ -154,6 +155,22 @@ export const cardPlugin = ({
154
155
  }
155
156
  });
156
157
  }
158
+ if (isDatasourceConfigEditable(CONFLUENCE_SEARCH_DATASOURCE_ID)) {
159
+ quickInsertArray.push({
160
+ id: 'datasource',
161
+ title: formatMessage(messages.datasourceConfluenceSearch),
162
+ description: formatMessage(messages.datasourceConfluenceSearchDescription),
163
+ categories: ['external-content', 'development'],
164
+ keywords: ['confluence'],
165
+ featured: true,
166
+ icon: () => /*#__PURE__*/React.createElement(IconDatasourceConfluenceSearch, null),
167
+ action(insert) {
168
+ const tr = insert(undefined);
169
+ showDatasourceModal('confluence-search')(tr);
170
+ return tr;
171
+ }
172
+ });
173
+ }
157
174
  return quickInsertArray;
158
175
  }
159
176
  }
@@ -133,6 +133,8 @@ export const DatasourceModal = ({
133
133
  onInsert: onInsert
134
134
  }));
135
135
  }
136
+
137
+ // TODO: further refactor in https://product-fabric.atlassian.net/browse/EDM-9637
136
138
  if (modalType === 'confluence-search') {
137
139
  var _existingNode7, _existingNode7$attrs, _tableView$properties3, _existingNode8;
138
140
  if (!ready) {
@@ -168,7 +170,6 @@ export const DatasourceModal = ({
168
170
  "data-testid": "confluence-search-config-modal"
169
171
  }, /*#__PURE__*/React.createElement(ConfluenceSearchConfigModal, {
170
172
  datasourceId: datasourceId,
171
- viewMode: 'issue',
172
173
  visibleColumnKeys: visibleColumnKeys,
173
174
  parameters: parameters,
174
175
  url: (_existingNode8 = existingNode) === null || _existingNode8 === void 0 ? void 0 : _existingNode8.attrs.url,
@@ -3,11 +3,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  /** @jsx jsx */
4
4
  import React from 'react';
5
5
  import { jsx } from '@emotion/react';
6
- import { embedSpacingStyles } from '@atlaskit/editor-common/styles';
7
6
  import { calcColumnsFromPx, calcMediaPxWidth, calcPctFromPx, calcPxFromColumns, handleSides, imageAlignmentMap, Resizer, snapTo, wrappedLayouts, wrapperStyle } from '@atlaskit/editor-common/ui';
8
7
  import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
9
- import { akEditorBreakoutPadding, akEditorMediaResizeHandlerPadding, akEditorMediaResizeHandlerPaddingWide, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
10
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
8
+ import { akEditorBreakoutPadding, akEditorMediaResizeHandlerPadding, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
11
9
  import { embedHeaderHeight } from '@atlaskit/smart-card';
12
10
  // eslint-disable-next-line @repo/internal/react/no-class-components
13
11
  export default class ResizableEmbedCard extends React.Component {
@@ -307,12 +305,9 @@ export default class ResizableEmbedCard extends React.Component {
307
305
  fullWidthMode,
308
306
  children
309
307
  } = this.props;
310
- const resizerProps = getBooleanFF('platform.editor.show-embed-card-frame-renderer') ? {
308
+ const resizerProps = {
311
309
  width: this.calcPxWidth(),
312
310
  innerPadding: akEditorMediaResizeHandlerPadding
313
- } : {
314
- width: this.calcPxWidth() - akEditorMediaResizeHandlerPaddingWide,
315
- innerPadding: akEditorMediaResizeHandlerPaddingWide
316
311
  };
317
312
  const enable = {};
318
313
  handleSides.forEach(side => {
@@ -340,7 +335,6 @@ export default class ResizableEmbedCard extends React.Component {
340
335
 
341
336
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
342
337
  return jsx("div", {
343
- css: getBooleanFF('platform.editor.show-embed-card-frame-renderer') ? {} : embedSpacingStyles,
344
338
  "data-testid": "resizable-embed-card-spacing"
345
339
  }, jsx("div", {
346
340
  css: wrapperStyle({
@@ -4,9 +4,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import React from 'react';
5
5
  import { blockCard, embedCard, inlineCard } from '@atlaskit/adf-schema';
6
6
  import { cardMessages as messages } from '@atlaskit/editor-common/messages';
7
- import { IconDatasourceAssetsObjects, IconDatasourceJiraIssue } from '@atlaskit/editor-common/quick-insert';
7
+ import { IconDatasourceAssetsObjects, IconDatasourceConfluenceSearch, IconDatasourceJiraIssue } from '@atlaskit/editor-common/quick-insert';
8
8
  import { canRenderDatasource } from '@atlaskit/editor-common/utils';
9
- import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource';
9
+ import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID, CONFLUENCE_SEARCH_DATASOURCE_ID } from '@atlaskit/link-datasource';
10
10
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
11
11
  import { createEventsQueue } from './analytics/create-events-queue';
12
12
  import { hideLinkToolbar, showDatasourceModal } from './pm-plugins/actions';
@@ -20,6 +20,7 @@ import DatasourceModalWithState from './ui/DatasourceModal/ModalWithState';
20
20
  import { EditorLinkingPlatformAnalytics } from './ui/EditorLinkingPlatformAnalytics';
21
21
  import { EditorSmartCardEvents } from './ui/EditorSmartCardEvents';
22
22
  import LayoutButton from './ui/LayoutButton';
23
+ import { isDatasourceConfigEditable } from './utils';
23
24
  /**
24
25
  * Card plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
25
26
  * from `@atlaskit/editor-core`.
@@ -158,6 +159,24 @@ export var cardPlugin = function cardPlugin(_ref) {
158
159
  }
159
160
  });
160
161
  }
162
+ if (isDatasourceConfigEditable(CONFLUENCE_SEARCH_DATASOURCE_ID)) {
163
+ quickInsertArray.push({
164
+ id: 'datasource',
165
+ title: formatMessage(messages.datasourceConfluenceSearch),
166
+ description: formatMessage(messages.datasourceConfluenceSearchDescription),
167
+ categories: ['external-content', 'development'],
168
+ keywords: ['confluence'],
169
+ featured: true,
170
+ icon: function icon() {
171
+ return /*#__PURE__*/React.createElement(IconDatasourceConfluenceSearch, null);
172
+ },
173
+ action: function action(insert) {
174
+ var tr = insert(undefined);
175
+ showDatasourceModal('confluence-search')(tr);
176
+ return tr;
177
+ }
178
+ });
179
+ }
161
180
  return quickInsertArray;
162
181
  }
163
182
  }
@@ -152,6 +152,8 @@ export var DatasourceModal = function DatasourceModal(_ref) {
152
152
  onInsert: onInsert
153
153
  }));
154
154
  }
155
+
156
+ // TODO: further refactor in https://product-fabric.atlassian.net/browse/EDM-9637
155
157
  if (modalType === 'confluence-search') {
156
158
  var _existingNode7, _tableView2$propertie, _existingNode8;
157
159
  if (!ready) {
@@ -198,7 +200,6 @@ export var DatasourceModal = function DatasourceModal(_ref) {
198
200
  "data-testid": "confluence-search-config-modal"
199
201
  }, /*#__PURE__*/React.createElement(ConfluenceSearchConfigModal, {
200
202
  datasourceId: _datasourceId2,
201
- viewMode: 'issue',
202
203
  visibleColumnKeys: _visibleColumnKeys2,
203
204
  parameters: _parameters2,
204
205
  url: (_existingNode8 = existingNode) === null || _existingNode8 === void 0 ? void 0 : _existingNode8.attrs.url,
@@ -13,11 +13,9 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
13
13
  /** @jsx jsx */
14
14
  import React from 'react';
15
15
  import { jsx } from '@emotion/react';
16
- import { embedSpacingStyles } from '@atlaskit/editor-common/styles';
17
16
  import { calcColumnsFromPx, calcMediaPxWidth, calcPctFromPx, calcPxFromColumns, handleSides, imageAlignmentMap, Resizer, snapTo, wrappedLayouts, wrapperStyle } from '@atlaskit/editor-common/ui';
18
17
  import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
19
- import { akEditorBreakoutPadding, akEditorMediaResizeHandlerPadding, akEditorMediaResizeHandlerPaddingWide, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
20
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
18
+ import { akEditorBreakoutPadding, akEditorMediaResizeHandlerPadding, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
21
19
  import { embedHeaderHeight } from '@atlaskit/smart-card';
22
20
  // eslint-disable-next-line @repo/internal/react/no-class-components
23
21
  var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
@@ -327,12 +325,9 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
327
325
  containerWidth = _this$props6.containerWidth,
328
326
  fullWidthMode = _this$props6.fullWidthMode,
329
327
  children = _this$props6.children;
330
- var resizerProps = getBooleanFF('platform.editor.show-embed-card-frame-renderer') ? {
328
+ var resizerProps = {
331
329
  width: this.calcPxWidth(),
332
330
  innerPadding: akEditorMediaResizeHandlerPadding
333
- } : {
334
- width: this.calcPxWidth() - akEditorMediaResizeHandlerPaddingWide,
335
- innerPadding: akEditorMediaResizeHandlerPaddingWide
336
331
  };
337
332
  var enable = {};
338
333
  handleSides.forEach(function (side) {
@@ -360,7 +355,6 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
360
355
 
361
356
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
362
357
  return jsx("div", {
363
- css: getBooleanFF('platform.editor.show-embed-card-frame-renderer') ? {} : embedSpacingStyles,
364
358
  "data-testid": "resizable-embed-card-spacing"
365
359
  }, jsx("div", {
366
360
  css: wrapperStyle({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "1.4.4",
3
+ "version": "1.6.0",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,7 +35,7 @@
35
35
  "@atlaskit/adf-schema": "^35.8.0",
36
36
  "@atlaskit/analytics-next": "^9.2.0",
37
37
  "@atlaskit/custom-steps": "^0.0.17",
38
- "@atlaskit/editor-common": "^78.24.0",
38
+ "@atlaskit/editor-common": "^78.26.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^1.0.0",
40
40
  "@atlaskit/editor-plugin-decorations": "^1.0.0",
41
41
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/linking-types": "^8.8.0",
55
55
  "@atlaskit/platform-feature-flags": "^0.2.0",
56
56
  "@atlaskit/primitives": "^5.5.0",
57
- "@atlaskit/smart-card": "^26.52.0",
57
+ "@atlaskit/smart-card": "^26.53.0",
58
58
  "@atlaskit/theme": "^12.7.0",
59
59
  "@atlaskit/tokens": "^1.43.0",
60
60
  "@babel/runtime": "^7.0.0",
@@ -107,9 +107,6 @@
107
107
  "platform.linking-platform.smart-card.inline-switcher": {
108
108
  "type": "boolean"
109
109
  },
110
- "platform.editor.show-embed-card-frame-renderer": {
111
- "type": "boolean"
112
- },
113
110
  "platform.linking-platform.datasource-word_wrap": {
114
111
  "type": "boolean"
115
112
  },