@logora/debate 0.4.87 → 0.4.89

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.
@@ -1,26 +1,27 @@
1
1
  import { jsx as o, jsxs as l, Fragment as f } from "react/jsx-runtime";
2
+ import { buildShareUrl as le } from "../../tools/share_url/index.js";
2
3
  import E from "classnames";
3
- import { useState as y, useEffect as le, useCallback as ne, Suspense as de, lazy as ce } from "react";
4
- import { useIntl as pe } from "react-intl";
4
+ import { useState as y, useEffect as ne, useCallback as de, Suspense as ce, lazy as pe } from "react";
5
+ import { useIntl as me } from "react-intl";
5
6
  import s from "./Argument.module.scss.js";
6
- import { ReplyFooter as me } from "./ReplyFooter.js";
7
- import { useRichContent as ue } from "./useRichContent.js";
8
- import { useAuth as he } from "../../auth/use_auth/useAuth.js";
9
- import { useConfig as fe } from "../../data/config_provider/useConfig.js";
10
- import { useList as ye } from "../../list/list_provider/useList.js";
7
+ import { ReplyFooter as ue } from "./ReplyFooter.js";
8
+ import { useRichContent as he } from "./useRichContent.js";
9
+ import { useAuth as fe } from "../../auth/use_auth/useAuth.js";
10
+ import { useConfig as ye } from "../../data/config_provider/useConfig.js";
11
+ import { useList as _e } from "../../list/list_provider/useList.js";
11
12
  import { useTranslatedContent as D } from "../../translation/translated_content/useTranslatedContent.js";
12
- import { SourceListItem as _e } from "../../source/source_list_item/SourceListItem.js";
13
- import { HashScroll as ge } from "../../tools/hash_scroll/HashScroll.js";
14
- import { ContentHeader as be } from "../../user_content/content_header/ContentHeader.js";
13
+ import { SourceListItem as ge } from "../../source/source_list_item/SourceListItem.js";
14
+ import { HashScroll as be } from "../../tools/hash_scroll/HashScroll.js";
15
+ import { ContentHeader as Me } from "../../user_content/content_header/ContentHeader.js";
15
16
  import { Icon as F } from "../../icons/icon/Icon.js";
