diff --git a/apps/client-web/package.json b/apps/client-web/package.json index 9366445..5f75d06 100644 --- a/apps/client-web/package.json +++ b/apps/client-web/package.json @@ -18,6 +18,7 @@ "@codemirror/state": "^6.5.2", "@codemirror/view": "^6.38.8", "@inkcre/core": "workspace:*", + "@inkcre/extension-runtime-client-web": "https://github.com/InKCre/ext-reg/releases/download/runtime-client-web-v0.1.0/inkcre-extension-runtime-client-web-0.1.0.tgz", "@inkcre/ui-web": "1.4.0", "@module-federation/runtime": "^0.21.4", "@supabase/postgrest-js": "^2.84.0", diff --git a/apps/client-web/src/components/extension/extensionCard/extensionCard.md b/apps/client-web/src/components/extension/extensionCard/extensionCard.md index 2911d00..ec13f24 100644 --- a/apps/client-web/src/components/extension/extensionCard/extensionCard.md +++ b/apps/client-web/src/components/extension/extensionCard/extensionCard.md @@ -5,11 +5,12 @@ A component that displays extension information and provides controls for toggli ## Props - `extension` (InstalledExtension, required): the canonical installed row -- `enabled` (boolean, required): whether the current Web Peer UUID is in `enabled[]` +- `enabled` (boolean, required): whether the selected Client's Peer UUID is in `enabled[]` +- `controlsCurrentWebRuntime` (boolean, required): whether the switch owns this browser's runtime +- `setEnabled` (function, required): application-level selected-Client control operation ## Emits -- `changed`: Emitted after current-Peer enablement changes and the list should be refreshed - `updated`: Emitted with the canonical row after configuration or version changes - `uninstalled`: Emitted after the canonical row is removed @@ -17,6 +18,8 @@ A component that displays extension information and provides controls for toggli - Display canonical Extension Name, exact version, and optional nickname - Toggle enable/disable status with a switch +- Mount an Extension-owned setup contribution from this browser's running Web Distribution +- Keep setup availability independent of which Client is selected for enablement control - Edit extension configuration via JSON editor in a dialog - Change the exact shared version only while every Peer is disabled - Auto-formats configuration as JSON for easier editing diff --git a/apps/client-web/src/components/extension/extensionCard/extensionCard.ts b/apps/client-web/src/components/extension/extensionCard/extensionCard.ts index 9643960..5713e30 100644 --- a/apps/client-web/src/components/extension/extensionCard/extensionCard.ts +++ b/apps/client-web/src/components/extension/extensionCard/extensionCard.ts @@ -5,11 +5,15 @@ import type { InstalledExtension } from '@inkcre/core' export const extensionCardProps = { extension: { type: Object as PropType, required: true }, enabled: { type: Boolean, required: true }, + controlsCurrentWebRuntime: { type: Boolean, required: true }, + setEnabled: { + type: Function as PropType<(enabled: boolean) => Promise>, + required: true, + }, } as const // --- Emits --- export const extensionCardEmits = { - changed: () => true, updated: (_extension: InstalledExtension) => true, uninstalled: () => true, } as const diff --git a/apps/client-web/src/components/extension/extensionCard/extensionCard.vue b/apps/client-web/src/components/extension/extensionCard/extensionCard.vue index f72f738..ae5aab3 100644 --- a/apps/client-web/src/components/extension/extensionCard/extensionCard.vue +++ b/apps/client-web/src/components/extension/extensionCard/extensionCard.vue @@ -1,8 +1,8 @@