Skip to content

chore(deps): update RC component dependencies #514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ coverage
yarn.lock
package-lock.json
bun.lockb
.vscode

# dumi
.umi
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/body-overflow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint no-console:0 */
import Trigger from 'rc-trigger';
import Trigger from '@rc-component/trigger';
import React from 'react';
import { createPortal } from 'react-dom';
import '../../assets/index.less';
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/case.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint no-console:0 */

import React from 'react';
import type { CSSMotionProps } from 'rc-motion';
import type { ActionType, BuildInPlacements } from 'rc-trigger';
import Trigger from 'rc-trigger';
import type { CSSMotionProps } from '@rc-component/motion';
import type { ActionType, BuildInPlacements } from '@rc-component/trigger';
import Trigger from '@rc-component/trigger';
import './case.less';

const builtinPlacements: BuildInPlacements = {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/click-nested.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint no-console:0 */

import Trigger from 'rc-trigger';
import Trigger from '@rc-component/trigger';
import React from 'react';
import '../../assets/index.less';

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/clip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint no-console:0 */
import Trigger from 'rc-trigger';
import Trigger from '@rc-component/trigger';
import React from 'react';
import '../../assets/index.less';

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/container.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint no-console:0 */
import Trigger from 'rc-trigger';
import Trigger from '@rc-component/trigger';
import React from 'react';
import '../../assets/index.less';

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/large-popup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint no-console:0 */
import Trigger from 'rc-trigger';
import Trigger from '@rc-component/trigger';
import React from 'react';
import '../../assets/index.less';

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/nested.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import React from 'react';
import ReactDOM from 'react-dom';
import Trigger from 'rc-trigger';
import Trigger from '@rc-component/trigger';
import '../../assets/index.less';

const builtinPlacements = {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/point.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint no-console:0 */

import React from 'react';
import Trigger, { ActionType } from 'rc-trigger';
import Trigger, { ActionType } from '@rc-component/trigger';
import '../../assets/index.less';
import './point.less';

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/portal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint no-console:0 */

import Trigger from 'rc-trigger';
import Trigger from '@rc-component/trigger';
import React from 'react';
import { createPortal } from 'react-dom';
import '../../assets/index.less';
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/shadow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint no-console:0 */
import Trigger from 'rc-trigger';
import Trigger from '@rc-component/trigger';
import React from 'react';
import { createRoot } from 'react-dom/client';
import '../../assets/index.less';
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/simple.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint no-console:0 */

import Trigger, { ActionType } from 'rc-trigger';
import Trigger, { ActionType } from '@rc-component/trigger';
import React from 'react';
import '../../assets/index.less';

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/static-scroll.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint no-console:0 */
import Trigger from 'rc-trigger';
import Trigger from '@rc-component/trigger';
import React from 'react';
import '../../assets/index.less';
import { builtinPlacements } from './inside';
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/visible-fallback.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint no-console:0 */
import type { AlignType, TriggerRef } from 'rc-trigger';
import Trigger from 'rc-trigger';
import type { AlignType, TriggerRef } from '@rc-component/trigger';
import Trigger from '@rc-component/trigger';
import React from 'react';
import '../../assets/index.less';

Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,14 @@
"typescript": "^5.1.6"
},
"dependencies": {
"@babel/runtime": "^7.23.2",
"@rc-component/motion": "^1.1.4",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

依赖变了,代码里也要变的~

"@rc-component/portal": "^1.1.0",
"classnames": "^2.3.2",
"rc-motion": "^2.0.0",
"rc-resize-observer": "^1.3.1",
"rc-util": "^5.44.0"
"@rc-component/resize-observer": "^1.0.0",
"@rc-component/util": "^1.2.1",
"classnames": "^2.3.2"
},
"peerDependencies": {
"react": ">=16.9.0",
"react-dom": ">=16.9.0"
}
}
}
4 changes: 2 additions & 2 deletions src/Popup/Mask.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import classNames from 'classnames';
import type { CSSMotionProps } from 'rc-motion';
import CSSMotion from 'rc-motion';
import type { CSSMotionProps } from '@rc-component/motion';
import CSSMotion from '@rc-component/motion';
import * as React from 'react';

