@atlaskit/teams-public 0.72.1 → 0.72.2

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,13 @@
1
1
  # @atlaskit/teams-public
2
2
 
3
+ ## 0.72.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`fd9cfb7fca5c6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fd9cfb7fca5c6) -
8
+ Internal changes to remove unnecessary token fallbacks and imports from `@atlaskit/theme`
9
+ - Updated dependencies
10
+
3
11
  ## 0.72.1
4
12
 
5
13
  ### Patch Changes
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useSpaceInviteScheduler = void 0;
7
+ var _react = require("react");
8
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
+ var _spaceInviteScheduler = require("../utils/spaceInviteScheduler");
10
+ /**
11
+ * Registers `visibilitychange` and `beforeunload` listeners that flush all
12
+ * pending scheduled invites when the page is being torn down. On unmount the
13
+ * listeners are removed and any remaining pending invites are flushed.
14
+ *
15
+ * Call this once in a long-lived component (e.g. the Team Links sidebar) so
16
+ * that listeners survive popup open/close cycles. Consumers that need to
17
+ * schedule or cancel invites should import `spaceInviteScheduler` directly.
18
+ */
19
+ var useSpaceInviteScheduler = exports.useSpaceInviteScheduler = function useSpaceInviteScheduler() {
20
+ (0, _react.useEffect)(function () {
21
+ if (!(0, _platformFeatureFlags.fg)('space-team_linking_invites_fg')) {
22
+ return;
23
+ }
24
+ var onVisibilityChange = function onVisibilityChange() {
25
+ if (document.visibilityState === 'hidden') {
26
+ _spaceInviteScheduler.spaceInviteScheduler.flushAll();
27
+ }
28
+ };
29
+ var onBeforeUnload = function onBeforeUnload() {
30
+ _spaceInviteScheduler.spaceInviteScheduler.flushAll();
31
+ };
32
+ document.addEventListener('visibilitychange', onVisibilityChange);
33
+ window.addEventListener('beforeunload', onBeforeUnload);
34
+ return function () {
35
+ document.removeEventListener('visibilitychange', onVisibilityChange);
36
+ window.removeEventListener('beforeunload', onBeforeUnload);
37
+ _spaceInviteScheduler.spaceInviteScheduler.flushAll();
38
+ };
39
+ }, []);
40
+ };
@@ -14,7 +14,7 @@ exports.spaceInviteScheduler = void 0;
14
14
  * the global scope — a simple in-memory workaround is sufficient here.
15
15
  */
16
16
 
17
- var DEBOUNCE_MS = 30000;
17
+ var DEBOUNCE_MS = 15000;
18
18
  var pending = new Map();
19
19
 
20
20
  // Callers pass IDs in different formats — the teams package passes full ARIs
@@ -36,6 +36,7 @@ var spaceInviteScheduler = exports.spaceInviteScheduler = {
36
36
  clearTimeout(existing.timeoutId);
37
37
  }
