@atlaskit/link-datasource 3.9.1 → 3.10.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/hooks/useDatasourceTableFlag.js +12 -3
  3. package/dist/cjs/ui/issue-like-table/edit-type/icon/index.js +134 -0
  4. package/dist/cjs/ui/issue-like-table/edit-type/index.js +25 -8
  5. package/dist/cjs/ui/issue-like-table/edit-type/status/index.js +7 -1
  6. package/dist/cjs/ui/issue-like-table/messages.js +10 -0
  7. package/dist/cjs/ui/issue-like-table/render-type/icon/index.js +5 -0
  8. package/dist/cjs/ui/issue-like-table/render-type/index.js +5 -1
  9. package/dist/cjs/ui/issue-like-table/render-type/new-icon/index.js +25 -0
  10. package/dist/cjs/ui/issue-like-table/shared-components/icon/index.js +42 -0
  11. package/dist/cjs/ui/issue-like-table/table-cell-content/index.js +7 -3
  12. package/dist/es2019/hooks/useDatasourceTableFlag.js +12 -3
  13. package/dist/es2019/ui/issue-like-table/edit-type/icon/index.js +94 -0
  14. package/dist/es2019/ui/issue-like-table/edit-type/index.js +19 -6
  15. package/dist/es2019/ui/issue-like-table/edit-type/status/index.js +8 -1
  16. package/dist/es2019/ui/issue-like-table/messages.js +10 -0
  17. package/dist/es2019/ui/issue-like-table/render-type/icon/index.js +5 -0
  18. package/dist/es2019/ui/issue-like-table/render-type/index.js +3 -1
  19. package/dist/es2019/ui/issue-like-table/render-type/new-icon/index.js +18 -0
  20. package/dist/es2019/ui/issue-like-table/shared-components/icon/index.js +36 -0
  21. package/dist/es2019/ui/issue-like-table/table-cell-content/index.js +7 -3
  22. package/dist/esm/hooks/useDatasourceTableFlag.js +12 -3
  23. package/dist/esm/ui/issue-like-table/edit-type/icon/index.js +124 -0
  24. package/dist/esm/ui/issue-like-table/edit-type/index.js +25 -8
  25. package/dist/esm/ui/issue-like-table/edit-type/status/index.js +7 -1
  26. package/dist/esm/ui/issue-like-table/messages.js +10 -0
  27. package/dist/esm/ui/issue-like-table/render-type/icon/index.js +5 -0
  28. package/dist/esm/ui/issue-like-table/render-type/index.js +5 -1
  29. package/dist/esm/ui/issue-like-table/render-type/new-icon/index.js +18 -0
  30. package/dist/esm/ui/issue-like-table/shared-components/icon/index.js +35 -0
  31. package/dist/esm/ui/issue-like-table/table-cell-content/index.js +7 -3
  32. package/dist/types/hooks/useDatasourceTableFlag.d.ts +1 -0
  33. package/dist/types/ui/issue-like-table/edit-type/icon/index.d.ts +14 -0
  34. package/dist/types/ui/issue-like-table/edit-type/index.d.ts +2 -1
  35. package/dist/types/ui/issue-like-table/messages.d.ts +10 -0
  36. package/dist/types/ui/issue-like-table/render-type/icon/index.d.ts +4 -0
  37. package/dist/types/ui/issue-like-table/render-type/new-icon/index.d.ts +9 -0
  38. package/dist/types/ui/issue-like-table/shared-components/icon/index.d.ts +23 -0
  39. package/dist/types/ui/issue-like-table/types.d.ts +7 -0
  40. package/dist/types-ts4.5/hooks/useDatasourceTableFlag.d.ts +1 -0
  41. package/dist/types-ts4.5/ui/issue-like-table/edit-type/icon/index.d.ts +14 -0
  42. package/dist/types-ts4.5/ui/issue-like-table/edit-type/index.d.ts +2 -1
  43. package/dist/types-ts4.5/ui/issue-like-table/messages.d.ts +10 -0
  44. package/dist/types-ts4.5/ui/issue-like-table/render-type/icon/index.d.ts +4 -0
  45. package/dist/types-ts4.5/ui/issue-like-table/render-type/new-icon/index.d.ts +9 -0
  46. package/dist/types-ts4.5/ui/issue-like-table/shared-components/icon/index.d.ts +23 -0
  47. package/dist/types-ts4.5/ui/issue-like-table/types.d.ts +7 -0
  48. package/package.json +6 -3
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ interface SharedIconComponentProps {
3
+ /**
4
+ * URL or SVG for the priority icon
5
+ */
6
+ iconUrl: string;
7
+ /**
8
+ * Text that labels the icon. Will not be capitalised.
9
+ */
10
+ text?: string;
11
+ /**
12
+ * Label.
13
+ * Used for icon alt.
14
+ */
15
+ label?: string;
16
+ testId: string;
17
+ }
18
+ /**
19
+ * Renders a icon and label.
20
+ * If the text is undefined, render the capitalised label.
21
+ */
22
+ export declare function SharedIconComponent({ iconUrl, label, text, testId }: SharedIconComponentProps): JSX.Element;
23
+ export {};
@@ -9,6 +9,13 @@ export type DatasourceTypeWithOnlyValues = {
9
9
  }>['value'][];
