@@ -27,22 +27,22 @@ function handleDisconnect() {
2727 disconnect ()
2828}
2929
30- // function copyCommand() {
31- // let command = executeNpmxConnectorCommand.value
32- // if (portInput.value !== '31415') {
33- // command += ` --port ${portInput.value}`
34- // }
35- // copy(command)
36- // }
37-
38- // const selectedPM = useSelectedPackageManager()
39-
40- // const executeNpmxConnectorCommand = computed(() => {
41- // return getExecuteCommand({
42- // packageName: 'npmx-connector',
43- // packageManager: selectedPM.value,
44- // })
45- // })
30+ function copyCommand() {
31+ let command = executeNpmxConnectorCommand .value
32+ if (portInput .value !== ' 31415' ) {
33+ command += ` --port ${portInput .value } `
34+ }
35+ copy (command )
36+ }
37+
38+ const selectedPM = useSelectedPackageManager ()
39+
40+ const executeNpmxConnectorCommand = computed (() => {
41+ return getExecuteCommand ({
42+ packageName: ' npmx-connector' ,
43+ packageManager: selectedPM .value ,
44+ })
45+ })
4646 </script >
4747
4848<template >
@@ -87,26 +87,6 @@ function handleDisconnect() {
8787
8888 <!-- Disconnected state -->
8989 <form v-else class =" space-y-4" @submit.prevent =" handleConnect" >
90- <!-- Contributor-only notice -->
91- <div class =" p-3 bg-amber-500/10 border border-amber-500/30 rounded-lg" >
92- <div >
93- <span class =" inline-block text-xs font-bold uppercase tracking-wider text-fg rounded" >
94- {{ $t('connector.modal.contributor_badge') }}
95- </span >
96- <p class =" text-sm text-fg-muted" >
97- <i18n-t keypath =" connector.modal.contributor_notice" scope =" global" >
98- <template #link >
99- <LinkBase
100- to =" https://github.com/npmx-dev/npmx.dev/blob/main/CONTRIBUTING.md#local-connector-cli"
101- >
102- {{ $t('connector.modal.contributor_link') }}
103- </LinkBase >
104- </template >
105- </i18n-t >
106- </p >
107- </div >
108- </div >
109-
11090 <p class =" text-sm text-fg-muted" >
11191 {{ $t('connector.modal.run_hint') }}
11292 </p >
@@ -116,43 +96,20 @@ function handleDisconnect() {
11696 dir =" ltr"
11797 >
11898 <span class =" text-fg-subtle" >$</span >
119- <span class =" text-fg-subtle ms-2" >npx npmx-connector</span >
120- <ButtonBase
121- :aria-label =" copied ? $t('connector.modal.copied') : $t('connector.modal.copy_command')"
122- @click =" copy('npx npmx-connector')"
123- class =" ms-auto"
124- :classicon =" copied ? 'i-lucide:check text-green-500' : 'i-lucide:copy'"
125- />
99+ <span class =" text-fg-subtle ms-2" >{{ executeNpmxConnectorCommand }}</span >
100+ <div class =" ms-auto flex items-center gap-2" >
101+ <!-- Disable teleport in a modal dialog -->
102+ <PackageManagerSelect :teleport =" false" />
103+
104+ <ButtonBase
105+ :aria-label =" copied ? $t('connector.modal.copied') : $t('connector.modal.copy_command')"
106+ @click =" copyCommand"
107+ class =" ms-auto"
108+ :classicon =" copied ? 'i-lucide:check text-green-500' : 'i-lucide:copy'"
109+ />
110+ </div >
126111 </div >
127112
128- <!-- TODO: Uncomment when npmx-connector is published to npm
129- <div
130- class="flex items-center p-3 bg-bg-muted border border-border rounded-lg font-mono text-sm"
131- >
132- <span class="text-fg-subtle">$</span>
133- <span class="text-fg-subtle ms-2">{{ executeNpmxConnectorCommand }}</span>
134- <div class="ms-auto flex items-center gap-2">
135- <PackageManagerSelect />
136-
137- <button
138- type="button"
139- :aria-label="
140- copied ? $t('connector.modal.copied') : $t('connector.modal.copy_command')
141- "
142- class="ms-auto text-fg-subtle p-1.5 -m-1.5 hover:text-fg transition-colors duration-200 focus-visible:outline-accent/70 rounded"
143- @click="copyCommand"
144- >
145- <span v-if="!copied" class="i-lucide:copy block w-5 h-5" aria-hidden="true" />
146- <span
147- v-else
148- class="i-lucide:check block w-5 h-5 text-green-500"
149- aria-hidden="true"
150- />
151- </button>
152- </div>
153- </div>
154- -->
155-
156113 <p class =" text-sm text-fg-muted" >{{ $t('connector.modal.paste_token') }}</p >
157114
158115 <div class =" space-y-3" >
0 commit comments