38
38
  pending.set(key, {
39
+ callback: callback,
39
40
  timeoutId: setTimeout(function () {
40
41
  pending.delete(key);
41
42
  callback();
@@ -49,5 +50,21 @@ var spaceInviteScheduler = exports.spaceInviteScheduler = {
49
50
  clearTimeout(existing.timeoutId);
50
51
  pending.delete(key);
51
52
  }
53
+ },
54
+ /**
55
+ * Immediately fires all pending callbacks and clears the queue.
56
+ * Called automatically on page unload (visibilitychange / beforeunload)
57
+ * so that debounced invites are not lost when the user navigates away.
58
+ *
59
+ * Important: callbacks invoked during page teardown must use
60
+ * `fetch({ keepalive: true })` or `navigator.sendBeacon` — a regular
61
+ * `fetch` without `keepalive` may be cancelled by the browser.
62
+ */
63
+ flushAll: function flushAll() {
64
+ pending.forEach(function (entry) {
65
+ clearTimeout(entry.timeoutId);
66
+ entry.callback();
67
+ });
68
+ pending.clear();
52
69
  }
53
70
  };
@@ -18,7 +18,6 @@ var _primitives = require("@atlaskit/primitives");
18
18
  var _compiled = require("@atlaskit/primitives/compiled");
19
19
  var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
20
20
  var _teamsAppInternalProductPermissions = require("@atlaskit/teams-app-internal-product-permissions");
21
- var _colors = require("@atlaskit/theme/colors");
22
21
  var _teamContainersSkeleton = require("../../common/ui/team-containers-skeleton");
23
22
  var _spaceInviteScheduler = require("../../common/utils/spaceInviteScheduler");
24
23
  var _controllers = require("../../controllers");
@@ -34,8 +33,8 @@ var _teamLinkCard = require("./team-link-card");
34
33
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
35
34
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
36
35
 
37
- var ICON_BACKGROUND = exports.ICON_BACKGROUND = "var(--ds-icon-inverse, ".concat(_colors.N0, ")");
38
- var ICON_COLOR = exports.ICON_COLOR = "var(--ds-icon-subtle, ".concat(_colors.N90, ")");
36
+ var ICON_BACKGROUND = exports.ICON_BACKGROUND = "var(--ds-icon-inverse, #FFFFFF)";
37
+ var ICON_COLOR = exports.ICON_COLOR = "var(--ds-icon-subtle, #505258)";
39
38
  var MAX_NUMBER_OF_CONTAINERS_TO_SHOW = exports.MAX_NUMBER_OF_CONTAINERS_TO_SHOW = 4;
40
39
  var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
41
40
  var teamId = _ref.teamId,
@@ -0,0 +1,35 @@
1
+ import { useEffect } from 'react';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
3
+ import { spaceInviteScheduler } from '../utils/spaceInviteScheduler';
4
+
5
+ /**
6
+ * Registers `visibilitychange` and `beforeunload` listeners that flush all
7
+ * pending scheduled invites when the page is being torn down. On unmount the
8
+ * listeners are removed and any remaining pending invites are flushed.
9
+ *
10
+ * Call this once in a long-lived component (e.g. the Team Links sidebar) so
11
+ * that listeners survive popup open/close cycles. Consumers that need to
12
+ * schedule or cancel invites should import `spaceInviteScheduler` directly.
13
+ */
14
+ export const useSpaceInviteScheduler = () => {
15
+ useEffect(() => {
16
+ if (!fg('space-team_linking_invites_fg')) {
17
+ return;
18
+ }
19
+ const onVisibilityChange = () => {
20
+ if (document.visibilityState === 'hidden') {
21
+ spaceInviteScheduler.flushAll();
22
+ }
23
+ };
24
+ const onBeforeUnload = () => {
25
+ spaceInviteScheduler.flushAll();
26
+ };
27
+ document.addEventListener('visibilitychange', onVisibilityChange);
28
+ window.addEventListener('beforeunload', onBeforeUnload);
29
+ return () => {
30
+ document.removeEventListener('visibilitychange', onVisibilityChange);
31
+ window.removeEventListener('beforeunload', onBeforeUnload);
32
+ spaceInviteScheduler.flushAll();
33
+ };
34
+ }, []);
35
+ };
@@ -8,7 +8,7 @@
8
8
  * the global scope — a simple in-memory workaround is sufficient here.
9
9
  */
10
10
 
11
- const DEBOUNCE_MS = 30_000;
11
+ const DEBOUNCE_MS = 15_000;
12
12
  const pending = new Map();
13
13
 
14
14
  // Callers pass IDs in different formats — the teams package passes full ARIs
@@ -28,6 +28,7 @@ export const spaceInviteScheduler = {
28
28
  clearTimeout(existing.timeoutId);
29
29
  }
30
30
  pending.set(key, {
31
+ callback,
31
32
  timeoutId: setTimeout(() => {
32
33
  pending.delete(key);
33
34
  callback();
@@ -41,5 +42,21 @@ export const spaceInviteScheduler = {
41
42
  clearTimeout(existing.timeoutId);
42
43
  pending.delete(key);
43
44
  }
45
+ },
46
+ /**
47
+ * Immediately fires all pending callbacks and clears the queue.
48
+ * Called automatically on page unload (visibilitychange / beforeunload)
49
+ * so that debounced invites are not lost when the user navigates away.
50
+ *
51
+ * Important: callbacks invoked during page teardown must use
52
+ * `fetch({ keepalive: true })` or `navigator.sendBeacon` — a regular
53
+ * `fetch` without `keepalive` may be cancelled by the browser.
54
+ */
55
+ flushAll: () => {
56
+ pending.forEach(entry => {
57
+ clearTimeout(entry.timeoutId);
58
+ entry.callback();
59
+ });
60
+ pending.clear();
44
61
  }
45
62
  };
@@ -8,7 +8,6 @@ import { Grid } from '@atlaskit/primitives';
8
8
  import { Inline, Stack } from '@atlaskit/primitives/compiled';
9
9
  import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
10
10
  import { hasProductPermission, useProductPermissions } from '@atlaskit/teams-app-internal-product-permissions';
11
- import { N0, N90 } from '@atlaskit/theme/colors';
12
11
  import { TeamContainersSkeleton } from '../../common/ui/team-containers-skeleton';
13
12
  import { spaceInviteScheduler } from '../../common/utils/spaceInviteScheduler';
14
13
  import { hasProductPermission as hasProductPermissionOld } from '../../controllers';
@@ -21,8 +20,8 @@ import { getAddContainerCards } from './add-container-card';
21
20
  import { DisconnectDialogLazy } from './disconnect-dialog/async';
22
21
  import { NoProductAccessState } from './no-product-access-empty-state';
23
22
  import { TeamLinkCard } from './team-link-card';
24
- export const ICON_BACKGROUND = `var(--ds-icon-inverse, ${N0})`;
25
- export const ICON_COLOR = `var(--ds-icon-subtle, ${N90})`;
23
+ export const ICON_BACKGROUND = "var(--ds-icon-inverse, #FFFFFF)";
24
+ export const ICON_COLOR = "var(--ds-icon-subtle, #505258)";
26
25
  export const MAX_NUMBER_OF_CONTAINERS_TO_SHOW = 4;
27
26
  export const TeamContainers = ({
28
27
  teamId,
@@ -0,0 +1,35 @@
1
+ import { useEffect } from 'react';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
3
+ import { spaceInviteScheduler } from '../utils/spaceInviteScheduler';
4
+
5
+ /**
6
+ * Registers `visibilitychange` and `beforeunload` listeners that flush all
7
+ * pending scheduled invites when the page is being torn down. On unmount the
8
+ * listeners are removed and any remaining pending invites are flushed.
9
+ *
10
+ * Call this once in a long-lived component (e.g. the Team Links sidebar) so
11
+ * that listeners survive popup open/close cycles. Consumers that need to
12
+ * schedule or cancel invites should import `spaceInviteScheduler` directly.
13
+ */
14
+ export var useSpaceInviteScheduler = function useSpaceInviteScheduler() {
15
+ useEffect(function () {
16
+ if (!fg('space-team_linking_invites_fg')) {
17
+ return;
18
+ }
19
+ var onVisibilityChange = function onVisibilityChange() {
20
+ if (document.visibilityState === 'hidden') {
21
+ spaceInviteScheduler.flushAll();
22
+ }
23
+ };
24
+ var onBeforeUnload = function onBeforeUnload() {
25
+ spaceInviteScheduler.flushAll();
26
+ };
27
+ document.addEventListener('visibilitychange', onVisibilityChange);
28
+ window.addEventListener('beforeunload', onBeforeUnload);
29
+ return function () {
30
+ document.removeEventListener('visibilitychange', onVisibilityChange);
31
+ window.removeEventListener('beforeunload', onBeforeUnload);
32
+ spaceInviteScheduler.flushAll();
33
+ };
34
+ }, []);
35
+ };
@@ -8,7 +8,7 @@
8
8
  * the global scope — a simple in-memory workaround is sufficient here.
9
9
  */
10
10
 
11
- var DEBOUNCE_MS = 30000;
11
+ var DEBOUNCE_MS = 15000;
12
12
  var pending = new Map();
13
13
 
14
14
  // Callers pass IDs in different formats — the teams package passes full ARIs
@@ -30,6 +30,7 @@ export var spaceInviteScheduler = {
30
30
  clearTimeout(existing.timeoutId);
31
31
  }
32
32
  pending.set(key, {
33
+ callback: callback,
33
34
  timeoutId: setTimeout(function () {
34
35
  pending.delete(key);
35
36
  callback();
@@ -43,5 +44,21 @@ export var spaceInviteScheduler = {
43
44
  clearTimeout(existing.timeoutId);
44
45
  pending.delete(key);
45
46
  }
47
+ },
48
+ /**
49
+ * Immediately fires all pending callbacks and clears the queue.
50
+ * Called automatically on page unload (visibilitychange / beforeunload)
51
+ * so that debounced invites are not lost when the user navigates away.
52
+ *
53
+ * Important: callbacks invoked during page teardown must use
54
+ * `fetch({ keepalive: true })` or `navigator.sendBeacon` — a regular
55
+ * `fetch` without `keepalive` may be cancelled by the browser.
56
+ */
57
+ flushAll: function flushAll() {
58
+ pending.forEach(function (entry) {
59
+ clearTimeout(entry.timeoutId);
60
+ entry.callback();
61
+ });
62
+ pending.clear();
46
63
  }
47
64
  };
@@ -11,7 +11,6 @@ import { Grid } from '@atlaskit/primitives';
11
11
  import { Inline, Stack } from '@atlaskit/primitives/compiled';
12
12
  import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
13
13
  import { hasProductPermission, useProductPermissions } from '@atlaskit/teams-app-internal-product-permissions';
14
- import { N0, N90 } from '@atlaskit/theme/colors';
15
14
  import { TeamContainersSkeleton } from '../../common/ui/team-containers-skeleton';
16
15
  import { spaceInviteScheduler } from '../../common/utils/spaceInviteScheduler';
17
16
  import { hasProductPermission as hasProductPermissionOld } from '../../controllers';
@@ -24,8 +23,8 @@ import { getAddContainerCards } from './add-container-card';
24
23
  import { DisconnectDialogLazy } from './disconnect-dialog/async';
25
24
  import { NoProductAccessState } from './no-product-access-empty-state';
26
25
  import { TeamLinkCard } from './team-link-card';
27
- export var ICON_BACKGROUND = "var(--ds-icon-inverse, ".concat(N0, ")");
28
- export var ICON_COLOR = "var(--ds-icon-subtle, ".concat(N90, ")");
26
+ export var ICON_BACKGROUND = "var(--ds-icon-inverse, #FFFFFF)";
27
+ export var ICON_COLOR = "var(--ds-icon-subtle, #505258)";
29
28
  export var MAX_NUMBER_OF_CONTAINERS_TO_SHOW = 4;
30
29
  export var TeamContainers = function TeamContainers(_ref) {
31
30
  var teamId = _ref.teamId,
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Registers `visibilitychange` and `beforeunload` listeners that flush all
3
+ * pending scheduled invites when the page is being torn down. On unmount the
4
+ * listeners are removed and any remaining pending invites are flushed.
5
+ *
6
+ * Call this once in a long-lived component (e.g. the Team Links sidebar) so
7
+ * that listeners survive popup open/close cycles. Consumers that need to
8
+ * schedule or cancel invites should import `spaceInviteScheduler` directly.
9
+ */
10
+ export declare const useSpaceInviteScheduler: () => void;
@@ -10,4 +10,14 @@
10
10
  export declare const spaceInviteScheduler: {
11
11
  scheduleInvite: (teamId: string, containerId: string, callback: () => void) => void;
12
12
  cancelInvite: (teamId: string, containerId: string) => void;
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;
13
23
  };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Registers `visibilitychange` and `beforeunload` listeners that flush all
3
+ * pending scheduled invites when the page is being torn down. On unmount the
4
+ * listeners are removed and any remaining pending invites are flushed.
5
+ *
6
+ * Call this once in a long-lived component (e.g. the Team Links sidebar) so
7
+ * that listeners survive popup open/close cycles. Consumers that need to
8
+ * schedule or cancel invites should import `spaceInviteScheduler` directly.
9
+ */
10
+ export declare const useSpaceInviteScheduler: () => void;
@@ -10,4 +10,14 @@
10
10
  export declare const spaceInviteScheduler: {
11
11
  scheduleInvite: (teamId: string, containerId: string, callback: () => void) => void;
12
12
  cancelInvite: (teamId: string, containerId: string) => void;
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;
13
23
  };
package/package.json CHANGED
@@ -25,27 +25,26 @@
25
25
  "atlaskit:src": "src/index.ts",
26
26
  "dependencies": {
27
27
  "@atlaskit/afm-i18n-platform-people-and-teams-teams-public": "2.39.0",
28
- "@atlaskit/analytics-next": "^11.1.0",
29
- "@atlaskit/avatar": "^25.10.0",
28
+ "@atlaskit/analytics-next": "^11.2.0",
29
+ "@atlaskit/avatar": "^25.11.0",
30
30
  "@atlaskit/button": "^23.10.0",
31
31
  "@atlaskit/css": "^0.19.0",
32
- "@atlaskit/dropdown-menu": "^16.7.0",
32
+ "@atlaskit/dropdown-menu": "^16.8.0",
33
33
  "@atlaskit/feature-gate-js-client": "^5.5.0",
34
34
  "@atlaskit/heading": "^5.3.0",
35
- "@atlaskit/icon": "^33.0.0",
35
+ "@atlaskit/icon": "^34.0.0",
36
36
  "@atlaskit/image": "^3.0.0",
37
37
  "@atlaskit/link": "^3.3.0",
38
- "@atlaskit/modal-dialog": "^14.11.0",
38
+ "@atlaskit/modal-dialog": "^14.14.0",
39
39
  "@atlaskit/people-teams-ui-public": "^3.7.0",
40
40
  "@atlaskit/platform-feature-flags": "^1.1.0",
41
- "@atlaskit/primitives": "^18.0.0",
41
+ "@atlaskit/primitives": "^18.1.0",
42
42
  "@atlaskit/skeleton": "^2.1.0",
43
43
  "@atlaskit/teams-app-internal-analytics": "^1.27.0",
44
- "@atlaskit/teams-app-internal-product-permissions": "^1.2.0",
44
+ "@atlaskit/teams-app-internal-product-permissions": "^1.3.0",
45
45
  "@atlaskit/teams-client": "^4.30.0",
46
- "@atlaskit/theme": "^22.0.0",
47
- "@atlaskit/tokens": "^11.1.0",
48
- "@atlaskit/tooltip": "^21.0.0",
46
+ "@atlaskit/tokens": "^11.4.0",
47
+ "@atlaskit/tooltip": "^21.1.0",
49
48
  "@babel/runtime": "^7.0.0",
50
49
  "@compiled/react": "^0.20.0",
51
50
  "@types/string-hash": "^1.1.3",
@@ -64,10 +63,10 @@
64
63
  "@af/integration-testing": "workspace:^",
65
64
  "@af/visual-regression": "workspace:^",
66
65
  "@atlaskit/ssr": "workspace:^",
67
- "@atlassian/a11y-jest-testing": "^0.10.0",
66
+ "@atlassian/a11y-jest-testing": "^0.11.0",
68
67
  "@atlassian/feature-flags-test-utils": "^1.0.0",
69
68
  "@atlassian/ptc-test-utils": "^0.12.0",
70
- "@atlassian/testing-library": "^0.4.0",
69
+ "@atlassian/testing-library": "^0.5.0",
71
70
  "@testing-library/react": "^16.3.0",
72
71
  "@testing-library/user-event": "^14.4.3",
73
72
  "react-dom": "^18.2.0"
@@ -107,7 +106,7 @@
107
106
  }
108
107
  },
109
108
  "name": "@atlaskit/teams-public",
110
- "version": "0.72.1",
109
+ "version": "0.72.2",
111
110
  "description": "Public components related to teams",
112
111
  "author": "Atlassian Pty Ltd",
113
112
  "license": "Apache-2.0",
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/teams-public/space-invite-scheduler",
3
+ "main": "../dist/cjs/common/hooks/useSpaceInviteScheduler.js",
4
+ "module": "../dist/esm/common/hooks/useSpaceInviteScheduler.js",
5
+ "module:es2019": "../dist/es2019/common/hooks/useSpaceInviteScheduler.js",
6
+ "sideEffects": [
7
+ "*.compiled.css"
8
+ ],
9
+ "types": "../dist/types/common/hooks/useSpaceInviteScheduler.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.9": {
12
+ "*": [
13
+ "../dist/types-ts4.5/common/hooks/useSpaceInviteScheduler.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }