diff --git a/package.json b/package.json index c4d64c8..a24ef0b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@welshman", "private": true, - "version": "0.8.7", + "version": "0.8.8", "workspaces": [ "packages/*" ], diff --git a/packages/app/package.json b/packages/app/package.json index 280745b..1b31497 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@welshman/app", - "version": "0.8.7", + "version": "0.8.8", "author": "hodlbod", "license": "MIT", "description": "A collection of svelte stores for use in building nostr client applications.", @@ -24,7 +24,7 @@ "throttle-debounce": "^5.0.2" }, "peerDependencies": { - "@pomade/core": "^0.1.1", + "@pomade/core": "^0.1.3", "@welshman/feeds": "workspace:*", "@welshman/lib": "workspace:*", "@welshman/net": "workspace:*", @@ -37,7 +37,7 @@ "devDependencies": { "rimraf": "~6.0.0", "typescript": "~5.8.0", - "@pomade/core": "^0.1.1", + "@pomade/core": "^0.1.3", "@types/throttle-debounce": "^5.0.2", "@welshman/feeds": "workspace:*", "@welshman/lib": "workspace:*", diff --git a/packages/content/package.json b/packages/content/package.json index 245d1ec..3469bd6 100644 --- a/packages/content/package.json +++ b/packages/content/package.json @@ -1,6 +1,6 @@ { "name": "@welshman/content", - "version": "0.8.7", + "version": "0.8.8", "author": "hodlbod", "license": "MIT", "description": "A collection of utilities for parsing nostr note content.", diff --git a/packages/editor/package.json b/packages/editor/package.json index 5953b89..f05aadc 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -1,6 +1,6 @@ { "name": "@welshman/editor", - "version": "0.8.7", + "version": "0.8.8", "author": "hodlbod", "license": "MIT", "description": "A batteries-included nostr editor.", diff --git a/packages/feeds/package.json b/packages/feeds/package.json index 862e150..79c56ae 100644 --- a/packages/feeds/package.json +++ b/packages/feeds/package.json @@ -1,6 +1,6 @@ { "name": "@welshman/feeds", - "version": "0.8.7", + "version": "0.8.8", "author": "hodlbod", "license": "MIT", "description": "Utilities for building dynamic nostr feeds.", diff --git a/packages/lib/package.json b/packages/lib/package.json index 766bc55..dcd175e 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -1,6 +1,6 @@ { "name": "@welshman/lib", - "version": "0.8.7", + "version": "0.8.8", "author": "hodlbod", "license": "MIT", "description": "A collection of utilities.", diff --git a/packages/lib/src/Tools.ts b/packages/lib/src/Tools.ts index 99566ca..fb0977d 100644 --- a/packages/lib/src/Tools.ts +++ b/packages/lib/src/Tools.ts @@ -1555,12 +1555,24 @@ export const nthEq = (xs: any[], ...args: unknown[]) => xs[i] === v +/** Returns a function that checks if nth element is in value */ +export const nthIn = + (i: number, v: any[]) => + (xs: any[], ...args: unknown[]) => + v.includes(xs[i]) + /** Returns a function that checks if nth element does not equal value */ export const nthNe = (i: number, v: any) => (xs: any[], ...args: unknown[]) => xs[i] !== v +/** Returns a function that checks if nth element is not in value */ +export const nthNotIn = + (i: number, v: any[]) => + (xs: any[], ...args: unknown[]) => + !v.includes(xs[i]) + /** Returns a function that checks if key/value pairs of x match all pairs in spec */ export const spec = (values: Obj | Array) => diff --git a/packages/net/package.json b/packages/net/package.json index 437c981..b711cc2 100644 --- a/packages/net/package.json +++ b/packages/net/package.json @@ -1,6 +1,6 @@ { "name": "@welshman/net", - "version": "0.8.7", + "version": "0.8.8", "author": "hodlbod", "license": "MIT", "description": "Utilities for connecting with nostr relays.", diff --git a/packages/router/package.json b/packages/router/package.json index bc4fa43..2bdfc1b 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -1,6 +1,6 @@ { "name": "@welshman/router", - "version": "0.8.7", + "version": "0.8.8", "author": "hodlbod", "license": "MIT", "description": "A collection of utilities for nostr relay selection.", diff --git a/packages/signer/package.json b/packages/signer/package.json index 1f66d63..474602f 100644 --- a/packages/signer/package.json +++ b/packages/signer/package.json @@ -1,6 +1,6 @@ { "name": "@welshman/signer", - "version": "0.8.7", + "version": "0.8.8", "author": "hodlbod", "license": "MIT", "description": "A nostr signer implemenation supporting several login methods.", diff --git a/packages/store/package.json b/packages/store/package.json index 6ab3360..950fe09 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -1,6 +1,6 @@ { "name": "@welshman/store", - "version": "0.8.7", + "version": "0.8.8", "author": "hodlbod", "license": "MIT", "description": "A collection of utilities based on svelte/store for use with welshman", diff --git a/packages/util/package.json b/packages/util/package.json index dd9646a..481be7a 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@welshman/util", - "version": "0.8.7", + "version": "0.8.8", "author": "hodlbod", "license": "MIT", "description": "A collection of nostr-related utilities.", diff --git a/packages/util/src/Room.ts b/packages/util/src/Room.ts index db4e484..5ec9802 100644 --- a/packages/util/src/Room.ts +++ b/packages/util/src/Room.ts @@ -22,6 +22,8 @@ export type RoomMeta = { isHidden?: boolean isPrivate?: boolean isRestricted?: boolean + noText?: boolean + livekit?: boolean event?: TrustedEvent } @@ -64,6 +66,8 @@ export const readRoomMeta = (event: TrustedEvent): PublishedRoomMeta => { isHidden: event.tags.some(spec(["hidden"])), isPrivate: event.tags.some(spec(["private"])), isRestricted: event.tags.some(spec(["restricted"])), + noText: event.tags.some(spec(["no-text"])), + livekit: event.tags.some(spec(["livekit"])), } } @@ -93,11 +97,14 @@ export const makeRoomEditEvent = (room: RoomMeta) => { if (room.isHidden) tags.push(["hidden"]) if (room.isPrivate) tags.push(["private"]) if (room.isRestricted) tags.push(["restricted"]) + if (room.noText) tags.push(["no-text"]) + if (room.livekit) tags.push(["livekit"]) if (room.event) { for (const t of room.event.tags) { if (tags.some(spec(t.slice(0, 1)))) continue - if (["closed", "hidden", "private", "restricted"].includes(t[0])) continue + if (["closed", "hidden", "private", "restricted", "no-text", "livekit"].includes(t[0])) + continue tags.push(t) }