Skip to content
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
99 changes: 28 additions & 71 deletions app/components/Header/ConnectorModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ function handleDisconnect() {
disconnect()
}

// function copyCommand() {
// let command = executeNpmxConnectorCommand.value
// if (portInput.value !== '31415') {
// command += ` --port ${portInput.value}`
// }
// copy(command)
// }

// const selectedPM = useSelectedPackageManager()

// const executeNpmxConnectorCommand = computed(() => {
// return getExecuteCommand({
// packageName: 'npmx-connector',
// packageManager: selectedPM.value,
// })
// })
function copyCommand() {
let command = executeNpmxConnectorCommand.value
if (portInput.value !== '31415') {
command += ` --port ${portInput.value}`
}
copy(command)
}

const selectedPM = useSelectedPackageManager()

const executeNpmxConnectorCommand = computed(() => {
return getExecuteCommand({
packageName: 'npmx-connector',
packageManager: selectedPM.value,
})
})
</script>

<template>
Expand Down Expand Up @@ -87,26 +87,6 @@ function handleDisconnect() {

<!-- Disconnected state -->
<form v-else class="space-y-4" @submit.prevent="handleConnect">
<!-- Contributor-only notice -->
<div class="p-3 bg-amber-500/10 border border-amber-500/30 rounded-lg">
<div>
<span class="inline-block text-xs font-bold uppercase tracking-wider text-fg rounded">
{{ $t('connector.modal.contributor_badge') }}
</span>
<p class="text-sm text-fg-muted">
<i18n-t keypath="connector.modal.contributor_notice" scope="global">
<template #link>
<LinkBase
to="https://github.com/npmx-dev/npmx.dev/blob/main/CONTRIBUTING.md#local-connector-cli"
>
{{ $t('connector.modal.contributor_link') }}
</LinkBase>
</template>
</i18n-t>
</p>
</div>
</div>

<p class="text-sm text-fg-muted">
{{ $t('connector.modal.run_hint') }}
</p>
Expand All @@ -116,43 +96,20 @@ function handleDisconnect() {
dir="ltr"
>
<span class="text-fg-subtle">$</span>
<span class="text-fg-subtle ms-2">npx npmx-connector</span>
<ButtonBase
:aria-label="copied ? $t('connector.modal.copied') : $t('connector.modal.copy_command')"
@click="copy('npx npmx-connector')"
class="ms-auto"
:classicon="copied ? 'i-lucide:check text-green-500' : 'i-lucide:copy'"
/>
<span class="text-fg-subtle ms-2">{{ executeNpmxConnectorCommand }}</span>
<div class="ms-auto flex items-center gap-2">
<!-- Disable teleport in a modal dialog -->
<PackageManagerSelect :teleport="false" />

<ButtonBase
:aria-label="copied ? $t('connector.modal.copied') : $t('connector.modal.copy_command')"
@click="copyCommand"
class="ms-auto"
:classicon="copied ? 'i-lucide:check text-green-500' : 'i-lucide:copy'"
/>
</div>
</div>

<!-- TODO: Uncomment when npmx-connector is published to npm
<div
class="flex items-center p-3 bg-bg-muted border border-border rounded-lg font-mono text-sm"
>
<span class="text-fg-subtle">$</span>
<span class="text-fg-subtle ms-2">{{ executeNpmxConnectorCommand }}</span>
<div class="ms-auto flex items-center gap-2">
<PackageManagerSelect />

<button
type="button"
:aria-label="
copied ? $t('connector.modal.copied') : $t('connector.modal.copy_command')
"
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"
@click="copyCommand"
>
<span v-if="!copied" class="i-lucide:copy block w-5 h-5" aria-hidden="true" />
<span
v-else
class="i-lucide:check block w-5 h-5 text-green-500"
aria-hidden="true"
/>
</button>
</div>
</div>
-->

<p class="text-sm text-fg-muted">{{ $t('connector.modal.paste_token') }}</p>

<div class="space-y-3">
Expand Down
11 changes: 10 additions & 1 deletion app/components/Package/ManagerSelect.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<script setup lang="ts">
import { onClickOutside, useEventListener } from '@vueuse/core'

withDefaults(
defineProps<{
teleport?: boolean
}>(),
{
teleport: true,
},
)

const selectedPM = useSelectedPackageManager()

const listRef = useTemplateRef('listRef')
Expand Down Expand Up @@ -121,7 +130,7 @@ function handleKeydown(event: KeyboardEvent) {
</button>

<!-- Dropdown menu (teleported to body to avoid clipping) -->
<Teleport to="body">
<Teleport to="body" :disabled="!teleport">
<Transition
:enter-active-class="prefersReducedMotion ? '' : 'transition-opacity duration-150'"
:enter-from-class="prefersReducedMotion ? '' : 'opacity-0'"
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,6 @@
"connector": {
"modal": {
"title": "الموصل المحلي",
"contributor_badge": "للمساهمين فقط",
"contributor_notice": "لم يُنشر الموصل بعد على npm. راجع {link} لمعرفة كيفية التشغيل محليًا.",
"contributor_link": "دليل المساهمة",
"connected": "متصل",
"connected_as_user": "متصل كـ ~{user}",
"connected_hint": "يمكنك الآن إدارة الحزم والمؤسسات من واجهة الويب.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/az-AZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,6 @@
"connector": {
"modal": {
"title": "Lokal Konnektor",
"contributor_badge": "Yalnız əməkdaşlar üçün",
"contributor_notice": "Konnektor hələ npm-ə dərc edilməyib. Lokal işə salmaq üçün {link} baxın.",
"contributor_link": "töhfə bələdçisi",
"connected": "Qoşulub",
"connected_as_user": "~{user} kimi qoşulub",
"connected_hint": "İndi veb interfeysdən paketləri və təşkilatları idarə edə bilərsiniz.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/bg-BG.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,6 @@
"connector": {
"modal": {
"title": "Локален конектор",
"contributor_badge": "Само за сътрудници",
"contributor_notice": "Конекторът все още не е публикуван в npm. Вижте {link} за как да го стартирате локално.",
"contributor_link": "ръководство за сътрудничество",
"connected": "Свързан",
"connected_as_user": "Свързан като ~{user}",
"connected_hint": "Сега можете да управлявате пакети и организации от уеб интерфейса.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/bn-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,6 @@
"connector": {
"modal": {
"title": "স্থানীয় কনেক্টর",
"contributor_badge": "কন্ট্রিবিউটারদের জন্য মাত্র",
"contributor_notice": "কনেক্টর এখনো npm এ প্রকাশিত হয়নি। স্থানীয়ভাবে চালানোর জন্য {link} দেখুন।",
"contributor_link": "অবদানের নির্দেশনা",
"connected": "সংযুক্ত হয়েছে",
"connected_as_user": "~{user} হিসাবে সংযুক্ত",
"connected_hint": "এখন আপনি ওয়েব UI থেকে প্যাকেজ এবং সংস্থাগুলি পরিচালনা করতে পারবেন।",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/cs-CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,6 @@
"connector": {
"modal": {
"title": "Lokální konektor",
"contributor_badge": "Pouze přispěvatelé",
"contributor_notice": "Konektor ještě není publikován na npm. Viz {link} pro informace, jak jej spustit lokálně.",
"contributor_link": "příručka pro přispěvatele",
"connected": "Připojeno",
"connected_as_user": "Připojeno jako ~{user}",
"connected_hint": "Nyní můžete spravovat balíčky a organizace z webového rozhraní.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,6 @@
"connector": {
"modal": {
"title": "Lokaler Connector",
"contributor_badge": "Nur für Mitwirkende",
"contributor_notice": "Der Connector ist noch nicht auf npm veröffentlicht. Siehe den {link} für Informationen zum lokalen Ausführen.",
"contributor_link": "Leitfaden für Mitwirkende",
"connected": "Verbunden",
"connected_as_user": "Verbunden als ~{user}",
"connected_hint": "Du kannst jetzt Pakete und Organisationen über die Web-Oberfläche verwalten.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,6 @@
"connector": {
"modal": {
"title": "Local Connector",
"contributor_badge": "Contributors only",
"contributor_notice": "The connector is not yet published to npm. See the {link} for how to run locally.",
"contributor_link": "contributing guide",
"connected": "Connected",
"connected_as_user": "Connected as ~{user}",
"connected_hint": "You can now manage packages and organizations from the web UI.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,6 @@
"connector": {
"modal": {
"title": "Conector Local",
"contributor_badge": "Solo colaboradores",
"contributor_notice": "El conector aún no está publicado en npm. Consulta la {link} para saber cómo ejecutarlo localmente.",
"contributor_link": "guía de contribución",
"connected": "Conectado",
"connected_as_user": "Conectado como ~{user}",
"connected_hint": "Ahora puedes gestionar paquetes y organizaciones desde la interfaz web.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,6 @@
"connector": {
"modal": {
"title": "Connecteur local",
"contributor_badge": "Contributeurs uniquement",
"contributor_notice": "Le connecteur n'est pas encore publié sur npm. Consultez le {link} pour savoir comment l'exécuter localement.",
"contributor_link": "guide de contribution",
"connected": "Connecté·e",
"connected_as_user": "Connecté·e en tant que ~{user}",
"connected_hint": "Vous pouvez maintenant gérer les paquets et les organisations depuis l'interface web.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/hi-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,6 @@
"connector": {
"modal": {
"title": "लोकल कनेक्टर",
"contributor_badge": "केवल योगदानकर्ताओं के लिए",
"contributor_notice": "कनेक्टर अभी तक npm पर प्रकाशित नहीं हुआ है। स्थानीय रूप से चलाने के लिए {link} देखें।",
"contributor_link": "योगदान गाइड",
"connected": "कनेक्ट किया गया",
"connected_as_user": "~{user} के रूप में कनेक्ट किया गया",
"connected_hint": "अब आप वेब UI से पैकेज और संगठन प्रबंधित कर सकते हैं।",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/hu-HU.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,6 @@
"connector": {
"modal": {
"title": "Helyi Connector",
"contributor_badge": "Csak közreműködőknek",
"contributor_notice": "A connector még nincs közzétéve az npm-en. Lásd a(z) {link} -et a helyi futtatásról.",
"contributor_link": "közreműködési útmutató",
"connected": "Csatlakoztatva",
"connected_as_user": "Csatlakoztatva mint ~{user}",
"connected_hint": "Most már kezelheted a csomagokat és szervezeteket a webes felületről.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/id-ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,6 @@
"connector": {
"modal": {
"title": "Konektor Lokal",
"contributor_badge": "Hanya untuk kontributor",
"contributor_notice": "Konektor belum diterbitkan ke npm. Lihat {link} untuk cara menjalankannya secara lokal.",
"contributor_link": "panduan kontribusi",
"connected": "Terhubung",
"connected_as_user": "Terhubung sebagai ~{user}",
"connected_hint": "Anda sekarang dapat mengelola paket dan organisasi dari UI web.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,6 @@
"connector": {
"modal": {
"title": "Connettore locale",
"contributor_badge": "Solo collaboratori",
"contributor_notice": "Il connettore non è ancora pubblicato su npm. Vedi {link} per come eseguire localmente.",
"contributor_link": "guida ai contributi",
"connected": "Connesso",
"connected_as_user": "Connesso come ~{user}",
"connected_hint": "Puoi ora gestire i pacchetti e le organizzazioni dall'interfaccia web.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,6 @@
"connector": {
"modal": {
"title": "ローカルコネクタ",
"contributor_badge": "コントリビューター専用",
"contributor_notice": "コネクタはまだ npm に公開されていません。ローカルでの実行方法については {link} を参照してください。",
"contributor_link": "コントリビューションガイド",
"connected": "接続済み",
"connected_as_user": "~{user} として接続済み",
"connected_hint": "Web UIからパッケージとorganizationを管理できるようになりました。",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/kn-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,6 @@
"connector": {
"modal": {
"title": "ಸ್ಥಳೀಯ ಸಂಪರ್ಕಕ",
"contributor_badge": "ಸಹಯೋಗಿಗಳಿಗೆ ಮಾತ್ರ",
"contributor_notice": "ಸಂಪರ್ಕಕ ಇನ್ನೂ npm ನಲ್ಲಿ ಪ್ರಕಟವಾಗಿಲ್ಲ. ಸ್ಥಳೀಯವಾಗಿ ಚಾಲನೆ ಮಾಡಲು {link} ನೋಡಿ.",
"contributor_link": "ಸಹಯೋಗ ಮಾರ್ಗದರ್ಶಿ",
"connected": "ಸಂಪರ್ಕಿಸಲಾಗಿದೆ",
"connected_as_user": "~{user} ಎಂದು ಸಂಪರ್ಕಿಸಲಾಗಿದೆ",
"connected_hint": "ಈಗ ನೀವು ವೆಬ್ UI ಯಿಂದ ಪ್ಯಾಕೇಜ್‌ಗಳು ಮತ್ತು ಸಂಸ್ಥೆಗಳನ್ನು ನಿರ್ವಹಿಸಬಹುದು.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/nb-NO.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,6 @@
"connector": {
"modal": {
"title": "Lokal Connector",
"contributor_badge": "Kun for bidragsytere",
"contributor_notice": "Connectoren er ennå ikke publisert til npm. Se {link} for hvordan du kjører den lokalt.",
"contributor_link": "bidragsguiden",
"connected": "Tilkoblet",
"connected_as_user": "Koblet til som ~{user}",
"connected_hint": "Du kan nå administrere pakker og organisasjoner fra nettleseren.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/ne-NP.json
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,6 @@
"connector": {
"modal": {
"title": "लोकल कनेक्टर",
"contributor_badge": "कन्ट्रिब्युटर मात्र",
"contributor_notice": "कनेक्टर अझै npm मा प्रकाशित गरिएको छैन। लोकल रूपमा चलाउने तरिका हेर्न {link} हेर्नुहोस्।",
"contributor_link": "कन्ट्रिब्युटिङ गाइड",
"connected": "जोडियो",
"connected_as_user": "~{user} रूपमा जोडियो",
"connected_hint": "अब तपाईं वेब UI बाट प्याकेज र संगठनहरू व्यवस्थापन गर्न सक्नुहुन्छ।",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/pl-PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,6 @@
"connector": {
"modal": {
"title": "Lokalny konektor",
"contributor_badge": "Tylko dla współtwórców",
"contributor_notice": "Konektor nie jest jeszcze opublikowany na npm. Zobacz {link}, aby uruchomić lokalnie.",
"contributor_link": "przewodnik współtworzenia",
"connected": "Połączono",
"connected_as_user": "Połączono jako ~{user}",
"connected_hint": "Możesz teraz zarządzać pakietami i organizacjami z poziomu interfejsu WWW.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,6 @@
"connector": {
"modal": {
"title": "Conector Local",
"contributor_badge": "Apenas contribuidores",
"contributor_notice": "O conector ainda não foi publicado no npm. Veja o {link} para saber como executar localmente.",
"contributor_link": "guia de contribuição",
"connected": "Conectado",
"connected_as_user": "Conectado como ~{user}",
"connected_hint": "Agora você pode gerenciar pacotes e organizações a partir da interface web.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,6 @@
"connector": {
"modal": {
"title": "Локальный коннектор",
"contributor_badge": "Только для контрибьюторов",
"contributor_notice": "Коннектор ещё не опубликован в npm. См. {link}, чтобы узнать, как запустить его локально.",
"contributor_link": "руководстве для участников",
"connected": "Подключено",
"connected_as_user": "Подключен как ~{user}",
"connected_hint": "Теперь вы можете управлять пакетами и организациями из веб-интерфейса.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/ta-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,6 @@
"connector": {
"modal": {
"title": "உள்ளூர் இணைப்பான்",
"contributor_badge": "பங்களிப்பாளர்கள் மட்டும்",
"contributor_notice": "இணைப்பான் இன்னும் npm-ல் வெளியிடப்படவில்லை. உள்ளூரில் இயக்குவதற்கு {link} ஐப் பார்க்கவும்.",
"contributor_link": "பங்களிப்பு வழிகாட்டி",
"connected": "இணைக்கப்பட்டது",
"connected_as_user": "~{user} ஆக இணைக்கப்பட்டது",
"connected_hint": "இப்போது நீங்கள் இணைய இடைமுகத்திலிருந்து தொகுப்புகளையும் நிறுவனங்களையும் நிர்வகிக்கலாம்.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/te-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,6 @@
"connector": {
"modal": {
"title": "లోకల్ కనెక్టర్",
"contributor_badge": "కంట్రిబ్యూటర్‌లకు మాత్రమే",
"contributor_notice": "కనెక్టర్ ఇంకా npm లో ప్రచురించబడలేదు. స్థానికంగా అమలు చేయడానికి {link} చూడండి.",
"contributor_link": "కంట్రిబ్యూషన్ గైడ్",
"connected": "కనెక్ట్ చేయబడింది",
"connected_as_user": "~{user} గా కనెక్ట్ చేయబడింది",
"connected_hint": "ఇప్పుడు మీరు వెబ్ UI నుండి ప్యాకేజ్‌లు మరియు సంస్థలను నిర్వహించవచ్చు.",
Expand Down
3 changes: 0 additions & 3 deletions i18n/locales/tr-TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,6 @@
"connector": {
"modal": {
"title": "Yerel Bağlayıcı",
"contributor_badge": "Yalnızca katkıda bulunanlar için",
"contributor_notice": "Bağlayıcı henüz npm'e yayınlanmadı. Yerel olarak çalıştırmak için {link} bakın.",
"contributor_link": "katkı rehberi",
"connected": "Bağlandı",
"connected_as_user": "~{user} olarak bağlandı",
"connected_hint": "Artık web arayüzünden paketleri ve organizasyonları yönetebilirsiniz.",
Expand Down
Loading
Loading