refactor: migrate legacy wire namespace to wrn
This commit is contained in:
@@ -18,7 +18,7 @@ component PresenceList {
|
||||
<Avatar src='{member.avatar || ""}' fallback='{member.name || member.userId || "?"}' size="sm" color='{color}' />
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="m-0 truncate text-sm font-semibold">{member.name || member.userId}</p>
|
||||
<p class="m-0 text-xs text-[var(--wire-color-muted)]">{member.status || "online"}</p>
|
||||
<p class="m-0 text-xs text-[var(--wrn-color-muted)]">{member.status || "online"}</p>
|
||||
</div>
|
||||
<Badge label='{member.status || "online"}' color='{member.status == "busy" ? "danger" : member.status == "away" ? "warning" : "success"}' size="sm" variant="soft" />
|
||||
</div>
|
||||
|
||||
@@ -25,8 +25,8 @@ component RealtimeRoom {
|
||||
>
|
||||
<section data-room='{room}' data-room-user='{user}' class="flex min-h-72 flex-col gap-4">
|
||||
<RoomStatus label='{statusLabel}' color='{color}' size='{size}' />
|
||||
<div data-room-log role="log" aria-live="polite" class="flex min-h-40 flex-1 flex-col gap-3 overflow-y-auto rounded-[var(--wire-radius-sm)] bg-[var(--wire-color-surface-2)] p-3">
|
||||
<p data-room-empty class="m-auto text-sm text-[var(--wire-color-muted)]">{emptyLabel}</p>
|
||||
<div data-room-log role="log" aria-live="polite" class="flex min-h-40 flex-1 flex-col gap-3 overflow-y-auto rounded-[var(--wrn-radius-sm)] bg-[var(--wrn-color-surface-2)] p-3">
|
||||
<p data-room-empty class="m-auto text-sm text-[var(--wrn-color-muted)]">{emptyLabel}</p>
|
||||
<slot></slot>
|
||||
</div>
|
||||
<slot name="composer"></slot>
|
||||
|
||||
@@ -16,8 +16,8 @@ component RoomStatus {
|
||||
<Badge label="Live" color='{color}' size='{size}' variant="soft" />
|
||||
<span
|
||||
data-room-status
|
||||
data-room-status-class="inline-flex items-center gap-2 text-xs font-medium text-[var(--wire-color-muted)]"
|
||||
class="inline-flex items-center gap-2 text-xs font-medium text-[var(--wire-color-muted)]"
|
||||
data-room-status-class="inline-flex items-center gap-2 text-xs font-medium text-[var(--wrn-color-muted)]"
|
||||
class="inline-flex items-center gap-2 text-xs font-medium text-[var(--wrn-color-muted)]"
|
||||
aria-live="polite"
|
||||
>{label}</span>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@wrnexus/realtime",
|
||||
"version": "0.8.8",
|
||||
"version": "0.8.9",
|
||||
"description": "Typed realtime rooms, message helpers, presence utilities, package UI blocks, and WRNexusJS integration.",
|
||||
"type": "module",
|
||||
"sideEffects": false,
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface BrowserRoomConnection {
|
||||
}
|
||||
|
||||
export interface WrnexusRealtimeWindow extends Window {
|
||||
wire?: {
|
||||
wrn?: {
|
||||
room?: (name: string, query?: string) => BrowserRoomConnection;
|
||||
};
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export function connectRoom(
|
||||
): BrowserRoomConnection {
|
||||
const roomName = assertRealtimeRoomName(name);
|
||||
const target = options.window ?? (globalThis as unknown as WrnexusRealtimeWindow);
|
||||
const factory = target.wire?.room;
|
||||
const factory = target.wrn?.room;
|
||||
if (!factory) {
|
||||
throw new Error(
|
||||
"WRN-REALTIME-CLIENT-NOT-READY: add a RealtimeRoom/data-room component before calling connectRoom().",
|
||||
|
||||
Reference in New Issue
Block a user