@singi-labs/sifa-sdk 0.19.105 → 0.19.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cards/resolve-card-url.js +7 -0
- package/dist/cards/resolve-card-url.js.map +1 -1
- package/dist/index.cjs +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/stream/two-tier.js +3 -0
- package/dist/stream/two-tier.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1578,7 +1578,7 @@ interface CardHealth {
|
|
|
1578
1578
|
* must be verified by record existence rather than an HTTP probe of the app.
|
|
1579
1579
|
*
|
|
1580
1580
|
* Resolution order:
|
|
1581
|
-
* 1. Per-collection bespoke logic (tangled, kipclip, margin, smokesignal
|
|
1581
|
+
* 1. Per-collection bespoke logic (tangled, userinput, bookhive, kipclip, margin, smokesignal
|
|
1582
1582
|
* rsvp, standard documents). These mirror the inline logic in the
|
|
1583
1583
|
* individual card components.
|
|
1584
1584
|
* 2. Generic `record.url` field (used by hyperboards and similar).
|
package/dist/index.d.ts
CHANGED
|
@@ -1578,7 +1578,7 @@ interface CardHealth {
|
|
|
1578
1578
|
* must be verified by record existence rather than an HTTP probe of the app.
|
|
1579
1579
|
*
|
|
1580
1580
|
* Resolution order:
|
|
1581
|
-
* 1. Per-collection bespoke logic (tangled, kipclip, margin, smokesignal
|
|
1581
|
+
* 1. Per-collection bespoke logic (tangled, userinput, bookhive, kipclip, margin, smokesignal
|
|
1582
1582
|
* rsvp, standard documents). These mirror the inline logic in the
|
|
1583
1583
|
* individual card components.
|
|
1584
1584
|
* 2. Generic `record.url` field (used by hyperboards and similar).
|
package/dist/index.js
CHANGED
|
@@ -385,7 +385,7 @@ import {
|
|
|
385
385
|
roadmapIssueUrl
|
|
386
386
|
} from "./roadmap/index.js";
|
|
387
387
|
import { SIFA_REPO_GROUPS, describeSifaRecord, repoGroupForCollection } from "./repo/index.js";
|
|
388
|
-
var SIFA_SDK_VERSION = "0.19.
|
|
388
|
+
var SIFA_SDK_VERSION = "0.19.106";
|
|
389
389
|
export {
|
|
390
390
|
ACTIVITY_TIERS,
|
|
391
391
|
ACTIVITY_VERBS,
|
package/dist/stream/two-tier.js
CHANGED
|
@@ -14,6 +14,9 @@ function isRich(vm) {
|
|
|
14
14
|
if (vm.media && vm.media.length > 0) return true;
|
|
15
15
|
if (vm.externalLink) return true;
|
|
16
16
|
if (vm.body && RICH_BODY_KINDS.has(vm.body.kind)) return true;
|
|
17
|
+
if (vm.body?.kind === "standard-site") {
|
|
18
|
+
return Boolean(vm.body.title?.trim()) && /^https?:\/\//i.test(vm.body.coverImageUrl ?? "");
|
|
19
|
+
}
|
|
17
20
|
return false;
|
|
18
21
|
}
|
|
19
22
|
function isSelfAuthoredRich(vm) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/stream/two-tier.ts"],"sourcesContent":["import { isRelationalActivity } from '../taxonomy/relational.js';\nimport type { StreamCardBody, StreamCardVM } from './stream-card-vm.js';\n\n/** The collection NSID from an at-uri (at://did/collection/rkey). */\nfunction collectionOf(uri: string): string {\n return uri.split('/')[3] ?? '';\n}\n\n/**\n * Body kinds whose content is inherently rich enough to warrant a card when the\n * actor authored it: structured records that a one-line summary would gut\n * (a merged PR with diff stats, a book log, a media review, a music track, an\n * embedded media body). Plain `text` and `generic` are deliberately NOT here:\n * a text post renders inline on the line, keeping the timeline compact.\n */\nconst RICH_BODY_KINDS: ReadonlySet<StreamCardBody['kind']> = new Set([\n 'github-pr',\n 'book',\n 'media-review',\n 'media',\n 'track',\n]);\n\n/**\n * Whether a view-model carries rich content worth a card (as opposed to a\n * compact line): resolved media, an external-link card,
|
|
1
|
+
{"version":3,"sources":["../../src/stream/two-tier.ts"],"sourcesContent":["import { isRelationalActivity } from '../taxonomy/relational.js';\nimport type { StreamCardBody, StreamCardVM } from './stream-card-vm.js';\n\n/** The collection NSID from an at-uri (at://did/collection/rkey). */\nfunction collectionOf(uri: string): string {\n return uri.split('/')[3] ?? '';\n}\n\n/**\n * Body kinds whose content is inherently rich enough to warrant a card when the\n * actor authored it: structured records that a one-line summary would gut\n * (a merged PR with diff stats, a book log, a media review, a music track, an\n * embedded media body). Plain `text` and `generic` are deliberately NOT here:\n * a text post renders inline on the line, keeping the timeline compact.\n */\nconst RICH_BODY_KINDS: ReadonlySet<StreamCardBody['kind']> = new Set([\n 'github-pr',\n 'book',\n 'media-review',\n 'media',\n 'track',\n]);\n\n/**\n * Whether a view-model carries rich content worth a card (as opposed to a\n * compact line): resolved media, an external-link card, a structured rich\n * body, or a published document with a title and a cover image (not every\n * document: one without a cover stays a line, which is why `standard-site` is\n * not in {@link RICH_BODY_KINDS}). Independent of who authored it —\n * {@link isSelfAuthoredRich} adds the authorship gate.\n */\nfunction isRich(vm: StreamCardVM): boolean {\n if (vm.media && vm.media.length > 0) return true;\n if (vm.externalLink) return true;\n if (vm.body && RICH_BODY_KINDS.has(vm.body.kind)) return true;\n // A published document is rich when it has a title and an http(s) cover image\n // to show (`coverImageUrl`, which sifa-api fills from the document's own cover\n // or the article's og:image). Without either it stays a compact line: an\n // image with no headline says nothing on its own.\n if (vm.body?.kind === 'standard-site') {\n return Boolean(vm.body.title?.trim()) && /^https?:\\/\\//i.test(vm.body.coverImageUrl ?? '');\n }\n return false;\n}\n\n/**\n * The two-tier timeline rule: a `StreamCardVM` upgrades from a compact line to\n * a rich card only when BOTH hold — it is the actor's OWN creation\n * (`tier === 'creation'`, not a relational `action` like an RSVP, reply, or\n * endorsement) AND it carries rich content ({@link isRich}). A followee's own\n * photo or book log becomes a card; their comment on someone else's photo, or a\n * bare `:)` post, stays a line.\n *\n * A relational activity (comment, reply, RSVP, endorsement, membership, ...) is\n * NEVER rich, even when it carries media: the line shows what was acted on and\n * links out, rather than reproducing someone else's content.\n */\nexport function isSelfAuthoredRich(vm: StreamCardVM): boolean {\n if (isRelationalActivity(collectionOf(vm.uri))) return false;\n return vm.tier === 'creation' && isRich(vm);\n}\n\n/** Convenience inverse of {@link isSelfAuthoredRich}: render this VM as a line. */\nexport function renderAsLine(vm: StreamCardVM): boolean {\n return !isSelfAuthoredRich(vm);\n}\n"],"mappings":";AAAA,SAAS,4BAA4B;AAIrC,SAAS,aAAa,KAAqB;AACzC,SAAO,IAAI,MAAM,GAAG,EAAE,CAAC,KAAK;AAC9B;AASA,IAAM,kBAAuD,oBAAI,IAAI;AAAA,EACnE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAUD,SAAS,OAAO,IAA2B;AACzC,MAAI,GAAG,SAAS,GAAG,MAAM,SAAS,EAAG,QAAO;AAC5C,MAAI,GAAG,aAAc,QAAO;AAC5B,MAAI,GAAG,QAAQ,gBAAgB,IAAI,GAAG,KAAK,IAAI,EAAG,QAAO;AAKzD,MAAI,GAAG,MAAM,SAAS,iBAAiB;AACrC,WAAO,QAAQ,GAAG,KAAK,OAAO,KAAK,CAAC,KAAK,gBAAgB,KAAK,GAAG,KAAK,iBAAiB,EAAE;AAAA,EAC3F;AACA,SAAO;AACT;AAcO,SAAS,mBAAmB,IAA2B;AAC5D,MAAI,qBAAqB,aAAa,GAAG,GAAG,CAAC,EAAG,QAAO;AACvD,SAAO,GAAG,SAAS,cAAc,OAAO,EAAE;AAC5C;AAGO,SAAS,aAAa,IAA2B;AACtD,SAAO,CAAC,mBAAmB,EAAE;AAC/B;","names":[]}
|
package/package.json
CHANGED