@atlaskit/teams-public 1.5.0 → 2.0.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.
Files changed (105) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/assets/package.json +1 -8
  3. package/container-icon/package.json +1 -8
  4. package/i18n/package.json +1 -8
  5. package/loom-avatar/main/package.json +1 -8
  6. package/loom-avatar/package.json +1 -8
  7. package/main/package.json +1 -8
  8. package/next/add-container-card/package.json +1 -8
  9. package/next/package.json +1 -8
  10. package/next/team-container-skeleton/package.json +1 -8
  11. package/next/team-link-card/package.json +1 -8
  12. package/package.json +23 -31
  13. package/separator/package.json +1 -8
  14. package/space-invite-scheduler/package.json +1 -8
  15. package/team-containers/package.json +1 -8
  16. package/team-containers/types/package.json +1 -8
  17. package/team-containers-skeleton/package.json +1 -8
  18. package/team-link-card/package.json +1 -8
  19. package/types/package.json +1 -8
  20. package/use-create-containers/package.json +1 -8
  21. package/use-product-permission/package.json +1 -8
  22. package/use-team-containers/package.json +1 -8
  23. package/use-team-links-and-containers/package.json +1 -8
  24. package/use-team-web-links/package.json +1 -8
  25. package/utils/get-container-properties/package.json +1 -8
  26. package/utils/get-is-experiment-enabled/package.json +1 -8
  27. package/utils/package.json +1 -8
  28. package/utils/space-invite-scheduler/package.json +1 -8
  29. package/dist/types-ts4.5/common/assets/index.d.ts +0 -3
  30. package/dist/types-ts4.5/common/hooks/useSpaceInviteScheduler.d.ts +0 -10
  31. package/dist/types-ts4.5/common/types.d.ts +0 -38
  32. package/dist/types-ts4.5/common/ui/container-icon/index.d.ts +0 -10
  33. package/dist/types-ts4.5/common/ui/loom-avatar/index.d.ts +0 -1
  34. package/dist/types-ts4.5/common/ui/loom-avatar/main.d.ts +0 -10
  35. package/dist/types-ts4.5/common/ui/loom-avatar/utils.d.ts +0 -16
  36. package/dist/types-ts4.5/common/ui/separator/index.d.ts +0 -2
  37. package/dist/types-ts4.5/common/ui/team-containers-skeleton/index.d.ts +0 -5
  38. package/dist/types-ts4.5/common/ui/team-containers-skeleton/linked-container-card-skeleton/index.d.ts +0 -5
  39. package/dist/types-ts4.5/common/ui/team-link-card-actions/index.d.ts +0 -15
  40. package/dist/types-ts4.5/common/utils/analytics.d.ts +0 -34
  41. package/dist/types-ts4.5/common/utils/get-container-properties.d.ts +0 -74
  42. package/dist/types-ts4.5/common/utils/get-is-experiment-enabled.d.ts +0 -23
  43. package/dist/types-ts4.5/common/utils/get-link-domain.d.ts +0 -16
  44. package/dist/types-ts4.5/common/utils/spaceInviteScheduler.d.ts +0 -23
  45. package/dist/types-ts4.5/common/utils/team-web-link-converters.d.ts +0 -10
  46. package/dist/types-ts4.5/controllers/hooks/use-create-containers/index.d.ts +0 -24
  47. package/dist/types-ts4.5/controllers/hooks/use-product-permission/index.d.ts +0 -5
  48. package/dist/types-ts4.5/controllers/hooks/use-refresh-containers-on-container-created/index.d.ts +0 -3
  49. package/dist/types-ts4.5/controllers/hooks/use-team-containers/index.d.ts +0 -59
  50. package/dist/types-ts4.5/controllers/hooks/use-team-containers/mocks.d.ts +0 -127
  51. package/dist/types-ts4.5/controllers/hooks/use-team-containers/multi-team.d.ts +0 -63
  52. package/dist/types-ts4.5/controllers/hooks/use-team-links-and-containers/index.d.ts +0 -18
  53. package/dist/types-ts4.5/controllers/hooks/use-team-web-links/index.d.ts +0 -165
  54. package/dist/types-ts4.5/controllers/hooks/use-team-web-links/multi-team.d.ts +0 -43
  55. package/dist/types-ts4.5/controllers/hooks/use-team-web-links/types.d.ts +0 -21
  56. package/dist/types-ts4.5/controllers/index.d.ts +0 -3
  57. package/dist/types-ts4.5/controllers/product-permission/main.d.ts +0 -6
  58. package/dist/types-ts4.5/controllers/product-permission/types.d.ts +0 -59
  59. package/dist/types-ts4.5/controllers/product-permission/utils.d.ts +0 -7
  60. package/dist/types-ts4.5/i18n/cs.d.ts +0 -8
  61. package/dist/types-ts4.5/i18n/da.d.ts +0 -8
  62. package/dist/types-ts4.5/i18n/de.d.ts +0 -8
  63. package/dist/types-ts4.5/i18n/en.d.ts +0 -8
  64. package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -8
  65. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -8
  66. package/dist/types-ts4.5/i18n/es.d.ts +0 -8
  67. package/dist/types-ts4.5/i18n/fi.d.ts +0 -8
  68. package/dist/types-ts4.5/i18n/fr.d.ts +0 -8
  69. package/dist/types-ts4.5/i18n/hr.d.ts +0 -8
  70. package/dist/types-ts4.5/i18n/hu.d.ts +0 -8
  71. package/dist/types-ts4.5/i18n/index.d.ts +0 -35
  72. package/dist/types-ts4.5/i18n/it.d.ts +0 -8
  73. package/dist/types-ts4.5/i18n/ja.d.ts +0 -8
  74. package/dist/types-ts4.5/i18n/ko.d.ts +0 -8
  75. package/dist/types-ts4.5/i18n/nb.d.ts +0 -8
  76. package/dist/types-ts4.5/i18n/nl.d.ts +0 -8
  77. package/dist/types-ts4.5/i18n/pl.d.ts +0 -8
  78. package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -8
  79. package/dist/types-ts4.5/i18n/ru.d.ts +0 -8
  80. package/dist/types-ts4.5/i18n/sl.d.ts +0 -8
  81. package/dist/types-ts4.5/i18n/sr_RS.d.ts +0 -8
  82. package/dist/types-ts4.5/i18n/sr_YR.d.ts +0 -8
  83. package/dist/types-ts4.5/i18n/sv.d.ts +0 -8
  84. package/dist/types-ts4.5/i18n/th.d.ts +0 -8
  85. package/dist/types-ts4.5/i18n/tr.d.ts +0 -8
  86. package/dist/types-ts4.5/i18n/uk.d.ts +0 -8
  87. package/dist/types-ts4.5/i18n/vi.d.ts +0 -8
  88. package/dist/types-ts4.5/i18n/zh.d.ts +0 -8
  89. package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -8
  90. package/dist/types-ts4.5/index.d.ts +0 -19
  91. package/dist/types-ts4.5/next/common/ui/team-container-skeleton/index.d.ts +0 -3
  92. package/dist/types-ts4.5/next/index.d.ts +0 -3
  93. package/dist/types-ts4.5/next/ui/team-containers/add-container-card/index.d.ts +0 -10
  94. package/dist/types-ts4.5/next/ui/team-containers/team-link-card/index.d.ts +0 -18
  95. package/dist/types-ts4.5/ui/team-containers/add-container-card/add-container-card-button/index.d.ts +0 -6
  96. package/dist/types-ts4.5/ui/team-containers/add-container-card/index.d.ts +0 -29
  97. package/dist/types-ts4.5/ui/team-containers/disconnect-dialog/async.d.ts +0 -3
  98. package/dist/types-ts4.5/ui/team-containers/disconnect-dialog/index.d.ts +0 -46
  99. package/dist/types-ts4.5/ui/team-containers/index.d.ts +0 -3
  100. package/dist/types-ts4.5/ui/team-containers/main.d.ts +0 -6
  101. package/dist/types-ts4.5/ui/team-containers/no-product-access-empty-state/index.d.ts +0 -2
  102. package/dist/types-ts4.5/ui/team-containers/no-product-access-empty-state/no-product-access-icon/index.d.ts +0 -2
  103. package/dist/types-ts4.5/ui/team-containers/team-link-card/index.d.ts +0 -19
  104. package/dist/types-ts4.5/ui/team-containers/team-link-card/team-link-card-title.d.ts +0 -9
  105. package/dist/types-ts4.5/ui/team-containers/types.d.ts +0 -84
