-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
212 changed files
with
16,996 additions
and
2,705 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
### Description | ||
|
||
<!-- Please insert your description here and provide info about the "what" this PR is solving. --> | ||
|
||
### Linked Issues | ||
|
||
<!-- e.g. fixes #123 --> | ||
|
||
### Additional Context | ||
|
||
<!-- Is there anything you would like the reviewers to focus on? --> | ||
|
||
--- | ||
|
||
> [!TIP] | ||
> The author of this PR can publish a _preview release_ by commenting `/publish` below. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Add continuous release label | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
label: | ||
if: ${{ github.event.issue.pull_request && (github.event.comment.user.id == github.event.issue.user.id || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR') && startsWith(github.event.comment.body, '/publish') }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- run: gh issue edit ${{ github.event.issue.number }} --add-label cr-tracked --repo ${{ github.repository }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.CR_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: CR | ||
|
||
env: | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
types: [opened, synchronize, labeled, ready_for_review] | ||
paths-ignore: | ||
- '.github/**' | ||
- '__tests__/**' | ||
- 'art/**' | ||
- 'docs/**' | ||
- '*.md' | ||
|
||
permissions: {} | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
release: | ||
if: ${{ !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'cr-tracked') && !contains(github.event.pull_request.labels.*.name, 'spam') && !contains(github.event.pull_request.labels.*.name, 'invalid') }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v3 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
cache: pnpm | ||
- run: pnpm install | ||
- run: pnpm build | ||
- run: npx pkg-pr-new publish --compact --no-template --pnpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
__tests__/e2e/.vitepress/theme/components/ApiPreference.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<script setup lang="ts"> | ||
import { useLocalStorage } from '@vueuse/core' | ||
const props = defineProps<{ | ||
options: string[] | ||
defaultOption: string | ||
screenMenu?: boolean | ||
}>() | ||
// reactivity isn't needed for props here | ||
const key = removeSpaces(`api-preference-${props.options.join('-')}`) | ||
const name = key + (props.screenMenu ? '-screen-menu' : '') | ||
const selected = useLocalStorage(key, () => props.defaultOption) | ||
const optionsWithKeys = props.options.map((option) => ({ | ||
key: name + '-' + removeSpaces(option), | ||
value: option | ||
})) | ||
function removeSpaces(str: string) { | ||
return str.replace(/\s/g, '_') | ||
} | ||
</script> | ||
|
||
<template> | ||
<div class="VPApiPreference" :class="{ 'screen-menu': screenMenu }"> | ||
<template v-for="option in optionsWithKeys" :key="option"> | ||
<input | ||
type="radio" | ||
:id="option.key" | ||
:name="name" | ||
:value="option.value" | ||
v-model="selected" | ||
/> | ||
<label :for="option.key">{{ option.value }}</label> | ||
</template> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.VPApiPreference { | ||
display: flex; | ||
margin: 12px 0; | ||
border: 1px solid var(--vp-c-border); | ||
border-radius: 6px; | ||
font-size: 14px; | ||
color: var(--vp-c-text-1); | ||
} | ||
.VPApiPreference:first-child { | ||
margin-top: 0; | ||
} | ||
.VPApiPreference:last-child { | ||
margin-bottom: 0; | ||
} | ||
.VPApiPreference.screen-menu { | ||
margin: 12px 0 0 12px; | ||
} | ||
.VPApiPreference input[type='radio'] { | ||
pointer-events: none; | ||
position: fixed; | ||
opacity: 0; | ||
} | ||
.VPApiPreference label { | ||
flex: 1; | ||
margin: 2px; | ||
padding: 4px 12px; | ||
cursor: pointer; | ||
border-radius: 4px; | ||
text-align: center; | ||
} | ||
.VPApiPreference input[type='radio']:checked + label { | ||
background-color: var(--vp-c-default-soft); | ||
color: var(--vp-c-brand-1); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<script setup lang="ts"> | ||
import { computed } from 'vue' | ||
import { useRoute } from 'vitepress' | ||
import VPNavBarMenuGroup from 'vitepress/dist/client/theme-default/components/VPNavBarMenuGroup.vue' | ||
import VPNavScreenMenuGroup from 'vitepress/dist/client/theme-default/components/VPNavScreenMenuGroup.vue' | ||
const props = defineProps<{ | ||
versions: { text: string; link: string }[] | ||
screenMenu?: boolean | ||
}>() | ||
const route = useRoute() | ||
const sortedVersions = computed(() => { | ||
return [...props.versions].sort( | ||
(a, b) => b.link.split('/').length - a.link.split('/').length | ||
) | ||
}) | ||
const currentVersion = computed(() => { | ||
return ( | ||
sortedVersions.value.find((version) => route.path.startsWith(version.link)) | ||
?.text || 'Versions' | ||
) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<VPNavBarMenuGroup | ||
v-if="!screenMenu" | ||
:item="{ text: currentVersion, items: versions }" | ||
class="VPNavVersion" | ||
/> | ||
<VPNavScreenMenuGroup | ||
v-else | ||
:text="currentVersion" | ||
:items="versions" | ||
class="VPNavVersion" | ||
/> | ||
</template> | ||
|
||
<style scoped> | ||
.VPNavVersion :deep(button .text) { | ||
color: var(--vp-c-text-1) !important; | ||
} | ||
.VPNavVersion:hover :deep(button .text) { | ||
color: var(--vp-c-text-2) !important; | ||
} | ||
</style> |
Oops, something went wrong.