@logora/debate 0.4.112 → 0.4.113

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.
@@ -0,0 +1 @@
1
+ ._body_m3gxh_3{display:flex;flex-direction:column;align-items:center;padding-top:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;padding-bottom:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;padding-right:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;padding-left:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important}._logo_m3gxh_13{align-self:center}@container (min-width: 576px){._logo_m3gxh_13{margin-top:0!important}}._logo_m3gxh_13{margin-bottom:var(--space-unit, 1em)!important}._logoImage_m3gxh_25{object-fit:contain;width:100px!important;max-height:100px!important}._icon_m3gxh_31{width:120px;height:120px;fill-rule:evenodd;fill:var(--call-primary-color, #434343)!important}@container (max-width: 767.98px){._icon_m3gxh_31{width:80px;height:80px}}._mainText_m3gxh_44{font-size:var(--font-size-normal, 16px);font-weight:var(--font-weight-normal, 400);font-variation-settings:var(--font-variation-normal, normal);color:var(--text-primary, #222222);text-align:center;margin-right:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;margin-left:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}@container (min-width: 576px){._mainText_m3gxh_44{margin-right:var(--spacer-lg, calc(var(--space-unit, 1em) * 1.5))!important}}@container (min-width: 576px){._mainText_m3gxh_44{margin-left:var(--spacer-lg, calc(var(--space-unit, 1em) * 1.5))!important}}@container (max-width: 767.98px){._mainText_m3gxh_44{font-size:var(--font-size-small, 16px)}}._title_m3gxh_69{font-weight:var(--font-weight-bold, 700);font-variation-settings:var(--font-variation-bold, normal);margin-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}._button_m3gxh_75{margin-top:var(--space-unit, 1em)!important;margin-bottom:var(--space-unit, 1em)!important}
@@ -1,26 +1,59 @@
1
- import { jsx as t, jsxs as d } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as r } from "react/jsx-runtime";
2
2
  import "react";
3
- import { useIntl as l } from "react-intl";
4
- import o from "./SubscriptionModal.module.scss.js";
5
- import { Modal as m } from "../../dialog/modal/Modal.js";
6
- import { Button as n } from "../../action/button/Button.js";
7
- const M = ({ title: i, text: r, buttonLabel: a, url: s }) => {
8
- const e = l();
9
- return /* @__PURE__ */ t(m, { "data-vid": "subscription_modal", showCloseButton: !0, children: /* @__PURE__ */ d("div", { className: o.body, children: [
10
- /* @__PURE__ */ t("div", { className: o.title, children: i || e.formatMessage({
11
- id: "auth.subscription_modal.title",
12
- defaultMessage: "Subscribe to comment"
13
- }) }),
14
- /* @__PURE__ */ t("div", { children: r || e.formatMessage({
15
- id: "auth.subscription_modal.text",
16
- defaultMessage: "Commenting is reserved to subscribers."
17
- }) }),
18
- s && /* @__PURE__ */ t(n, { "data-tid": "link_subscribe", to: s, external: !0, border: !1, children: a || e.formatMessage({
19
- id: "auth.subscription_modal.button",
20
- defaultMessage: "Subscribe"
21
- }) })
3
+ import { useIntl as n } from "react-intl";
4
+ import e from "./SubscriptionModal.module.scss.js";
5
+ import { useConfig as c } from "../../data/config_provider/useConfig.js";
6
+ import { Modal as u } from "../../dialog/modal/Modal.js";
7
+ import { Icon as g } from "../../icons/icon/Icon.js";
8
+ import { Button as b } from "../../action/button/Button.js";
9
+ const y = ({ title: a, text: m, buttonLabel: l, url: i }) => {
10
+ const t = n(), s = c(), d = s?.provider?.companyName;
11
+ return /* @__PURE__ */ o(u, { "data-vid": "subscription_modal", children: /* @__PURE__ */ r("div", { className: e.body, children: [
12
+ /* @__PURE__ */ o("div", { className: e.logo, children: s?.logo_url ? /* @__PURE__ */ o(
13
+ "img",
14
+ {
15
+ height: 100,
16
+ width: 100,
17
+ className: e.logoImage,
18
+ src: s.logo_url,
19
+ alt: `Logo ${d || ""}`
20
+ }
21
+ ) : /* @__PURE__ */ o(
22
+ g,
23
+ {
24
+ name: "next",
25
+ "aria-hidden": "true",
26
+ height: 50,
27
+ width: 50,
28
+ className: e.icon
29
+ }
30
+ ) }),
31
+ /* @__PURE__ */ r("div", { className: e.mainText, children: [
32
+ /* @__PURE__ */ o("div", { className: e.title, children: a || t.formatMessage({
33
+ id: "auth.subscription_modal.title",
34
+ defaultMessage: "Subscribe to comment"
35
+ }) }),
36
+ m || t.formatMessage({
37
+ id: "auth.subscription_modal.text",
38
+ defaultMessage: "Commenting is reserved to subscribers."
39
+ })
40
+ ] }),
41
+ i && /* @__PURE__ */ o(
42
+ b,
43
+ {
44
+ "data-tid": "link_subscribe",
45
+ className: e.button,
46
+ to: i,
47
+ external: !0,
48
+ border: !1,
49
+ children: l || t.formatMessage({
50
+ id: "auth.subscription_modal.button",
51
+ defaultMessage: "Subscribe"
52
+ })
53
+ }
54
+ )
22
55
  ] }) });
23
56
  };
24
57
  export {
25
- M as SubscriptionModal
58
+ y as SubscriptionModal
26
59
  };
@@ -1,9 +1,19 @@
1
- import '../../../assets/components/auth/subscription_modal/SubscriptionModal.module-xQS4aWtJ.css';const t = "_body_14nv4_3", o = "_title_14nv4_15", e = {
2
- body: t,
3
- title: o
1
+ import '../../../assets/components/auth/subscription_modal/SubscriptionModal.module-DC7Au7I2.css';const o = "_body_m3gxh_3", t = "_logo_m3gxh_13", _ = "_logoImage_m3gxh_25", n = "_icon_m3gxh_31", g = "_mainText_m3gxh_44", m = "_title_m3gxh_69", e = "_button_m3gxh_75", c = {
2
+ body: o,
3
+ logo: t,
4
+ logoImage: _,
5
+ icon: n,
6
+ mainText: g,
7
+ title: m,
8
+ button: e
4
9
  };
5
10
  export {
6
- t as body,
7
- e as default,
8
- o as title
11
+ o as body,
12
+ e as button,
13
+ c as default,
14
+ n as icon,
15
+ t as logo,
16
+ _ as logoImage,
17
+ g as mainText,
18
+ m as title
9
19
  };
@@ -1,17 +1,23 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { createContext as f, useContext as i, Suspense as u, lazy as s } from "react";
3
- import { ConfigContext as c } from "../../data/config_provider/ConfigProvider.js";
3
+ import { ConfigContext as d } from "../../data/config_provider/ConfigProvider.js";
4
4
  import { useModal as h } from "../../dialog/modal/useModal.js";
5
- import { useAuth as m } from "../../auth/use_auth/useAuth.js";
6
- const p = s(() => import("../../auth/auth_modal/index.js").then((t) => ({ default: t.AuthModal }))), w = s(() => import("../../auth/subscription_modal/index.js").then((t) => ({ default: t.SubscriptionModal }))), l = f(null), b = () => {
7
- const { config: t } = i(c), o = i(l), { isLoggedIn: r, currentUser: e } = m() || {};
8
- return !!(r && o && t?.[o]?.subscribersOnly === !0 && e?.is_subscriber !== !0);
9
- }, R = () => {
10
- const { config: t } = i(c), o = i(l), r = b(), { showModal: e } = h(), d = o ? t?.[o] : null;
5
+ import { useAuth as p } from "../../auth/use_auth/useAuth.js";
6
+ const w = s(() => import("../../auth/auth_modal/index.js").then((t) => ({ default: t.AuthModal }))), m = s(() => import("../../auth/subscription_modal/index.js").then((t) => ({ default: t.SubscriptionModal }))), l = f(null), b = () => {
7
+ const { config: t } = i(d), e = i(l), { isLoggedIn: r, currentUser: o } = p() || {};
8
+ return !!(r && e && t?.[e]?.subscribersOnly === !0 && o?.is_subscriber !== !0);
9
+ }, x = () => {
10
+ const { config: t } = i(d), e = i(l), r = b(), { showModal: o } = h(), c = e ? t?.[e] : null;
11
11
  return (a = {}) => {
12
12
  if (r) {
13
- e(
14
- /* @__PURE__ */ n(u, { fallback: null, children: /* @__PURE__ */ n(w, { ...d?.subscriptionModal }) })
13
+ if (typeof window < "u" && window.dispatchEvent(
14
+ new CustomEvent("logora:subscription:requested", {
15
+ detail: { module: e, redirectUrl: window.location.href }
16
+ })
17
+ ), t?.auth?.disableSubscriptionModal === !0)
18
+ return;
19
+ o(
20
+ /* @__PURE__ */ n(u, { fallback: null, children: /* @__PURE__ */ n(m, { ...c?.subscriptionModal }) })
15
21
  );
16
22
  return;
17
23
  }
@@ -23,13 +29,13 @@ const p = s(() => import("../../auth/auth_modal/index.js").then((t) => ({ defaul
23
29
  new CustomEvent("logora:authentication:requested", {
24
30
  detail: { redirectUrl: window.location.href }
25
31
  })
26
- )), t?.auth?.disableLoginModal !== !0 && e(
27
- /* @__PURE__ */ n(u, { fallback: null, children: /* @__PURE__ */ n(p, { ...a }) })
32
+ )), t?.auth?.disableLoginModal !== !0 && o(
33
+ /* @__PURE__ */ n(u, { fallback: null, children: /* @__PURE__ */ n(w, { ...a }) })
28
34
  );
29
35
  };
30
36
  };
31
37
  export {
32
38
  l as ModuleContext,
33
- R as useAuthRequired,
39
+ x as useAuthRequired,
34
40
  b as useSubscriptionRequired
35
41
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.4.112",
3
+ "version": "0.4.113",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",
@@ -1 +0,0 @@
1
- ._body_14nv4_3{display:flex;flex-direction:column;align-items:center;text-align:center;gap:1em;padding-top:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;padding-bottom:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;padding-right:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;padding-left:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important}._title_14nv4_15{font-weight:700;font-size:1.2em}