@atlaskit/link-datasource 1.22.1 → 1.22.3

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,21 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 1.22.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#68572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68572) [`15d407fe5143`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/15d407fe5143) - Upgrading @atlaskit/editor-prosemirror dependency
8
+ - [#70460](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70460) [`2f37600156ae`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2f37600156ae) - The internal composition of a component in this package has changed. There is no expected change in behaviour.
9
+ - Updated dependencies
10
+
11
+ ## 1.22.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [#70489](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70489) [`8bf6a93203db`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8bf6a93203db) - Define analytics events to fire when provider Authentication succeeds or fail.
16
+ - [#70400](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70400) [`933b3c1e55d4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/933b3c1e55d4) - [ux] css styling for Avatar group styles is increased in specificity for inserting and rendering from Jira Issues modal to ensure that editor css does not apply to the component
17
+ - Updated dependencies
18
+
3
19
  ## 1.22.1
4
20
 
5
21
  ### Patch Changes
@@ -9,6 +9,7 @@ var _react = require("react");
9
9
  var _react2 = require("@emotion/react");
10
10
  var _reactIntlNext = require("react-intl-next");
11
11
  var _emptyState = _interopRequireDefault(require("@atlaskit/empty-state"));
12
+ var _primitives = require("@atlaskit/primitives");
12
13
  var _colors = require("@atlaskit/theme/colors");
13
14
  var _analytics = require("../../../analytics");
14
15
  var _accessRequiredSvg = require("./access-required-svg");
@@ -25,8 +26,8 @@ var descriptionMessageStyles = (0, _react2.css)({
25
26
  flexDirection: 'column',
26
27
  gap: "var(--ds-space-200, 16px)"
27
28
  });
28
- var iconContainerStyles = (0, _react2.css)({
29
- marginBottom: "var(--ds-space-200, 16px)"
29
+ var iconContainerStyles = (0, _primitives.xcss)({
30
+ marginBottom: 'space.200'
30
31
  });
31
32
  var Description = function Description(_ref) {
32
33
  var message = _ref.message,
@@ -38,8 +39,8 @@ var Description = function Description(_ref) {
38
39
  }, url), (0, _react2.jsx)("span", null, message));
39
40
  };
40
41
  var IconContainer = function IconContainer() {
41
- return (0, _react2.jsx)("div", {
42
- css: iconContainerStyles
42
+ return (0, _react2.jsx)(_primitives.Box, {
43
+ xcss: iconContainerStyles
43
44
  }, (0, _react2.jsx)(_accessRequiredSvg.AccessRequiredSVG, null));
44
45
  };
45
46
  var AccessRequired = exports.AccessRequired = function AccessRequired(_ref2) {
@@ -54,19 +54,28 @@ var ProviderAuthRequired = exports.ProviderAuthRequired = function ProviderAuthR
54
54
  _context.next = 4;
55
55
  return (0, _outboundAuthFlowClient.auth)(authInfo.url);
56
56
  case 4:
57
+ fireEvent('operational.provider.authSuccess', {
58
+ extensionKey: authInfo.key,
59
+ experience: 'datasource'
60
+ });
57
61
  onAuthSuccess === null || onAuthSuccess === void 0 || onAuthSuccess();
58
- _context.next = 11;
62
+ _context.next = 13;
59
63
  break;
60
- case 7:
61
- _context.prev = 7;
64
+ case 8:
65
+ _context.prev = 8;
62
66
  _context.t0 = _context["catch"](1);
63
- onAuthError === null || onAuthError === void 0 || onAuthError();
67
+ fireEvent('operational.provider.authFailure', {
68
+ reason: _context.t0 instanceof _outboundAuthFlowClient.AuthError && _context.t0.type ? _context.t0.type : null,
69
+ extensionKey: authInfo.key,
70
+ experience: 'datasource'
71
+ });
64
72
  captureError('ProviderOnAuthRequest', _context.t0);
65
- case 11:
73
+ onAuthError === null || onAuthError === void 0 || onAuthError();
74
+ case 13:
66
75
  case "end":
67
76
  return _context.stop();
68
77
  }
69
- }, _callee, null, [[1, 7]]);
78
+ }, _callee, null, [[1, 8]]);
70
79
  }));
