@rmdes/indiekit-endpoint-activitypub 2.4.3 → 2.4.5
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.
|
@@ -282,7 +282,9 @@ document.addEventListener("alpine:init", () => {
|
|
|
282
282
|
const card = entry.target;
|
|
283
283
|
const uid = card.dataset.uid;
|
|
284
284
|
if (uid && !card.classList.contains("ap-card--read")) {
|
|
285
|
-
|
|
285
|
+
// Mark read server-side but DON'T dim visually in this session.
|
|
286
|
+
// Cards only appear dimmed when they arrive from the server
|
|
287
|
+
// with item.read=true on a subsequent page load.
|
|
286
288
|
this._batch.push(uid);
|
|
287
289
|
}
|
|
288
290
|
this._observer.unobserve(card);
|
package/assets/reader-tabs.js
CHANGED
|
@@ -366,6 +366,16 @@ document.addEventListener("alpine:init", () => {
|
|
|
366
366
|
}
|
|
367
367
|
},
|
|
368
368
|
|
|
369
|
+
// ── Public load-more method (called by button click) ────────────────────
|
|
370
|
+
|
|
371
|
+
loadMoreTab(tab) {
|
|
372
|
+
if (tab.type === "instance") {
|
|
373
|
+
this._loadMoreInstanceTab(tab);
|
|
374
|
+
} else if (tab.type === "hashtag") {
|
|
375
|
+
this._loadMoreHashtagTab(tab);
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
|
|
369
379
|
// ── Infinite scroll for tab panels ───────────────────────────────────────
|
|
370
380
|
|
|
371
381
|
_setupScrollObserver(tab) {
|
package/assets/reader.css
CHANGED
|
@@ -2486,15 +2486,21 @@
|
|
|
2486
2486
|
}
|
|
2487
2487
|
|
|
2488
2488
|
.ap-quote-embed__content {
|
|
2489
|
-
-webkit-box-orient: vertical;
|
|
2490
|
-
-webkit-line-clamp: 6;
|
|
2491
2489
|
color: var(--color-on-background);
|
|
2492
|
-
display: -webkit-box;
|
|
2493
2490
|
font-size: var(--font-size-s);
|
|
2494
2491
|
line-height: 1.5;
|
|
2492
|
+
max-height: calc(1.5em * 6);
|
|
2495
2493
|
overflow: hidden;
|
|
2496
2494
|
}
|
|
2497
2495
|
|
|
2496
|
+
.ap-quote-embed__content a {
|
|
2497
|
+
display: inline;
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2500
|
+
.ap-quote-embed__content a span {
|
|
2501
|
+
display: inline;
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2498
2504
|
.ap-quote-embed__content p {
|
|
2499
2505
|
margin: 0 0 var(--space-xs);
|
|
2500
2506
|
}
|
|
@@ -116,14 +116,17 @@ export function mapMastodonStatusToItem(status, instance) {
|
|
|
116
116
|
video,
|
|
117
117
|
audio,
|
|
118
118
|
inReplyTo: status.in_reply_to_id ? `https://${instance}/web/statuses/${status.in_reply_to_id}` : "",
|
|
119
|
-
quoteUrl: status.quote?.url || status.quote?.uri || "",
|
|
120
119
|
createdAt: new Date().toISOString(),
|
|
121
120
|
_explore: true,
|
|
122
121
|
};
|
|
123
122
|
|
|
124
123
|
// Map quoted post data if present (Mastodon 4.3+ quote support)
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
// Mastodon API wraps the quoted status: { state: "accepted", quoted_status: { ...fullStatus } }
|
|
125
|
+
const quotedStatus = status.quote?.quoted_status || null;
|
|
126
|
+
if (quotedStatus) {
|
|
127
|
+
item.quoteUrl = quotedStatus.url || quotedStatus.uri || "";
|
|
128
|
+
|
|
129
|
+
const q = quotedStatus;
|
|
127
130
|
const qAccount = q.account || {};
|
|
128
131
|
const qAcct = qAccount.acct || "";
|
|
129
132
|
const qHandle = qAcct.includes("@") ? `@${qAcct}` : `@${qAcct}@${instance}`;
|
|
@@ -152,6 +155,8 @@ export function mapMastodonStatusToItem(status, instance) {
|
|
|
152
155
|
name: "",
|
|
153
156
|
photo: qPhoto.slice(0, 1),
|
|
154
157
|
};
|
|
158
|
+
} else {
|
|
159
|
+
item.quoteUrl = "";
|
|
155
160
|
}
|
|
156
161
|
|
|
157
162
|
return item;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rmdes/indiekit-endpoint-activitypub",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.5",
|
|
4
4
|
"description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"indiekit",
|
|
@@ -302,10 +302,19 @@
|
|
|
302
302
|
x-html="tabState[tab._id] ? tabState[tab._id].html : ''">
|
|
303
303
|
</div>
|
|
304
304
|
|
|
305
|
-
{#
|
|
306
|
-
<div class="ap-
|
|
307
|
-
x-show="tabState[tab._id] && tabState[tab._id].
|
|
308
|
-
<
|
|
305
|
+
{# Load more button + loading spinner for subsequent pages #}
|
|
306
|
+
<div class="ap-load-more"
|
|
307
|
+
x-show="tabState[tab._id] && tabState[tab._id].html && !tabState[tab._id].done">
|
|
308
|
+
<button class="ap-load-more__btn"
|
|
309
|
+
x-show="!tabState[tab._id]?.loading"
|
|
310
|
+
@click="loadMoreTab(tab)"
|
|
311
|
+
:disabled="tabState[tab._id]?.loading">
|
|
312
|
+
{{ __("activitypub.reader.pagination.loadMore") }}
|
|
313
|
+
</button>
|
|
314
|
+
<span class="ap-explore-tab-loading__text"
|
|
315
|
+
x-show="tabState[tab._id]?.loading">
|
|
316
|
+
{{ __("activitypub.reader.pagination.loading") }}
|
|
317
|
+
</span>
|
|
309
318
|
</div>
|
|
310
319
|
|
|
311
320
|
{# Empty state — loaded successfully but no posts #}
|
|
@@ -357,10 +366,19 @@
|
|
|
357
366
|
x-html="tabState[tab._id] ? tabState[tab._id].html : ''">
|
|
358
367
|
</div>
|
|
359
368
|
|
|
360
|
-
{#
|
|
361
|
-
<div class="ap-
|
|
362
|
-
x-show="tabState[tab._id] && tabState[tab._id].
|
|
363
|
-
<
|
|
369
|
+
{# Load more button + loading spinner for subsequent pages #}
|
|
370
|
+
<div class="ap-load-more"
|
|
371
|
+
x-show="tabState[tab._id] && tabState[tab._id].html && !tabState[tab._id].done">
|
|
372
|
+
<button class="ap-load-more__btn"
|
|
373
|
+
x-show="!tabState[tab._id]?.loading"
|
|
374
|
+
@click="loadMoreTab(tab)"
|
|
375
|
+
:disabled="tabState[tab._id]?.loading">
|
|
376
|
+
{{ __("activitypub.reader.pagination.loadMore") }}
|
|
377
|
+
</button>
|
|
378
|
+
<span class="ap-explore-tab-loading__text"
|
|
379
|
+
x-show="tabState[tab._id]?.loading">
|
|
380
|
+
{{ __("activitypub.reader.pagination.loading") }}
|
|
381
|
+
</span>
|
|
364
382
|
</div>
|
|
365
383
|
|
|
366
384
|
{# Empty state — no instance tabs pinned yet #}
|