export interface MaskProps {
Expand Down
10 changes: 5 additions & 5 deletions src/Popup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import classNames from 'classnames';
import type { CSSMotionProps } from 'rc-motion';
import CSSMotion from 'rc-motion';
import ResizeObserver from 'rc-resize-observer';
import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
import { composeRef } from 'rc-util/lib/ref';
import type { CSSMotionProps } from '@rc-component/motion';
import CSSMotion from '@rc-component/motion';
import ResizeObserver from '@rc-component/resize-observer';
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
import { composeRef } from '@rc-component/util/lib/ref';
import * as React from 'react';
import type { TriggerProps } from '../';
import type { AlignType, ArrowPos, ArrowTypeOuter } from '../interface';
Expand Down
2 changes: 1 addition & 1 deletion src/TriggerWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
getNodeRef,
supportRef,
useComposeRef,
} from 'rc-util/lib/ref';
} from '@rc-component/util/lib/ref';
import * as React from 'react';
import type { TriggerProps } from '.';

Expand Down
8 changes: 4 additions & 4 deletions src/hooks/useAlign.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isDOM } from 'rc-util/lib/Dom/findDOMNode';
import isVisible from 'rc-util/lib/Dom/isVisible';
import useEvent from 'rc-util/lib/hooks/useEvent';
import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
import { isDOM } from '@rc-component/util/lib/Dom/findDOMNode';
import isVisible from '@rc-component/util/lib/Dom/isVisible';
import useEvent from '@rc-component/util/lib/hooks/useEvent';
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
import * as React from 'react';
import type { TriggerProps } from '..';
import type {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useWatch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
import { collectScroller, getWin } from '../util';

export default function useWatch(
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useWinClick.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getShadowRoot } from 'rc-util/lib/Dom/shadow';
import { warning } from 'rc-util/lib/warning';
import { getShadowRoot } from '@rc-component/util/lib/Dom/shadow';
import { warning } from '@rc-component/util/lib/warning';
import * as React from 'react';
import { getWin } from '../util';

Expand Down
16 changes: 8 additions & 8 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import Portal from '@rc-component/portal';
import classNames from 'classnames';
import type { CSSMotionProps } from 'rc-motion';
import ResizeObserver from 'rc-resize-observer';
import { isDOM } from 'rc-util/lib/Dom/findDOMNode';
import { getShadowRoot } from 'rc-util/lib/Dom/shadow';
import useEvent from 'rc-util/lib/hooks/useEvent';
import useId from 'rc-util/lib/hooks/useId';
import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
import isMobile from 'rc-util/lib/isMobile';
import type { CSSMotionProps } from '@rc-component/motion';
import ResizeObserver from '@rc-component/resize-observer';
import { isDOM } from '@rc-component/util/lib/Dom/findDOMNode';
import { getShadowRoot } from '@rc-component/util/lib/Dom/shadow';
import useEvent from '@rc-component/util/lib/hooks/useEvent';
import useId from '@rc-component/util/lib/hooks/useId';
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
import isMobile from '@rc-component/util/lib/isMobile';
import * as React from 'react';
import Popup from './Popup';
import TriggerWrapper from './TriggerWrapper';
Expand Down
2 changes: 1 addition & 1 deletion src/interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CSSMotionProps } from 'rc-motion';
import type { CSSMotionProps } from '@rc-component/motion';

export type Placement =
| 'top'
Expand Down
4 changes: 2 additions & 2 deletions tests/align.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { act, cleanup, fireEvent, render } from '@testing-library/react';
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
import React from 'react';
import type { TriggerProps, TriggerRef } from '../src';
import Trigger from '../src';
import { awaitFakeTimer } from './util';

import { _rs } from 'rc-resize-observer';
import { _rs } from '@rc-component/resize-observer';

