@apolitical/component-library 3.5.17-ac.0 → 3.5.17-ac.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/index.mjs CHANGED
@@ -7664,7 +7664,8 @@ const uc = ({
7664
7664
  "aria-haspopup": "true",
7665
7665
  "aria-expanded": o,
7666
7666
  "aria-controls": e,
7667
- screenreaderText: s.formatMessage({ id: "moreMenu" })
7667
+ screenreaderText: s.formatMessage({ id: "moreMenu" }),
7668
+ className: "more-menu-button"
7668
7669
  }
7669
7670
  ),
7670
7671
  /* @__PURE__ */ a.jsx("ul", { id: e, hidden: !o, children: n.map(({ href: l, onClick: u, text: m, icon: f, ...p }, h) => {
@@ -11206,95 +11207,96 @@ const ll = ({
11206
11207
  list: (v) => i.list({ ...v, reactionId: r })
11207
11208
  }
11208
11209
  });
11209
- return /* @__PURE__ */ a.jsx(
11210
- Mc,
11211
- {
11212
- loadMore: { isLoading: l, hasNextPage: d, loadNextPage: () => c() },
11213
- form: {
11214
- content: {
11215
- type: "reply",
11216
- slugs: {
11217
- question: `${t}/${e}`,
11218
- answer: n,
11219
- reply: r
11220
- }
11221
- },
11222
- functions: {
11223
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
11224
- create: (v, { body: y }) => u({ activityId: n, replyId: r, content: y })
11210
+ if (o.length !== 0)
11211
+ return /* @__PURE__ */ a.jsx(
11212
+ Mc,
11213
+ {
11214
+ loadMore: { isLoading: l, hasNextPage: d, loadNextPage: () => c() },
11215
+ form: {
11216
+ content: {
11217
+ type: "reply",
11218
+ slugs: {
11219
+ question: `${t}/${e}`,
11220
+ answer: n,
11221
+ reply: r
11222
+ }
11223
+ },
11224
+ functions: {
11225
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11226
+ create: (v, { body: y }) => u({ activityId: n, replyId: r, content: y })
11227
+ },
11228
+ meta: { isEditing: !1, showSuccessMessage: !1 }
11225
11229
  },
11226
- meta: { isEditing: !1, showSuccessMessage: !1 }
11227
- },
11228
- children: o && o.length > 0 ? o == null ? void 0 : o.map((v) => {
11229
- var A, W, Z, z, K, T, P, I, q, U, te, G;
11230
- const {
11231
- id: y,
11232
- own_children: _,
11233
- latest_children: S,
11234
- children_counts: j
11235
- } = 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) => {
11236
- var ee;
11237
- return ((ee = V == null ? void 0 : V.user) == null ? void 0 : ee.id) === (b == null ? void 0 : b.id);
11238
- }) : !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) => {
11239
- var ee, re, O;
11240
- return {
11241
- id: (ee = V == null ? void 0 : V.user) == null ? void 0 : ee.id,
11242
- name: (O = (re = V == null ? void 0 : V.user) == null ? void 0 : re.data) == null ? void 0 : O.name
11243
- };
11244
- }) : !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 : (
11245
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
11246
- ((P = (T = v == null ? void 0 : v.data) == null ? void 0 : T.content) == null ? void 0 : P.text) || ""
11247
- );
11248
- return /* @__PURE__ */ a.jsx(
11249
- ln,
11250
- {
11251
- content: {
11252
- id: y,
11253
- type: "reply",
11254
- body: N,
11255
- canLike: k,
11256
- createdAt: v == null ? void 0 : v.created_at,
11257
- slugs: {
11258
- question: `${t}/${e}`,
11259
- answer: n,
11260
- // Stop-gap solution to avoid having to change the DiscussionPost component
11261
- // The `reply` is currently used to define the form ID which handles the focus
11262
- reply: v == null ? void 0 : v.parent
11263
- },
11264
- slug: "",
11265
- author: {
11266
- id: C == null ? void 0 : C.id,
11267
- name: (I = C.data) == null ? void 0 : I.name,
11268
- organization: (q = C.data) == null ? void 0 : q.organization,
11269
- jobTitle: (U = C.data) == null ? void 0 : U.jobTitle,
11270
- location: (te = C.data) == null ? void 0 : te.location,
11271
- image: {
11272
- thumbnail: ((G = C.data) == null ? void 0 : G.thumbnail) || void 0
11273
- }
11274
- },
11275
- userLiked: X,
11276
- likes: (j == null ? void 0 : j.like) || 0,
11277
- peopleWhoLiked: $
11278
- },
11279
- functions: {
11230
+ children: o && o.length > 0 ? o == null ? void 0 : o.map((v) => {
11231
+ var A, W, Z, z, K, T, P, I, q, U, te, G;
11232
+ const {
11233
+ id: y,
11234
+ own_children: _,
11235
+ latest_children: S,
11236
+ children_counts: j
11237
+ } = 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) => {
11238
+ var ee;
11239
+ return ((ee = V == null ? void 0 : V.user) == null ? void 0 : ee.id) === (b == null ? void 0 : b.id);
11240
+ }) : !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) => {
11241
+ var ee, re, O;
11242
+ return {
11243
+ id: (ee = V == null ? void 0 : V.user) == null ? void 0 : ee.id,
11244
+ name: (O = (re = V == null ? void 0 : V.user) == null ? void 0 : re.data) == null ? void 0 : O.name
11245
+ };
11246
+ }) : !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 : (
11247
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11248
+ ((P = (T = v == null ? void 0 : v.data) == null ? void 0 : T.content) == null ? void 0 : P.text) || ""
11249
+ );
11250
+ return /* @__PURE__ */ a.jsx(
11251
+ ln,
11252
+ {
11280
11253
  content: {
11281
- createContent: () => null,
11282
- deleteContent: () => p({ replyId: y }),
11283
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
11284
- updateContent: (V, { body: ee }) => m({ replyId: y, content: ee })
11285
- },
11286
- likes: {
11287
- createLike: () => f({ replyId: y }),
11288
- deleteLike: () => h({ replyId: y, reactionId: R })
11254
+ id: y,
11255
+ type: "reply",
11256
+ body: N,
11257
+ canLike: k,
11258
+ createdAt: v == null ? void 0 : v.created_at,
11259
+ slugs: {
11260
+ question: `${t}/${e}`,
11261
+ answer: n,
11262
+ // Stop-gap solution to avoid having to change the DiscussionPost component
11263
+ // The `reply` is currently used to define the form ID which handles the focus
11264
+ reply: v == null ? void 0 : v.parent
11265
+ },
11266
+ slug: "",
11267
+ author: {
11268
+ id: C == null ? void 0 : C.id,
11269
+ name: (I = C.data) == null ? void 0 : I.name,
11270
+ organization: (q = C.data) == null ? void 0 : q.organization,
11271
+ jobTitle: (U = C.data) == null ? void 0 : U.jobTitle,
11272
+ location: (te = C.data) == null ? void 0 : te.location,
11273
+ image: {
11274
+ thumbnail: ((G = C.data) == null ? void 0 : G.thumbnail) || void 0
11275
+ }
11276
+ },
11277
+ userLiked: X,
11278
+ likes: (j == null ? void 0 : j.like) || 0,
11279
+ peopleWhoLiked: $
11289
11280
  },
11290
- comments: {}
11291
- }
11292
- },
11293
- y
11294
- );
11295
- }) : null
11296
- }
11297
- );
11281
+ functions: {
11282
+ content: {
11283
+ createContent: () => null,
11284
+ deleteContent: () => p({ replyId: y }),
11285
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11286
+ updateContent: (V, { body: ee }) => m({ replyId: y, content: ee })
11287
+ },
11288
+ likes: {
11289
+ createLike: () => f({ replyId: y }),
11290
+ deleteLike: () => h({ replyId: y, reactionId: R })
11291
+ },
11292
+ comments: {}
11293
+ }
11294
+ },
11295
+ y
11296
+ );
11297
+ }) : null
11298
+ }
11299
+ );
11298
11300
  };
11299
11301
  const ul = ({
11300
11302
  basePath: t,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "3.5.17-ac.0",
3
+ "version": "3.5.17-ac.1",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {