@apolitical/component-library 3.5.18 → 3.5.19
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/index.js +1 -1
- package/index.mjs +112 -105
- package/package.json +1 -1
- package/style.css +1 -1
package/index.mjs
CHANGED
|
@@ -9789,24 +9789,32 @@ const Mc = ({
|
|
|
9789
9789
|
const i = H(), o = Ee(ir), c = Bt(s, {
|
|
9790
9790
|
element: "li"
|
|
9791
9791
|
});
|
|
9792
|
-
return /* @__PURE__ */ a.jsxs(
|
|
9793
|
-
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9792
|
+
return /* @__PURE__ */ a.jsxs(
|
|
9793
|
+
"div",
|
|
9794
|
+
{
|
|
9795
|
+
className: E("thread-wrapper", {
|
|
9796
|
+
"empty-thread": !c
|
|
9797
|
+
}),
|
|
9798
|
+
children: [
|
|
9799
|
+
!Object.is(c, null) && /* @__PURE__ */ a.jsx("ul", { className: "thread", children: c }),
|
|
9800
|
+
!t && /* @__PURE__ */ a.jsx(
|
|
9801
|
+
on,
|
|
9802
|
+
{
|
|
9803
|
+
hasNextPage: e,
|
|
9804
|
+
loadNextPage: n,
|
|
9805
|
+
size: "small",
|
|
9806
|
+
styling: { muted: !0 },
|
|
9807
|
+
icon: { icon: "arrow_corner-down_right", position: "left" },
|
|
9808
|
+
messages: {
|
|
9809
|
+
button: i.formatMessage({ id: "discussion_thread_loadMore" }),
|
|
9810
|
+
error: i.formatMessage({ id: "loadMore_error" })
|
|
9811
|
+
}
|
|
9812
|
+
}
|
|
9813
|
+
),
|
|
9814
|
+
r && o.showForm && /* @__PURE__ */ a.jsx(sr, { ...r })
|
|
9815
|
+
]
|
|
9816
|
+
}
|
|
9817
|
+
);
|
|
9810
9818
|
}, Rc = "post", Fc = "reply", Ga = "00000000-0000-0000-0000-000000000000";
|
|
9811
9819
|
function or({ queryClient: t, queryKey: e }) {
|
|
9812
9820
|
function n(r, s, i) {
|
|
@@ -11206,96 +11214,95 @@ const ll = ({
|
|
|
11206
11214
|
list: (v) => i.list({ ...v, reactionId: r })
|
|
11207
11215
|
}
|
|
11208
11216
|
});
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
{
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
}
|
|
11222
|
-
},
|
|
11223
|
-
functions: {
|
|
11224
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11225
|
-
create: (v, { body: y }) => u({ activityId: n, replyId: r, content: y })
|
|
11226
|
-
},
|
|
11227
|
-
meta: { isEditing: !1, showSuccessMessage: !1 }
|
|
11217
|
+
return /* @__PURE__ */ a.jsx(
|
|
11218
|
+
Mc,
|
|
11219
|
+
{
|
|
11220
|
+
loadMore: { isLoading: l, hasNextPage: d, loadNextPage: () => c() },
|
|
11221
|
+
form: {
|
|
11222
|
+
content: {
|
|
11223
|
+
type: "reply",
|
|
11224
|
+
slugs: {
|
|
11225
|
+
question: `${t}/${e}`,
|
|
11226
|
+
answer: n,
|
|
11227
|
+
reply: r
|
|
11228
|
+
}
|
|
11228
11229
|
},
|
|
11229
|
-
|
|
11230
|
-
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
jobTitle: (U = C.data) == null ? void 0 : U.jobTitle,
|
|
11271
|
-
location: (te = C.data) == null ? void 0 : te.location,
|
|
11272
|
-
image: {
|
|
11273
|
-
thumbnail: ((G = C.data) == null ? void 0 : G.thumbnail) || void 0
|
|
11274
|
-
}
|
|
11275
|
-
},
|
|
11276
|
-
userLiked: X,
|
|
11277
|
-
likes: (j == null ? void 0 : j.like) || 0,
|
|
11278
|
-
peopleWhoLiked: $
|
|
11230
|
+
functions: {
|
|
11231
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11232
|
+
create: (v, { body: y }) => u({ activityId: n, replyId: r, content: y })
|
|
11233
|
+
},
|
|
11234
|
+
meta: { isEditing: !1, showSuccessMessage: !1 }
|
|
11235
|
+
},
|
|
11236
|
+
children: o && o.length > 0 ? o == null ? void 0 : o.map((v) => {
|
|
11237
|
+
var A, W, Z, z, K, T, P, I, q, U, te, G;
|
|
11238
|
+
const {
|
|
11239
|
+
id: y,
|
|
11240
|
+
own_children: _,
|
|
11241
|
+
latest_children: S,
|
|
11242
|
+
children_counts: j
|
|
11243
|
+
} = v, F = (((A = _ == null ? void 0 : _.like) == null ? void 0 : A.length) || 0) > 0 ? (W = _ == null ? void 0 : _.like) == null ? void 0 : W.find((V) => {
|
|
11244
|
+
var ee;
|
|
11245
|
+
return ((ee = V == null ? void 0 : V.user) == null ? void 0 : ee.id) === (b == null ? void 0 : b.id);
|
|
11246
|
+
}) : !1, R = F ? F == null ? void 0 : F.id : "", X = !!F, $ = (((Z = S == null ? void 0 : S.like) == null ? void 0 : Z.length) || 0) > 0 ? (z = S == null ? void 0 : S.like) == null ? void 0 : z.map((V) => {
|
|
11247
|
+
var ee, re, O;
|
|
11248
|
+
return {
|
|
11249
|
+
id: (ee = V == null ? void 0 : V.user) == null ? void 0 : ee.id,
|
|
11250
|
+
name: (O = (re = V == null ? void 0 : V.user) == null ? void 0 : re.data) == null ? void 0 : O.name
|
|
11251
|
+
};
|
|
11252
|
+
}) : !1, C = v == null ? void 0 : v.user, w = (C == null ? void 0 : C.id) === (b == null ? void 0 : b.id), k = cn(s, w), N = typeof v.data.content == "string" ? (K = v == null ? void 0 : v.data) == null ? void 0 : K.content : (
|
|
11253
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11254
|
+
((P = (T = v == null ? void 0 : v.data) == null ? void 0 : T.content) == null ? void 0 : P.text) || ""
|
|
11255
|
+
);
|
|
11256
|
+
return /* @__PURE__ */ a.jsx(
|
|
11257
|
+
ln,
|
|
11258
|
+
{
|
|
11259
|
+
content: {
|
|
11260
|
+
id: y,
|
|
11261
|
+
type: "reply",
|
|
11262
|
+
body: N,
|
|
11263
|
+
canLike: k,
|
|
11264
|
+
createdAt: v == null ? void 0 : v.created_at,
|
|
11265
|
+
slugs: {
|
|
11266
|
+
question: `${t}/${e}`,
|
|
11267
|
+
answer: n,
|
|
11268
|
+
// Stop-gap solution to avoid having to change the DiscussionPost component
|
|
11269
|
+
// The `reply` is currently used to define the form ID which handles the focus
|
|
11270
|
+
reply: v == null ? void 0 : v.parent
|
|
11279
11271
|
},
|
|
11280
|
-
|
|
11281
|
-
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11286
|
-
|
|
11287
|
-
|
|
11288
|
-
|
|
11289
|
-
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
|
|
11272
|
+
slug: "",
|
|
11273
|
+
author: {
|
|
11274
|
+
id: C == null ? void 0 : C.id,
|
|
11275
|
+
name: (I = C.data) == null ? void 0 : I.name,
|
|
11276
|
+
organization: (q = C.data) == null ? void 0 : q.organization,
|
|
11277
|
+
jobTitle: (U = C.data) == null ? void 0 : U.jobTitle,
|
|
11278
|
+
location: (te = C.data) == null ? void 0 : te.location,
|
|
11279
|
+
image: {
|
|
11280
|
+
thumbnail: ((G = C.data) == null ? void 0 : G.thumbnail) || void 0
|
|
11281
|
+
}
|
|
11282
|
+
},
|
|
11283
|
+
userLiked: X,
|
|
11284
|
+
likes: (j == null ? void 0 : j.like) || 0,
|
|
11285
|
+
peopleWhoLiked: $
|
|
11293
11286
|
},
|
|
11294
|
-
|
|
11295
|
-
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11287
|
+
functions: {
|
|
11288
|
+
content: {
|
|
11289
|
+
createContent: () => null,
|
|
11290
|
+
deleteContent: () => p({ replyId: y }),
|
|
11291
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11292
|
+
updateContent: (V, { body: ee }) => m({ replyId: y, content: ee })
|
|
11293
|
+
},
|
|
11294
|
+
likes: {
|
|
11295
|
+
createLike: () => f({ replyId: y }),
|
|
11296
|
+
deleteLike: () => h({ replyId: y, reactionId: R })
|
|
11297
|
+
},
|
|
11298
|
+
comments: {}
|
|
11299
|
+
}
|
|
11300
|
+
},
|
|
11301
|
+
y
|
|
11302
|
+
);
|
|
11303
|
+
}) : null
|
|
11304
|
+
}
|
|
11305
|
+
);
|
|
11299
11306
|
};
|
|
11300
11307
|
const ul = ({
|
|
11301
11308
|
basePath: t,
|