71
80
  return function onAuthRequest() {
72
81
  return _ref2.apply(this, arguments);
@@ -33,7 +33,7 @@ var avatarWrapperStyles = (0, _primitives.xcss)({
33
33
  var widthObserverWrapperStyles = (0, _primitives.xcss)({
34
34
  position: 'relative'
35
35
  });
36
- var AvatarGroupWrapperStyles = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /*\n The css from editor core package affects the padding of the AvatarGroup\n The & refers to the parent selector (.<generated className>),\n so && becomes .<generated className>.<generated className> which increases its specificity\n */\n && ul {\n padding-left: 0px;\n }\n"])));
36
+ var AvatarGroupWrapperStyles = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ul {\n padding-left: 0px !important;\n }\n"])));
37
37
  var getMaxUserCount = function getMaxUserCount(userCount, availableWidth) {
38
38
  if (availableWidth <= 28) {
39
39
  // If width is less than or equal to 28px, we should only display the user count
@@ -3,6 +3,7 @@ import { useEffect } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { useIntl } from 'react-intl-next';
5
5
  import EmptyState from '@atlaskit/empty-state';
6
+ import { Box, xcss } from '@atlaskit/primitives';
6
7
  import { N400 } from '@atlaskit/theme/colors';
7
8
  import { useDatasourceAnalyticsEvents } from '../../../analytics';
8
9
  import { AccessRequiredSVG } from './access-required-svg';
@@ -17,8 +18,8 @@ const descriptionMessageStyles = css({
17
18
  flexDirection: 'column',
18
19
  gap: "var(--ds-space-200, 16px)"
19
20
  });
20
- const iconContainerStyles = css({
21
- marginBottom: "var(--ds-space-200, 16px)"
21
+ const iconContainerStyles = xcss({
22
+ marginBottom: 'space.200'
22
23
  });
23
24
  const Description = ({
24
25
  message,
@@ -30,8 +31,8 @@ const Description = ({
30
31
  css: urlStyles
31
32
  }, url), jsx("span", null, message));
32
33
  };
33
- const IconContainer = () => jsx("div", {
34
- css: iconContainerStyles
34
+ const IconContainer = () => jsx(Box, {
35
+ xcss: iconContainerStyles
35
36
  }, jsx(AccessRequiredSVG, null));
36
37
  export const AccessRequired = ({
37
38
  url
@@ -4,7 +4,7 @@ import { css, jsx } from '@emotion/react';
4
4
  import { useIntl } from 'react-intl-next';
5
5
  import Button from '@atlaskit/button';
6
6
  import EmptyState from '@atlaskit/empty-state';
7
- import { auth as outboundAuth } from '@atlaskit/outbound-auth-flow-client';
7
+ import { AuthError, auth as outboundAuth } from '@atlaskit/outbound-auth-flow-client';
8
8
  import { useDatasourceAnalyticsEvents } from '../../../analytics';
9
9
  import useErrorLogger from '../../../hooks/useErrorLogger';
10
10
  import { loadingErrorMessages } from './messages';
@@ -36,10 +36,19 @@ export const ProviderAuthRequired = ({
36
36
  const [authInfo] = auth;
37
37
  try {
38
38
  await outboundAuth(authInfo.url);
39
+ fireEvent('operational.provider.authSuccess', {
40
+ extensionKey: authInfo.key,
41
+ experience: 'datasource'
42
+ });
39
43
  onAuthSuccess === null || onAuthSuccess === void 0 ? void 0 : onAuthSuccess();
40
44
  } catch (error) {
41
- onAuthError === null || onAuthError === void 0 ? void 0 : onAuthError();
45
+ fireEvent('operational.provider.authFailure', {
46
+ reason: error instanceof AuthError && error.type ? error.type : null,
47
+ extensionKey: authInfo.key,
48
+ experience: 'datasource'
49
+ });
42
50
  captureError('ProviderOnAuthRequest', error);
51
+ onAuthError === null || onAuthError === void 0 ? void 0 : onAuthError();
43
52
  }
44
53
  };
45
54
  const renderAuthDescription = () => jsx(React.Fragment, null, formatMessage(loadingErrorMessages.authScreenDescriptionText), ' ', jsx("a", {
@@ -21,13 +21,8 @@ const widthObserverWrapperStyles = xcss({
21
21
  position: 'relative'
22
22
  });
23
23
  const AvatarGroupWrapperStyles = styled.div`
24
- /*
25
- The css from editor core package affects the padding of the AvatarGroup
26
- The & refers to the parent selector (.<generated className>),
27
- so && becomes .<generated className>.<generated className> which increases its specificity
28
- */
29
- && ul {
30
- padding-left: 0px;
24
+ ul {
25
+ padding-left: 0px !important;
31
26
  }
32
27
  `;
33
28
  const getMaxUserCount = (userCount, availableWidth) => {
@@ -3,6 +3,7 @@ import { useEffect } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { useIntl } from 'react-intl-next';
5
5
  import EmptyState from '@atlaskit/empty-state';
6
+ import { Box, xcss } from '@atlaskit/primitives';
6
7
  import { N400 } from '@atlaskit/theme/colors';
7
8
  import { useDatasourceAnalyticsEvents } from '../../../analytics';
8
9
  import { AccessRequiredSVG } from './access-required-svg';
@@ -17,8 +18,8 @@ var descriptionMessageStyles = css({
17
18
  flexDirection: 'column',
18
19
  gap: "var(--ds-space-200, 16px)"
19
20
  });
20
- var iconContainerStyles = css({
21
- marginBottom: "var(--ds-space-200, 16px)"
21
+ var iconContainerStyles = xcss({
22
+ marginBottom: 'space.200'
22
23
  });
23
24
  var Description = function Description(_ref) {
24
25
  var message = _ref.message,
@@ -30,8 +31,8 @@ var Description = function Description(_ref) {
30
31
  }, url), jsx("span", null, message));
31
32
  };
32
33
  var IconContainer = function IconContainer() {
33
- return jsx("div", {
34
- css: iconContainerStyles
34
+ return jsx(Box, {
35
+ xcss: iconContainerStyles
35
36
  }, jsx(AccessRequiredSVG, null));
36
37
  };
37
38
  export var AccessRequired = function AccessRequired(_ref2) {
@@ -7,7 +7,7 @@ import { css, jsx } from '@emotion/react';
7
7
  import { useIntl } from 'react-intl-next';
8
8
  import Button from '@atlaskit/button';
9
9
  import EmptyState from '@atlaskit/empty-state';
10
- import { auth as outboundAuth } from '@atlaskit/outbound-auth-flow-client';
10
+ import { AuthError, auth as outboundAuth } from '@atlaskit/outbound-auth-flow-client';
11
11
  import { useDatasourceAnalyticsEvents } from '../../../analytics';
12
12
  import useErrorLogger from '../../../hooks/useErrorLogger';
13
13
  import { loadingErrorMessages } from './messages';
@@ -43,19 +43,28 @@ export var ProviderAuthRequired = function ProviderAuthRequired(_ref) {
43
43
  _context.next = 4;
44
44
  return outboundAuth(authInfo.url);
45
45
  case 4:
46
+ fireEvent('operational.provider.authSuccess', {
47
+ extensionKey: authInfo.key,
48
+ experience: 'datasource'
49
+ });
46
50
  onAuthSuccess === null || onAuthSuccess === void 0 || onAuthSuccess();
47
- _context.next = 11;
51
+ _context.next = 13;
48
52
  break;
49
- case 7:
50
- _context.prev = 7;
53
+ case 8:
54
+ _context.prev = 8;
51
55
  _context.t0 = _context["catch"](1);
52
- onAuthError === null || onAuthError === void 0 || onAuthError();
56
+ fireEvent('operational.provider.authFailure', {
57
+ reason: _context.t0 instanceof AuthError && _context.t0.type ? _context.t0.type : null,
58
+ extensionKey: authInfo.key,
59
+ experience: 'datasource'
60
+ });
53
61
  captureError('ProviderOnAuthRequest', _context.t0);
54
- case 11:
62
+ onAuthError === null || onAuthError === void 0 || onAuthError();
63
+ case 13:
55
64
  case "end":
56
65
  return _context.stop();
57
66
  }
58
- }, _callee, null, [[1, 7]]);
67
+ }, _callee, null, [[1, 8]]);
59
68
  }));
60
69
  return function onAuthRequest() {
61
70
  return _ref2.apply(this, arguments);
@@ -23,7 +23,7 @@ var avatarWrapperStyles = xcss({
23
23
  var widthObserverWrapperStyles = xcss({
24
24
  position: 'relative'
25
25
  });
26
- var AvatarGroupWrapperStyles = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /*\n The css from editor core package affects the padding of the AvatarGroup\n The & refers to the parent selector (.<generated className>),\n so && becomes .<generated className>.<generated className> which increases its specificity\n */\n && ul {\n padding-left: 0px;\n }\n"])));
26
+ var AvatarGroupWrapperStyles = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ul {\n padding-left: 0px !important;\n }\n"])));
27
27
  var getMaxUserCount = function getMaxUserCount(userCount, availableWidth) {
28
28
  if (availableWidth <= 28) {
29
29
  // If width is less than or equal to 28px, we should only display the user count
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::c9cb39dfcf360ccc71b740ba1353dc6b>>
6
+ * @codegen <<SignedSource::e9179418960d1cbfd58428448cf63c82>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -70,6 +70,15 @@ export type DatasourceOperationFailedAttributesType = {
70
70
  traceId: string | null;
71
71
  status: number | null;
72
72
  };
73
+ export type ProviderAuthSuccessAttributesType = {
74
+ extensionKey: string | null;
75
+ experience: 'datasource';
76
+ };
77
+ export type ProviderAuthFailureAttributesType = {
78
+ extensionKey: string | null;
79
+ reason: 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' | 'authclientoauth2.autherror' | null;
80
+ experience: 'datasource';
81
+ };
73
82
  export type NextItemLoadedAttributesType = {
74
83
  destinationObjectTypes: unknown[];
75
84
  extensionKey: string | null;
@@ -169,6 +178,12 @@ export type AnalyticsEventAttributes = {
169
178
  /**
170
179
  * Fired when a generic operation failed */
171
180
  'operational.datasource.operationFailed': DatasourceOperationFailedAttributesType;
181
+ /**
182
+ * Fired when an auth provider connection is successful. */
183
+ 'operational.provider.authSuccess': ProviderAuthSuccessAttributesType;
184
+ /**
185
+ * Fired when an auth provider connection failed to complete. */
186
+ 'operational.provider.authFailure': ProviderAuthFailureAttributesType;
172
187
  /**
173
188
  * Fired when user scrolls to the next page/list of the objects */
174
189
  'track.nextItem.loaded': NextItemLoadedAttributesType;
@@ -1,20 +1,11 @@
1
1
  import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import { DatasourceAdf, DatasourceAdfView, InlineCardAdf } from '@atlaskit/linking-common/types';
3
- export interface AssetsDatasourceParameters extends Record<string, unknown> {
2
+ import { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common/types';
3
+ export type AssetsDatasourceParameters = {
4
4
  workspaceId: string;
5
5
  aql: string;
6
6
  schemaId: string;
7
- }
8
- export interface AssetsDatasourceAdf extends DatasourceAdf {
9
- attrs: {
10
- url?: string;
11
- datasource: {
12
- id: string;
13
- parameters: AssetsDatasourceParameters;
14
- views: DatasourceAdfView[];
15
- };
16
- };
17
- }
7
+ };
8
+ export type AssetsDatasourceAdf = DatasourceAdf<AssetsDatasourceParameters>;
18
9
  export interface AssetsConfigModalProps {
19
10
  datasourceId: string;
20
11
  visibleColumnKeys?: string[];
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::c9cb39dfcf360ccc71b740ba1353dc6b>>
6
+ * @codegen <<SignedSource::e9179418960d1cbfd58428448cf63c82>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -70,6 +70,15 @@ export type DatasourceOperationFailedAttributesType = {
70
70
  traceId: string | null;
71
71
  status: number | null;
72
72
  };
73
+ export type ProviderAuthSuccessAttributesType = {
74
+ extensionKey: string | null;
75
+ experience: 'datasource';
76
+ };
77
+ export type ProviderAuthFailureAttributesType = {
78
+ extensionKey: string | null;
79
+ reason: 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' | 'authclientoauth2.autherror' | null;
80
+ experience: 'datasource';
81
+ };
73
82
  export type NextItemLoadedAttributesType = {
74
83
  destinationObjectTypes: unknown[];
75
84
  extensionKey: string | null;
@@ -169,6 +178,12 @@ export type AnalyticsEventAttributes = {
169
178
  /**
170
179
  * Fired when a generic operation failed */
171
180
  'operational.datasource.operationFailed': DatasourceOperationFailedAttributesType;
181
+ /**
182
+ * Fired when an auth provider connection is successful. */
183
+ 'operational.provider.authSuccess': ProviderAuthSuccessAttributesType;
184
+ /**
185
+ * Fired when an auth provider connection failed to complete. */
186
+ 'operational.provider.authFailure': ProviderAuthFailureAttributesType;
172
187
  /**
173
188
  * Fired when user scrolls to the next page/list of the objects */
174
189
  'track.nextItem.loaded': NextItemLoadedAttributesType;
@@ -1,20 +1,11 @@
1
1
  import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import { DatasourceAdf, DatasourceAdfView, InlineCardAdf } from '@atlaskit/linking-common/types';
3
- export interface AssetsDatasourceParameters extends Record<string, unknown> {
2
+ import { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common/types';
3
+ export type AssetsDatasourceParameters = {
4
4
  workspaceId: string;
5
5
  aql: string;
6
6
  schemaId: string;
7
- }
8
- export interface AssetsDatasourceAdf extends DatasourceAdf {
9
- attrs: {
10
- url?: string;
11
- datasource: {
12
- id: string;
13
- parameters: AssetsDatasourceParameters;
14
- views: DatasourceAdfView[];
15
- };
16
- };
17
- }
7
+ };
8
+ export type AssetsDatasourceAdf = DatasourceAdf<AssetsDatasourceParameters>;
18
9
  export interface AssetsConfigModalProps {
19
10
  datasourceId: string;
20
11
  visibleColumnKeys?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "1.22.1",
3
+ "version": "1.22.3",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -31,13 +31,13 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@atlaskit/adf-schema": "^35.5.1",
34
- "@atlaskit/analytics-next": "^9.1.3",
34
+ "@atlaskit/analytics-next": "^9.2.0",
35
35
  "@atlaskit/avatar": "^21.4.0",
36
36
  "@atlaskit/avatar-group": "^9.5.0",
37
37
  "@atlaskit/badge": "^15.2.0",
38
38
  "@atlaskit/button": "^17.3.0",
39
- "@atlaskit/dropdown-menu": "^12.3.0",
40
- "@atlaskit/editor-prosemirror": "1.1.0",
39
+ "@atlaskit/dropdown-menu": "^12.5.0",
40
+ "@atlaskit/editor-prosemirror": "3.0.0",
41
41
  "@atlaskit/empty-state": "^7.5.0",
42
42
  "@atlaskit/form": "^9.0.3",
43
43
  "@atlaskit/heading": "^1.6.0",