export const triggerResize = (target: Element) => {
act(() => {
Expand Down
2 changes: 1 addition & 1 deletion tests/arrow.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { act, cleanup, render } from '@testing-library/react';
import {
spyElementPrototype,
spyElementPrototypes,
} from 'rc-util/lib/test/domHook';
} from '@rc-component/util/lib/test/domHook';
import Trigger from '../src';

describe('Trigger.Arrow', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/basic.test.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable max-classes-per-file */

import { act, cleanup, fireEvent, render } from '@testing-library/react';
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
import React, { StrictMode, createRef } from 'react';
import ReactDOM, { createPortal } from 'react-dom';
import Trigger from '../src';
Expand Down
2 changes: 1 addition & 1 deletion tests/flip-visibleFirst.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-invalid-this */
import { act, cleanup, render } from '@testing-library/react';
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
import * as React from 'react';
import type { AlignType, TriggerProps, TriggerRef } from '../src';
import Trigger from '../src';
Expand Down
4 changes: 2 additions & 2 deletions tests/flip.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { act, cleanup, render } from '@testing-library/react';
import { _rs } from 'rc-resize-observer';
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
import { _rs } from '@rc-component/resize-observer';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
import * as React from 'react';
import type { AlignType, TriggerProps } from '../src';
import Trigger from '../src';
Expand Down
2 changes: 1 addition & 1 deletion tests/flipShift.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { act, cleanup, render } from '@testing-library/react';
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
import React from 'react';
import Trigger from '../src';

Expand Down
2 changes: 1 addition & 1 deletion tests/mask.test.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { fireEvent, render } from '@testing-library/react';
import Trigger from '../src';
import CSSMotion from 'rc-motion';
import CSSMotion from '@rc-component/motion';
import { placementAlignMap } from './util';

describe('Trigger.Mask', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/mobile.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { act, fireEvent, render } from '@testing-library/react';
import isMobile from 'rc-util/lib/isMobile';
import isMobile from '@rc-component/util/lib/isMobile';
import React from 'react';
import Trigger from '../src';
import { placementAlignMap } from './util';

jest.mock('rc-util/lib/isMobile');
jest.mock('@rc-component/util/lib/isMobile');

describe('Trigger.Mobile', () => {
beforeAll(() => {
Expand Down
2 changes: 1 addition & 1 deletion tests/portal.test.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable max-classes-per-file */

import { act, cleanup, fireEvent, render } from '@testing-library/react';
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
import React from 'react';
import ReactDOM from 'react-dom';
import Trigger from '../src';
Expand Down
2 changes: 1 addition & 1 deletion tests/rect.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cleanup, render } from '@testing-library/react';
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
import React from 'react';
import Trigger from '../src';
import { awaitFakeTimer } from './util';
Expand Down
2 changes: 1 addition & 1 deletion tests/ref.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable max-classes-per-file */

import { cleanup, render } from '@testing-library/react';
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
import React from 'react';
import Trigger, { type TriggerRef } from '../src';

Expand Down
7 changes: 7 additions & 0 deletions tests/setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// jsdom add motion events to test CSSMotion
window.AnimationEvent = window.AnimationEvent || (() => {});
window.TransitionEvent = window.TransitionEvent || (() => {});
global.ResizeObserver = jest.fn(() => {
return {
observe() { },
unobserve() { },
disconnect() { },
};
});
2 changes: 1 addition & 1 deletion tests/shadow.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { act, fireEvent } from '@testing-library/react';
import { resetWarned } from 'rc-util/lib/warning';
import { resetWarned } from '@rc-component/util/lib/warning';
import React from 'react';
import { createRoot } from 'react-dom/client';
import Trigger from '../src';
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"paths": {
"@/*": ["src/*"],
"@@/*": [".dumi/tmp/*"],
"rc-trigger": ["src/index.tsx"]
"@rc-component/trigger": ["src/index.tsx"]
}
}
}
Loading