10
10
  };
11
11
  }[DatasourceType['type']];
12
+ /** Object typing a list of data objects for type K */
13
+ export type DatasourceTypeWithOnlyTypeValues<K> = {
14
+ type: K;
15
+ values: Extract<DatasourceType, {
16
+ type: K;
17
+ }>['value'][];
18
+ };
12
19
  export type TableViewPropsRenderType = (item: DatasourceTypeWithOnlyValues) => React.ReactNode;
13
20
  export interface ColumnSizesMap {
14
21
  [key: string]: number;
@@ -1,6 +1,7 @@
1
1
  import { type CreateFlagArgs } from '@atlaskit/flag';
2
2
  interface DatasourceTableFlagOptions {
3
3
  url?: string;
4
+ isFetchAction?: boolean;
4
5
  }
5
6
  export declare const useDatasourceTableFlag: (options?: DatasourceTableFlagOptions) => {
6
7
  showErrorFlag: (args?: Partial<CreateFlagArgs> & {
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { type FieldProps } from '@atlaskit/form';
3
+ import { type ExecuteFetch } from '../../../../state/actions';
4
+ import type { DatasourceTypeWithOnlyTypeValues, DatasourceTypeWithOnlyValues } from '../../types';
5
+ interface Props extends Omit<FieldProps<string>, 'value'> {
6
+ currentValue: DatasourceTypeWithOnlyTypeValues<'icon'>;
7
+ setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
8
+ executeFetch?: ExecuteFetch;
9
+ }
10
+ /**
11
+ * Should be gated by FF rollout of platform-datasources-enable-two-way-sync-priority
12
+ */
13
+ declare const PriorityEditType: (props: Props) => JSX.Element;
14
+ export default PriorityEditType;
@@ -1,12 +1,13 @@
1
1
  import React from 'react';
2
2
  import type InlineEdit from '@atlaskit/inline-edit';
3
3
  import type { DatasourceType } from '@atlaskit/linking-types';
4
+ import { type ExecuteFetch } from '../../../state/actions';
4
5
  import { type DatasourceTypeWithOnlyValues } from '../types';
5
6
  export declare const editType: ({ defaultValue, currentValue, setEditValues, executeFetch, }: {
6
7
  defaultValue: DatasourceTypeWithOnlyValues;
7
8
  currentValue: DatasourceTypeWithOnlyValues;
8
9
  setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
9
- executeFetch?: (<E>(inputs: any) => Promise<E>) | undefined;
10
+ executeFetch?: ExecuteFetch | undefined;
10
11
  }) => Pick<React.ComponentProps<typeof InlineEdit>, 'defaultValue' | 'editView'>;
11
12
  export declare const isEditTypeSupported: (type: DatasourceType['type']) => boolean;
12
13
  export declare const isEditTypeSelectable: (type: DatasourceType['type']) => boolean;
@@ -19,6 +19,16 @@ export declare const issueLikeTableMessages: {
19
19
  description: string;
20
20
  defaultMessage: string;
21
21
  };
22
+ fetchActionErrorGenericDescription: {
23
+ id: string;
24
+ description: string;
25
+ defaultMessage: string;
26
+ };
27
+ fetchActionErrorGenericTitle: {
28
+ id: string;
29
+ description: string;
30
+ defaultMessage: string;
31
+ };
22
32
  wrapText: {
23
33
  id: string;
24
34
  description: string;
@@ -5,5 +5,9 @@ interface IconProps extends Icon {
5
5
  }
6
6
  export declare const ICON_TYPE_TEST_ID = "link-datasource-render-type--icon";
7
7
  export declare const ICON_TYPE_TEXT_TEST_ID = "link-datasource-render-type--icon-text";
8
+ /**
9
+ * @deprecated: To be cleaned up and replaced with new-icon after
10
+ * `platform-datasources-enable-two-way-sync-priority` rollout.
11
+ */
8
12
  declare const IconRenderType: ({ label, text, source, testId }: IconProps) => JSX.Element;
9
13
  export default IconRenderType;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { type Icon } from '@atlaskit/linking-types';
3
+ interface IconProps extends Icon {
4
+ testId?: string;
5
+ }
6
+ export declare const ICON_TYPE_TEST_ID = "link-datasource-render-type--icon";
7
+ export declare const ICON_TYPE_TEXT_TEST_ID = "link-datasource-render-type--icon-text";
8
+ declare const IconRenderType: ({ label, text, source, testId }: IconProps) => JSX.Element;
9
+ export default IconRenderType;
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ interface SharedIconComponentProps {
3
+ /**
4
+ * URL or SVG for the priority icon
5
+ */
6
+ iconUrl: string;
7
+ /**
8
+ * Text that labels the icon. Will not be capitalised.
9
+ */
10
+ text?: string;
11
+ /**
12
+ * Label.
13
+ * Used for icon alt.
14
+ */
15
+ label?: string;
16
+ testId: string;
17
+ }
18
+ /**
19
+ * Renders a icon and label.
20
+ * If the text is undefined, render the capitalised label.
21
+ */
22
+ export declare function SharedIconComponent({ iconUrl, label, text, testId }: SharedIconComponentProps): JSX.Element;
23
+ export {};
@@ -9,6 +9,13 @@ export type DatasourceTypeWithOnlyValues = {
9
9
  }>['value'][];
10
10
  };
11
11
  }[DatasourceType['type']];
12
+ /** Object typing a list of data objects for type K */
13
+ export type DatasourceTypeWithOnlyTypeValues<K> = {
14
+ type: K;
15
+ values: Extract<DatasourceType, {
16
+ type: K;
17
+ }>['value'][];
18
+ };
12
19
  export type TableViewPropsRenderType = (item: DatasourceTypeWithOnlyValues) => React.ReactNode;
13
20
  export interface ColumnSizesMap {
14
21
  [key: string]: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "3.9.1",
3
+ "version": "3.10.1",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -47,7 +47,7 @@
47
47
  "@atlaskit/empty-state": "^7.12.0",
48
48
  "@atlaskit/flag": "^15.8.0",
49
49
  "@atlaskit/form": "^10.5.0",
50
- "@atlaskit/heading": "^2.4.0",
50
+ "@atlaskit/heading": "^3.0.0",
51
51
  "@atlaskit/icon": "^22.24.0",
52
52
  "@atlaskit/icon-object": "^6.7.0",
53
53
  "@atlaskit/image": "^1.3.0",
@@ -77,7 +77,7 @@
77
77
  "@atlaskit/smart-user-picker": "6.11.1",
78
78
  "@atlaskit/spinner": "^16.3.0",
79
79
  "@atlaskit/tag": "^12.6.0",
80
- "@atlaskit/textfield": "6.5.4",
80
+ "@atlaskit/textfield": "6.5.5",
81
81
  "@atlaskit/theme": "^14.0.0",
82
82
  "@atlaskit/tokens": "^2.2.0",
83
83
  "@atlaskit/tooltip": "^18.9.0",
@@ -168,6 +168,9 @@
168
168
  "platform-datasources-enable-two-way-sync-statuses": {
169
169
  "type": "boolean"
170
170
  },
171
+ "platform-datasources-enable-two-way-sync-priority": {
172
+ "type": "boolean"
173
+ },
171
174
  "platform.linking-platform.datasource-assets_add_version_parameter": {
172
175
  "type": "boolean"
173
176
  },