@atlaskit/teams-app-internal-popup-adaptor 1.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  ## 1.1.0
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
8
+ Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
9
+
10
+ Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
11
+
12
+ Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
13
+
14
+ ```diff
15
+ - "typesVersions": {
16
+ - ">=4.5 <4.9": {
17
+ - "*": [
18
+ - "dist/types-ts4.5/*",
19
+ - "dist/types-ts4.5/index.d.ts"
20
+ - ]
21
+ - }
22
+ - },
23
+ ```
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+
3
29
  ### Minor Changes
4
30
 
5
31
  - [`780c4e073e406`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/780c4e073e406) -
@@ -87,7 +87,9 @@ test('schedule replaces an in-flight timer rather than stacking it', () => {
87
87
  test('unmounting clears any pending timer', () => {
88
88
  const callback = jest.fn();
89
89
 
90
- const { unmount } = render(<HoverDelayTrigger callback={callback} delay={100} action="schedule" />);
90
+ const { unmount } = render(
91
+ <HoverDelayTrigger callback={callback} delay={100} action="schedule" />,
92
+ );
91
93
 
92
94
  unmount();
93
95
 
@@ -1,8 +1,4 @@
1
- import {
2
- getChildPortalFromParentPopup,
3
- hasRelatedTarget,
4
- isMovingToKudos,
5
- } from '../../src/utils';
1
+ import { getChildPortalFromParentPopup, hasRelatedTarget, isMovingToKudos } from '../../src/utils';
6
2
 
7
3
  const buildEventWithRelatedTarget = (relatedTarget: EventTarget | null): Event => {
8
4
  return new MouseEvent('mouseleave', { relatedTarget } as MouseEventInit);
package/package.json CHANGED
@@ -7,21 +7,13 @@
7
7
  "module": "dist/esm/index.js",
8
8
  "module:es2019": "dist/es2019/index.js",
9
9
  "types": "dist/types/index.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "dist/types-ts4.5/*",
14
- "dist/types-ts4.5/index.d.ts"
15
- ]
16
- }
17
- },
18
10
  "sideEffects": [
19
11
  "*.compiled.css"
20
12
  ],
21
13
  "atlaskit:src": "src/PopupTriggerWithHover.tsx",
22
14
  "dependencies": {
23
- "@atlaskit/popup": "^4.19.0",
24
- "@atlaskit/spinner": "^19.1.0",
15
+ "@atlaskit/popup": "^5.0.0",
16
+ "@atlaskit/spinner": "^20.0.0",
25
17
  "@atlassian/entry-point-types": "^0.0.0",
26
18
  "@atlassian/internal-entry-point-container": "^1.1.0",
27
19
  "@atlassian/react-async": "^0.21.0",
@@ -37,7 +29,8 @@
37
29
  },
38
30
  "devDependencies": {
39
31
  "@atlassian/feature-flags-test-utils": "^1.1.0",
40
- "@atlassian/testing-library": "^0.5.0",
32
+ "@atlassian/testing-library": "^0.6.0",
33
+ "react": "^18.2.0",
41
34
  "react-dom": "^18.2.0",
42
35
  "relay-test-utils": "^20.1.1"
43
36
  },
@@ -71,7 +64,7 @@
71
64
  }
72
65
  },
73
66
  "name": "@atlaskit/teams-app-internal-popup-adaptor",
74
- "version": "1.1.0",
67
+ "version": "2.0.0",
75
68
  "description": "Internal popup trigger adapter shared by People and Teams profile card packages (hover/click/preload behavior)",
76
69
  "author": "Atlassian Pty Ltd",
77
70
  "publishConfig": {
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/PopupTriggerWithHover.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/PopupTriggerWithHover.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/PopupTriggerWithHover.d.ts"
17
10
  }
package/tsconfig.app.json CHANGED
@@ -40,6 +40,21 @@
40
40
  "references": [
41
41
  {
42
42
  "path": "../../design-system/popup/tsconfig.app.json"
43
+ },
44
+ {
45
+ "path": "../../design-system/spinner/tsconfig.app.json"
46
+ },
47
+ {
48
+ "path": "../../entry-points/entry-point-types/tsconfig.app.json"
49
+ },
50
+ {
51
+ "path": "../../entry-points/internal-entry-point-container/tsconfig.app.json"
52
+ },
53
+ {
54
+ "path": "../../async/react-async/tsconfig.app.json"
55
+ },
56
+ {
57
+ "path": "../../relay/relay-environment-provider/tsconfig.app.json"
43
58
  }
44
59
  ],
45
60
  "files": []
package/tsconfig.dev.json CHANGED
@@ -40,6 +40,9 @@
40
40
  "references": [
41
41
  {
42
42
  "path": "./tsconfig.app.json"
43
+ },
44
+ {
45
+ "path": "../../platform/testing-library/tsconfig.app.json"
43
46
  }
44
47
  ]
45
48
  }
@@ -1,28 +0,0 @@
1
- import React, { type ReactNode } from 'react';
2
- import { type ContentProps, type PopupProps, type TriggerProps } from '@atlaskit/popup';
3
- import type { AnyEntryPoint, GetRuntimePropsFromEntryPoint, ParamsOfEntryPoint } from '@atlassian/entry-point-types';
4
- import { type ErrorCallback, type ErrorFallback } from '@atlassian/internal-entry-point-container';
5
- export type TriggerMode = 'hover' | 'click' | Array<'hover' | 'click'>;
6
- type UnionOmit<T, K extends string | number | symbol> = T extends unknown ? Omit<T, K> : never;
7
- type CustomPopupProps = UnionOmit<PopupProps, 'isOpen' | 'content'>;
8
- type EntryPointPropsType<TEntryPoint> = GetRuntimePropsFromEntryPoint<TEntryPoint>;
9
- export type PopupTriggerWithHoverProps<TEntryPoint> = {
10
- entryPoint: TEntryPoint;
11
- entryPointParams?: ParamsOfEntryPoint<TEntryPoint>;
12
- entryPointProps?: Omit<EntryPointPropsType<TEntryPoint>, 'onClose' | 'onContentResized'> & {
13
- onClose?: () => void;
14
- onContentResized?: ContentProps['update'];
15
- };
16
- errorFallback?: ErrorFallback;
17
- fallback?: ReactNode;
18
- forcedReportErrorUFO?: boolean;
19
- onError?: ErrorCallback;
20
- onOpen?: (method: 'hover' | 'click') => void;
21
- trigger: (triggerProps: TriggerProps) => ReactNode;
22
- /**
23
- * How the popup should be triggered. Defaults to `'click'` when omitted.
24
- */
25
- triggerMode?: TriggerMode;
26
- } & CustomPopupProps;
27
- export declare function PopupTriggerWithHover<TEntryPoint extends AnyEntryPoint>({ trigger, triggerMode, entryPoint, entryPointParams, entryPointProps, fallback, errorFallback, onError, forcedReportErrorUFO, onOpen, onClose, ...popupProps }: PopupTriggerWithHoverProps<TEntryPoint>): React.JSX.Element;
28
- export {};
@@ -1 +0,0 @@
1
- export { PopupTriggerWithHover, type PopupTriggerWithHoverProps, type TriggerMode, } from './PopupTriggerWithHover';
@@ -1,8 +0,0 @@
1
- /**
2
- * Hook for managing delayed hover actions with timeout management.
3
- */
4
- declare function useHoverDelay(callback: () => void, delay: number): {
5
- schedule: () => void;
6
- clear: () => void;
7
- };
8
- export { useHoverDelay };
@@ -1,19 +0,0 @@
1
- import { type MutableRefObject } from 'react';
2
- export type UseHoverTriggerRefProps = {
3
- onOpen: () => void;
4
- onClose?: () => void;
5
- isOpen?: boolean;
6
- isDisabled?: boolean;
7
- openedByRef?: MutableRefObject<'hover' | 'click' | null>;
8
- delays?: {
9
- hoverOpen?: number;
10
- hoverClose?: number;
11
- };
12
- };
13
- /**
14
- * Hover behavior for popup trigger and content with delayed open/close.
15
- */
16
- export declare function useHoverTriggerRef({ onOpen, onClose, isOpen, isDisabled, openedByRef, delays, }: UseHoverTriggerRefProps): {
17
- triggerRef: (element: HTMLElement | null) => void;
18
- contentRef: (element: HTMLElement | null) => void;
19
- };
@@ -1,13 +0,0 @@
1
- export type OnLoad<T> = (obj: {
2
- dispose: () => void;
3
- reference: T;
4
- }) => void;
5
- export type UsePreloadRefProps<T> = {
6
- load: () => T;
7
- onLoad: OnLoad<T>;
8
- };
9
- export declare function usePreloadRef<T extends {
10
- dispose: () => void;
11
- }>({ load, onLoad, }: UsePreloadRefProps<T>): ((element: HTMLElement | null) => void) & {
12
- loadAndOpen: () => void;
13
- };
@@ -1,9 +0,0 @@
1
- import { type MutableRefObject } from 'react';
2
- export type UsePressableTriggerRefProps = {
3
- onOpen: () => void;
4
- onClose?: () => void;
5
- isOpen?: boolean;
6
- isDisabled?: boolean;
7
- openedByRef?: MutableRefObject<'hover' | 'click' | null>;
8
- };
9
- export declare function usePressableTriggerRef({ onOpen, onClose, isOpen, isDisabled, openedByRef, }: UsePressableTriggerRefProps): (element: HTMLElement | null) => void;
@@ -1,16 +0,0 @@
1
- /**
2
- * Type guard to check if an event has a relatedTarget property.
3
- */
4
- declare function hasRelatedTarget(event: Event): event is Event & {
5
- relatedTarget: EventTarget | null;
6
- };
7
- /**
8
- * Checks if the mouse is moving to an atlaskit portal or kudos modal
9
- * where we should prevent the popup from closing
10
- */
11
- declare function isMovingToKudos(relatedTarget: EventTarget | null): boolean;
12
- /**
13
- * Returns the child portal if mouse is moving to a portal controlled by the parent popup.
14
- */
15
- declare function getChildPortalFromParentPopup(relatedTarget: EventTarget | null, parentPopupElement: HTMLElement | null): Element | null;
16
- export { hasRelatedTarget, isMovingToKudos, getChildPortalFromParentPopup };