@logora/debate 0.3.92 → 0.3.93

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
+ ._tabsWrapper_14x1i_3{position:relative;display:flex;align-items:stretch;width:100%;max-width:100%}._navTabs_14x1i_11{display:flex;flex-wrap:nowrap;gap:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));white-space:nowrap;padding-left:0;margin-top:0;margin-bottom:0;border-bottom:none!important;list-style:none;flex:1}@container (max-width: 575.98px){._navTabs_14x1i_11{font-size:var(--font-size-normal, 16px);gap:var(--space-unit, 1em)}}._navTabs_14x1i_11{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:none}._navTabs_14x1i_11::-webkit-scrollbar{display:none}._arrow_14x1i_39{position:absolute;top:0;bottom:0;z-index:2;display:flex;align-items:center;justify-content:center;border:none;cursor:pointer;padding:0;transition:opacity .2s ease;outline:none;background:none;line-height:0}._arrow_14x1i_39 svg{display:block}._arrow_14x1i_39:focus-visible{outline:2px solid var(--call-primary-color, #434343);outline-offset:-2px}._arrowLeft_14x1i_63{left:0;padding-left:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));background:linear-gradient(to right,var(--background-color-container, white) 40%,transparent)}._arrowLeft_14x1i_63 svg{transform:rotate(90deg)}._arrowRight_14x1i_72{right:0;padding-right:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));background:linear-gradient(to left,var(--background-color-container, white) 40%,transparent)}._arrowRight_14x1i_72 svg{transform:rotate(-90deg)}._arrowHidden_14x1i_81{opacity:0;pointer-events:none}._navItem_14x1i_86{cursor:pointer}._navLink_14x1i_90{display:block;position:relative;padding:var(--spacer-md, calc(var(--space-unit, 1em) * .75)) var(--spacer-md, calc(var(--space-unit, 1em) * .75));border:none!important;color:var(--text-primary, #222222);outline:0}._navLink_14x1i_90:hover,._navLink_14x1i_90:focus{text-decoration:none;color:var(--text-primary, #222222)!important;background:transparent}._navLink_14x1i_90._disabled_14x1i_103{color:var(--darkest-text-tertiary, #c7c7c7);pointer-events:none;cursor:default}._navLink_14x1i_90:after{content:"";background-color:var(--text-primary, #222222);height:2px;position:absolute;width:100%;left:0;bottom:0;z-index:1;transition:transform .25s ease 0s;transform:scaleX(0)}._navLink_14x1i_90._active_14x1i_120{color:var(--text-primary, #222222)!important;background:transparent;font-weight:var(--font-weight-bold, 700)}._navLink_14x1i_90._active_14x1i_120:after{transform:scaleX(1)}
@@ -1,19 +1,21 @@
1
1
  import { AuthProvider as s } from "./AuthProvider.js";
2
2
  import { utf8ToBase64url as e } from "../use_auth/base64.js";
3
3
  class u extends s {
4
- constructor(r, t) {
5
- super(), this.providerName = r, this.userData = t;
4
+ constructor(t, r) {
5
+ super(), this.providerName = t, this.userData = r;
6
6
  }
7
7
  shouldInitAuth() {
8
8
  return !!this.userData;
9
9
  }
10
10
  getSessionId = () => null;
11
- isSameUser(r) {
11
+ isSameUser(t) {
12
12
  return !0;
13
13
  }
14
14
  getAssertion() {
15
- const r = JSON.stringify(this.userData);
16
- return e(r);
15
+ if (!this.userData || typeof this.userData != "object")
16
+ return null;
17
+ const t = JSON.stringify(this.userData);
18
+ return e(t);
17
19
  }
18
20
  getAuthorizationParams() {
19
21
  return {
@@ -1,17 +1,17 @@
1
- import { AuthProvider as e } from "./AuthProvider.js";
2
- class i extends e {
3
- constructor(r, s) {
4
- super(), this.providerName = r, this.userData = s;
1
+ import { AuthProvider as t } from "./AuthProvider.js";
2
+ class i extends t {
3
+ constructor(s, r) {
4
+ super(), this.providerName = s, this.userData = r;
5
5
  }
6
6
  shouldInitAuth() {
7
7
  return !!this.userData;
8
8
  }
9
9
  getSessionId = () => null;
10
- isSameUser(r) {
10
+ isSameUser(s) {
11
11
  return !0;
12
12
  }
13
13
  getAuthorizationParams() {
14
- return {
14
+ return !this.userData?.email || !this.userData?.password ? null : {
15
15
  grant_type: "password",
16
16
  username: this.userData.email,
17
17
  password: this.userData.password,
@@ -1,30 +1,34 @@
1
- import { authTokenHandler as E } from "./authTokenHandler.js";
1
+ import { authTokenHandler as m } from "./authTokenHandler.js";
2
2
  import { useAuth as w } from "./useAuth.js";
3
3
  import { useDataProvider as v } from "../../data/data_provider/useDataProvider.js";
4
- const I = "logora:emailConsent", L = (i, u, d) => {
5
- const { removeToken: r, fetchToken: f } = E(
4
+ const I = "logora:emailConsent", L = (i, u, f) => {
5
+ const { removeToken: a, fetchToken: d } = m(
6
6
  i,
7
7
  u,
8
- d
9
- ), { setCurrentUser: o, setIsLoggedIn: n, setIsLoggingIn: s, setAuthError: a } = w(), h = v(), l = (e) => {
10
- f(e).then((t) => {
8
+ f
9
+ ), { setCurrentUser: n, setIsLoggedIn: s, setIsLoggingIn: t, setAuthError: r } = w(), l = v(), h = (e) => {
10
+ if (!e) {
11
+ r(!0), t(!1);
12
+ return;
13
+ }
14
+ d(e).then((o) => {
11
15
  c();
12
- }).catch((t) => {
13
- a(t);
16
+ }).catch((o) => {
17
+ r(o);
14
18
  });
15
19
  }, g = () => {
16
- n(!1), s(!1), o({}), r(), p();
20
+ s(!1), t(!1), n({}), a(), E();
17
21
  }, c = () => {
18
- h.getOneWithToken("me", "").then((e) => {
22
+ l.getOneWithToken("me", "").then((e) => {
19
23
  if (e.data.success) {
20
- const t = e.data.data.resource;
21
- o(t), n(!0), s(!1), m(t);
24
+ const o = e.data.data.resource;
25
+ n(o), s(!0), t(!1), p(o);
22
26
  } else
23
- a(!0), n(!1), s(!1), o({}), r();
27
+ r(!0), s(!1), t(!1), n({}), a();
24
28
  }).catch((e) => {
25
- a(!0), n(!1), s(!1), o({}), r();
29
+ r(!0), s(!1), t(!1), n({}), a();
26
30
  });
27
- }, m = (e) => {
31
+ }, p = (e) => {
28
32
  typeof window < "u" && window.dispatchEvent(
29
33
  new CustomEvent("logora:authentication:success", {
30
34
  detail: {
@@ -32,11 +36,11 @@ const I = "logora:emailConsent", L = (i, u, d) => {
32
36
  }
33
37
  })
34
38
  );
35
- }, p = () => {
39
+ }, E = () => {
36
40
  typeof window < "u" && window.dispatchEvent(new CustomEvent("logora:authentication:logout"));
37
41
  };
38
42
  return {
39
- loginUser: l,
43
+ loginUser: h,
40
44
  logoutUser: g,
41
45
  fetchUser: c
42
46
  };
@@ -35,7 +35,7 @@ const y = (l) => l?.replace(/&nbsp;/g, " "), st = ({
35
35
  sources: p,
36
36
  hideSubmit: _ = !1,
37
37
  hideSourceAction: A = !1,
38
- onActivation: n,
38
+ onActivation: s,
39
39
  disabled: B = !1,
40
40
  handleChange: C,
41
41
  handleSourcesChange: h,
@@ -51,14 +51,14 @@ const y = (l) => l?.replace(/&nbsp;/g, " "), st = ({
51
51
  autoFocus: a = !1,
52
52
  ...H
53
53
  }) => {
54
- const [s, J] = f(a || g), [Q, W] = f(""), [$, q] = f(""), [d, u] = f([]), { showModal: D } = Me(), N = Ce(), v = Se(), E = xe(!1);
54
+ const [n, J] = f(a || g), [Q, W] = f(""), [$, q] = f(""), [d, u] = f([]), { showModal: D } = Me(), N = Ce(), v = Se(), E = xe(!1);
55
55
  M(() => {
56
- a && !E.current && n && (E.current = !0, n());
57
- }, [a, n]), M(() => {
56
+ a && !E.current && s && (E.current = !0, s());
57
+ }, [a, s]), M(() => {
58
58
  p && u(p);
59
59
  }, [p]);
60
60
  const I = () => {
61
- s || (J(!0), n && n());
61
+ n || (J(!0), s && s());
62
62
  }, F = {
63
63
  editable: !B,
64
64
  theme: Pe,
@@ -114,7 +114,7 @@ const y = (l) => l?.replace(/&nbsp;/g, " "), st = ({
114
114
  "div",
115
115
  {
116
116
  className: b(i.editorInner, {
117
- [i.editorInnerInactive]: !s && !g
117
+ [i.editorInnerInactive]: !n && !g
118
118
  }),
119
119
  children: [
120
120
  /* @__PURE__ */ e(
@@ -124,7 +124,7 @@ const y = (l) => l?.replace(/&nbsp;/g, " "), st = ({
124
124
  le,
125
125
  {
126
126
  className: b(i.editorInput, {
127
- [i.editorInputInactive]: !s
127
+ [i.editorInputInactive]: !n
128
128
  }),
129
129
  ...H
130
130
  }
@@ -142,14 +142,14 @@ const y = (l) => l?.replace(/&nbsp;/g, " "), st = ({
142
142
  shortBar: O,
143
143
  onSubmit: V,
144
144
  onAddSource: X,
145
- isActive: s || g,
145
+ isActive: n || g,
146
146
  sourceTooltip: T?.length > 0 && N.formatMessage({
147
147
  id: "input.allowed_domains_tooltip",
148
148
  defaultMessage: "With the new source function, you can add links to your article."
149
149
  })
150
150
  }
151
151
  ),
152
- s && m && !k && /* @__PURE__ */ S("div", { className: i.charactersCount, children: [
152
+ n && m && !k && /* @__PURE__ */ S("div", { className: i.charactersCount, children: [
153
153
  /* @__PURE__ */ e(se, { maxLength: m }),
154
154
  " ",
155
155
  N.formatMessage({
@@ -170,7 +170,7 @@ const y = (l) => l?.replace(/&nbsp;/g, " "), st = ({
170
170
  ),
171
171
  /* @__PURE__ */ e(Ie, { content: w }),
172
172
  /* @__PURE__ */ e(Re, { richContent: L }),
173
- /* @__PURE__ */ e(Ne, { autoFocus: a }),
173
+ /* @__PURE__ */ e(Ne, { autoFocus: a, isActive: n }),
174
174
  m && /* @__PURE__ */ e(ve, { maxLength: m }),
175
175
  /* @__PURE__ */ e(Ee, { storageUid: P || v }),
176
176
  /* @__PURE__ */ e(me, { editorRef: j })
@@ -1,18 +1,20 @@
1
- import { useLexicalComposerContext as u } from "@lexical/react/LexicalComposerContext";
2
- import { useRef as c, useEffect as s } from "react";
3
- import { useInput as f } from "../../input_provider/useInput.js";
4
- const E = ({ autoFocus: t = !1 }) => {
5
- const [o] = u(), { focus: e } = f(), r = c(!1);
6
- return s(() => {
7
- e && o.focus(() => {
8
- o.getRootElement().focus();
1
+ import { useLexicalComposerContext as l } from "@lexical/react/LexicalComposerContext";
2
+ import { useRef as f, useEffect as r } from "react";
3
+ import { useInput as m } from "../../input_provider/useInput.js";
4
+ const d = ({ autoFocus: n = !1, isActive: t = !1 }) => {
5
+ const [o] = l(), { focus: s } = m(), u = f(!1), c = f(t), e = () => {
6
+ o.focus(() => {
7
+ o.getRootElement()?.focus();
9
8
  });
10
- }, [e, o]), s(() => {
11
- t && !r.current && (r.current = !0, o.focus(() => {
12
- o.getRootElement().focus();
13
- }));
9
+ };
10
+ return r(() => {
11
+ s && e();
12
+ }, [s, o]), r(() => {
13
+ n && !u.current && (u.current = !0, e());
14
+ }, [n, o]), r(() => {
15
+ t && !c.current && e(), c.current = t;
14
16
  }, [t, o]), null;
15
17
  };
16
18
  export {
17
- E as FocusPlugin
19
+ d as FocusPlugin
18
20
  };
@@ -1,23 +1,23 @@
1
- import '../../../assets/components/navigation/tabs/Tabs.module-CFizOU1d.css';const a = "_tabsWrapper_s0wnb_3", n = "_navTabs_s0wnb_11", r = "_arrow_s0wnb_38", s = "_arrowLeft_s0wnb_62", t = "_arrowRight_s0wnb_71", _ = "_arrowHidden_s0wnb_80", o = "_navItem_s0wnb_85", w = "_navLink_s0wnb_89", e = "_active_s0wnb_119", b = {
1
+ import '../../../assets/components/navigation/tabs/Tabs.module-CYpmMK3l.css';const a = "_tabsWrapper_14x1i_3", r = "_navTabs_14x1i_11", t = "_arrow_14x1i_39", _ = "_arrowLeft_14x1i_63", n = "_arrowRight_14x1i_72", o = "_arrowHidden_14x1i_81", i = "_navItem_14x1i_86", s = "_navLink_14x1i_90", e = "_active_14x1i_120", c = {
2
2
  tabsWrapper: a,
3
- navTabs: n,
4
- arrow: r,
5
- arrowLeft: s,
6
- arrowRight: t,
7
- arrowHidden: _,
8
- navItem: o,
9
- navLink: w,
3
+ navTabs: r,
4
+ arrow: t,
5
+ arrowLeft: _,
6
+ arrowRight: n,
7
+ arrowHidden: o,
8
+ navItem: i,
9
+ navLink: s,
10
10
  active: e
11
11
  };
12
12
  export {
13
13
  e as active,
14
- r as arrow,
15
- _ as arrowHidden,
16
- s as arrowLeft,
17
- t as arrowRight,
18
- b as default,
19
- o as navItem,
20
- w as navLink,
21
- n as navTabs,
14
+ t as arrow,
15
+ o as arrowHidden,
16
+ _ as arrowLeft,
17
+ n as arrowRight,
18
+ c as default,
19
+ i as navItem,
20
+ s as navLink,
21
+ r as navTabs,
22
22
  a as tabsWrapper
23
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.3.92",
3
+ "version": "0.3.93",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",
@@ -1 +0,0 @@
1
- ._tabsWrapper_s0wnb_3{position:relative;display:flex;align-items:stretch;width:100%;max-width:100%}._navTabs_s0wnb_11{display:flex;flex-wrap:nowrap;gap:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));white-space:nowrap;padding-left:0;margin-top:0;margin-bottom:0;border-bottom:none!important;list-style:none;flex:1}@container (max-width: 575.98px){._navTabs_s0wnb_11{font-size:var(--font-size-normal, 16px);gap:var(--space-unit, 1em)}}._navTabs_s0wnb_11{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}._navTabs_s0wnb_11::-webkit-scrollbar{display:none}._arrow_s0wnb_38{position:absolute;top:0;bottom:0;z-index:2;display:flex;align-items:center;justify-content:center;border:none;cursor:pointer;padding:0;transition:opacity .2s ease;outline:none;background:none;line-height:0}._arrow_s0wnb_38 svg{display:block}._arrow_s0wnb_38:focus-visible{outline:2px solid var(--call-primary-color, #434343);outline-offset:-2px}._arrowLeft_s0wnb_62{left:0;padding-left:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));background:linear-gradient(to right,var(--background-color-container, white) 40%,transparent)}._arrowLeft_s0wnb_62 svg{transform:rotate(90deg)}._arrowRight_s0wnb_71{right:0;padding-right:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));background:linear-gradient(to left,var(--background-color-container, white) 40%,transparent)}._arrowRight_s0wnb_71 svg{transform:rotate(-90deg)}._arrowHidden_s0wnb_80{opacity:0;pointer-events:none}._navItem_s0wnb_85{cursor:pointer}._navLink_s0wnb_89{display:block;position:relative;padding:var(--spacer-md, calc(var(--space-unit, 1em) * .75)) var(--spacer-md, calc(var(--space-unit, 1em) * .75));border:none!important;color:var(--text-primary, #222222);outline:0}._navLink_s0wnb_89:hover,._navLink_s0wnb_89:focus{text-decoration:none;color:var(--text-primary, #222222)!important;background:transparent}._navLink_s0wnb_89._disabled_s0wnb_102{color:var(--darkest-text-tertiary, #c7c7c7);pointer-events:none;cursor:default}._navLink_s0wnb_89:after{content:"";background-color:var(--text-primary, #222222);height:2px;position:absolute;width:100%;left:0;bottom:0;z-index:1;transition:transform .25s ease 0s;transform:scaleX(0)}._navLink_s0wnb_89._active_s0wnb_119{color:var(--text-primary, #222222)!important;background:transparent;font-weight:var(--font-weight-bold, 700)}._navLink_s0wnb_89._active_s0wnb_119:after{transform:scaleX(1)}