@@ -1,34 +0,0 @@
1
- import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
2
- type AnalyticsAttribute = Record<string, string | number | boolean | undefined>;
3
- interface AnalyticsEvent {
4
- action?: string;
5
- actionSubject?: string;
6
- actionSubjectId?: string;
7
- attributes?: Record<string, string | number | boolean | undefined | AnalyticsAttribute>;
8
- name?: string;
9
- source?: string;
10
- }
11
- /**
12
- * @private
13
- * @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
14
- */
15
- export declare const usePeopleAndTeamAnalytics: () => {
16
- fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
17
- fireScreenEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
18
- fireTrackEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
19
- fireUIEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
20
- };
21
- export declare enum AnalyticsAction {
22
- RENDERED = "rendered",
23
- CLICKED = "clicked",
24
- FAILED = "failed",
25
- SUCCEEDED = "succeeded",
26
- VIEWED = "viewed",
27
- CLOSED = "closed",
28
- ERROR = "error",
29
- SUBMITED = "submitted",
30
- FETCHED = "fetched",
31
- SENT = "sent",
32
- OPENED = "opened"
33
- }
34
- export {};
@@ -1,74 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- import { type ContainerSubTypes, type ContainerTypes } from '../types';
3
- interface ContainerProperties {
4
- description: ReactNode;
5
- icon: ReactNode;
6
- title?: ReactNode;
7
- containerTypeText: ReactNode;
8
- isEmptyContainer?: boolean;
9
- }
10
- type IconSize = 'xxsmall' | 'xsmall' | 'small' | 'medium';
11
- export declare const messages: {
12
- addConfluenceContainerTitle: {
13
- id: string;
14
- defaultMessage: string;
15
- description: string;
16
- };
17
- confluenceContainerDescription: {
18
- id: string;
19
- defaultMessage: string;
20
- description: string;
21
- };
22
- addLoomSpace: {
23
- id: string;
24
- defaultMessage: string;
25
- description: string;
26
- };
27
- addJiraProject: {
28
- id: string;
29
- defaultMessage: string;
30
- description: string;
31
- };
32
- jiraProjectDescription: {
33
- id: string;
34
- defaultMessage: string;
35
- description: string;
36
- };
37
- loomSpaceDescription: {
38
- id: string;
39
- defaultMessage: string;
40
- description: string;
41
- };
42
- spaceContainerTextOverride: {
43
- id: string;
44
- defaultMessage: string;
45
- description: string;
46
- };
47
- emptyLinkContainerDescription: {
48
- id: string;
49
- defaultMessage: string;
50
- description: string;
51
- };
52
- addLink: {
53
- id: string;
54
- defaultMessage: string;
55
- description: string;
56
- };
57
- linkContainerDescription: {
58
- id: string;
59
- defaultMessage: string;
60
- description: string;
61
- };
62
- };
63
- interface GetContainerPropertiesParams {
64
- containerType: ContainerTypes;
65
- iconSize?: IconSize;
66
- containerTypeProperties?: {
67
- subType?: ContainerSubTypes;
68
- name?: string;
69
- };
70
- isEmptyContainer?: boolean;
71
- isDisplayedOnProfileCard?: boolean;
72
- }
73
- export declare const getContainerProperties: ({ containerType, iconSize, containerTypeProperties, isEmptyContainer, isDisplayedOnProfileCard, }: GetContainerPropertiesParams) => ContainerProperties;
74
- export {};
@@ -1,23 +0,0 @@
1
- export declare const COHORT_PARAMETER = "cohort";
2
- export declare const NOT_ENROLLED = "not-enrolled";
3
- export declare const CONTROL = "control";
4
- export declare const EXPERIMENT = "experiment";
5
- export declare const VARIATION = "variation";
6
- export declare const VAR1 = "variation_1";
7
- export declare const VAR2 = "variation_2";
8
- export declare const VAR3 = "variation_3";
9
- export declare const VAR4 = "variation_4";
10
- export declare const cohorts: {
11
- readonly NOT_ENROLLED: 'not-enrolled';
12
- readonly CONTROL: 'control';
13
- readonly EXPERIMENT: 'experiment';
14
- readonly VARIATION: 'variation';
15
- readonly VAR1: 'variation_1';
16
- readonly VAR2: 'variation_2';
17
- readonly VAR3: 'variation_3';
18
- readonly VAR4: 'variation_4';
19
- };
20
- export declare const DEFAULT_VALID_EXPERIMENT_COHORTS: ('not-enrolled' | 'control' | 'experiment' | 'variation' | 'variation_1' | 'variation_2' | 'variation_3' | 'variation_4')[];
21
- export type CohortKeys = keyof typeof cohorts;
22
- export type Cohort = (typeof cohorts)[CohortKeys];
23
- export declare const getIsExperimentEnabled: (experimentName: string, variantKey?: Cohort, validExperimentCohorts?: Cohort[], fireExperimentExposure?: boolean) => boolean;
@@ -1,16 +0,0 @@
1
- /**
2
- * Extract the domain from the URL. Strips "www" subdomains
3
- * e.g. http://dogs.animals.com/yellow/golden-retriever becomes "dogs.animals.com"
4
- * e.g. http://www.blake.com/memes becomes "blake.com"
5
- *
6
- * Return an empty string if a totally invalid url is somehow passed in.
7
- * @param url
8
- */
9
- export declare const getDomainFromLinkUri: (url: string) => string;
10
- /**
11
- * Extract the domain from the URL.
12
- * Throws if url param is not a valid URL.
13
- * Marked as unsafe because the URL constructor throws Type Errors when it
14
- * receives invalid URLs. Feel free to use this method with adequate care.
15
- */
16
- export declare const unsafeGetDomainFromUrl: (url: string) => string;
@@ -1,23 +0,0 @@
1
- /**
2
- * FE debounce mechanism to avoid spamming invites when users consecutively
3
- * link and unlink teams from containers in quick succession. We'll log the
4
- * frequency of this occurring and decide whether to move debouncing to the
5
- * BE as a productionisation task.
6
- *
7
- * Uses module-level state rather than a globalThis singleton to avoid polluting
8
- * the global scope — a simple in-memory workaround is sufficient here.
9
- */
10
- export declare const spaceInviteScheduler: {
11
- scheduleInvite: (teamId: string, containerId: string, callback: () => void) => void;
12
- cancelInvite: (teamId: string, containerId: string) => boolean;
13
- /**
14
- * Immediately fires all pending callbacks and clears the queue.
15
- * Called automatically on page unload (visibilitychange / beforeunload)
16
- * so that debounced invites are not lost when the user navigates away.
17
- *
18
- * Important: callbacks invoked during page teardown must use
19
- * `fetch({ keepalive: true })` or `navigator.sendBeacon` — a regular
20
- * `fetch` without `keepalive` may be cancelled by the browser.
21
- */
22
- flushAll: () => void;
23
- };
@@ -1,10 +0,0 @@
1
- import { type NewTeamWebLink, type TeamContainer, type TeamWebLink } from '../types';
2
- export interface TeamLinkIconData {
3
- linkUrl?: string;
4
- iconUrl?: string;
5
- productName?: string;
6
- }
7
- export declare const containerToNewWebLink: (container: TeamContainer) => NewTeamWebLink;
8
- export declare const webLinkToContainer: (link: TeamWebLink, iconData?: TeamLinkIconData) => TeamContainer;
9
- export declare const webLinksToContainers: (links: TeamWebLink[], linkIcons?: TeamLinkIconData[]) => TeamContainer[];
10
- export declare const isNewTeamWebLink: (input: TeamContainer | NewTeamWebLink) => input is NewTeamWebLink;
@@ -1,24 +0,0 @@
1
- import { type BoundActions, type HookFunction, type StoreActionApi } from 'react-sweet-state';
2
- type Product = 'Jira' | 'Confluence' | 'Loom' | 'WebLink';
3
- type ContainerState = {
4
- isLoading: boolean;
5
- isCreated: boolean;
6
- };
7
- type State = {
8
- Jira: ContainerState;
9
- Confluence: ContainerState;
10
- Loom: ContainerState;
11
- };
12
- type StoreAction = StoreActionApi<State>;
13
- /**
14
- * Custom hook for accessing and updating the state of container creation (Jira, Confluence, Loom).
15
- *
16
- * Provides state and actions for loading and creation status of each container type.
17
- *
18
- * @returns {object} State and actions for managing container creation.
19
- */
20
- declare const useCreateContainers: HookFunction<State, BoundActions<State, {
21
- updateContainerLoading: (product: Product, isLoading: boolean) => ({ setState, getState }: StoreAction) => void;
22
- updateContainerCreated: (product: Product, isCreated: boolean) => ({ setState, getState }: StoreAction) => void;
23
- }>, void>;
24
- export { useCreateContainers };
@@ -1,5 +0,0 @@
1
- import { type ProductPermissions } from '../../product-permission/types';
2
- /**
3
- * @deprecated Use useProductPermissions from "@atlaskit/teams-app-internal-product-permissions" instead
4
- */
5
- export declare const useProductPermissions: ProductPermissions;
@@ -1,3 +0,0 @@
1
- export declare const INTERVAL_TIME = 2000;
2
- export declare const TIMEOUT_DURATION = 30000;
3
- export declare const useRefreshOnContainerCreated: (teamId: string) => void;
@@ -1,59 +0,0 @@
1
- import { type Action, type BoundActions, type HookFunction } from 'react-sweet-state';
2
- import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
3
- import type { TeamContainers, TeamWithMemberships, UnlinkContainerMutationError } from '@atlaskit/teams-client/types';
4
- import { type TeamContainer } from '../../../common/types';
5
- type ConnectedTeams = {
6
- containerId: string | undefined;
7
- isLoading: boolean;
8
- hasLoaded: boolean;
9
- teams: TeamWithMemberships[] | undefined;
10
- error: Error | null;
11
- numberOfTeams: number | undefined;
12
- };
13
- type State = {
14
- teamContainers: TeamContainers;
15
- loading: boolean;
16
- hasLoaded: boolean;
17
- error: Error | null;
18
- unlinkError: UnlinkContainerMutationError | null;
19
- teamId: string | null;
20
- connectedTeams: ConnectedTeams;
21
- };
22
- export declare const useTeamContainersHook: HookFunction<State, BoundActions<State, {
23
- fetchTeamContainers: (teamId: string, fireAnalytics: ReturnType<typeof useAnalyticsEvents>['fireEvent']) => Action<State>;
24
- refetchTeamContainers: (fireAnalytics: ReturnType<typeof useAnalyticsEvents>['fireEvent']) => Action<State>;
25
- fetchNumberOfConnectedTeams: (containerId: string, fireAnalytics: ReturnType<typeof useAnalyticsEvents>['fireEvent']) => Action<State>;
26
- fetchConnectedTeams: (containerId: string, fireAnalytics: ReturnType<typeof useAnalyticsEvents>['fireEvent']) => Action<State>;
27
- unlinkTeamContainers: (teamId: string, containerId: string) => Action<State>;
28
- addTeamContainer: (teamContainer: TeamContainer) => Action<State>;
29
- }>, void>;
30
- export declare const useTeamContainers: (teamId: string, enable?: boolean) => {
31
- teamContainers: TeamContainers;
32
- loading: boolean;
33
- hasLoaded: boolean;
34
- error: Error | null;
35
- unlinkError: UnlinkContainerMutationError | null;
36
- teamId: string | null;
37
- connectedTeams: {
38
- containerId: string | undefined;
39
- isLoading: boolean;
40
- hasLoaded: boolean;
41
- teams: TeamWithMemberships[] | undefined;
42
- error: Error | null;
43
- numberOfTeams: number | undefined;
44
- };
45
- addTeamContainer: (teamContainer: TeamContainer) => void | Promise<void>;
46
- unlinkTeamContainers: (containerId: string) => void | Promise<void>;
47
- refetchTeamContainers: () => Promise<void>;
48
- };
49
- export declare const useConnectedTeams: (teamId?: string) => {
50
- fetchNumberOfConnectedTeams: (containerId: string) => void | Promise<void>;
51
- fetchConnectedTeams: (containerId: string) => void | Promise<void>;
52
- containerId: string | undefined;
53
- isLoading: boolean;
54
- hasLoaded: boolean;
55
- teams: TeamWithMemberships[] | undefined;
56
- error: Error | null;
57
- numberOfTeams: number | undefined;
58
- };
59
- export {};
@@ -1,127 +0,0 @@
1
- export declare const MOCK_TEAM_CONTAINERS: {
2
- graphStore: {
3
- cypherQuery: {
4
- edges: ({
5
- node: {
6
- from: {
7
- id: string;
8
- };
9
- to: {
10
- id: string;
11
- data: {
12
- __typename: string;
13
- confluenceSpaceName: string;
14
- type: string;
15
- createdDate: string;
16
- links: {
17
- webUi: string;
18
- };
19
- icon: {
20
- path: string;
21
- };
22
- jiraProjectName?: undefined;
23
- webUrl?: undefined;
24
- created?: undefined;
25
- avatar?: undefined;
26
- };
27
- };
28
- };
29
- } | {
30
- node: {
31
- from: {
32
- id: string;
33
- };
34
- to: {
35
- id: string;
36
- data: {
37
- __typename: string;
38
- jiraProjectName: string;
39
- webUrl: string;
40
- created: string;
41
- avatar: {
42
- medium: string;
43
- };
44
- confluenceSpaceName?: undefined;
45
- type?: undefined;
46
- createdDate?: undefined;
47
- links?: undefined;
48
- icon?: undefined;
49
- };
50
- };
51
- };
52
- })[];
53
- };
54
- };
55
- };
56
- export declare const MOCK_TEAM_CONTAINERSV2: {
57
- graphStore: {
58
- cypherQueryV2: {
59
- edges: ({
60
- node: {
61
- columns: {
62
- key: string;
63
- value: {
64
- data: {
65
- __typename: string;
66
- id: string;
67
- confluenceSpaceName: string;
68
- type: string;
69
- createdDate: string;
70
- links: {
71
- base: string;
72
- webUi: string;
73
- };
74
- icon: {
75
- path: string;
76
- };
77
- };
78
- };
79
- }[];
80
- };
81
- } | {
82
- node: {
83
- columns: {
84
- key: string;
85
- value: {
86
- data: {
87
- __typename: string;
88
- id: string;
89
- jiraProjectName: string;
90
- webUrl: string;
91
- created: string;
92
- avatar: {
93
- medium: string;
94
- };
95
- projectType: string;
96
- projectTypeName: string;
97
- };
98
- };
99
- }[];
100
- };
101
- })[];
102
- };
103
- };
104
- };
105
- export declare const MOCK_CONNECTED_TEAMS_RESULT: {
106
- id: string;
107
- displayName: string;
108
- description: string;
109
- state: string;
110
- membershipSettings: string;
111
- organizationId: string;
112
- creatorId: string;
113
- isVerified: boolean;
114
- members: {
115
- id: string;
116
- fullName: string;
117
- avatarUrl: string;
118
- status: string;
119
- }[];
120
- includesYou: boolean;
121
- memberCount: number;
122
- smallAvatarImageUrl: string;
123
- smallHeaderImageUrl: string;
124
- largeAvatarImageUrl: string;
125
- largeHeaderImageUrl: string;
126
- restriction: string;
127
- }[];
@@ -1,63 +0,0 @@
1
- import { type Action, type BoundActions, type HookFunction } from 'react-sweet-state';
2
- import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/teams-app-internal-analytics';
3
- import type { TeamContainers, TeamWithMemberships, UnlinkContainerMutationError } from '@atlaskit/teams-client/types';
4
- import { type TeamContainer } from '../../../common/types';
5
- type ConnectedTeams = {
6
- containerId: string | undefined;
7
- isLoading: boolean;
8
- hasLoaded: boolean;
9
- teams: TeamWithMemberships[] | undefined;
10
- error: Error | null;
11
- numberOfTeams: number | undefined;
12
- };
13
- type TeamState = {
14
- teamContainers: TeamContainers;
15
- loading: boolean;
16
- hasLoaded: boolean;
17
- error: Error | null;
18
- unlinkError: UnlinkContainerMutationError | null;
19
- teamId: string | null;
20
- connectedTeams: ConnectedTeams;
21
- };
22
- type State = {
23
- teams: Record<string, TeamState>;
24
- unlinkError: UnlinkContainerMutationError | null;
25
- };
26
- type FireAnalyticsProps = {
27
- action: string;
28
- actionSubject: string;
29
- containerId: string;
30
- numberOfTeams?: number;
31
- error?: Error;
32
- };
33
- export declare const useTeamContainersHook: HookFunction<State, BoundActions<State, {
34
- fetchTeamContainers: (teamId: string, fireAnalytics: (action: string, actionSubject: string, error?: Error) => void, fireAnalyticsNext: ReturnType<typeof useAnalyticsEventsNext>['fireEvent']) => Action<State>;
35
- refetchTeamContainers: (teamId: string, fireAnalytics: (action: string, actionSubject: string, error?: Error) => void, fireAnalyticsNext: ReturnType<typeof useAnalyticsEventsNext>['fireEvent']) => Action<State>;
36
- fetchNumberOfConnectedTeams: (teamId: string, containerId: string, fireAnalytics: (props: FireAnalyticsProps) => void, fireAnalyticsNext: ReturnType<typeof useAnalyticsEventsNext>['fireEvent']) => Action<State>;
37
- fetchConnectedTeams: (teamId: string, containerId: string, fireAnalytics: (props: FireAnalyticsProps) => void, fireAnalyticsNext: ReturnType<typeof useAnalyticsEventsNext>['fireEvent']) => Action<State>;
38
- unlinkTeamContainers: (teamId: string, containerId: string) => Action<State>;
39
- addTeamContainer: (teamId: string, teamContainer: TeamContainer) => Action<State>;
40
- }>, void>;
41
- export declare const useTeamContainers: (teamId: string, enable?: boolean) => {
42
- teamContainers: TeamContainers;
43
- loading: boolean;
44
- hasLoaded: boolean;
45
- error: Error | null;
46
- unlinkError: UnlinkContainerMutationError | null;
47
- teamId: string | null;
48
- connectedTeams: ConnectedTeams;
49
- addTeamContainer: (teamContainer: TeamContainer) => void | Promise<void>;
50
- unlinkTeamContainers: (containerId: string) => void | Promise<void>;
51
- refetchTeamContainers: () => Promise<void>;
52
- };
53
- export declare const useConnectedTeams: (teamId: string) => {
54
- fetchNumberOfConnectedTeams: (containerId: string) => void | Promise<void>;
55
- fetchConnectedTeams: (containerId: string) => void | Promise<void>;
56
- containerId: string | undefined;
57
- isLoading: boolean;
58
- hasLoaded: boolean;
59
- teams: TeamWithMemberships[] | undefined;
60
- error: Error | null;
61
- numberOfTeams: number | undefined;
62
- };
63
- export {};
@@ -1,18 +0,0 @@
1
- import { type NewTeamWebLink, type TeamContainer } from '../../../common/types';
2
- export type UseTeamLinksAndContainersResult = {
3
- isLoading: boolean;
4
- hasError: boolean;
5
- containersError: boolean;
6
- webLinksError: boolean;
7
- webLinksHasLoaded: boolean;
8
- containersHasLoaded: boolean;
9
- hasLoaded: boolean;
10
- teamLinks: TeamContainer[];
11
- canAddMoreLink: boolean;
12
- iconsLoading: boolean;
13
- iconHasLoaded: boolean;
14
- addTeamLink: (containerOrWebLink: TeamContainer | NewTeamWebLink) => Promise<any>;
15
- updateTeamLinkById: (linkId: string, updatedFields: Partial<NewTeamWebLink>) => Promise<any>;
16
- removeTeamLink: (container: TeamContainer) => Promise<void>;
17
- };
18
- export declare const useTeamLinksAndContainers: (teamId: string, enableContainers?: boolean) => UseTeamLinksAndContainersResult;
@@ -1,165 +0,0 @@
1
- import { type BoundActions, type HookReturnValue } from 'react-sweet-state';
2
- import type { TeamLink } from '@atlaskit/teams-client/types';
3
- import { type NewTeamWebLink, type TeamWebLink } from '../../../common/types';
4
- import { type StoreApi, type TeamLinkIconData, type TeamWebLinksState } from './types';
5
- export declare const actions: {
6
- getTeamWebLinks: (teamId: string) => ({ getState, setState, dispatch }: StoreApi) => Promise<void>;
7
- getTeamWebLinkIcons: (teamId: string) => ({ getState, setState }: StoreApi) => Promise<void>;
8
- createTeamWebLink: (teamId: string, newLink: NewTeamWebLink) => ({ getState, setState, dispatch }: StoreApi) => Promise<TeamLink>;
9
- updateTeamWebLink: (teamId: string, linkId: string, newLink: NewTeamWebLink) => ({ getState, setState, dispatch }: StoreApi) => Promise<TeamLink>;
10
- removeWebLink: (teamId: string, linkId: string) => ({ getState, setState }: StoreApi) => Promise<void>;
11
- fetchWebLinkTitle: (url: string) => ({ setState }: StoreApi) => Promise<string | undefined>;
12
- initialState: (state: Partial<TeamWebLinksState>) => ({ setState }: StoreApi) => void;
13
- };
14
- export declare const useTeamWebLinks: (teamId?: string) => HookReturnValue<TeamWebLinksState, BoundActions<TeamWebLinksState, {
15
- getTeamWebLinks: (teamId: string) => ({ getState, setState, dispatch }: StoreApi) => Promise<void>;
16
- getTeamWebLinkIcons: (teamId: string) => ({ getState, setState }: StoreApi) => Promise<void>;
17
- createTeamWebLink: (teamId: string, newLink: NewTeamWebLink) => ({ getState, setState, dispatch }: StoreApi) => Promise<TeamLink>;
18
- updateTeamWebLink: (teamId: string, linkId: string, newLink: NewTeamWebLink) => ({ getState, setState, dispatch }: StoreApi) => Promise<TeamLink>;
19
- removeWebLink: (teamId: string, linkId: string) => ({ getState, setState }: StoreApi) => Promise<void>;
20
- fetchWebLinkTitle: (url: string) => ({ setState }: StoreApi) => Promise<string | undefined>;
21
- initialState: (state: Partial<TeamWebLinksState>) => ({ setState }: StoreApi) => void;
22
- }>>;
23
- export declare const useTeamWebLinksActions: () => HookReturnValue<{
24
- teams: Record<string, {
25
- isLoading: boolean;
26
- hasLoaded: boolean;
27
- hasError: boolean;
28
- errorType: Error | null;
29
- shouldReload: boolean;
30
- links: TeamWebLink[];
31
- linkIcons: TeamLinkIconData[];
32
- iconsLoading: boolean;
33
- iconsError: boolean;
34
- iconHasLoaded: boolean;
35
- }>;
36
- currentTeamId: string;
37
- }, BoundActions<{
38
- teams: Record<string, {
39
- isLoading: boolean;
40
- hasLoaded: boolean;
41
- hasError: boolean;
42
- errorType: Error | null;
43
- shouldReload: boolean;
44
- links: TeamWebLink[];
45
- linkIcons: TeamLinkIconData[];
46
- iconsLoading: boolean;
47
- iconsError: boolean;
48
- iconHasLoaded: boolean;
49
- }>;
50
- currentTeamId: string;
51
- }, {
52
- getTeamWebLinks: (teamId: string) => ({ getState, setState, dispatch, }: StoreApi<{
53
- teams: Record<string, {
54
- isLoading: boolean;
55
- hasLoaded: boolean;
56
- hasError: boolean;
57
- errorType: Error | null;
58
- shouldReload: boolean;
59
- links: TeamWebLink[];
60
- linkIcons: TeamLinkIconData[];
61
- iconsLoading: boolean;
62
- iconsError: boolean;
63
- iconHasLoaded: boolean;
64
- }>;
65
- currentTeamId: string;
66
- }>) => Promise<void>;
67
- getTeamWebLinkIcons: (teamId: string) => ({ getState, setState, }: StoreApi<{
68
- teams: Record<string, {
69
- isLoading: boolean;
70
- hasLoaded: boolean;
71
- hasError: boolean;
72
- errorType: Error | null;
73
- shouldReload: boolean;
74
- links: TeamWebLink[];
75
- linkIcons: TeamLinkIconData[];
76
- iconsLoading: boolean;
77
- iconsError: boolean;
78
- iconHasLoaded: boolean;
79
- }>;
80
- currentTeamId: string;
81
- }>) => Promise<void>;
82
- createTeamWebLink: (teamId: string, newLink: NewTeamWebLink) => ({ getState, setState, dispatch, }: StoreApi<{
83
- teams: Record<string, {
84
- isLoading: boolean;
85
- hasLoaded: boolean;
86
- hasError: boolean;
87
- errorType: Error | null;
88
- shouldReload: boolean;
89
- links: TeamWebLink[];
90
- linkIcons: TeamLinkIconData[];
91
- iconsLoading: boolean;
92
- iconsError: boolean;
93
- iconHasLoaded: boolean;
94
- }>;
95
- currentTeamId: string;
96
- }>) => Promise<TeamLink>;
97
- updateTeamWebLink: (teamId: string, linkId: string, newLink: NewTeamWebLink) => ({ getState, setState, dispatch, }: StoreApi<{
98
- teams: Record<string, {
99
- isLoading: boolean;
100
- hasLoaded: boolean;
101
- hasError: boolean;
102
- errorType: Error | null;
103
- shouldReload: boolean;
104
- links: TeamWebLink[];
105
- linkIcons: TeamLinkIconData[];
106
- iconsLoading: boolean;
107
- iconsError: boolean;
108
- iconHasLoaded: boolean;
109
- }>;
110
- currentTeamId: string;
111
- }>) => Promise<TeamLink>;
112
- removeWebLink: (teamId: string, linkId: string) => ({ getState, setState, }: StoreApi<{
113
- teams: Record<string, {
114
- isLoading: boolean;
115
- hasLoaded: boolean;
116
- hasError: boolean;
117
- errorType: Error | null;
118
- shouldReload: boolean;
119
- links: TeamWebLink[];
120
- linkIcons: TeamLinkIconData[];
121
- iconsLoading: boolean;
122
- iconsError: boolean;
123
- iconHasLoaded: boolean;
124
- }>;
125
- currentTeamId: string;
126
- }>) => Promise<void>;
127
- fetchWebLinkTitle: (url: string) => ({ setState, }: StoreApi<{
128
- teams: Record<string, {
129
- isLoading: boolean;
130
- hasLoaded: boolean;
131
- hasError: boolean;
132
- errorType: Error | null;
133
- shouldReload: boolean;
134
- links: TeamWebLink[];
135
- linkIcons: TeamLinkIconData[];
136
- iconsLoading: boolean;
137
- iconsError: boolean;
138
- iconHasLoaded: boolean;
139
- }>;
140
- currentTeamId: string;
141
- }>) => Promise<string | undefined>;
142
- initialState: () => ({ setState, }: StoreApi<{
143
- teams: Record<string, {
144
- isLoading: boolean;
145
- hasLoaded: boolean;
146
- hasError: boolean;
147
- errorType: Error | null;
148
- shouldReload: boolean;
149
- links: TeamWebLink[];
150
- linkIcons: TeamLinkIconData[];
151
- iconsLoading: boolean;
152
- iconsError: boolean;
153
- iconHasLoaded: boolean;
154
- }>;
155
- currentTeamId: string;
156
- }>) => void;
157
- }>> | HookReturnValue<TeamWebLinksState, BoundActions<TeamWebLinksState, {
158
- getTeamWebLinks: (teamId: string) => ({ getState, setState, dispatch }: StoreApi) => Promise<void>;
159
- getTeamWebLinkIcons: (teamId: string) => ({ getState, setState }: StoreApi) => Promise<void>;
160
- createTeamWebLink: (teamId: string, newLink: NewTeamWebLink) => ({ getState, setState, dispatch }: StoreApi) => Promise<TeamLink>;
161
- updateTeamWebLink: (teamId: string, linkId: string, newLink: NewTeamWebLink) => ({ getState, setState, dispatch }: StoreApi) => Promise<TeamLink>;
162
- removeWebLink: (teamId: string, linkId: string) => ({ getState, setState }: StoreApi) => Promise<void>;
163
- fetchWebLinkTitle: (url: string) => ({ setState }: StoreApi) => Promise<string | undefined>;
164
- initialState: (state: Partial<TeamWebLinksState>) => ({ setState }: StoreApi) => void;
165
- }>>;