16
- import { ReadMore as Me } from "../../text/read_more/ReadMore.js";
17
- import { TranslationButton as Ie } from "../../translation/translation_button/TranslationButton.js";
18
- import { ContentFooter as ve } from "../../user_content/content_footer/ContentFooter.js";
19
- import { VoteButton as Ce } from "../../vote/vote_button/VoteButton.js";
20
- import { VotePaginatedList as Se } from "../../list/paginated_list/VotePaginatedList.js";
21
- import { UserContentSkeleton as Re } from "../../skeleton/user_content_skeleton/UserContentSkeleton.js";
22
- import { Button as Te } from "../../action/button/Button.js";
23
- const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({ default: e.ArgumentInput }))), P = (e) => e?.replace(/ /g, " "), we = ({
17
+ import { ReadMore as Ie } from "../../text/read_more/ReadMore.js";
18
+ import { TranslationButton as ve } from "../../translation/translation_button/TranslationButton.js";
19
+ import { ContentFooter as Ce } from "../../user_content/content_footer/ContentFooter.js";
20
+ import { VoteButton as Se } from "../../vote/vote_button/VoteButton.js";
21
+ import { VotePaginatedList as Re } from "../../list/paginated_list/VotePaginatedList.js";
22
+ import { UserContentSkeleton as Te } from "../../skeleton/user_content_skeleton/UserContentSkeleton.js";
23
+ import { Button as Ne } from "../../action/button/Button.js";
24
+ const we = pe(() => import("../../input/argument_input/index.js").then((e) => ({ default: e.ArgumentInput }))), P = (e) => e?.replace(/ /g, " "), Ae = ({
24
25
  argument: e,
25
26
  argumentReplies: n,
26
27
  nestingLevel: _ = 0,
@@ -45,7 +46,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
45
46
  replyRedirectUrl: Q,
46
47
  hideContent: W = !1
47
48
  }) => {
48
- const a = pe(), { isLoggedIn: x, currentUser: p } = he(), M = p?.moderation_status === "banned", r = fe(), X = ye(), [m, I] = y(!1), [Z, L] = y(!1), [ee, te] = y(!1), U = ue(e), [u, v] = y(), h = D(
49
+ const a = me(), { isLoggedIn: x, currentUser: p } = fe(), M = p?.moderation_status === "banned", r = ye(), X = _e(), [m, I] = y(!1), [Z, L] = y(!1), [ee, te] = y(!1), U = he(e), [u, v] = y(), h = D(
49
50
  e.content,
50
51
  e.language,
51
52
  "content",
@@ -56,7 +57,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
56
57
  "name",
57
58
  e.position?.translation_entries
58
59
  ), C = `argument_${e.id}`, S = e.position && g?.map((t) => t.id).indexOf(e.position.id) + 1;
59
- le(() => {
60
+ ne(() => {
60
61
  n !== void 0 && ae();
61
62
  }, [n]);
62
63
  const se = (t) => {
@@ -66,13 +67,13 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
66
67
  }
67
68
  }, k = () => {
68
69
  te((t) => !t);
69
- }, $ = () => {
70
+ }, B = () => {
70
71
  I((t) => !t), v([]);
71
72
  }, re = (t) => {
72
73
  if (!u?.find((i) => i.id === t.id))
73
74
  return t;
74
- }, ie = ne((t, i) => /* @__PURE__ */ o(
75
- _e,
75
+ }, ie = de((t, i) => /* @__PURE__ */ o(
76
+ ge,
76
77
  {
77
78
  publisher: t.publisher,
78
79
  url: t.source_url,
@@ -87,8 +88,8 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
87
88
  );
88
89
  t.length > 0 && (v(t), I(!0));
89
90
  }
90
- }, B = (t = null) => /* @__PURE__ */ o(
91
- Ae,
91
+ }, $ = (t = null) => /* @__PURE__ */ o(
92
+ xe,
92
93
  {
93
94
  ...t ? { argument: t } : {},
94
95
  nestingLevel: _ + 1,
@@ -102,7 +103,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
102
103
  flashParent: (i) => se(`argument_${i}`)
103
104
  }
104
105
  );
105
- return /* @__PURE__ */ l(ge, { elementId: C, onScroll: () => L(!0), children: [
106
+ return /* @__PURE__ */ l(be, { elementId: C, onScroll: () => L(!0), children: [
106
107
  /* @__PURE__ */ l(
107
108
  "div",
108
109
  {
@@ -118,7 +119,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
118
119
  id: C,
119
120
  children: [
120
121
  /* @__PURE__ */ o(
121
- be,
122
+ Me,
122
123
  {
123
124
  selectedContent: e.is_selected,
124
125
  author: e.author,
@@ -168,7 +169,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
168
169
  }
169
170
  ),
170
171
  /* @__PURE__ */ o(
171
- Me,
172
+ Ie,
172
173
  {
173
174
  content: /* @__PURE__ */ l(f, { children: [
174
175
  e.is_edited && /* @__PURE__ */ o("div", { className: s.edited, children: a.formatMessage({
@@ -183,7 +184,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
183
184
  }
184
185
  ) : /* @__PURE__ */ o("div", { className: s.argumentContent, children: P(h.translatedContent) }),
185
186
  h.isTranslated && /* @__PURE__ */ o(
186
- Ie,
187
+ ve,
187
188
  {
188
189
  language: e.language,
189
190
  callback: () => h.toggleContent()
@@ -209,7 +210,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
209
210
  e.sources?.length > 0 && /* @__PURE__ */ o("div", { className: s.argumentSourcesList, children: e.sources.map(ie) })
210
211
  ] }),
211
212
  !w && !e.is_deleted && /* @__PURE__ */ o(
212
- ve,
213
+ Ce,
213
214
  {
214
215
  resource: e,
215
216
  disabled: b || e.status === "rejected" || e.status === "pending" || !x && r?.actions?.disableInputForVisitor === !0 || M,
@@ -221,7 +222,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
221
222
  enableReply: _ <= R || p.role === "editor" || p.role === "moderator",
222
223
  handleReplyTo: k,
223
224
  replyRedirectUrl: Q,
224
- shareUrl: `https://app.logora.fr/share/a/${e.id}`,
225
+ shareUrl: le(r, "a", e.id),
225
226
  shareTitle: a.formatMessage({
226
227
  id: "share.argument.title",
227
228
  defaultMessage: "Share a debate"
@@ -238,7 +239,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
238
239
  enableEdition: O,
239
240
  enableDeletion: Y,
240
241
  children: /* @__PURE__ */ o(
241
- Ce,
242
+ Se,
242
243
  {
243
244
  voteableType: "Message",
244
245
  voteableId: e.id,
@@ -251,12 +252,12 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
251
252
  }
252
253
  ),
253
254
  !w && !A && /* @__PURE__ */ o(
254
- me,
255
+ ue,
255
256
  {
256
257
  numberReplies: e.number_replies,
257
258
  repliesAuthors: e.replies_authors,
258
259
  expandReplies: m,
259
- onToggleReplies: $,
260
+ onToggleReplies: B,
260
261
  isReply: e.is_reply
261
262
  }
262
263
  )
@@ -264,8 +265,8 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
264
265
  }
265
266
  ),
266
267
  !A && /* @__PURE__ */ l(f, { children: [
267
- ee && /* @__PURE__ */ o(de, { fallback: null, children: /* @__PURE__ */ o(
268
- Ne,
268
+ ee && /* @__PURE__ */ o(ce, { fallback: null, children: /* @__PURE__ */ o(
269
+ we,
269
270
  {
270
271
  groupId: e.group_id,
271
272
  groupType: T,
@@ -298,13 +299,13 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
298
299
  },
299
300
  `Reply${e.id}`
300
301
  ) }),
301
- u?.length > 0 && m && /* @__PURE__ */ o("div", { className: s.repliesList, children: u.map((t) => B(t)) }),
302
+ u?.length > 0 && m && /* @__PURE__ */ o("div", { className: s.repliesList, children: u.map((t) => $(t)) }),
302
303
  m && /* @__PURE__ */ o("div", { className: s.repliesList, children: /* @__PURE__ */ o(
303
- Se,
304
+ Re,
304
305
  {
305
306
  voteableType: "Message",
306
307
  currentListId: `argument_${e.id}_reply_list`,
307
- loadingComponent: /* @__PURE__ */ o(Re, {}),
308
+ loadingComponent: /* @__PURE__ */ o(Te, {}),
308
309
  resource: "messages",
309
310
  sort: "+created_at",
310
311
  filters: {
@@ -317,15 +318,15 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
317
318
  resourcePropName: "argument",
318
319
  emptyListComponent: /* @__PURE__ */ o(f, {}),
319
320
  transformData: (t) => re(t),
320
- children: B(e)
321
+ children: $(e)
321
322
  }
322
323
  ) }),
323
324
  u?.length > 0 && !m && /* @__PURE__ */ o("div", { className: s.repliesList, children: e.number_replies > 1 && /* @__PURE__ */ o("div", { className: s.readMoreLink, children: /* @__PURE__ */ o(
324
- Te,
325
+ Ne,
325
326
  {
326
327
  role: "link",
327
328
  rightIcon: /* @__PURE__ */ o(F, { name: "lightArrow", height: 10, width: 10 }),
328
- handleClick: $,
329
+ handleClick: B,
329
330
  children: a.formatMessage({
330
331
  id: "argument.argument.see_more",
331
332
  defaultMessage: "See more"
@@ -334,8 +335,8 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
334
335
  ) }) })
335
336
  ] })
336
337
  ] });
337
- }, Ae = we;
338
+ }, xe = Ae;
338
339
  export {
339
- we as Argument,
340
- Ae as ArgumentContainer
340
+ Ae as Argument,
341
+ xe as ArgumentContainer
341
342
  };
@@ -1,24 +1,17 @@
1
- import { jsx as e } from "react/jsx-runtime";
1
+ import { jsx as t } from "react/jsx-runtime";
2
2
  import "react";
3
- const t = (l) => /* @__PURE__ */ e(
3
+ const e = (h) => /* @__PURE__ */ t(
4
4
  "svg",
5
5
  {
6
6
  width: "24",
7
7
  height: "24",
8
- viewBox: "0 0 24 24",
8
+ viewBox: "0 -960 960 960",
9
9
  fill: "none",
10
10
  xmlns: "http://www.w3.org/2000/svg",
11
- ...l,
12
- children: /* @__PURE__ */ e(
13
- "path",
14
- {
15
- fillRule: "evenodd",
16
- clipRule: "evenodd",
17
- d: "M19.06 3.58988L20.41 4.93988C21.2 5.71988 21.2 6.98988 20.41 7.76988L7.18 20.9999H3V16.8199L13.4 6.40988L16.23 3.58988C17.01 2.80988 18.28 2.80988 19.06 3.58988ZM5 18.9999L6.41 19.0599L16.23 9.22988L14.82 7.81988L5 17.6399V18.9999Z"
18
- }
19
- )
11
+ ...h,
12
+ children: /* @__PURE__ */ t("path", { d: "M760-200v-160q0-50-35-85t-85-35H273l144 144-57 56-240-240 240-240 57 56-144 144h367q83 0 141.5 58.5T840-360v160h-80Z" })
20
13
  }
21
14
  );
22
15
  export {
23
- t as Reply
16
+ e as Reply
24
17
  };
@@ -1,17 +1,17 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import "react";
3
- const r = (o) => /* @__PURE__ */ t(
3
+ const h = (q) => /* @__PURE__ */ t(
4
4
  "svg",
5
5
  {
6
6
  width: "24",
7
7
  height: "24",
8
- viewBox: "0 0 24 24",
8
+ viewBox: "0 -960 960 960",
9
9
  fill: "none",
10
10
  xmlns: "http://www.w3.org/2000/svg",
11
- ...o,
12
- children: /* @__PURE__ */ t("path", { d: "M12.5147 7.26316C3.84082 7.26316 2.61516 16.4211 3.08657 21C4.97221 13.4211 10.1577 12.1579 12.5147 12.4737V16.7368L21 10.1053L12.5147 3V7.26316Z" })
11
+ ...q,
12
+ children: /* @__PURE__ */ t("path", { d: "M680-80q-50 0-85-35t-35-85q0-6 3-28L282-392q-16 15-37 23.5t-45 8.5q-50 0-85-35t-35-85q0-50 35-85t85-35q24 0 45 8.5t37 23.5l281-164q-2-7-2.5-13.5T560-760q0-50 35-85t85-35q50 0 85 35t35 85q0 50-35 85t-85 35q-24 0-45-8.5T598-672L317-508q2 7 2.5 13.5t.5 14.5q0 8-.5 14.5T317-452l281 164q16-15 37-23.5t45-8.5q50 0 85 35t35 85q0 50-35 85t-85 35Zm0-80q17 0 28.5-11.5T720-200q0-17-11.5-28.5T680-240q-17 0-28.5 11.5T640-200q0 17 11.5 28.5T680-160ZM200-440q17 0 28.5-11.5T240-480q0-17-11.5-28.5T200-520q-17 0-28.5 11.5T160-480q0 17 11.5 28.5T200-440Zm508.5-291.5Q720-743 720-760t-11.5-28.5Q697-800 680-800t-28.5 11.5Q640-777 640-760t11.5 28.5Q663-720 680-720t28.5-11.5ZM680-200ZM200-480Zm480-280Z" })
13
13
  }
14
14
  );
15
15
  export {
16
- r as Share
16
+ h as Share
17
17
  };
@@ -1,20 +1,21 @@
1
1
  import { jsx as t, jsxs as d, Fragment as I } from "react/jsx-runtime";
2
2
  import { useState as p, useEffect as N } from "react";
3
+ import { buildShareUrl as y } from "../../tools/share_url/index.js";
3
4
  import C from "classnames";
4
- import { useIntl as y } from "react-intl";
5
+ import { useIntl as L } from "react-intl";
5
6
  import o from "./ProposalBox.module.scss.js";
6
- import { useConfig as L } from "../../data/config_provider/useConfig.js";
7
- import { useAuth as B } from "../../auth/use_auth/useAuth.js";
7
+ import { useConfig as B } from "../../data/config_provider/useConfig.js";
8
+ import { useAuth as U } from "../../auth/use_auth/useAuth.js";
8
9
  import { useTranslatedContent as _ } from "../../translation/translated_content/useTranslatedContent.js";
9
10
  import { lexicalToHtml as H } from "../../input/text_editor/lexicalToHtml.js";
10
- import { HashScroll as U } from "../../tools/hash_scroll/HashScroll.js";
11
- import { ContentHeader as D } from "../../user_content/content_header/ContentHeader.js";
12
- import { ReadMore as P } from "../../text/read_more/ReadMore.js";
13
- import { TranslationButton as R } from "../../translation/translation_button/TranslationButton.js";
11
+ import { HashScroll as D } from "../../tools/hash_scroll/HashScroll.js";
12
+ import { ContentHeader as P } from "../../user_content/content_header/ContentHeader.js";
13
+ import { ReadMore as R } from "../../text/read_more/ReadMore.js";
14
+ import { TranslationButton as F } from "../../translation/translation_button/TranslationButton.js";
14
15
  import { SourceListItem as $ } from "../../source/source_list_item/SourceListItem.js";
15
- import { ContentFooter as F } from "../../user_content/content_footer/ContentFooter.js";
16
- import { UpDownVoteBox as j } from "../../vote/up_down_vote_box/UpDownVoteBox.js";
17
- const te = ({
16
+ import { ContentFooter as j } from "../../user_content/content_footer/ContentFooter.js";
17
+ import { UpDownVoteBox as A } from "../../vote/up_down_vote_box/UpDownVoteBox.js";
18
+ const re = ({
18
19
  proposal: e,
19
20
  disabled: c = !1,
20
21
  fixedContentHeight: m,
@@ -22,12 +23,12 @@ const te = ({
22
23
  enableEdition: v = !0,
23
24
  hideFooter: x = !1
24
25
  }) => {
25
- const [h, M] = p(null), [w, b] = p(!1), r = y(), n = L(), { currentUser: f } = B(), u = f?.moderation_status === "banned", g = `proposal_${e.id}`, i = _(
26
+ const [h, M] = p(null), [w, b] = p(!1), s = L(), a = B(), { currentUser: f } = U(), u = f?.moderation_status === "banned", g = `proposal_${e.id}`, i = _(
26
27
  e.title,
27
28
  e.language,
28
29
  "title",
29
30
  e.translation_entries
30
- ), a = _(
31
+ ), n = _(
31
32
  e.content,
32
33
  e.language,
33
34
  "content",
@@ -35,24 +36,24 @@ const te = ({
35
36
  );
36
37
  N(() => {
37
38
  if (e.rich_content) {
38
- const s = JSON.parse(e.rich_content);
39
- if (s.hasOwnProperty("root")) {
40
- const l = H(s);
39
+ const r = JSON.parse(e.rich_content);
40
+ if (r.hasOwnProperty("root")) {
41
+ const l = H(r);
41
42
  M(l);
42
43
  }
43
44
  }
44
45
  }, [e.rich_content]);
45
46
  const S = () => {
46
- i.toggleContent(), a.toggleContent();
47
+ i.toggleContent(), n.toggleContent();
47
48
  };
48
- return /* @__PURE__ */ t(U, { elementId: g, onScroll: () => b(!0), children: /* @__PURE__ */ d(
49
+ return /* @__PURE__ */ t(D, { elementId: g, onScroll: () => b(!0), children: /* @__PURE__ */ d(
49
50
  "div",
50
51
  {
51
52
  className: C(o.proposalBoxContainer, { [o.flash]: w }),
52
53
  id: g,
53
54
  children: [
54
55
  /* @__PURE__ */ t(
55
- D,
56
+ P,
56
57
  {
57
58
  author: e.author,
58
59
  tag: e.tag?.display_name,
@@ -69,23 +70,23 @@ const te = ({
69
70
  }),
70
71
  children: [
71
72
  /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
72
- P,
73
+ R,
73
74
  {
74
75
  content: /* @__PURE__ */ d(I, { children: [
75
- e.is_edited && /* @__PURE__ */ t("div", { className: o.edited, children: r.formatMessage({
76
+ e.is_edited && /* @__PURE__ */ t("div", { className: o.edited, children: s.formatMessage({
76
77
  id: "proposal.updated",
77
78
  defaultMessage: "Updated proposal"
78
79
  }) }),
79
80
  /* @__PURE__ */ t("div", { className: o.proposalTitle, children: i.translatedContent }),
80
- h && !a.isTranslated ? /* @__PURE__ */ t(
81
+ h && !n.isTranslated ? /* @__PURE__ */ t(
81
82
  "div",
82
83
  {
83
84
  className: o.proposalContent,
84
85
  dangerouslySetInnerHTML: { __html: h }
85
86
  }
86
- ) : /* @__PURE__ */ t("div", { className: o.proposalContent, children: a.translatedContent }),
87
- (a.isTranslated || i.isTranslated) && /* @__PURE__ */ t(
88
- R,
87
+ ) : /* @__PURE__ */ t("div", { className: o.proposalContent, children: n.translatedContent }),
88
+ (n.isTranslated || i.isTranslated) && /* @__PURE__ */ t(
89
+ F,
89
90
  {
90
91
  language: e.language,
91
92
  callback: () => S()
@@ -93,54 +94,54 @@ const te = ({
93
94
  )
94
95
  ] }),
95
96
  lineCount: 7,
96
- readMoreText: r.formatMessage({
97
+ readMoreText: s.formatMessage({
97
98
  id: "action.read_more",
98
99
  defaultMessage: "Read more"
99
100
  }),
100
- readLessText: r.formatMessage({
101
+ readLessText: s.formatMessage({
101
102
  id: "action.read_less",
102
103
  defaultMessage: "Read less"
103
104
  })
104
105
  }
105
106
  ) }),
106
- e.sources?.length > 0 && /* @__PURE__ */ t("div", { className: o.proposalSourcesList, children: e.sources.map((s, l) => /* @__PURE__ */ t(
107
+ e.sources?.length > 0 && /* @__PURE__ */ t("div", { className: o.proposalSourcesList, children: e.sources.map((r, l) => /* @__PURE__ */ t(
107
108
  $,
108
109
  {
109
- publisher: s.publisher,
110
- url: s.source_url,
111
- title: s.title,
110
+ publisher: r.publisher,
111
+ url: r.source_url,
112
+ title: r.title,
112
113
  index: l
113
114
  },
114
- s.id
115
+ r.id
115
116
  )) })
116
117
  ]
117
118
  }
118
119
  ),
119
120
  !x && /* @__PURE__ */ t(
120
- F,
121
+ j,
121
122
  {
122
123
  resource: e,
123
124
  disabled: c || u,
124
125
  reportType: "Proposal",
125
126
  deleteType: "proposals",
126
127
  deleteListId: "proposalsList",
127
- shareModalTitle: r.formatMessage({ id: "share.proposal" }),
128
- shareUrl: `https://app.logora.fr/share/p/${e.id}`,
129
- shareTitle: r.formatMessage({ id: "share.proposal.title" }),
130
- shareText: r.formatMessage({ id: "share.proposal.text" }),
131
- shareCode: `<iframe src="https://cdn.logora.com/embed.html?shortname=${n.shortname}&id=${e.id}&resource=proposal" frameborder="0" width="100%" height="335px" scrolling="no"></iframe>`,
132
- showShareCode: n?.actions?.hideCodeShare !== !0,
128
+ shareModalTitle: s.formatMessage({ id: "share.proposal" }),
129
+ shareUrl: y(a, "p", e.id),
130
+ shareTitle: s.formatMessage({ id: "share.proposal.title" }),
131
+ shareText: s.formatMessage({ id: "share.proposal.text" }),
132
+ shareCode: `<iframe src="https://cdn.logora.com/embed.html?shortname=${a.shortname}&id=${e.id}&resource=proposal" frameborder="0" width="100%" height="335px" scrolling="no"></iframe>`,
133
+ showShareCode: a?.actions?.hideCodeShare !== !0,
133
134
  showActions: !e.author.consultation_id,
134
135
  enableEdition: v,
135
136
  children: /* @__PURE__ */ t(
136
- j,
137
+ A,
137
138
  {
138
139
  voteableType: "Proposal",
139
140
  voteableId: e.id,
140
141
  totalUpvote: e.total_upvotes,
141
142
  totalDownvote: e.total_downvotes,
142
143
  disabled: c || f?.id === e?.author?.id || u,
143
- hideDownvotes: n?.actions?.hideDownvotes
144
+ hideDownvotes: a?.actions?.hideDownvotes
144
145
  }
145
146
  )
146
147
  }
@@ -150,5 +151,5 @@ const te = ({
150
151
  ) });
151
152
  };
152
153
  export {
153
- te as ProposalBox
154
+ re as ProposalBox
154
155
  };
@@ -0,0 +1,18 @@
1
+ const o = "app.logora.fr", s = (t) => {
2
+ if (typeof t != "string" || t.trim() === "")
3
+ return null;
4
+ const r = t.trim();
5
+ try {
6
+ const { host: n } = new URL(
7
+ /^https?:\/\//i.test(r) ? r : `https://${r}`
8
+ );
9
+ return n || null;
10
+ } catch {
11
+ return null;
12
+ }
13
+ }, e = (t) => s(t?.provider?.shareDomain) ?? o, h = (t, r, n) => `https://${e(t)}/share/${r}/${n}`;
14
+ export {
15
+ o as DEFAULT_SHARE_DOMAIN,
16
+ h as buildShareUrl,
17
+ e as shareDomain
18
+ };