@wexio/messenger-widget-react 1.1.3 → 1.1.4

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.
@@ -12,10 +12,10 @@ import "react-dom";
12
12
  import "react/jsx-runtime";
13
13
  import "react-dom/client";
14
14
  import { i as e } from "./widget-react-B9XrHKqv.js";
15
- import { E as t, S as n, f as r, p as i, r as a } from "./widget-react-D4IN0PAd.js";
16
- import { a as o, c as ee, i as s, l as c, n as l, o as u, r as te, s as d, t as f } from "./widget-react-qdPNeB-W.js";
17
- import { f as p, g as m, l as h, n as g, r as _, u as v } from "./widget-react-nq6E5YOO.js";
18
- import { i as y, n as b } from "./widget-react-CQ0DMi7b.js";
15
+ import { T as t, g as n, h as r, k as i, o as a } from "./widget-react-BFgpQWPW.js";
16
+ import { f as o, g as ee, l as te, n as s, r as c, u as l } from "./widget-react-DmQP1bcj.js";
17
+ import { i as u, n as d } from "./widget-react-BGCZpMUT.js";
18
+ import { a as f, c as p, i as m, l as h, n as g, o as _, r as v, s as y, t as b } from "./widget-react-CPnUEeex.js";
19
19
  import { t as x } from "./widget-react-GkCAcRz0.js";
20
20
  import { useEffect as S, useMemo as C, useState as w } from "react";
21
21
  import { jsx as T, jsxs as E } from "react/jsx-runtime";
