@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.
Files changed (4) hide show
  1. package/index.js +1 -1
  2. package/index.mjs +112 -105
  3. package/package.json +1 -1
  4. 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("div", { className: "thread-wrapper", children: [
9793
- !Object.is(c, null) && /* @__PURE__ */ a.jsx("ul", { className: "thread", children: c }),
9794
- !t && /* @__PURE__ */ a.jsx(
9795
- on,
9796
- {
9797
- hasNextPage: e,
9798
- loadNextPage: n,
9799
- size: "small",
9800
- styling: { muted: !0 },
9801
- icon: { icon: "arrow_corner-down_right", position: "left" },
9802
- messages: {
9803
- button: i.formatMessage({ id: "discussion_thread_loadMore" }),
9804
- error: i.formatMessage({ id: "loadMore_error" })
9805
- }
9806
- }
9807
- ),
9808
- r && o.showForm && /* @__PURE__ */ a.jsx(sr, { ...r })
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
- if (o.length !== 0)
11210
- return /* @__PURE__ */ a.jsx(
11211
- Mc,
11212
- {
11213
- loadMore: { isLoading: l, hasNextPage: d, loadNextPage: () => c() },
11214
- form: {
11215
- content: {
11216
- type: "reply",
11217
- slugs: {
11218
- question: `${t}/${e}`,
11219
- answer: n,
11220
- reply: r
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
- children: o && o.length > 0 ? o == null ? void 0 : o.map((v) => {
11230
- var A, W, Z, z, K, T, P, I, q, U, te, G;
11231
- const {
11232
- id: y,
11233
- own_children: _,
11234
- latest_children: S,
11235
- children_counts: j
11236
- } = 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) => {
11237
- var ee;
11238
- return ((ee = V == null ? void 0 : V.user) == null ? void 0 : ee.id) === (b == null ? void 0 : b.id);
11239
- }) : !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) => {
11240
- var ee, re, O;
11241
- return {
11242
- id: (ee = V == null ? void 0 : V.user) == null ? void 0 : ee.id,
11243
- name: (O = (re = V == null ? void 0 : V.user) == null ? void 0 : re.data) == null ? void 0 : O.name
11244
- };
11245
- }) : !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 : (
11246
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
11247
- ((P = (T = v == null ? void 0 : v.data) == null ? void 0 : T.content) == null ? void 0 : P.text) || ""
11248
- );
11249
- return /* @__PURE__ */ a.jsx(
11250
- ln,
11251
- {
11252
- content: {
11253
- id: y,
11254
- type: "reply",
11255
- body: N,
11256
- canLike: k,
11257
- createdAt: v == null ? void 0 : v.created_at,
11258
- slugs: {
11259
- question: `${t}/${e}`,
11260
- answer: n,
11261
- // Stop-gap solution to avoid having to change the DiscussionPost component
11262
- // The `reply` is currently used to define the form ID which handles the focus
11263
- reply: v == null ? void 0 : v.parent
11264
- },
11265
- slug: "",
11266
- author: {
11267
- id: C == null ? void 0 : C.id,
11268
- name: (I = C.data) == null ? void 0 : I.name,
11269
- organization: (q = C.data) == null ? void 0 : q.organization,
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
- functions: {
11281
- content: {
11282
- createContent: () => null,
11283
- deleteContent: () => p({ replyId: y }),
11284
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
11285
- updateContent: (V, { body: ee }) => m({ replyId: y, content: ee })
11286
- },
11287
- likes: {
11288
- createLike: () => f({ replyId: y }),
11289
- deleteLike: () => h({ replyId: y, reactionId: R })
11290
- },
11291
- comments: {}
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
- y
11295
- );
11296
- }) : null
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "3.5.18",
3
+ "version": "3.5.19",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {