@telia-ace/widget-components-back-link 1.1.1-rc.0 → 1.1.1-rc.2
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.
- package/{back-link-3a8fd180.mjs → back-link-54301a28.mjs} +41 -37
- package/back-link-95858d0c.js +20 -0
- package/index-33c6a46f.js +591 -0
- package/index-ad1d2389.mjs +4032 -0
- package/index.js +1 -1
- package/index.mjs +6 -2
- package/package.json +5 -5
- package/back-link-4a9ef4a2.js +0 -20
- package/index-b5ce891a.mjs +0 -7909
- package/index-edf03e83.js +0 -624
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import { jsx as c, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import x from "@emotion/styled";
|
|
3
|
+
import "@emotion/react";
|
|
4
|
+
import { E as v, C as $, u as D, a as E, b as B, c as z, d as C, e as M, f as N, l as P, g as d, B as R } from "./index-ad1d2389.mjs";
|
|
3
5
|
import { useContext as k, useState as h, useEffect as f } from "react";
|
|
4
6
|
import "react-dom";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import "react-transition-group";
|
|
8
|
+
import "react-router-dom";
|
|
9
|
+
const w = (e = {}) => (Object.keys(e).forEach((t) => {
|
|
10
|
+
(e[t] === null || typeof e[t] > "u") && delete e[t];
|
|
11
|
+
}), e), A = (e, t) => e.get("seoConfiguration") ? /* @__PURE__ */ c(v, { ...t }) : null, I = () => k($), Q = () => {
|
|
12
|
+
const e = D(), t = I(), [n, l] = h([]), [u, r] = h();
|
|
9
13
|
return f(() => {
|
|
10
|
-
if (
|
|
11
|
-
const s = new E(
|
|
14
|
+
if (e && t) {
|
|
15
|
+
const s = new E(e).withId(t.id), i = e.actions(s, t.type || B());
|
|
12
16
|
r(i), n !== null && (n.forEach((o) => {
|
|
13
17
|
i.dispatch(o.key, o.data).then((a) => o.resolve(a)).catch((a) => o.reject(a));
|
|
14
18
|
}), l(null));
|
|
15
19
|
}
|
|
16
|
-
}, [
|
|
20
|
+
}, [e, t.id]), (s, i) => n !== null ? new Promise((o, a) => {
|
|
17
21
|
n.push({
|
|
18
22
|
key: s,
|
|
19
23
|
data: i,
|
|
@@ -21,10 +25,10 @@ const w = (t = {}) => (Object.keys(t).forEach((e) => {
|
|
|
21
25
|
reject: a
|
|
22
26
|
});
|
|
23
27
|
}) : u.dispatch(s, i);
|
|
24
|
-
},
|
|
25
|
-
const
|
|
28
|
+
}, S = () => k(z), q = (e) => {
|
|
29
|
+
const t = C(), n = M(), [l, u] = h({ name: "", params: {} }), r = N();
|
|
26
30
|
return f(() => {
|
|
27
|
-
const s = (
|
|
31
|
+
const s = (e || t).get("$widget");
|
|
28
32
|
if (!s)
|
|
29
33
|
return;
|
|
30
34
|
const { events: i } = s;
|
|
@@ -34,57 +38,57 @@ const w = (t = {}) => (Object.keys(t).forEach((e) => {
|
|
|
34
38
|
w(g), u({ name: b, params: g });
|
|
35
39
|
}
|
|
36
40
|
});
|
|
37
|
-
}, [r,
|
|
41
|
+
}, [r, e, t]), f(() => {
|
|
38
42
|
if (n && n.history && r.current) {
|
|
39
43
|
const s = n.getRouteData(), { name: i, params: o } = s;
|
|
40
44
|
w(o), u({ name: i, params: o });
|
|
41
45
|
}
|
|
42
46
|
}, [n, r]), l;
|
|
43
|
-
}, y =
|
|
47
|
+
}, y = x.div`
|
|
44
48
|
font-weight: 300;
|
|
45
49
|
button {
|
|
46
|
-
color: ${(
|
|
47
|
-
var
|
|
48
|
-
return (
|
|
50
|
+
color: ${(e) => {
|
|
51
|
+
var t;
|
|
52
|
+
return (t = e.theme.colors) == null ? void 0 : t.primary;
|
|
49
53
|
}};
|
|
50
54
|
text-decoration: underline;
|
|
51
|
-
font-size: ${(
|
|
52
|
-
var
|
|
53
|
-
return (
|
|
55
|
+
font-size: ${(e) => {
|
|
56
|
+
var t;
|
|
57
|
+
return (t = e.theme.fonts) == null ? void 0 : t.normal;
|
|
54
58
|
}};
|
|
55
59
|
span {
|
|
56
60
|
font-weight: 300;
|
|
57
61
|
}
|
|
58
62
|
&:focus-visible {
|
|
59
63
|
${P}
|
|
60
|
-
padding: ${(
|
|
61
|
-
var
|
|
62
|
-
return `calc(${(
|
|
64
|
+
padding: ${(e) => {
|
|
65
|
+
var t, n;
|
|
66
|
+
return `calc(${(t = e.theme.sizes) == null ? void 0 : t.small} / 2) ${(n = e.theme.sizes) == null ? void 0 : n.small}`;
|
|
63
67
|
}};
|
|
64
68
|
}
|
|
65
69
|
}
|
|
66
|
-
`, L =
|
|
67
|
-
margin-right: ${(
|
|
68
|
-
var
|
|
69
|
-
return (
|
|
70
|
+
`, L = x.svg`
|
|
71
|
+
margin-right: ${(e) => {
|
|
72
|
+
var t;
|
|
73
|
+
return (t = e.theme.sizes) == null ? void 0 : t.small;
|
|
70
74
|
}};
|
|
71
75
|
line {
|
|
72
|
-
stroke: ${(
|
|
73
|
-
var
|
|
74
|
-
return (
|
|
76
|
+
stroke: ${(e) => {
|
|
77
|
+
var t;
|
|
78
|
+
return (t = e.theme.colors) == null ? void 0 : t.primary;
|
|
75
79
|
}};
|
|
76
80
|
}
|
|
77
|
-
`,
|
|
78
|
-
const n =
|
|
81
|
+
`, H = ({ className: e, ...t }) => {
|
|
82
|
+
const n = Q(), { params: l } = q(), u = C(), { conditions: r = [], label: s = "" } = S();
|
|
79
83
|
if (!(r && r.length ? r.reduce((a, m) => l[m] ? !0 : a, !1) : !0))
|
|
80
|
-
return
|
|
81
|
-
...
|
|
82
|
-
className: d(
|
|
84
|
+
return A(u, {
|
|
85
|
+
...t,
|
|
86
|
+
className: d(e, "humany-back-link")
|
|
83
87
|
});
|
|
84
88
|
const o = () => {
|
|
85
89
|
n("click");
|
|
86
90
|
};
|
|
87
|
-
return s ? /* @__PURE__ */ c(y, { ...
|
|
91
|
+
return s ? /* @__PURE__ */ c(y, { ...t, className: d(e, "humany-back-link"), children: /* @__PURE__ */ p(R, { "aria-label": s, onClick: o, children: [
|
|
88
92
|
/* @__PURE__ */ p(
|
|
89
93
|
L,
|
|
90
94
|
{
|
|
@@ -100,7 +104,7 @@ const w = (t = {}) => (Object.keys(t).forEach((e) => {
|
|
|
100
104
|
}
|
|
101
105
|
),
|
|
102
106
|
s && /* @__PURE__ */ c("span", { children: s })
|
|
103
|
-
] }) }) : /* @__PURE__ */ c(y, { ...
|
|
107
|
+
] }) }) : /* @__PURE__ */ c(y, { ...t, className: d(e, "humany-back-link"), children: /* @__PURE__ */ p(
|
|
104
108
|
"svg",
|
|
105
109
|
{
|
|
106
110
|
width: "8",
|
|
@@ -134,5 +138,5 @@ const w = (t = {}) => (Object.keys(t).forEach((e) => {
|
|
|
134
138
|
) });
|
|
135
139
|
};
|
|
136
140
|
export {
|
|
137
|
-
|
|
141
|
+
H as default
|
|
138
142
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),g=require("@emotion/styled");require("@emotion/react");const n=require("./index-33c6a46f.js"),l=require("react");require("react-dom");require("react-transition-group");require("react-router-dom");const f=(t={})=>(Object.keys(t).forEach(e=>{(t[e]===null||typeof t[e]>"u")&&delete t[e]}),t),w=(t,e)=>t.get("seoConfiguration")?i.jsx(n.Empty,{...e}):null,C=()=>l.useContext(n.ComponentNodeContext),k=()=>{const t=n.useComponentPlatform(),e=C(),[s,d]=l.useState([]),[m,c]=l.useState();return l.useEffect(()=>{if(t&&e){const r=new n.ComponentQuery(t).withId(e.id),a=t.actions(r,e.type||n.uuid());c(a),s!==null&&(s.forEach(o=>{a.dispatch(o.key,o.data).then(u=>o.resolve(u)).catch(u=>o.reject(u))}),d(null))}},[t,e.id]),(r,a)=>s!==null?new Promise((o,u)=>{s.push({key:r,data:a,resolve:o,reject:u})}):m.dispatch(r,a)},b=()=>l.useContext(n.ComponentPropertyContext),v=t=>{const e=n.useContainer(),s=n.useRouter(),[d,m]=l.useState({name:"",params:{}}),c=n.useIsMounted();return l.useEffect(()=>{const r=(t||e).get("$widget");if(!r)return;const{events:a}=r;return a.subscribe("router:change",(u,{next:{routeData:p}})=>{if(c.current){const{name:y,params:h}=p;f(h),m({name:y,params:h})}})},[c,t,e]),l.useEffect(()=>{if(s&&s.history&&c.current){const r=s.getRouteData(),{name:a,params:o}=r;f(o),m({name:a,params:o})}},[s,c]),d},x=g.div`
|
|
2
|
+
font-weight: 300;
|
|
3
|
+
button {
|
|
4
|
+
color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.primary}};
|
|
5
|
+
text-decoration: underline;
|
|
6
|
+
font-size: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.normal}};
|
|
7
|
+
span {
|
|
8
|
+
font-weight: 300;
|
|
9
|
+
}
|
|
10
|
+
&:focus-visible {
|
|
11
|
+
${n.linkTabStyle}
|
|
12
|
+
padding: ${t=>{var e,s;return`calc(${(e=t.theme.sizes)==null?void 0:e.small} / 2) ${(s=t.theme.sizes)==null?void 0:s.small}`}};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`,j=g.svg`
|
|
16
|
+
margin-right: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.small}};
|
|
17
|
+
line {
|
|
18
|
+
stroke: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.primary}};
|
|
19
|
+
}
|
|
20
|
+
`,q=({className:t,...e})=>{const s=k(),{params:d}=v(),m=n.useContainer(),{conditions:c=[],label:r=""}=b();if(!(c&&c.length?c.reduce((u,p)=>d[p]?!0:u,!1):!0))return w(m,{...e,className:n.appendClassNames(t,"humany-back-link")});const o=()=>{s("click")};return r?i.jsx(x,{...e,className:n.appendClassNames(t,"humany-back-link"),children:i.jsxs(n.Button,{"aria-label":r,onClick:o,children:[i.jsxs(j,{width:"7",height:"13",viewBox:"0 0 7 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"6.64645",y1:"12.5513",x2:"0.648357",y2:"6.55319"}),i.jsx("line",{x1:"0.646447",y1:"6.64455",x2:"6.64454",y2:"0.646465"})]}),r&&i.jsx("span",{children:r})]})}):i.jsx(x,{...e,className:n.appendClassNames(t,"humany-back-link"),children:i.jsxs("svg",{width:"8",height:"16",viewBox:"0 0 8 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{y1:"-0.5",x2:"10.2585",y2:"-0.5",transform:"matrix(-0.682358 -0.731018 0.682358 -0.731018 8 14.9999)",stroke:"white"}),i.jsx("line",{y1:"-0.5",x2:"10.2585",y2:"-0.5",transform:"matrix(0.682359 -0.731018 0.682358 0.731018 1 8.49915)",stroke:"white"})]})})};exports.default=q;
|