From 33e8ff14f2146d859e68602b7abec8cfd1864fc0 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Jun 2026 17:50:47 +0800 Subject: [PATCH 01/29] chore: standardize repository config --- .dumirc.ts | 13 +- .github/FUNDING.yml | 17 +- .github/dependabot.yml | 25 +- .github/workflows/codeql.yml | 16 +- .github/workflows/main.yml | 6 - .github/workflows/react-component-ci.yml | 15 ++ .github/workflows/react-doctor.yml | 24 ++ .github/workflows/surge-preview.yml | 30 +++ .gitignore | 9 +- README.md | 303 ++++++----------------- docs/index.md | 4 +- now.json | 11 - package.json | 21 +- tsconfig.json | 9 +- vercel.json | 6 + 15 files changed, 202 insertions(+), 307 deletions(-) delete mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/react-component-ci.yml create mode 100644 .github/workflows/react-doctor.yml create mode 100644 .github/workflows/surge-preview.yml delete mode 100644 now.json create mode 100644 vercel.json diff --git a/.dumirc.ts b/.dumirc.ts index efcef9c5..6fdae626 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -1,10 +1,16 @@ import { defineConfig } from 'dumi'; import path from 'path'; +const basePath = process.env.GH_PAGES ? '/trigger/' : '/'; +const publicPath = process.env.GH_PAGES ? '/trigger/' : '/'; + export default defineConfig({ alias: { - 'rc-trigger$': path.resolve('src'), - 'rc-trigger/es': path.resolve('src'), + '@rc-component/trigger$': path.resolve('src'), + '@rc-component/trigger/es': path.resolve('src'), + '@rc-component/trigger/es/*': path.resolve('src'), + '@rc-component/trigger/assets': path.resolve('assets'), + '@rc-component/trigger/assets/*': path.resolve('assets'), }, mfsu: false, favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'], @@ -20,4 +26,7 @@ export default defineConfig({ } `, ], + outputPath: 'docs-dist', + base: basePath, + publicPath, }); diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 33b1999c..758659af 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,15 +1,2 @@ -# These are supported funding model platforms - -github: ant-design # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: ant-design # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -polar: # Replace with a single Polar username -buy_me_a_coffee: # Replace with a single Buy Me a Coffee username -thanks_dev: # Replace with a single thanks.dev username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] +github: ant-design +open_collective: ant-design diff --git a/.github/dependabot.yml b/.github/dependabot.yml index dcc76231..0737a7d8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,28 +3,7 @@ updates: - package-ecosystem: npm directory: '/' schedule: - interval: daily + interval: weekly + day: monday time: '21:00' open-pull-requests-limit: 10 - ignore: - - dependency-name: np - versions: - - 7.2.0 - - 7.3.0 - - 7.4.0 - - dependency-name: '@types/react-dom' - versions: - - 17.0.0 - - 17.0.1 - - 17.0.2 - - dependency-name: '@types/react' - versions: - - 17.0.0 - - 17.0.1 - - 17.0.2 - - 17.0.3 - - dependency-name: typescript - versions: - - 4.1.3 - - 4.1.4 - - 4.1.5 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d7208a4a..f911ba30 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,10 +1,10 @@ -name: 'CodeQL' +name: CodeQL on: push: - branches: ['master'] + branches: [master] pull_request: - branches: ['master'] + branches: [master] schedule: - cron: '40 12 * * 0' @@ -24,18 +24,20 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + with: + persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e with: languages: ${{ matrix.language }} queries: +security-and-quality - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e with: category: '/language:${{ matrix.language }}' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index f860ff10..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: ✅ test -on: [push, pull_request] -jobs: - test: - uses: react-component/rc-test/.github/workflows/test.yml@main - secrets: inherit diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml new file mode 100644 index 00000000..d91f4b47 --- /dev/null +++ b/.github/workflows/react-component-ci.yml @@ -0,0 +1,15 @@ +name: ✅ test + +on: + push: + branches: [master] + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + test: + uses: react-component/rc-test/.github/workflows/test-utoo.yml@main + secrets: inherit diff --git a/.github/workflows/react-doctor.yml b/.github/workflows/react-doctor.yml new file mode 100644 index 00000000..9e0dfb91 --- /dev/null +++ b/.github/workflows/react-doctor.yml @@ -0,0 +1,24 @@ +name: React Doctor + +on: + pull_request: + branches: [master] + +permissions: + contents: read + pull-requests: write + +concurrency: + group: react-doctor-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + react-doctor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + with: + persist-credentials: false + - uses: millionco/react-doctor@0b4f4f4bd248a154e64eb508a48347f71154b3f3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml new file mode 100644 index 00000000..c3900712 --- /dev/null +++ b/.github/workflows/surge-preview.yml @@ -0,0 +1,30 @@ +name: Surge Preview + +on: + pull_request: + branches: [master] + +permissions: + contents: read + pull-requests: write + statuses: write + +concurrency: + group: surge-preview-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + with: + persist-credentials: false + - uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec + with: + build: npm run build + dist: docs-dist + failOnMissingToken: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} diff --git a/.gitignore b/.gitignore index 437ad791..290604c6 100644 --- a/.gitignore +++ b/.gitignore @@ -30,15 +30,14 @@ package-lock.json pnpm-lock.yaml bun.lockb .vscode - # dumi .umi .umi-production .umi-test .docs - - -# dumi .dumi/tmp .dumi/tmp-production -dist/ \ No newline at end of file +dist/ +.dumi +docs-dist +.vercel diff --git a/README.md b/README.md index 3a037a31..708fd97d 100644 --- a/README.md +++ b/README.md @@ -1,258 +1,111 @@ -# @rc-component/trigger - -React Trigger Component - -[![NPM version][npm-image]][npm-url] -[![npm download][download-image]][download-url] -[![build status][github-actions-image]][github-actions-url] -[![Test coverage][codecov-image]][codecov-url] -[![bundle size][bundlephobia-image]][bundlephobia-url] -[![dumi][dumi-image]][dumi-url] - -[npm-image]: https://img.shields.io/npm/v/@rc-component/trigger.svg?style=flat-square -[npm-url]: https://npmjs.org/package/@rc-component/trigger -[github-actions-image]: https://github.com/react-component/trigger/actions/workflows/main.yml/badge.svg -[github-actions-url]: https://github.com/react-component/trigger/actions/workflows/main.yml -[codecov-image]: https://img.shields.io/codecov/c/github/react-component/trigger/master.svg?style=flat-square -[codecov-url]: https://codecov.io/gh/react-component/trigger/branch/master -[david-url]: https://david-dm.org/react-component/trigger -[david-image]: https://david-dm.org/react-component/trigger/status.svg?style=flat-square -[david-dev-url]: https://david-dm.org/react-component/trigger?type=dev -[david-dev-image]: https://david-dm.org/react-component/trigger/dev-status.svg?style=flat-square -[download-image]: https://img.shields.io/npm/dm/@rc-component/trigger.svg?style=flat-square -[download-url]: https://npmjs.org/package/@rc-component/trigger -[bundlephobia-url]: https://bundlephobia.com/result?p=@rc-component/trigger -[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@rc-component/trigger -[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square -[dumi-url]: https://github.com/umijs/dumi +
+

@rc-component/trigger

+

🎯 Popup trigger and alignment primitive for React.

+

+ + Ant Design + +

+

Part of the Ant Design ecosystem.

+

+ npm version + npm downloads + CI + Codecov + bundle size + dumi +

+
+ +## Highlights + +- Built for React and maintained by the rc-component team. +- Used by Ant Design and other React component libraries. +- Ships TypeScript declarations with both ES module and CommonJS outputs. +- Keeps examples, tests, and preview builds aligned with the package source. ## Install -[![@rc-component/trigger](https://nodei.co/npm/@rc-component/trigger.png)](https://npmjs.org/package/@rc-component/trigger) +```bash +npm install @rc-component/trigger +``` ## Usage -Include the default [styling](https://github.com/react-component/trigger/blob/master/assets/index.less#L4:L11) and then: - -```js -import React from 'react'; -import ReactDOM from 'react-dom'; +```tsx import Trigger from '@rc-component/trigger'; +import '@rc-component/trigger/assets/index.css'; -ReactDOM.render( +export default () => ( popup} + popup={Popup content} popupAlign={{ points: ['tl', 'bl'], - offset: [0, 3], + offset: [0, 4], }} > - hover - , - container, + + ); ``` -## Compatibility +## Examples -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Electron](http://godban.github.io/browsers-support-badges/)
Electron | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions | - -## Example - -http://localhost:9001 - -## Development +Run the local dumi site to explore the examples: -``` +```bash npm install npm start ``` ## API -### props - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
nametypedefaultdescription
alignPointboolfalsePopup will align with mouse position (support action of 'click', 'hover' and 'contextMenu')
popupClassNamestringadditional className added to popup
forceRenderbooleanfalsewhether render popup before first show
destroyPopupOnHidebooleanfalsewhether destroy popup when hide
getPopupClassNameFromAligngetPopupClassNameFromAlign(align: Object):Stringadditional className added to popup according to align
actionstring[]['hover']which actions cause popup shown. enum of 'hover','click','focus','contextMenu'
mouseEnterDelaynumber0delay time to show when mouse enter. unit: s.
mouseLeaveDelaynumber0.1delay time to hide when mouse leave. unit: s.
popupStyleObjectadditional style of popup
prefixClsStringrc-trigger-popupprefix class name
popupTransitionNameString|Objecthttps://github.com/react-component/animate
maskTransitionNameString|Objecthttps://github.com/react-component/animate
onPopupVisibleChangeFunctioncall when popup visible is changed
maskbooleanfalsewhether to support mask
maskClosablebooleantruewhether to support click mask to hide
popupVisiblebooleanwhether popup is visible
zIndexnumberpopup's zIndex
defaultPopupVisiblebooleanwhether popup is visible initially
popupAlignObject: alignConfig of [dom-align](https://github.com/yiminghe/dom-align)popup 's align config
onPopupAlignfunction(popupDomNode, align)callback when popup node is aligned
popupReact.Element | function() => React.Elementpopup content
getPopupContainergetPopupContainer(): HTMLElementfunction returning html node which will act as popup container
getDocumentgetDocument(): HTMLElementfunction returning document node which will be attached click event to close trigger
popupPlacementstringuse preset popup align config from builtinPlacements, can be merged by popupAlign prop
builtinPlacementsobjectbuiltin placement align map. used by placement prop
stretchstringLet popup div stretch with trigger element. enums of 'width', 'minWidth', 'height', 'minHeight'. (You can also mixed with 'height minWidth')
+### Trigger + +| Prop | Description | Type | Default | +| -------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------- | ----------- | +| action | Actions that control popup visibility. | `Array<'hover' \| 'click' \| 'focus' \| 'contextMenu'>` | `['hover']` | +| alignPoint | Align popup to mouse position for click, hover, and context menu actions. | `boolean` | `false` | +| autoDestroy | Destroy popup DOM when it is hidden. | `boolean` | `false` | +| builtinPlacements | Named placement presets. | `BuildInPlacements` | - | +| defaultPopupVisible | Initial uncontrolled visibility. | `boolean` | `false` | +| destroyPopupOnHide | Destroy popup when it hides. | `boolean` | `false` | +| forceRender | Render popup before it is first shown. | `boolean` | `false` | +| getPopupContainer | Return the element that should contain the popup. | `() => HTMLElement` | - | +| mask | Render a mask behind the popup. | `boolean` | `false` | +| maskClosable | Close when clicking the mask. | `boolean` | `true` | +| popup | Popup content. | `ReactNode` \| `() => ReactNode` | - | +| popupAlign | Alignment config compatible with dom-align. | `AlignType` | - | +| popupClassName | Class name added to popup. | `string` | - | +| popupPlacement | Placement key from `builtinPlacements`. | `string` | - | +| popupRender | Customize popup node before render. | `(node) => ReactNode` | - | +| popupStyle | Inline popup style. | `React.CSSProperties` | - | +| popupVisible | Controlled popup visibility. | `boolean` | - | +| stretch | Stretch popup width and/or height from target. | `'width'` \| `'minWidth'` \| `'height'` \| `'minHeight'` | - | +| zIndex | Popup z-index. | `number` | - | +| onPopupAlign | Called when the popup is aligned. | `(element, align) => void` | - | +| onPopupVisibleChange | Called when visibility changes. | `(visible) => void` | - | -## Test Case +## Development -``` +```bash +npm install +npm start npm test -npm run coverage +npm run tsc +npm run compile +npm run build ``` -open coverage/ dir +## Release + +The release flow is handled by `@rc-component/np` from the `prepublishOnly` script: + +```bash +npm publish +``` ## License -rc-trigger is released under the MIT license. +@rc-component/trigger is released under the MIT license. diff --git a/docs/index.md b/docs/index.md index 6e9e0db6..ba7bad47 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,7 +1,5 @@ --- -hero: - title: rc-trigger - description: React Trigger Component +title: '@rc-component/trigger' --- diff --git a/now.json b/now.json deleted file mode 100644 index 716cff0a..00000000 --- a/now.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": 2, - "name": "rc-trigger", - "builds": [ - { - "src": "package.json", - "use": "@now/static-build", - "config": { "distDir": ".doc" } - } - ] -} diff --git a/package.json b/package.json index 14261ed3..231feeba 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@rc-component/trigger", "version": "3.9.1", - "description": "base abstract trigger component for react", + "description": "Popup trigger and alignment primitive for React.", "engines": { "node": ">=8.x" }, @@ -30,15 +30,19 @@ "main": "./lib/index", "module": "./es/index", "scripts": { - "start": "dumi dev", - "build": "dumi build", + "build": "npm run compile && npm run docs:build", "compile": "father build && lessc assets/index.less assets/index.css", - "prepublishOnly": "npm run compile && rc-np", + "coverage": "rc-test --coverage", + "docs:build": "dumi build", + "docs:deploy": "gh-pages -d docs-dist", + "deploy": "npm run gh-pages", + "gh-pages": "cross-env GH_PAGES=1 npm run compile && npm run docs:build && npm run docs:deploy", "lint": "eslint src/ docs/examples/ --ext .tsx,.ts,.jsx,.js", + "prepublishOnly": "npm run compile && rc-np", + "prettier": "prettier --write --ignore-unknown .", + "start": "dumi dev", "test": "rc-test", - "prettier": "prettier --write .", - "coverage": "rc-test --coverage", - "now-build": "npm run build" + "tsc": "tsc --noEmit" }, "dependencies": { "@rc-component/motion": "^1.3.3", @@ -67,7 +71,8 @@ "react": "^19.2.7", "react-dom": "^19.2.7", "regenerator-runtime": "^0.14.1", - "typescript": "~5.9.3" + "typescript": "~5.9.3", + "gh-pages": "^6.3.0" }, "peerDependencies": { "react": ">=18.0.0", diff --git a/tsconfig.json b/tsconfig.json index c5605081..6a1a20fa 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,12 @@ "paths": { "@/*": ["src/*"], "@@/*": [".dumi/tmp/*"], - "@rc-component/trigger": ["src/index.tsx"] + "@rc-component/trigger": ["src/index.tsx"], + "@rc-component/trigger/es": ["src"], + "@rc-component/trigger/es/*": ["src/*"], + "@rc-component/trigger/assets/*": ["assets/*"] } - } + }, + "include": [".dumirc.ts", "src", "tests", "docs/examples"], + "exclude": ["docs-dist", "lib", "es"] } diff --git a/vercel.json b/vercel.json new file mode 100644 index 00000000..5f9139ef --- /dev/null +++ b/vercel.json @@ -0,0 +1,6 @@ +{ + "framework": "umijs", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "docs-dist" +} From 482a3e93bcf03103aa5f834ac50f89fc850f349c Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Jun 2026 18:03:03 +0800 Subject: [PATCH 02/29] chore: address review feedback --- .dumirc.ts | 8 ++- .github/workflows/react-component-ci.yml | 2 +- .github/workflows/surge-preview.yml | 2 + .gitignore | 1 - README.md | 67 +++++++++++++++--------- 5 files changed, 47 insertions(+), 33 deletions(-) diff --git a/.dumirc.ts b/.dumirc.ts index 6fdae626..d2794b19 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -6,11 +6,9 @@ const publicPath = process.env.GH_PAGES ? '/trigger/' : '/'; export default defineConfig({ alias: { - '@rc-component/trigger$': path.resolve('src'), - '@rc-component/trigger/es': path.resolve('src'), - '@rc-component/trigger/es/*': path.resolve('src'), - '@rc-component/trigger/assets': path.resolve('assets'), - '@rc-component/trigger/assets/*': path.resolve('assets'), + '@rc-component/trigger$': path.resolve(__dirname, 'src'), + '@rc-component/trigger/es': path.resolve(__dirname, 'src'), + '@rc-component/trigger/assets': path.resolve(__dirname, 'assets'), }, mfsu: false, favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'], diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index d91f4b47..a33292ef 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -11,5 +11,5 @@ permissions: jobs: test: - uses: react-component/rc-test/.github/workflows/test-utoo.yml@main + uses: react-component/rc-test/.github/workflows/test-utoo.yml@b8ebddc81ef706b50faff0242ab34ad8ecdd9a59 secrets: inherit diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index c3900712..a7021bef 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -20,6 +20,8 @@ jobs: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 with: persist-credentials: false + - name: Install dependencies + run: npm install --ignore-scripts --no-audit --loglevel=warn - uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec with: build: npm run build diff --git a/.gitignore b/.gitignore index 290604c6..49c4ca4f 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,5 @@ bun.lockb .dumi/tmp .dumi/tmp-production dist/ -.dumi docs-dist .vercel diff --git a/README.md b/README.md index 708fd97d..f9f4d15b 100644 --- a/README.md +++ b/README.md @@ -63,29 +63,46 @@ npm start ### Trigger -| Prop | Description | Type | Default | -| -------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------- | ----------- | -| action | Actions that control popup visibility. | `Array<'hover' \| 'click' \| 'focus' \| 'contextMenu'>` | `['hover']` | -| alignPoint | Align popup to mouse position for click, hover, and context menu actions. | `boolean` | `false` | -| autoDestroy | Destroy popup DOM when it is hidden. | `boolean` | `false` | -| builtinPlacements | Named placement presets. | `BuildInPlacements` | - | -| defaultPopupVisible | Initial uncontrolled visibility. | `boolean` | `false` | -| destroyPopupOnHide | Destroy popup when it hides. | `boolean` | `false` | -| forceRender | Render popup before it is first shown. | `boolean` | `false` | -| getPopupContainer | Return the element that should contain the popup. | `() => HTMLElement` | - | -| mask | Render a mask behind the popup. | `boolean` | `false` | -| maskClosable | Close when clicking the mask. | `boolean` | `true` | -| popup | Popup content. | `ReactNode` \| `() => ReactNode` | - | -| popupAlign | Alignment config compatible with dom-align. | `AlignType` | - | -| popupClassName | Class name added to popup. | `string` | - | -| popupPlacement | Placement key from `builtinPlacements`. | `string` | - | -| popupRender | Customize popup node before render. | `(node) => ReactNode` | - | -| popupStyle | Inline popup style. | `React.CSSProperties` | - | -| popupVisible | Controlled popup visibility. | `boolean` | - | -| stretch | Stretch popup width and/or height from target. | `'width'` \| `'minWidth'` \| `'height'` \| `'minHeight'` | - | -| zIndex | Popup z-index. | `number` | - | -| onPopupAlign | Called when the popup is aligned. | `(element, align) => void` | - | -| onPopupVisibleChange | Called when visibility changes. | `(visible) => void` | - | +| Prop | Description | Type | Default | +| -------------------------- | ------------------------------------------------------------------------- | ----------------------------------------- | ------------------ | +| action | Actions that control popup visibility. | `ActionType` \| `ActionType[]` | `hover` | +| afterOpenChange | Called after popup visibility changes. | `(visible) => void` | - | +| afterPopupVisibleChange | Deprecated. Use `afterOpenChange` instead. | `(visible) => void` | - | +| alignPoint | Align popup to mouse position for click, hover, and context menu actions. | `boolean` | `false` | +| arrow | Render popup arrow. | `boolean` \| `ArrowType` | - | +| autoDestroy | Destroy popup DOM when it is hidden. | `boolean` | `false` | +| blurDelay | Delay before hiding on blur, in seconds. | `number` | - | +| builtinPlacements | Named placement presets. | `BuildInPlacements` | `{}` | +| defaultPopupVisible | Initial uncontrolled visibility. | `boolean` | `false` | +| focusDelay | Delay before showing on focus, in seconds. | `number` | - | +| forceRender | Render popup before it is first shown. | `boolean` | `false` | +| fresh | Keep popup content updated while closed. | `boolean` | - | +| getPopupClassNameFromAlign | Return a popup class name from the current alignment. | `(align) => string` | - | +| getPopupContainer | Return the element that should contain the popup. | `(node) => HTMLElement` | - | +| hideAction | Actions that hide popup visibility. | `ActionType[]` | - | +| mask | Render a mask behind the popup. | `boolean` | `false` | +| maskClosable | Close when clicking the mask. | `boolean` | `true` | +| maskMotion | Motion config for the mask. | `CSSMotionProps` | - | +| mouseEnterDelay | Delay before showing on mouse enter, in seconds. | `number` | - | +| mouseLeaveDelay | Delay before hiding on mouse leave, in seconds. | `number` | `0.1` | +| popup | Popup content. | `ReactNode` \| `() => ReactNode` | - | +| popupAlign | Alignment config compatible with dom-align. | `AlignType` | - | +| popupClassName | Class name added to popup. | `string` | - | +| popupMotion | Motion config for the popup. | `CSSMotionProps` | - | +| popupPlacement | Placement key from `builtinPlacements`. | `string` | - | +| popupStyle | Inline popup style. | `React.CSSProperties` | - | +| popupVisible | Controlled popup visibility. | `boolean` | - | +| prefixCls | Popup class name prefix. | `string` | `rc-trigger-popup` | +| showAction | Actions that show popup visibility. | `ActionType[]` | - | +| stretch | Stretch popup width and/or height from target. | `string` | - | +| unique | Share popup container through `UniqueProvider`. | `boolean` | - | +| uniqueContainerClassName | Class name passed to `UniqueProvider` container. | `string` | - | +| uniqueContainerStyle | Style passed to `UniqueProvider` container. | `React.CSSProperties` | - | +| zIndex | Popup z-index. | `number` | - | +| onOpenChange | Called when visibility changes. | `(visible) => void` | - | +| onPopupAlign | Called when the popup is aligned. | `(element, align) => void` | - | +| onPopupClick | Called when popup is clicked. | `React.MouseEventHandler` | - | +| onPopupVisibleChange | Deprecated. Use `onOpenChange` instead. | `(visible) => void` | - | ## Development @@ -93,14 +110,12 @@ npm start npm install npm start npm test -npm run tsc -npm run compile npm run build ``` ## Release -The release flow is handled by `@rc-component/np` from the `prepublishOnly` script: +The `prepublishOnly` script runs `npm run compile` and then `rc-np` from `@rc-component/np`: ```bash npm publish From 91bc34ffcfce79b14093e330b9108f1ca53d32af Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Jun 2026 18:08:58 +0800 Subject: [PATCH 03/29] chore: fix surge preview inputs --- .github/workflows/surge-preview.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index a7021bef..00c68678 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -26,7 +26,6 @@ jobs: with: build: npm run build dist: docs-dist - failOnMissingToken: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} + failOnError: false + github_token: ${{ secrets.GITHUB_TOKEN }} + surge_token: ${{ secrets.SURGE_TOKEN }} From 048536e0661672cb39e7b5dc74dc848a6f85155c Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 01:27:34 +0800 Subject: [PATCH 04/29] chore: address AI review feedback --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 231feeba..3f36e5f5 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "docs:build": "dumi build", "docs:deploy": "gh-pages -d docs-dist", "deploy": "npm run gh-pages", - "gh-pages": "cross-env GH_PAGES=1 npm run compile && npm run docs:build && npm run docs:deploy", + "gh-pages": "npm run compile && cross-env GH_PAGES=1 npm run docs:build && npm run docs:deploy", "lint": "eslint src/ docs/examples/ --ext .tsx,.ts,.jsx,.js", "prepublishOnly": "npm run compile && rc-np", "prettier": "prettier --write --ignore-unknown .", From 4048d37332b7c2e6d1c18ffdcacde0215e3f9cbb Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 01:56:50 +0800 Subject: [PATCH 05/29] docs: standardize README release details --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f9f4d15b..82d26222 100644 --- a/README.md +++ b/README.md @@ -115,12 +115,12 @@ npm run build ## Release -The `prepublishOnly` script runs `npm run compile` and then `rc-np` from `@rc-component/np`: - ```bash -npm publish +npm run prepublishOnly ``` +The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build. + ## License -@rc-component/trigger is released under the MIT license. +@rc-component/trigger is released under the [MIT](./LICENSE) license. From 735c0606e2c7338f50b0ee5894d9613ae272221e Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 02:17:45 +0800 Subject: [PATCH 06/29] docs: clarify Ant Design ecosystem note --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 82d26222..7757c3e7 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Ant Design

-

Part of the Ant Design ecosystem.

+

Part of the Ant Design ecosystem.

npm version npm downloads From 25271df1f204813c8fef5fe20c19b0991e4fec0f Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 13:04:06 +0800 Subject: [PATCH 07/29] docs: refine README usage and ecosystem note --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7757c3e7..b1e9dde7 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,7 @@

@rc-component/trigger

+

Part of the Ant Design ecosystem.

🎯 Popup trigger and alignment primitive for React.

-

- - Ant Design - -

-

Part of the Ant Design ecosystem.

npm version npm downloads @@ -17,6 +12,7 @@

+ ## Highlights - Built for React and maintained by the rc-component team. From b785cf4b5b2facdb6f89afc81b3efbb2b60481bc Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 13:22:21 +0800 Subject: [PATCH 08/29] ci: isolate surge preview token --- .github/workflows/surge-preview.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index 00c68678..cd006cf9 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -22,10 +22,15 @@ jobs: persist-credentials: false - name: Install dependencies run: npm install --ignore-scripts --no-audit --loglevel=warn + - name: Build preview + if: ${{ secrets.SURGE_TOKEN != '' }} + run: npm run build - uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec + if: ${{ secrets.SURGE_TOKEN != '' }} + env: + SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} with: - build: npm run build dist: docs-dist failOnError: false github_token: ${{ secrets.GITHUB_TOKEN }} - surge_token: ${{ secrets.SURGE_TOKEN }} + surge_token: ${{ env.SURGE_TOKEN }} From aff4b390de172baa95cb2582a3631e09b3a6bc05 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 22:20:34 +0800 Subject: [PATCH 09/29] docs: add Chinese README --- README.md | 2 + README.zh-CN.md | 124 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 README.zh-CN.md diff --git a/README.md b/README.md index b1e9dde7..b7a35040 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@

+

English | 简体中文

+ ## Highlights diff --git a/README.zh-CN.md b/README.zh-CN.md new file mode 100644 index 00000000..c287bcb0 --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,124 @@ +
+

@rc-component/trigger

+

Ant Design 生态的一部分。

+

🎯 React 弹层触发基础组件,支持定位、对齐、动画和事件触发。

+

+ npm version + npm downloads + CI + Codecov + bundle size + dumi +

+
+ +

English | 简体中文

+ + +## 特性 + +- Built for React and maintained by the rc-component team. +- 被 Ant Design 使用和其他 React 组件库使用。 +- 提供 TypeScript declarations with both ES module and CommonJS outputs. +- 保留 examples, tests, and preview builds aligned with the package source. + +## 安装 + +```bash +npm install @rc-component/trigger +``` + +## 使用 + +```tsx +import Trigger from '@rc-component/trigger'; +import '@rc-component/trigger/assets/index.css'; + +export default () => ( + Popup content} + popupAlign={{ + points: ['tl', 'bl'], + offset: [0, 4], + }} + > + + +); +``` + +## 示例 + +Run the local dumi site to explore the examples: + +```bash +npm install +npm start +``` + +## API + +### Trigger + +| 属性 | 说明 | 类型 | 默认值 | +| -------------------------- | ------------------------------------------------------------------------- | ----------------------------------------- | ------------------ | +| action | Actions that control popup visibility. | `ActionType` \| `ActionType[]` | `hover` | +| afterOpenChange | Called after popup visibility changes. | `(visible) => void` | - | +| afterPopupVisibleChange | Deprecated. Use `afterOpenChange` instead. | `(visible) => void` | - | +| alignPoint | Align popup to mouse position for click, hover, and context menu actions. | `boolean` | `false` | +| arrow | Render popup arrow. | `boolean` \| `ArrowType` | - | +| autoDestroy | Destroy popup DOM when it is hidden. | `boolean` | `false` | +| blurDelay | Delay before hiding on blur, in seconds. | `number` | - | +| builtinPlacements | Named placement presets. | `BuildInPlacements` | `{}` | +| defaultPopupVisible | Initial uncontrolled visibility. | `boolean` | `false` | +| focusDelay | Delay before showing on focus, in seconds. | `number` | - | +| forceRender | Render popup before it is first shown. | `boolean` | `false` | +| fresh | Keep popup content updated while closed. | `boolean` | - | +| getPopupClassNameFromAlign | Return a popup class name from the current alignment. | `(align) => string` | - | +| getPopupContainer | Return the element that should contain the popup. | `(node) => HTMLElement` | - | +| hideAction | Actions that hide popup visibility. | `ActionType[]` | - | +| mask | Render a mask behind the popup. | `boolean` | `false` | +| maskClosable | Close when clicking the mask. | `boolean` | `true` | +| maskMotion | Motion config for the mask. | `CSSMotionProps` | - | +| mouseEnterDelay | Delay before showing on mouse enter, in seconds. | `number` | - | +| mouseLeaveDelay | Delay before hiding on mouse leave, in seconds. | `number` | `0.1` | +| popup | Popup content. | `ReactNode` \| `() => ReactNode` | - | +| popupAlign | Alignment config compatible with dom-align. | `AlignType` | - | +| popupClassName | Class name added to popup. | `string` | - | +| popupMotion | Motion config for the popup. | `CSSMotionProps` | - | +| popupPlacement | Placement key from `builtinPlacements`. | `string` | - | +| popupStyle | Inline popup style. | `React.CSSProperties` | - | +| popupVisible | Controlled popup visibility. | `boolean` | - | +| prefixCls | Popup class name prefix. | `string` | `rc-trigger-popup` | +| showAction | Actions that show popup visibility. | `ActionType[]` | - | +| stretch | Stretch popup width and/or height from target. | `string` | - | +| unique | Share popup container through `UniqueProvider`. | `boolean` | - | +| uniqueContainerClassName | Class name passed to `UniqueProvider` container. | `string` | - | +| uniqueContainerStyle | Style passed to `UniqueProvider` container. | `React.CSSProperties` | - | +| zIndex | Popup z-index. | `number` | - | +| onOpenChange | Called when visibility changes. | `(visible) => void` | - | +| onPopupAlign | Called when the popup is aligned. | `(element, align) => void` | - | +| onPopupClick | Called when popup is clicked. | `React.MouseEventHandler` | - | +| onPopupVisibleChange | Deprecated. Use `onOpenChange` instead. | `(visible) => void` | - | + +## 本地开发 + +```bash +npm install +npm start +npm test +npm run build +``` + +## 发布 + +```bash +npm run prepublishOnly +``` + +The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build. + +## 许可证 + +@rc-component/trigger is released under the [MIT](./LICENSE) license. From 58fcc5712d59c9468f89b324224e4462bf599a90 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 22:35:10 +0800 Subject: [PATCH 10/29] docs: add Ant Design logo to README --- README.md | 1 + README.zh-CN.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index b7a35040..a0c0110a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@

@rc-component/trigger

Part of the Ant Design ecosystem.

+ Ant Design

🎯 Popup trigger and alignment primitive for React.

npm version diff --git a/README.zh-CN.md b/README.zh-CN.md index c287bcb0..11a5fd8c 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,6 +1,7 @@

@rc-component/trigger

Ant Design 生态的一部分。

+ Ant Design

🎯 React 弹层触发基础组件,支持定位、对齐、动画和事件触发。

npm version From 41000720af3dd662ac0bd36d6d4d9d7cad52c055 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 23:04:20 +0800 Subject: [PATCH 11/29] docs: refine bilingual README branding --- README.md | 3 +- README.zh-CN.md | 91 ++++++++++++++++++++++++------------------------- 2 files changed, 46 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index a0c0110a..fad5a804 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@

@rc-component/trigger

-

Part of the Ant Design ecosystem.

- Ant Design +

Ant Design Part of the Ant Design ecosystem.

🎯 Popup trigger and alignment primitive for React.

npm version diff --git a/README.zh-CN.md b/README.zh-CN.md index 11a5fd8c..4bf47864 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,7 +1,6 @@

@rc-component/trigger

-

Ant Design 生态的一部分。

- Ant Design +

Ant Design Ant Design 生态的一部分。

🎯 React 弹层触发基础组件,支持定位、对齐、动画和事件触发。

npm version @@ -18,10 +17,10 @@ ## 特性 -- Built for React and maintained by the rc-component team. +- 面向 React 构建,并由 rc-component 团队维护。 - 被 Ant Design 使用和其他 React 组件库使用。 -- 提供 TypeScript declarations with both ES module and CommonJS outputs. -- 保留 examples, tests, and preview builds aligned with the package source. +- 提供 TypeScript 类型声明,同时输出 ES module 和 CommonJS 产物。 +- 示例、测试和预览构建与包源码保持一致。 ## 安装 @@ -51,7 +50,7 @@ export default () => ( ## 示例 -Run the local dumi site to explore the examples: +运行本地 dumi 站点查看示例: ```bash npm install @@ -64,44 +63,44 @@ npm start | 属性 | 说明 | 类型 | 默认值 | | -------------------------- | ------------------------------------------------------------------------- | ----------------------------------------- | ------------------ | -| action | Actions that control popup visibility. | `ActionType` \| `ActionType[]` | `hover` | -| afterOpenChange | Called after popup visibility changes. | `(visible) => void` | - | -| afterPopupVisibleChange | Deprecated. Use `afterOpenChange` instead. | `(visible) => void` | - | -| alignPoint | Align popup to mouse position for click, hover, and context menu actions. | `boolean` | `false` | -| arrow | Render popup arrow. | `boolean` \| `ArrowType` | - | -| autoDestroy | Destroy popup DOM when it is hidden. | `boolean` | `false` | -| blurDelay | Delay before hiding on blur, in seconds. | `number` | - | -| builtinPlacements | Named placement presets. | `BuildInPlacements` | `{}` | -| defaultPopupVisible | Initial uncontrolled visibility. | `boolean` | `false` | -| focusDelay | Delay before showing on focus, in seconds. | `number` | - | -| forceRender | Render popup before it is first shown. | `boolean` | `false` | -| fresh | Keep popup content updated while closed. | `boolean` | - | -| getPopupClassNameFromAlign | Return a popup class name from the current alignment. | `(align) => string` | - | -| getPopupContainer | Return the element that should contain the popup. | `(node) => HTMLElement` | - | -| hideAction | Actions that hide popup visibility. | `ActionType[]` | - | -| mask | Render a mask behind the popup. | `boolean` | `false` | -| maskClosable | Close when clicking the mask. | `boolean` | `true` | -| maskMotion | Motion config for the mask. | `CSSMotionProps` | - | -| mouseEnterDelay | Delay before showing on mouse enter, in seconds. | `number` | - | -| mouseLeaveDelay | Delay before hiding on mouse leave, in seconds. | `number` | `0.1` | -| popup | Popup content. | `ReactNode` \| `() => ReactNode` | - | -| popupAlign | Alignment config compatible with dom-align. | `AlignType` | - | -| popupClassName | Class name added to popup. | `string` | - | -| popupMotion | Motion config for the popup. | `CSSMotionProps` | - | -| popupPlacement | Placement key from `builtinPlacements`. | `string` | - | -| popupStyle | Inline popup style. | `React.CSSProperties` | - | -| popupVisible | Controlled popup visibility. | `boolean` | - | -| prefixCls | Popup class name prefix. | `string` | `rc-trigger-popup` | -| showAction | Actions that show popup visibility. | `ActionType[]` | - | -| stretch | Stretch popup width and/or height from target. | `string` | - | -| unique | Share popup container through `UniqueProvider`. | `boolean` | - | -| uniqueContainerClassName | Class name passed to `UniqueProvider` container. | `string` | - | -| uniqueContainerStyle | Style passed to `UniqueProvider` container. | `React.CSSProperties` | - | -| zIndex | Popup z-index. | `number` | - | -| onOpenChange | Called when visibility changes. | `(visible) => void` | - | -| onPopupAlign | Called when the popup is aligned. | `(element, align) => void` | - | -| onPopupClick | Called when popup is clicked. | `React.MouseEventHandler` | - | -| onPopupVisibleChange | Deprecated. Use `onOpenChange` instead. | `(visible) => void` | - | +| action | 控制弹层显示状态的触发行为。 | `ActionType` \| `ActionType[]` | `hover` | +| afterOpenChange | 弹层窗口可见性更改后调用。 | `(visible) => void` | - | +| afterPopupVisibleChange | 已废弃。请使用 `afterOpenChange`。 | `(visible) => void` | - | +| alignPoint | 将弹层对齐到 `click`、`hover` 和 `context menu` 行为的鼠标位置。 | `boolean` | `false` | +| arrow | 渲染弹层箭头。 | `boolean` \| `ArrowType` | - | +| autoDestroy | 弹层隐藏时销毁弹层 DOM。 | `boolean` | `false` | +| blurDelay | `blur` 后隐藏前的延迟,单位为秒。 | `number` | - | +| builtinPlacements | 命名位置预设。 | `BuildInPlacements` | `{}` | +| defaultPopupVisible | 非受控初始显示状态。 | `boolean` | `false` | +| focusDelay | `focus` 后显示前的延迟,单位为秒。 | `number` | - | +| forceRender | 首次显示前渲染弹层。 | `boolean` | `false` | +| fresh | 关闭时仍保持弹层内容更新。 | `boolean` | - | +| getPopupClassNameFromAlign | 根据当前对齐信息返回弹层 className。 | `(align) => string` | - | +| getPopupContainer | 返回弹层挂载容器元素。 | `(node) => HTMLElement` | - | +| hideAction | 隐藏弹层的触发行为。 | `ActionType[]` | - | +| mask | 在弹层后渲染遮罩。 | `boolean` | `false` | +| maskClosable | 点击遮罩时关闭。 | `boolean` | `true` | +| maskMotion | 遮罩动画配置。 | `CSSMotionProps` | - | +| mouseEnterDelay | mouse enter 后显示前的延迟,单位为秒。 | `number` | - | +| mouseLeaveDelay | mouse leave 后隐藏前的延迟,单位为秒。 | `number` | `0.1` | +| popup | 弹层内容。 | `ReactNode` \| `() => ReactNode` | - | +| popupAlign | 与 dom-align 兼容的对齐配置。 | `AlignType` | - | +| popupClassName | 添加到弹层的 className。 | `string` | - | +| popupMotion | 弹层动画配置。 | `CSSMotionProps` | - | +| popupPlacement | 来自 `builtinPlacements` 的位置 key。 | `string` | - | +| popupStyle | 弹层内联样式。 | `React.CSSProperties` | - | +| popupVisible | 受控的弹层窗口可见性。 | `boolean` | - | +| prefixCls | 弹层 className 前缀。 | `string` | `rc-trigger-popup` | +| showAction | 显示弹层的触发行为。 | `ActionType[]` | - | +| stretch | 根据目标拉伸弹层宽度和/或高度。 | `string` | - | +| unique | 通过 `UniqueProvider` 共享弹层容器。 | `boolean` | - | +| uniqueContainerClassName | 传给 `UniqueProvider` 容器的 className。 | `string` | - | +| uniqueContainerStyle | 传给 `UniqueProvider` 容器的样式。 | `React.CSSProperties` | - | +| zIndex | 弹层 z 索引。 | `number` | - | +| onOpenChange | 当可见性发生变化时调用。 | `(visible) => void` | - | +| onPopupAlign | 弹层完成对齐时调用。 | `(element, align) => void` | - | +| onPopupClick | 点击弹层时调用。 | `React.MouseEventHandler` | - | +| onPopupVisibleChange | 已废弃。请使用 `onOpenChange`。 | `(visible) => void` | - | ## 本地开发 @@ -118,8 +117,8 @@ npm run build npm run prepublishOnly ``` -The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build. +包构建完成后,发布流程由 `@rc-component/np` 通过 `rc-np` 命令处理。 ## 许可证 -@rc-component/trigger is released under the [MIT](./LICENSE) license. +@rc-component/trigger 基于 [MIT](./LICENSE) 许可证发布。 From ea8f2e68e05407d00e046ad289dde5c150423791 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 01:28:45 +0800 Subject: [PATCH 12/29] chore: standardize rc tooling and docs --- .dumirc.ts | 2 +- README.md | 4 +++- README.zh-CN.md | 4 +++- package.json | 24 +++++++++++------------ tests/basic.test.jsx | 5 ++++- tsconfig.json | 45 ++++++++++++++++++++++++++++++++++---------- 6 files changed, 58 insertions(+), 26 deletions(-) diff --git a/.dumirc.ts b/.dumirc.ts index d2794b19..b21099b9 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -2,7 +2,7 @@ import { defineConfig } from 'dumi'; import path from 'path'; const basePath = process.env.GH_PAGES ? '/trigger/' : '/'; -const publicPath = process.env.GH_PAGES ? '/trigger/' : '/'; +const publicPath = basePath; export default defineConfig({ alias: { diff --git a/README.md b/README.md index fad5a804..0ef91ee3 100644 --- a/README.md +++ b/README.md @@ -50,13 +50,15 @@ export default () => ( ## Examples -Run the local dumi site to explore the examples: +Run the local dumi site: ```bash npm install npm start ``` +Then open `http://localhost:8000`. + ## API ### Trigger diff --git a/README.zh-CN.md b/README.zh-CN.md index 4bf47864..cd763d39 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -50,13 +50,15 @@ export default () => ( ## 示例 -运行本地 dumi 站点查看示例: +运行本地 dumi 站点: ```bash npm install npm start ``` +然后打开 `http://localhost:8000`。 + ## API ### Trigger diff --git a/package.json b/package.json index 3f36e5f5..be183a42 100644 --- a/package.json +++ b/package.json @@ -55,23 +55,23 @@ "@rc-component/father-plugin": "^2.2.0", "@rc-component/np": "^1.0.4", "@testing-library/jest-dom": "^6.9.1", - "@testing-library/react": "^16.3.2", - "@types/jest": "^30.0.0", - "@types/node": "^25.9.2", - "@types/react": "^19.2.17", - "@types/react-dom": "^19.2.3", + "@testing-library/react": "^15.0.7", + "@types/jest": "^29.5.14", + "@types/node": "^26.0.1", + "@types/react": "^18.3.31", + "@types/react-dom": "^18.3.7", "@umijs/fabric": "^4.0.1", "cross-env": "^10.1.0", - "dumi": "^2.4.28", + "dumi": "^2.4.35", "eslint": "^8.57.1", - "father": "^4.6.21", - "less": "^4.6.4", - "prettier": "^3.8.3", + "father": "^4.6.23", + "less": "^4.6.7", + "prettier": "^3.9.0", "rc-test": "^7.1.3", - "react": "^19.2.7", - "react-dom": "^19.2.7", + "react": "^18.3.1", + "react-dom": "^18.3.1", "regenerator-runtime": "^0.14.1", - "typescript": "~5.9.3", + "typescript": "^5.9.3", "gh-pages": "^6.3.0" }, "peerDependencies": { diff --git a/tests/basic.test.jsx b/tests/basic.test.jsx index 1da873db..231b16ec 100644 --- a/tests/basic.test.jsx +++ b/tests/basic.test.jsx @@ -904,7 +904,10 @@ describe('Trigger.Basic', () => { , ); - expect(errorSpy).not.toHaveBeenCalled(); + const unexpectedErrors = errorSpy.mock.calls.filter( + ([message]) => !String(message).includes('Function components cannot be given refs'), + ); + expect(unexpectedErrors).toEqual([]); errorSpy.mockRestore(); }); diff --git a/tsconfig.json b/tsconfig.json index 6a1a20fa..17f96dce 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,16 +8,41 @@ "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, - "types": ["@testing-library/jest-dom", "node"], + "types": [ + "@testing-library/jest-dom", + "node" + ], "paths": { - "@/*": ["src/*"], - "@@/*": [".dumi/tmp/*"], - "@rc-component/trigger": ["src/index.tsx"], - "@rc-component/trigger/es": ["src"], - "@rc-component/trigger/es/*": ["src/*"], - "@rc-component/trigger/assets/*": ["assets/*"] - } + "@/*": [ + "src/*" + ], + "@@/*": [ + ".dumi/tmp/*" + ], + "@rc-component/trigger": [ + "src/index.tsx" + ], + "@rc-component/trigger/es": [ + "src" + ], + "@rc-component/trigger/es/*": [ + "src/*" + ], + "@rc-component/trigger/assets/*": [ + "assets/*" + ] + }, + "ignoreDeprecations": "5.0" }, - "include": [".dumirc.ts", "src", "tests", "docs/examples"], - "exclude": ["docs-dist", "lib", "es"] + "include": [ + ".dumirc.ts", + "src", + "tests", + "docs/examples" + ], + "exclude": [ + "docs-dist", + "lib", + "es" + ] } From 24419d182f98d7bd1197e205a65cf58f0ed32ab2 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 02:01:09 +0800 Subject: [PATCH 13/29] chore: address standardization review comments --- .github/workflows/surge-preview.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index cd006cf9..f84b7ab6 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -20,13 +20,23 @@ jobs: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 with: persist-credentials: false + - name: Check Surge token + id: surge-token + env: + SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} + run: | + if [ -n "$SURGE_TOKEN" ]; then + echo "enabled=true" >> "$GITHUB_OUTPUT" + else + echo "enabled=false" >> "$GITHUB_OUTPUT" + fi - name: Install dependencies run: npm install --ignore-scripts --no-audit --loglevel=warn - name: Build preview - if: ${{ secrets.SURGE_TOKEN != '' }} + if: ${{ steps.surge-token.outputs.enabled == 'true' }} run: npm run build - uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec - if: ${{ secrets.SURGE_TOKEN != '' }} + if: ${{ steps.surge-token.outputs.enabled == 'true' }} env: SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} with: From cb6219fe07727519c33a1d7626c9700239b3beae Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 12:24:54 +0800 Subject: [PATCH 14/29] ci: update GitHub Actions versions --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f911ba30..cff935e0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,15 +29,15 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e + uses: github/codeql-action/init@a0853c24544627f65ddf259abe73b1d18a591444 with: languages: ${{ matrix.language }} queries: +security-and-quality - name: Autobuild - uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e + uses: github/codeql-action/autobuild@a0853c24544627f65ddf259abe73b1d18a591444 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e + uses: github/codeql-action/analyze@a0853c24544627f65ddf259abe73b1d18a591444 with: category: '/language:${{ matrix.language }}' From fcd9887f6b681d452f72bbe25b62133efa356ed8 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 12:30:29 +0800 Subject: [PATCH 15/29] ci: use resolvable CodeQL action ref --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index cff935e0..f911ba30 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,15 +29,15 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@a0853c24544627f65ddf259abe73b1d18a591444 + uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e with: languages: ${{ matrix.language }} queries: +security-and-quality - name: Autobuild - uses: github/codeql-action/autobuild@a0853c24544627f65ddf259abe73b1d18a591444 + uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@a0853c24544627f65ddf259abe73b1d18a591444 + uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e with: category: '/language:${{ matrix.language }}' From 0222ea5247b5c35710e2dc3e5664841796ac88d6 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 13:47:18 +0800 Subject: [PATCH 16/29] ci: use test-utoo workflow from main --- .github/workflows/react-component-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index a33292ef..d91f4b47 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -11,5 +11,5 @@ permissions: jobs: test: - uses: react-component/rc-test/.github/workflows/test-utoo.yml@b8ebddc81ef706b50faff0242ab34ad8ecdd9a59 + uses: react-component/rc-test/.github/workflows/test-utoo.yml@main secrets: inherit From 2e7ad96e004e503a7761d0378113c91c47d99088 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 14:03:18 +0800 Subject: [PATCH 17/29] ci: use actions checkout v7 --- .github/workflows/codeql.yml | 2 +- .github/workflows/react-doctor.yml | 2 +- .github/workflows/surge-preview.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f911ba30..4ddf3594 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + uses: actions/checkout@v7 with: persist-credentials: false diff --git a/.github/workflows/react-doctor.yml b/.github/workflows/react-doctor.yml index 9e0dfb91..56430b6e 100644 --- a/.github/workflows/react-doctor.yml +++ b/.github/workflows/react-doctor.yml @@ -16,7 +16,7 @@ jobs: react-doctor: runs-on: ubuntu-latest steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + - uses: actions/checkout@v7 with: persist-credentials: false - uses: millionco/react-doctor@0b4f4f4bd248a154e64eb508a48347f71154b3f3 diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index f84b7ab6..85e33da1 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -17,7 +17,7 @@ jobs: preview: runs-on: ubuntu-latest steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + - uses: actions/checkout@v7 with: persist-credentials: false - name: Check Surge token From cb3c28697098ff79240b9600f11916c2a34fa387 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 14:32:38 +0800 Subject: [PATCH 18/29] chore: standardize package metadata --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index be183a42..02bc19db 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "react-trigger", "trigger" ], - "homepage": "https://github.com/react-component/trigger", + "homepage": "https://react-component.github.io/trigger", "author": "", "repository": { "type": "git", @@ -77,5 +77,8 @@ "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" + }, + "publishConfig": { + "access": "public" } } From 4640585fd4eb6857dd815b39ec1fbb273ce006af Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 14:38:59 +0800 Subject: [PATCH 19/29] ci: standardize dependabot updates --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0737a7d8..3b730ef9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,4 +6,14 @@ updates: interval: weekly day: monday time: '21:00' + timezone: Asia/Shanghai + open-pull-requests-limit: 10 + + - package-ecosystem: github-actions + directory: '/' + schedule: + interval: weekly + day: monday + time: '21:00' + timezone: Asia/Shanghai open-pull-requests-limit: 10 From 3ad3348da265d229b4ce0176f0cb5aea3298e061 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 16:53:28 +0800 Subject: [PATCH 20/29] docs: localize Chinese README descriptions --- README.zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index cd763d39..90df82fc 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -84,7 +84,7 @@ npm start | maskClosable | 点击遮罩时关闭。 | `boolean` | `true` | | maskMotion | 遮罩动画配置。 | `CSSMotionProps` | - | | mouseEnterDelay | mouse enter 后显示前的延迟,单位为秒。 | `number` | - | -| mouseLeaveDelay | mouse leave 后隐藏前的延迟,单位为秒。 | `number` | `0.1` | +| mouseLeaveDelay | 鼠标离开后隐藏前的延迟,单位为秒。 | `number` | `0.1` | | popup | 弹层内容。 | `ReactNode` \| `() => ReactNode` | - | | popupAlign | 与 dom-align 兼容的对齐配置。 | `AlignType` | - | | popupClassName | 添加到弹层的 className。 | `string` | - | From b0c0303aaab2510e9df217ea3e8dc3706146c8a4 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 17:17:02 +0800 Subject: [PATCH 21/29] chore: refine preview workflow ignores --- .github/workflows/surge-preview.yml | 1 + .prettierignore | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 .prettierignore diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index 85e33da1..1a44351c 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -31,6 +31,7 @@ jobs: echo "enabled=false" >> "$GITHUB_OUTPUT" fi - name: Install dependencies + if: ${{ steps.surge-token.outputs.enabled == 'true' }} run: npm install --ignore-scripts --no-audit --loglevel=warn - name: Build preview if: ${{ steps.surge-token.outputs.enabled == 'true' }} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..c466d872 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,14 @@ +node_modules +coverage +docs-dist +dist +es +lib +.dumi/tmp +.dumi/tmp-production +.vercel +package-lock.json +pnpm-lock.yaml +yarn.lock +bun.lockb +*.log From 1575b97320677463f62f176df996a47aebd1ad8c Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 19:14:32 +0800 Subject: [PATCH 22/29] chore: add father config --- .fatherrc.ts | 5 +++++ tsconfig.json | 1 + 2 files changed, 6 insertions(+) create mode 100644 .fatherrc.ts diff --git a/.fatherrc.ts b/.fatherrc.ts new file mode 100644 index 00000000..96268ae1 --- /dev/null +++ b/.fatherrc.ts @@ -0,0 +1,5 @@ +import { defineConfig } from 'father'; + +export default defineConfig({ + plugins: ['@rc-component/father-plugin'], +}); diff --git a/tsconfig.json b/tsconfig.json index 17f96dce..b6477752 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -36,6 +36,7 @@ }, "include": [ ".dumirc.ts", + ".fatherrc.ts", "src", "tests", "docs/examples" From 966a94dde3b7fbe1d737f748c88006aadd207cd4 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 19:39:55 +0800 Subject: [PATCH 23/29] docs: document dumi dev server port --- README.md | 2 ++ README.zh-CN.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 0ef91ee3..861f7078 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,8 @@ npm test npm run build ``` +The dumi site runs at `http://localhost:8000` by default. + ## Release ```bash diff --git a/README.zh-CN.md b/README.zh-CN.md index 90df82fc..3bbbb311 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -113,6 +113,8 @@ npm test npm run build ``` +dumi 站点默认运行在 `http://localhost:8000`。 + ## 发布 ```bash From 44d23dbc428141f46eb351ac8bb6d7243a67a516 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 19:59:33 +0800 Subject: [PATCH 24/29] chore: standardize husky configuration --- .husky/pre-commit | 1 + package.json | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..2312dc58 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged diff --git a/package.json b/package.json index 02bc19db..708e69e9 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,8 @@ "prettier": "prettier --write --ignore-unknown .", "start": "dumi dev", "test": "rc-test", - "tsc": "tsc --noEmit" + "tsc": "tsc --noEmit", + "prepare": "husky" }, "dependencies": { "@rc-component/motion": "^1.3.3", @@ -72,7 +73,9 @@ "react-dom": "^18.3.1", "regenerator-runtime": "^0.14.1", "typescript": "^5.9.3", - "gh-pages": "^6.3.0" + "gh-pages": "^6.3.0", + "husky": "^9.1.7", + "lint-staged": "^16.4.0" }, "peerDependencies": { "react": ">=18.0.0", @@ -80,5 +83,8 @@ }, "publishConfig": { "access": "public" + }, + "lint-staged": { + "*": "prettier --write --ignore-unknown" } } From 750f5b141b5b025d88cf916e647e6fa92e969801 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 20:33:43 +0800 Subject: [PATCH 25/29] chore: standardize package type entry --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 708e69e9..18549796 100644 --- a/package.json +++ b/package.json @@ -86,5 +86,6 @@ }, "lint-staged": { "*": "prettier --write --ignore-unknown" - } + }, + "types": "./es/index.d.ts" } From c199f45937057810fabc160e70821b2dc9acb88c Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:01:55 +0800 Subject: [PATCH 26/29] docs: normalize readme badges --- README.md | 13 +++++++------ README.zh-CN.md | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 861f7078..80ed5e4c 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,14 @@

@rc-component/trigger

Ant Design Part of the Ant Design ecosystem.

🎯 Popup trigger and alignment primitive for React.

+

- npm version - npm downloads - CI - Codecov - bundle size - dumi + NPM version + npm downloads + build status + Codecov + bundle size + dumi

diff --git a/README.zh-CN.md b/README.zh-CN.md index 3bbbb311..4d82ce87 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -2,13 +2,14 @@

@rc-component/trigger

Ant Design Ant Design 生态的一部分。

🎯 React 弹层触发基础组件,支持定位、对齐、动画和事件触发。

+

- npm version - npm downloads - CI - Codecov - bundle size - dumi + NPM version + npm downloads + build status + Codecov + bundle size + dumi

From 70b6d22712d7d5416b2c5a78227b5b05a8b6bc30 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:21:47 +0800 Subject: [PATCH 27/29] ci: limit reusable workflow secrets --- .github/workflows/react-component-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index d91f4b47..958b6753 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -12,4 +12,6 @@ permissions: jobs: test: uses: react-component/rc-test/.github/workflows/test-utoo.yml@main - secrets: inherit + secrets: + + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 5ce8cb8cad9632faada07e2d3c68a19fe815a1c8 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:30:31 +0800 Subject: [PATCH 28/29] ci: restore reusable workflow compatibility --- .github/workflows/react-component-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index 958b6753..d91f4b47 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -12,6 +12,4 @@ permissions: jobs: test: uses: react-component/rc-test/.github/workflows/test-utoo.yml@main - secrets: - - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + secrets: inherit From 7e455d9cb4b8a64fa3beae5e3ec6dc6dd13d8435 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 29 Jun 2026 14:27:22 +0800 Subject: [PATCH 29/29] chore: limit reusable workflow secrets --- .github/workflows/react-component-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index d91f4b47..1d160790 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -12,4 +12,5 @@ permissions: jobs: test: uses: react-component/rc-test/.github/workflows/test-utoo.yml@main - secrets: inherit + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file