@wexio/messenger-widget-react 1.3.0 → 1.3.1
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/CHANGELOG.md +10 -0
- package/dist/widget-react-BS9kUSRS.js +255 -0
- package/dist/{widget-react-vXfa9GKf.js → widget-react-BfO-uP4o.js} +45 -73
- package/dist/{widget-react-l5oryxYk.js → widget-react-Bop75Z1t.js} +83 -83
- package/dist/widget-react-BxEjM2it.js +118 -0
- package/dist/{widget-react-Dtx_fW3V.js → widget-react-C6lzldez.js} +1618 -1578
- package/dist/{widget-react-DWgRcZF7.js → widget-react-DRER1XF_.js} +80 -80
- package/dist/{widget-react-CuphoFsN.js → widget-react-DSAyUf2U.js} +3 -3
- package/dist/{widget-react-CHSNuztJ.js → widget-react-MXOCL3Mg.js} +129 -129
- package/dist/{widget-react-BZ-SHa2o.js → widget-react-bPokx9L5.js} +10 -10
- package/dist/widget-react.js +4012 -4019
- package/package.json +1 -1
- package/dist/widget-react-D8Z8cGhJ.js +0 -254
- package/dist/widget-react-DSUX0aJn.js +0 -117
|
@@ -12,13 +12,13 @@ import "react-dom";
|
|
|
12
12
|
import "react/jsx-runtime";
|
|
13
13
|
import "react-dom/client";
|
|
14
14
|
import { t as e } from "./widget-react-DbOJZl9F.js";
|
|
15
|
-
import {
|
|
16
|
-
import { i as
|
|
17
|
-
import { c as
|
|
18
|
-
import { useCallback as
|
|
19
|
-
import { Fragment as
|
|
15
|
+
import { Et as t, F as n, M as r, S as i, Tt as a, ht as o, l as s, st as c, u as l, x as u, z as d } from "./widget-react-C6lzldez.js";
|
|
16
|
+
import { i as f, n as p, o as m, t as h } from "./widget-react-krPPnv02.js";
|
|
17
|
+
import { c as g } from "./widget-react-CN_FIvMD.js";
|
|
18
|
+
import { useCallback as _, useEffect as v, useMemo as y, useRef as b, useState as x } from "react";
|
|
19
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
20
20
|
//#region lib/graphql/queries/generated/news.generated.tsx
|
|
21
|
-
var
|
|
21
|
+
var T = {}, E = t`
|
|
22
22
|
query VisitorNewsList($args: VisitorNewsListArgs) {
|
|
23
23
|
visitorNewsList(args: $args) {
|
|
24
24
|
items {
|
|
@@ -63,13 +63,13 @@ var C = {}, w = i`
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
`;
|
|
66
|
-
function
|
|
67
|
-
return
|
|
68
|
-
...
|
|
66
|
+
function ee(e) {
|
|
67
|
+
return a(E, {
|
|
68
|
+
...T,
|
|
69
69
|
...e
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
var
|
|
72
|
+
var D = t`
|
|
73
73
|
query VisitorNewsPostCard($args: VisitorNewsPostArgs!) {
|
|
74
74
|
visitorNewsPost(args: $args) {
|
|
75
75
|
_id
|
|
@@ -83,13 +83,13 @@ var E = i`
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
`;
|
|
86
|
-
function
|
|
87
|
-
return
|
|
88
|
-
...
|
|
86
|
+
function O(e) {
|
|
87
|
+
return a(D, {
|
|
88
|
+
...T,
|
|
89
89
|
...e
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
var
|
|
92
|
+
var k = t`
|
|
93
93
|
query VisitorNewsPost($args: VisitorNewsPostArgs!) {
|
|
94
94
|
visitorNewsPost(args: $args) {
|
|
95
95
|
_id
|
|
@@ -141,13 +141,13 @@ var O = i`
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
`;
|
|
144
|
-
function
|
|
145
|
-
return
|
|
146
|
-
...
|
|
144
|
+
function A(e) {
|
|
145
|
+
return a(k, {
|
|
146
|
+
...T,
|
|
147
147
|
...e
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
|
-
var
|
|
150
|
+
var j = t`
|
|
151
151
|
query VisitorNewsRelated($postId: ID!, $limit: Int, $locale: String) {
|
|
152
152
|
visitorNewsRelated(postId: $postId, limit: $limit, locale: $locale) {
|
|
153
153
|
_id
|
|
@@ -163,20 +163,20 @@ var A = i`
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
`;
|
|
166
|
-
function
|
|
167
|
-
return
|
|
168
|
-
...
|
|
166
|
+
function M(e) {
|
|
167
|
+
return a(j, {
|
|
168
|
+
...T,
|
|
169
169
|
...e
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
|
-
|
|
172
|
+
t`
|
|
173
173
|
mutation RecordVisitorNewsView($postId: String!) {
|
|
174
174
|
recordVisitorNewsView(postId: $postId) {
|
|
175
175
|
ok
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
`;
|
|
179
|
-
var
|
|
179
|
+
var N = t`
|
|
180
180
|
query VisitorNewsListSlim($args: VisitorNewsListArgs) {
|
|
181
181
|
visitorNewsList(args: $args) {
|
|
182
182
|
items {
|
|
@@ -186,13 +186,13 @@ var M = i`
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
`;
|
|
189
|
-
function
|
|
190
|
-
return
|
|
191
|
-
...
|
|
189
|
+
function P(e) {
|
|
190
|
+
return a(N, {
|
|
191
|
+
...T,
|
|
192
192
|
...e
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
var
|
|
195
|
+
var F = h("megaphone", [
|
|
196
196
|
["path", {
|
|
197
197
|
d: "M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",
|
|
198
198
|
key: "q8bfy3"
|
|
@@ -208,27 +208,27 @@ var P = p("megaphone", [
|
|
|
208
208
|
]);
|
|
209
209
|
//#endregion
|
|
210
210
|
//#region components/ui/icon.tsx
|
|
211
|
-
function
|
|
212
|
-
return /* @__PURE__ */
|
|
211
|
+
function I({ icon: e, size: t = 20, strokeWidth: n = 2, className: r, ...i }) {
|
|
212
|
+
return /* @__PURE__ */ C(e, {
|
|
213
213
|
width: t,
|
|
214
214
|
height: t,
|
|
215
215
|
strokeWidth: n,
|
|
216
|
-
className:
|
|
216
|
+
className: p("shrink-0", r),
|
|
217
217
|
...i
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
//#endregion
|
|
221
221
|
//#region components/ui/skeleton.tsx
|
|
222
|
-
function
|
|
223
|
-
return /* @__PURE__ */
|
|
222
|
+
function L({ className: e, ...t }) {
|
|
223
|
+
return /* @__PURE__ */ C("div", {
|
|
224
224
|
"data-slot": "skeleton",
|
|
225
|
-
className:
|
|
225
|
+
className: p("animate-pulse rounded-wx-sm bg-wx-bg-elevated", e),
|
|
226
226
|
...t
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
229
|
//#endregion
|
|
230
230
|
//#region components/widget/author-avatars.tsx
|
|
231
|
-
function
|
|
231
|
+
function R(e) {
|
|
232
232
|
if (!Array.isArray(e)) return;
|
|
233
233
|
let t = e.map((e) => {
|
|
234
234
|
if (!e || typeof e != "object") return null;
|
|
@@ -243,15 +243,15 @@ function L(e) {
|
|
|
243
243
|
}).filter((e) => !!e);
|
|
244
244
|
return t.length > 0 ? t : void 0;
|
|
245
245
|
}
|
|
246
|
-
function
|
|
247
|
-
return !e || e.length === 0 ? null : /* @__PURE__ */
|
|
246
|
+
function z({ authors: e, max: t = 3, className: n }) {
|
|
247
|
+
return !e || e.length === 0 ? null : /* @__PURE__ */ C("span", {
|
|
248
248
|
className: `flex items-center -space-x-1.5 ${n ?? ""}`,
|
|
249
|
-
children: e.slice(0, t).map((e) => e.photoUrl ? /* @__PURE__ */
|
|
249
|
+
children: e.slice(0, t).map((e) => e.photoUrl ? /* @__PURE__ */ C("img", {
|
|
250
250
|
src: e.photoUrl,
|
|
251
251
|
alt: e.name,
|
|
252
252
|
title: e.name,
|
|
253
253
|
className: "h-5 w-5 rounded-full border border-wx-bg object-cover"
|
|
254
|
-
}, e.id) : /* @__PURE__ */
|
|
254
|
+
}, e.id) : /* @__PURE__ */ C("span", {
|
|
255
255
|
title: e.name,
|
|
256
256
|
className: "flex h-5 w-5 items-center justify-center rounded-full border border-wx-bg bg-wx-bg-elevated-2 text-[9px] font-semibold text-wx-fg-muted",
|
|
257
257
|
children: e.name.charAt(0).toUpperCase()
|
|
@@ -260,30 +260,30 @@ function R({ authors: e, max: t = 3, className: n }) {
|
|
|
260
260
|
}
|
|
261
261
|
//#endregion
|
|
262
262
|
//#region components/widget/sticky-search-header.tsx
|
|
263
|
-
function
|
|
264
|
-
return /* @__PURE__ */
|
|
265
|
-
className:
|
|
266
|
-
children: [/* @__PURE__ */
|
|
263
|
+
function B({ value: e, onChange: t, placeholder: n, className: r }) {
|
|
264
|
+
return /* @__PURE__ */ w("div", {
|
|
265
|
+
className: p("sticky top-0 z-10 flex items-center gap-2.5 border-wx-border border-b bg-wx-bg px-4", r),
|
|
266
|
+
children: [/* @__PURE__ */ C(g, {
|
|
267
267
|
size: 16,
|
|
268
268
|
className: "shrink-0 text-wx-fg-muted"
|
|
269
|
-
}), /* @__PURE__ */
|
|
269
|
+
}), /* @__PURE__ */ C("input", {
|
|
270
270
|
type: "search",
|
|
271
271
|
value: e,
|
|
272
272
|
onChange: (e) => t(e.target.value),
|
|
273
273
|
placeholder: n,
|
|
274
|
-
className:
|
|
274
|
+
className: p("block w-full min-w-0 flex-1 border-0 bg-transparent py-3 text-sm text-wx-fg", "placeholder:text-wx-fg-muted focus:outline-none focus:ring-0", "[&::-webkit-search-cancel-button]:appearance-none")
|
|
275
275
|
})]
|
|
276
276
|
});
|
|
277
277
|
}
|
|
278
278
|
//#endregion
|
|
279
279
|
//#region lib/use-scroll-restore.ts
|
|
280
|
-
var
|
|
281
|
-
function
|
|
282
|
-
let t =
|
|
283
|
-
return
|
|
280
|
+
var V = /* @__PURE__ */ new Map();
|
|
281
|
+
function H(e) {
|
|
282
|
+
let t = b(null);
|
|
283
|
+
return v(() => {
|
|
284
284
|
let n = t.current;
|
|
285
285
|
if (!n) return;
|
|
286
|
-
let r =
|
|
286
|
+
let r = V.get(e) ?? 0, i = !1, a = performance.now(), o = () => {
|
|
287
287
|
if (i || !t.current) return;
|
|
288
288
|
let e = t.current;
|
|
289
289
|
if (e.scrollHeight - e.clientHeight >= r) {
|
|
@@ -298,7 +298,7 @@ function V(e) {
|
|
|
298
298
|
};
|
|
299
299
|
requestAnimationFrame(o);
|
|
300
300
|
let s = () => {
|
|
301
|
-
|
|
301
|
+
V.set(e, n.scrollTop);
|
|
302
302
|
};
|
|
303
303
|
return n.addEventListener("scroll", s, { passive: !0 }), () => {
|
|
304
304
|
i = !0, n.removeEventListener("scroll", s);
|
|
@@ -307,12 +307,12 @@ function V(e) {
|
|
|
307
307
|
}
|
|
308
308
|
//#endregion
|
|
309
309
|
//#region components/widget/tabs/news-tab/helpers.ts
|
|
310
|
-
function
|
|
310
|
+
function U(e) {
|
|
311
311
|
if (!e.upstreamUpdatedAt) return !1;
|
|
312
312
|
let t = Date.parse(e.upstreamUpdatedAt), n = Date.parse(e.publishedAt);
|
|
313
313
|
return Number.isNaN(t) || Number.isNaN(n) ? !1 : t > n + 6e4;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function W(e) {
|
|
316
316
|
let t = Date.parse(e);
|
|
317
317
|
if (Number.isNaN(t)) return "";
|
|
318
318
|
let n = Date.now() - t, r = Math.floor(n / 6e4);
|
|
@@ -325,41 +325,41 @@ function U(e) {
|
|
|
325
325
|
}
|
|
326
326
|
//#endregion
|
|
327
327
|
//#region components/widget/tabs/news-tab/index.tsx
|
|
328
|
-
var
|
|
329
|
-
function K({ isDummy: e, onOpenArticle:
|
|
330
|
-
let i =
|
|
328
|
+
var G = 10, te = 240;
|
|
329
|
+
function K({ isDummy: e, onOpenArticle: t }) {
|
|
330
|
+
let i = f("news"), a = n(), u = m(), p = r(), [h, g] = x(""), b = J(h, 300), T = b.length >= 2, E = p.previewData?.newsPosts, D = !e && Array.isArray(E) && E.length > 0, [O, k] = x(G), { data: A, error: j, loading: M, fetchMore: N } = ee({
|
|
331
331
|
variables: { args: {
|
|
332
332
|
locale: u,
|
|
333
|
-
limit:
|
|
333
|
+
limit: G,
|
|
334
334
|
offset: 0,
|
|
335
|
-
...
|
|
335
|
+
...T ? { query: b } : {}
|
|
336
336
|
} },
|
|
337
|
-
skip: e ||
|
|
337
|
+
skip: e || D,
|
|
338
338
|
notifyOnNetworkStatusChange: !0
|
|
339
339
|
});
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
}, [
|
|
343
|
-
let
|
|
340
|
+
v(() => {
|
|
341
|
+
k(G);
|
|
342
|
+
}, [b, D]);
|
|
343
|
+
let P = c(), R = s(P && !e && !T ? d.news(P, u) : null, A), z = y(() => (R?.visitorNewsList.items ?? []).filter((e) => !!e).map(q), [R]), V = D ? (E ?? []).filter((e) => !!e && typeof e == "object").map(q) : [], U = _((e) => e.title.toLowerCase().includes(b.toLowerCase()) || e.excerpt.toLowerCase().includes(b.toLowerCase()), [b]), W = e ? T ? o(a).filter(U) : o(a) : D ? T ? V.filter(U) : V : z, K = D || e ? W.slice(0, O) : W, X = y(() => e || D ? O < W.length : R?.visitorNewsList.meta.hasNextPage ?? !1, [
|
|
344
344
|
e,
|
|
345
|
-
E,
|
|
346
345
|
D,
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
346
|
+
O,
|
|
347
|
+
W.length,
|
|
348
|
+
R
|
|
349
|
+
]), [Z, Q] = x(!1), $ = _(async () => {
|
|
350
350
|
if (!(!X || Z)) {
|
|
351
|
-
if (e ||
|
|
352
|
-
|
|
351
|
+
if (e || D) {
|
|
352
|
+
k((e) => e + G);
|
|
353
353
|
return;
|
|
354
354
|
}
|
|
355
355
|
Q(!0);
|
|
356
356
|
try {
|
|
357
|
-
await
|
|
357
|
+
await N({
|
|
358
358
|
variables: { args: {
|
|
359
359
|
locale: u,
|
|
360
|
-
limit:
|
|
361
|
-
offset:
|
|
362
|
-
...
|
|
360
|
+
limit: G,
|
|
361
|
+
offset: A?.visitorNewsList.items.length ?? 0,
|
|
362
|
+
...T ? { query: b } : {}
|
|
363
363
|
} },
|
|
364
364
|
updateQuery: (e, { fetchMoreResult: t }) => {
|
|
365
365
|
if (!t) return e;
|
|
@@ -382,69 +382,69 @@ function K({ isDummy: e, onOpenArticle: r }) {
|
|
|
382
382
|
X,
|
|
383
383
|
Z,
|
|
384
384
|
e,
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
385
|
+
D,
|
|
386
|
+
T,
|
|
387
|
+
b,
|
|
388
388
|
u,
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
]),
|
|
389
|
+
N,
|
|
390
|
+
A
|
|
391
|
+
]), ne = H("news"), re = _((e) => {
|
|
392
392
|
let t = e.currentTarget;
|
|
393
|
-
t.scrollHeight - t.clientHeight - t.scrollTop <
|
|
394
|
-
}, [$]),
|
|
395
|
-
return
|
|
393
|
+
t.scrollHeight - t.clientHeight - t.scrollTop < te && $();
|
|
394
|
+
}, [$]), ie = W.length > 0 || T, ae = !e && !D && M && K.length === 0;
|
|
395
|
+
return j && K.length === 0 ? /* @__PURE__ */ C("div", {
|
|
396
396
|
className: "flex flex-1 flex-col items-center justify-center gap-3 px-6 py-12 text-center",
|
|
397
|
-
children: /* @__PURE__ */
|
|
397
|
+
children: /* @__PURE__ */ C("p", {
|
|
398
398
|
className: "text-sm text-wx-fg-muted",
|
|
399
399
|
children: i("emptyTitle")
|
|
400
400
|
})
|
|
401
|
-
}) : /* @__PURE__ */
|
|
401
|
+
}) : /* @__PURE__ */ w(l, {
|
|
402
402
|
className: "flex-1",
|
|
403
|
-
viewportRef:
|
|
404
|
-
onScroll:
|
|
405
|
-
children: [
|
|
406
|
-
value:
|
|
407
|
-
onChange:
|
|
403
|
+
viewportRef: ne,
|
|
404
|
+
onScroll: re,
|
|
405
|
+
children: [ie && /* @__PURE__ */ C(B, {
|
|
406
|
+
value: h,
|
|
407
|
+
onChange: g,
|
|
408
408
|
placeholder: i("searchPlaceholder")
|
|
409
|
-
}), /* @__PURE__ */
|
|
409
|
+
}), /* @__PURE__ */ C("div", {
|
|
410
410
|
className: "flex flex-col gap-3 px-4 pt-4 pb-6",
|
|
411
|
-
children:
|
|
411
|
+
children: ae ? Array.from({ length: 3 }).map((e, t) => /* @__PURE__ */ w("div", {
|
|
412
412
|
className: "overflow-hidden rounded-wx-lg bg-wx-bg-elevated",
|
|
413
|
-
children: [/* @__PURE__ */
|
|
413
|
+
children: [/* @__PURE__ */ C(L, { className: "aspect-[16/10] w-full rounded-none" }), /* @__PURE__ */ w("div", {
|
|
414
414
|
className: "space-y-2 px-5 py-4",
|
|
415
415
|
children: [
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ C(L, { className: "h-3 w-3/4" }),
|
|
417
|
+
/* @__PURE__ */ C(L, { className: "h-3 w-1/2" }),
|
|
418
|
+
/* @__PURE__ */ C(L, { className: "mt-1 h-2 w-1/3" })
|
|
419
419
|
]
|
|
420
420
|
})]
|
|
421
|
-
}, t)) : K.length === 0 ? /* @__PURE__ */
|
|
421
|
+
}, t)) : K.length === 0 ? /* @__PURE__ */ w("div", {
|
|
422
422
|
className: "flex flex-1 flex-col items-center justify-center gap-3 px-6 py-12 text-center",
|
|
423
423
|
children: [
|
|
424
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ C("div", {
|
|
425
425
|
className: "flex h-14 w-14 items-center justify-center rounded-full bg-wx-bg-elevated text-wx-fg-muted",
|
|
426
|
-
children: /* @__PURE__ */
|
|
427
|
-
icon:
|
|
426
|
+
children: /* @__PURE__ */ C(I, {
|
|
427
|
+
icon: F,
|
|
428
428
|
size: 28
|
|
429
429
|
})
|
|
430
430
|
}),
|
|
431
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ C("p", {
|
|
432
432
|
className: "text-base font-semibold text-wx-fg",
|
|
433
|
-
children: i(
|
|
433
|
+
children: i(T ? "noResults" : "emptyTitle")
|
|
434
434
|
}),
|
|
435
|
-
!
|
|
435
|
+
!T && /* @__PURE__ */ C("p", {
|
|
436
436
|
className: "text-sm text-wx-fg-muted",
|
|
437
437
|
children: i("emptyBody")
|
|
438
438
|
})
|
|
439
439
|
]
|
|
440
|
-
}) : /* @__PURE__ */ S
|
|
440
|
+
}) : /* @__PURE__ */ w(S, { children: [K.map((e, n) => /* @__PURE__ */ C(Y, {
|
|
441
441
|
item: e,
|
|
442
442
|
locale: u,
|
|
443
|
-
delay:
|
|
444
|
-
onClick: () =>
|
|
445
|
-
}, e.id)), Z && /* @__PURE__ */
|
|
443
|
+
delay: n < G ? n * .04 : 0,
|
|
444
|
+
onClick: () => t(e.id)
|
|
445
|
+
}, e.id)), Z && /* @__PURE__ */ C("div", {
|
|
446
446
|
className: "flex justify-center py-3",
|
|
447
|
-
children: /* @__PURE__ */
|
|
447
|
+
children: /* @__PURE__ */ C(L, { className: "h-3 w-24" })
|
|
448
448
|
})] })
|
|
449
449
|
})]
|
|
450
450
|
});
|
|
@@ -483,15 +483,15 @@ function q(e, t = 0) {
|
|
|
483
483
|
};
|
|
484
484
|
}
|
|
485
485
|
function J(e, t) {
|
|
486
|
-
let [n, r] =
|
|
487
|
-
return
|
|
486
|
+
let [n, r] = x(e);
|
|
487
|
+
return v(() => {
|
|
488
488
|
let n = setTimeout(() => r(e), t);
|
|
489
489
|
return () => clearTimeout(n);
|
|
490
490
|
}, [e, t]), n;
|
|
491
491
|
}
|
|
492
|
-
function Y({ item: t, locale: n, delay:
|
|
493
|
-
let o =
|
|
494
|
-
return /* @__PURE__ */
|
|
492
|
+
function Y({ item: t, locale: n, delay: r, onClick: a }) {
|
|
493
|
+
let o = f("news"), s = t.categories ?? (t.category ? [t.category] : []), c = R(t.authors);
|
|
494
|
+
return /* @__PURE__ */ w(e.button, {
|
|
495
495
|
type: "button",
|
|
496
496
|
onClick: a,
|
|
497
497
|
initial: {
|
|
@@ -506,52 +506,52 @@ function Y({ item: t, locale: n, delay: i, onClick: a }) {
|
|
|
506
506
|
whileTap: { scale: .985 },
|
|
507
507
|
transition: {
|
|
508
508
|
duration: .2,
|
|
509
|
-
delay:
|
|
509
|
+
delay: r
|
|
510
510
|
},
|
|
511
|
-
className:
|
|
512
|
-
children: [/* @__PURE__ */
|
|
511
|
+
className: p("block w-full shrink-0 overflow-hidden rounded-wx-lg bg-wx-bg-elevated text-left", "transition-colors hover:bg-wx-bg-elevated-2", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-wx-primary focus-visible:ring-offset-2 focus-visible:ring-offset-wx-bg"),
|
|
512
|
+
children: [/* @__PURE__ */ C("div", {
|
|
513
513
|
className: "aspect-[16/10] w-full bg-cover bg-center",
|
|
514
514
|
style: t.coverImageUrl ? { backgroundImage: `url(${t.coverImageUrl})` } : { background: `linear-gradient(135deg, ${t.coverGradient[0]}, ${t.coverGradient[1]})` },
|
|
515
515
|
"aria-hidden": "true"
|
|
516
|
-
}), /* @__PURE__ */
|
|
516
|
+
}), /* @__PURE__ */ w("div", {
|
|
517
517
|
className: "px-5 py-4",
|
|
518
518
|
children: [
|
|
519
|
-
(s.length > 0 || c != null) && /* @__PURE__ */
|
|
519
|
+
(s.length > 0 || c != null) && /* @__PURE__ */ w("div", {
|
|
520
520
|
className: "mb-1.5 flex items-center justify-between gap-2",
|
|
521
|
-
children: [/* @__PURE__ */
|
|
521
|
+
children: [/* @__PURE__ */ C("div", {
|
|
522
522
|
className: "flex min-w-0 flex-wrap gap-1.5",
|
|
523
|
-
children: s.slice(0, 2).map((e) => /* @__PURE__ */
|
|
523
|
+
children: s.slice(0, 2).map((e) => /* @__PURE__ */ C("span", {
|
|
524
524
|
className: "text-[10px] font-semibold uppercase tracking-wide text-wx-primary",
|
|
525
525
|
children: e.label
|
|
526
526
|
}, e.slug))
|
|
527
|
-
}), /* @__PURE__ */
|
|
527
|
+
}), /* @__PURE__ */ C(z, {
|
|
528
528
|
authors: c,
|
|
529
529
|
className: "shrink-0"
|
|
530
530
|
})]
|
|
531
531
|
}),
|
|
532
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ C(i, {
|
|
533
533
|
className: "text-sm",
|
|
534
534
|
children: t.title
|
|
535
535
|
}),
|
|
536
|
-
t.excerpt && /* @__PURE__ */
|
|
536
|
+
t.excerpt && /* @__PURE__ */ C(u, {
|
|
537
537
|
className: "mt-1 text-xs",
|
|
538
538
|
children: t.excerpt
|
|
539
539
|
}),
|
|
540
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ w("p", {
|
|
541
541
|
className: "mt-2 flex items-center gap-2 text-xs text-wx-fg-subtle",
|
|
542
|
-
children: [/* @__PURE__ */
|
|
542
|
+
children: [/* @__PURE__ */ C("span", { children: new Date(t.publishedAt).toLocaleDateString(n, {
|
|
543
543
|
month: "short",
|
|
544
544
|
day: "numeric",
|
|
545
545
|
year: "numeric"
|
|
546
|
-
}) }),
|
|
546
|
+
}) }), U(t) && t.upstreamUpdatedAt && /* @__PURE__ */ C("span", {
|
|
547
547
|
className: "rounded-full bg-wx-bg-elevated px-1.5 py-0.5 text-[10px] font-medium text-wx-fg-muted",
|
|
548
548
|
title: new Date(t.upstreamUpdatedAt).toLocaleString(n),
|
|
549
|
-
children: o("editedAt", { when:
|
|
549
|
+
children: o("editedAt", { when: W(t.upstreamUpdatedAt) })
|
|
550
550
|
})]
|
|
551
551
|
}),
|
|
552
|
-
t.tags && t.tags.length > 0 && /* @__PURE__ */
|
|
552
|
+
t.tags && t.tags.length > 0 && /* @__PURE__ */ C("div", {
|
|
553
553
|
className: "mt-2.5 flex flex-wrap gap-1",
|
|
554
|
-
children: t.tags.slice(0, 4).map((e) => /* @__PURE__ */
|
|
554
|
+
children: t.tags.slice(0, 4).map((e) => /* @__PURE__ */ C("span", {
|
|
555
555
|
className: "rounded-full bg-wx-bg-elevated px-2 py-0.5 text-[10px] font-medium text-wx-fg-muted",
|
|
556
556
|
children: e.label
|
|
557
557
|
}, e.slug))
|
|
@@ -561,6 +561,6 @@ function Y({ item: t, locale: n, delay: i, onClick: a }) {
|
|
|
561
561
|
});
|
|
562
562
|
}
|
|
563
563
|
//#endregion
|
|
564
|
-
export {
|
|
564
|
+
export { B as a, L as c, E as d, P as f, M as h, H as i, I as l, A as m, W as n, z as o, O as p, U as r, R as s, K as t, F as u };
|
|
565
565
|
|
|
566
|
-
//# sourceMappingURL=widget-react-
|
|
566
|
+
//# sourceMappingURL=widget-react-MXOCL3Mg.js.map
|
|
@@ -11,7 +11,7 @@ import "react";
|
|
|
11
11
|
import "react-dom";
|
|
12
12
|
import "react/jsx-runtime";
|
|
13
13
|
import "react-dom/client";
|
|
14
|
-
import { C as e,
|
|
14
|
+
import { C as e, Et as t, Tt as n, wt as r } from "./widget-react-C6lzldez.js";
|
|
15
15
|
import { n as i, r as a } from "./widget-react-krPPnv02.js";
|
|
16
16
|
import * as o from "react";
|
|
17
17
|
import { jsx as s } from "react/jsx-runtime";
|
|
@@ -33,7 +33,7 @@ var c = {}, l = /* @__PURE__ */ function(e) {
|
|
|
33
33
|
}
|
|
34
34
|
`;
|
|
35
35
|
function d(e) {
|
|
36
|
-
return
|
|
36
|
+
return n(u, {
|
|
37
37
|
...c,
|
|
38
38
|
...e
|
|
39
39
|
});
|
|
@@ -93,7 +93,7 @@ var f = t`
|
|
|
93
93
|
}
|
|
94
94
|
`;
|
|
95
95
|
function p(e) {
|
|
96
|
-
return
|
|
96
|
+
return n(f, {
|
|
97
97
|
...c,
|
|
98
98
|
...e
|
|
99
99
|
});
|
|
@@ -145,7 +145,7 @@ var m = t`
|
|
|
145
145
|
}
|
|
146
146
|
`;
|
|
147
147
|
function h(e) {
|
|
148
|
-
return
|
|
148
|
+
return n(m, {
|
|
149
149
|
...c,
|
|
150
150
|
...e
|
|
151
151
|
});
|
|
@@ -166,7 +166,7 @@ var g = t`
|
|
|
166
166
|
}
|
|
167
167
|
`;
|
|
168
168
|
function _(e) {
|
|
169
|
-
return
|
|
169
|
+
return n(g, {
|
|
170
170
|
...c,
|
|
171
171
|
...e
|
|
172
172
|
});
|
|
@@ -186,7 +186,7 @@ var v = t`
|
|
|
186
186
|
}
|
|
187
187
|
`;
|
|
188
188
|
function y(e) {
|
|
189
|
-
return
|
|
189
|
+
return n(v, {
|
|
190
190
|
...c,
|
|
191
191
|
...e
|
|
192
192
|
});
|
|
@@ -199,7 +199,7 @@ var b = t`
|
|
|
199
199
|
}
|
|
200
200
|
`;
|
|
201
201
|
function x(e) {
|
|
202
|
-
return
|
|
202
|
+
return r(b, {
|
|
203
203
|
...c,
|
|
204
204
|
...e
|
|
205
205
|
});
|
|
@@ -216,7 +216,7 @@ var S = t`
|
|
|
216
216
|
}
|
|
217
217
|
`;
|
|
218
218
|
function C(e) {
|
|
219
|
-
return
|
|
219
|
+
return n(S, {
|
|
220
220
|
...c,
|
|
221
221
|
...e
|
|
222
222
|
});
|
|
@@ -231,7 +231,7 @@ var w = t`
|
|
|
231
231
|
}
|
|
232
232
|
`;
|
|
233
233
|
function T(e) {
|
|
234
|
-
return
|
|
234
|
+
return n(w, {
|
|
235
235
|
...c,
|
|
236
236
|
...e
|
|
237
237
|
});
|
|
@@ -368,4 +368,4 @@ B.displayName = "Button";
|
|
|
368
368
|
//#endregion
|
|
369
369
|
export { f as a, _ as c, p as d, C as f, u as i, T as l, A as n, x as o, y as p, l as r, h as s, B as t, d as u };
|
|
370
370
|
|
|
371
|
-
//# sourceMappingURL=widget-react-
|
|
371
|
+
//# sourceMappingURL=widget-react-bPokx9L5.js.map
|