@@ -27,7 +27,7 @@ function ne(e) {
27
27
  title: typeof e.title == "string" ? e.title : "",
28
28
  excerpt: typeof e.excerpt == "string" ? e.excerpt : "",
29
29
  content: typeof e.content == "string" ? e.content : "",
30
- contentFormat: e.contentFormat === d.HTML ? d.HTML : d.MARKDOWN,
30
+ contentFormat: e.contentFormat === y.HTML ? y.HTML : y.MARKDOWN,
31
31
  authors: t(e.authors).filter((e) => !!e && typeof e == "object").map((e) => ({
32
32
  _id: String(e._id ?? ""),
33
33
  name: typeof e.name == "string" ? e.name : null,
@@ -42,31 +42,31 @@ function ne(e) {
42
42
  }
43
43
  //#endregion
44
44
  //#region components/widget/help-article-view/index.tsx
45
- function D({ slug: b, locale: D, isDummy: k, onHandoff: A, onOpenArticle: j, onOpenTranslation: M, onTitleResolved: N }) {
46
- let P = y("help"), F = y("demo"), I = t(), { config: L } = n(), R = L.messenger?.showRelatedHelpArticles ?? !0, z = L.messenger?.showReactionCounts ?? !0, B = x(), [V, H] = w(D), U = o(V, F), W = C(() => {
45
+ function D({ slug: d, locale: D, isDummy: k, onHandoff: A, onOpenArticle: j, onOpenTranslation: M, onTitleResolved: N }) {
46
+ let P = u("help"), F = u("demo"), I = i(), { config: L } = t(), R = L.messenger?.showRelatedHelpArticles ?? !0, z = L.messenger?.showReactionCounts ?? !0, B = x(), [V, H] = w(D), U = f(V, F), W = C(() => {
47
47
  if (k) return null;
48
48
  let e = I.previewData?.helpArticles;
49
- return Array.isArray(e) ? e.find((e) => e && typeof e == "object" && e.slug === b) ?? null : null;
49
+ return Array.isArray(e) ? e.find((e) => e && typeof e == "object" && e.slug === d) ?? null : null;
50
50
  }, [
51
51
  I.previewData,
52
52
  k,
53
- b
54
- ]), G = !!W, { data: K, loading: q } = _({
53
+ d
54
+ ]), G = !!W, { data: K, loading: q } = c({
55
55
  variables: { args: {
56
- slug: b,
56
+ slug: d,
57
57
  locale: D
58
58
  } },
59
59
  skip: k || G
60
- }), [J] = g(), Y = C(() => k ? p(U).find((e) => e.slug === b) : null, [
60
+ }), [J] = s(), Y = C(() => k ? o(U).find((e) => e.slug === d) : null, [
61
61
  k,
62
- b,
62
+ d,
63
63
  U
64
64
  ]), X = k ? Y ? {
65
65
  id: Y.id,
66
66
  title: Y.title,
67
67
  excerpt: Y.excerpt,
68
68
  content: Y.contentMarkdown,
69
- contentFormat: d.MARKDOWN,
69
+ contentFormat: y.MARKDOWN,
70
70
  authors: Y.authors,
71
71
  tags: Y.tags,
72
72
  reactionCounts: null,
@@ -88,7 +88,7 @@ function D({ slug: b, locale: D, isDummy: k, onHandoff: A, onOpenArticle: j, onO
88
88
  reactionCounts: K.visitorHelpArticle.reactionCounts ?? null,
89
89
  locale: K.visitorHelpArticle.locale,
90
90
  translations: K.visitorHelpArticle.translations
91
- } : null, { data: Z } = h({
91
+ } : null, { data: Z } = te({
92
92
  variables: {
93
93
  articleId: X?.id ?? "",
94
94
  limit: 5,
@@ -128,16 +128,16 @@ function D({ slug: b, locale: D, isDummy: k, onHandoff: A, onOpenArticle: j, onO
128
128
  I.previewData
129
129
  ]), Q = G ? re : Z?.visitorHelpRelated ?? [], ie = k || G ? null : K?.visitorHelpArticle?.viewerReaction ?? null, ae = !k && !G && K?.visitorHelpArticle ? [K.visitorHelpArticle._id, ...(K.visitorHelpArticle.translations ?? []).map((e) => e._id)] : X?.id ? [X.id] : [];
130
130
  S(() => {
131
- k || !X?.id || !m() || J({ variables: { articleId: X.id } }).catch(() => {});
131
+ k || !X?.id || !ee() || J({ variables: { articleId: X.id } }).catch(() => {});
132
132
  }, [
133
133
  X?.id,
134
134
  k,
135
135
  J
136
- ]), u(X?.title, N);
136
+ ]), _(X?.title, N);
137
137
  let oe = () => A();
138
138
  if (!q && !X) return /* @__PURE__ */ T("div", {
139
139
  className: "flex flex-1 flex-col items-center justify-center px-6 py-12",
140
- children: /* @__PURE__ */ T(r, { children: /* @__PURE__ */ T(i, {
140
+ children: /* @__PURE__ */ T(r, { children: /* @__PURE__ */ T(n, {
141
141
  className: "py-8 text-center",
142
142
  children: /* @__PURE__ */ T("p", {
143
143
  className: "text-sm font-semibold text-wx-fg",
@@ -148,7 +148,7 @@ function D({ slug: b, locale: D, isDummy: k, onHandoff: A, onOpenArticle: j, onO
148
148
  let se = D.split("-")[0].toLowerCase(), $ = X ? X.locale.split("-")[0].toLowerCase() : null;
149
149
  return !k && !G && !L.contentLocaleFallback && $ !== null && $ !== se ? /* @__PURE__ */ T("div", {
150
150
  className: "flex flex-1 flex-col items-center justify-center px-6 py-12",
151
- children: /* @__PURE__ */ T(r, { children: /* @__PURE__ */ T(i, {
151
+ children: /* @__PURE__ */ T(r, { children: /* @__PURE__ */ T(n, {
152
152
  className: "py-8 text-center",
153
153
  children: /* @__PURE__ */ T("p", {
154
154
  className: "text-sm font-semibold text-wx-fg",
@@ -193,12 +193,12 @@ function D({ slug: b, locale: D, isDummy: k, onHandoff: A, onOpenArticle: j, onO
193
193
  className: "mt-2 mb-5 text-sm text-wx-fg-muted",
194
194
  children: X.excerpt
195
195
  }),
196
- /* @__PURE__ */ T(te, {
196
+ /* @__PURE__ */ T(v, {
197
197
  content: X.content,
198
- isHtml: X.contentFormat === d.HTML || c(X.content),
198
+ isHtml: X.contentFormat === y.HTML || h(X.content),
199
199
  markdownMarginClass: "mt-3"
200
200
  }),
201
- /* @__PURE__ */ E(v, {
201
+ /* @__PURE__ */ E(l, {
202
202
  type: "button",
203
203
  variant: "solid",
204
204
  size: "lg",
@@ -210,8 +210,8 @@ function D({ slug: b, locale: D, isDummy: k, onHandoff: A, onOpenArticle: j, onO
210
210
  size: 16
211
211
  }), /* @__PURE__ */ T("span", { children: P("unresolvedCta") })]
212
212
  }),
213
- X.id && /* @__PURE__ */ T(f, {
214
- surface: ee.HELP,
213
+ X.id && /* @__PURE__ */ T(b, {
214
+ surface: p.HELP,
215
215
  itemId: X.id,
216
216
  reactionCounts: X.reactionCounts,
217
217
  viewerReaction: ie,
@@ -220,9 +220,9 @@ function D({ slug: b, locale: D, isDummy: k, onHandoff: A, onOpenArticle: j, onO
220
220
  showCounts: z,
221
221
  className: "mt-4"
222
222
  }),
223
- /* @__PURE__ */ T(l, {
223
+ /* @__PURE__ */ T(g, {
224
224
  currentLocale: k ? V : X.locale,
225
- locales: k ? [...s] : X.translations.map((e) => e.locale),
225
+ locales: k ? [...m] : X.translations.map((e) => e.locale),
226
226
  allowedLocales: k ? void 0 : L.supportedLocales,
227
227
  onSelect: k ? (e) => H(e) : (e) => {
228
228
  let t = X.translations.find((t) => t.locale === e);
@@ -282,7 +282,7 @@ function O() {
282
282
  "w-full",
283
283
  "w-11/12",
284
284
  "w-7/12"
285
- ].map((e, t) => /* @__PURE__ */ T("div", { className: b("h-3 rounded-md bg-wx-bg-elevated", e) }, t))
285
+ ].map((e, t) => /* @__PURE__ */ T("div", { className: d("h-3 rounded-md bg-wx-bg-elevated", e) }, t))
286
286
  })
287
287
  ]
288
288
  })
@@ -291,4 +291,4 @@ function O() {
291
291
  //#endregion
292
292
  export { D as HelpArticleView };
293
293
 
294
- //# sourceMappingURL=widget-react-C2zCJ9nY2.js.map
294
+ //# sourceMappingURL=widget-react-NUWScxeE2.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 { t as e } from "./widget-react-CQ0DMi7b.js";
14
+ import { t as e } from "./widget-react-BGCZpMUT.js";
15
15
  var t = e("send", [["path", {
16
16
  d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",
17
17
  key: "1ffxy3"
@@ -22,4 +22,4 @@ var t = e("send", [["path", {
22
22
  //#endregion
23
23
  export { t };
24
24
 
25
- //# sourceMappingURL=widget-react-BTMh-VbZ.js.map
25
+ //# sourceMappingURL=widget-react-NffhFueH.js.map