Skip to content
Open
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
18 changes: 16 additions & 2 deletions .github/workflows/beta-release.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Beta Release

on:
workflow_call:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
beta_release:
if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.fork == false
runs-on: ubuntu-latest
concurrency:
group: beta-release-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
id-token: write
issues: write
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -35,8 +41,16 @@ jobs:
env:
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}

- name: Build package
run: npm run build

- uses: actions/setup-node@v4
with:
node-version: '22.14.0'
registry-url: 'https://registry.npmjs.org'

- name: Release a new beta version
run: npm publish --tag beta --provenance --access public
run: npm publish --tag beta --access public --ignore-scripts

- uses: actions/github-script@v6
with:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ jobs:
if: 'github.event.pull_request.draft == false'
uses: ./.github/workflows/bundlesize.yaml

beta_release:
uses: ./.github/workflows/beta-release.yaml
# allow the children job to have access to the secrets of the repository
secrets: inherit

fail_if_pull_request_is_draft:
if: github.event.pull_request.draft == true
runs-on: ubuntu-18.04
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
"license": "MIT",
"private": false,
"author": "ReactTooltip",
"repository": "https://github.com/ReactTooltip/react-tooltip",
"repository": {
"type": "git",
"url": "git+https://github.com/ReactTooltip/react-tooltip.git"
},
"keywords": [
"react",
"react-component",
Expand Down
1 change: 1 addition & 0 deletions src/components/Tooltip/core-styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
position: absolute;
background: inherit;
z-index: -1;
clip-path: polygon(0% 100%, 100% 0%, 100% 100%);
}

.noArrow {
Expand Down
17 changes: 10 additions & 7 deletions src/components/TooltipController/TooltipController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,16 @@ const TooltipController = React.forwardRef<TooltipRefProps, ITooltipController>(
const { anchorRefs, activeAnchor: providerActiveAnchor } = useTooltip(id)

const getDataAttributesFromAnchorElement = (elementReference: HTMLElement) => {
const dataAttributes = elementReference?.getAttributeNames().reduce((acc, name) => {
if (name.startsWith('data-tooltip-')) {
const parsedAttribute = name.replace(/^data-tooltip-/, '') as DataAttribute
acc[parsedAttribute] = elementReference?.getAttribute(name) ?? null
}
return acc
}, {} as Record<DataAttribute, string | null>)
const dataAttributes = elementReference?.getAttributeNames().reduce(
(acc, name) => {
if (name.startsWith('data-tooltip-')) {
const parsedAttribute = name.replace(/^data-tooltip-/, '') as DataAttribute
acc[parsedAttribute] = elementReference?.getAttribute(name) ?? null
}
return acc
},
{} as Record<DataAttribute, string | null>,
)

return dataAttributes
}
Expand Down
Loading