@telia-ace/knowledge-widget-components-guide 1.3.41-rc.1 → 1.3.41-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/{guide-bea67580.mjs → guide-CZYBSJYj.mjs} +21 -21
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/languages.d.ts +18 -0
- package/package.json +10 -10
- /package/{guide-9d79906b.js → guide-BU3mplft.js} +0 -0
|
@@ -2,7 +2,7 @@ import { jsx as a, Fragment as X, jsxs as w } from "react/jsx-runtime";
|
|
|
2
2
|
import { css as P } from "@emotion/react";
|
|
3
3
|
import r from "@emotion/styled";
|
|
4
4
|
import { ContactList as Y, contactLink as me } from "@telia-ace/knowledge-widget-adapters";
|
|
5
|
-
import {
|
|
5
|
+
import { useRouteData as A, List as he, paddedBorderTabStyle as Z, TextLink as _, useDispatch as ee, useProperties as V, StyledHeaderText as ue, Feedback as ge, useContainer as te, Tooltip as fe, StyledListButton as T, Text as G, SymbolBadge as F, useFavorites as be, StyledText as Q, FavoriteButton as ye, DrawerList as ne, DrawerAnimationType as ae, DropdownList as oe, useChildren as pe, DialogLink as $e, embeddedLinkMapper as ke, Lightbox as we, createEmptyComponent as xe, Loader as ze, loadingOpacity as Le, contentBox as Se, genericHtml as Be, headingElement as Ne, Paragraph as Ce, DialogList as ve, linkTabStyle as De, Button as Re, Metadata as Oe } from "@telia-ace/knowledge-widget-ui";
|
|
6
6
|
import { NotFound as Te, Component as Fe } from "@telia-ace/widget-types-grid";
|
|
7
7
|
import { appendClassNames as I, buildCategoryTrail as Ie, createParams as Ee } from "@telia-ace/widget-utilities";
|
|
8
8
|
import { useMemo as E, useState as se, useEffect as le, useCallback as M, forwardRef as We } from "react";
|
|
@@ -69,7 +69,7 @@ const He = ({
|
|
|
69
69
|
li > span {
|
|
70
70
|
cursor: default;
|
|
71
71
|
}
|
|
72
|
-
`, Me = r(
|
|
72
|
+
`, Me = r(_)`
|
|
73
73
|
font-weight: 300;
|
|
74
74
|
color: ${(e) => {
|
|
75
75
|
var t;
|
|
@@ -83,17 +83,17 @@ const He = ({
|
|
|
83
83
|
`}
|
|
84
84
|
|
|
85
85
|
&:focus-visible {
|
|
86
|
-
${
|
|
86
|
+
${Z};
|
|
87
87
|
}
|
|
88
88
|
`, Pe = r(Y)`
|
|
89
89
|
border-top: ${(e) => e.theme.border};
|
|
90
90
|
${(e) => e.backButtonShown === "true" && `border-bottom: ${e.theme.border};`}
|
|
91
|
-
`, Ae = r(
|
|
91
|
+
`, Ae = r(ge)`
|
|
92
92
|
${(e) => {
|
|
93
93
|
var t, n;
|
|
94
94
|
return `padding: ${(t = e.theme.sizes) == null ? void 0 : t.large} ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
|
|
95
95
|
}}
|
|
96
|
-
`, Ve = r(
|
|
96
|
+
`, Ve = r(ue)`
|
|
97
97
|
${(e) => {
|
|
98
98
|
var t, n;
|
|
99
99
|
return `padding: ${(t = e.theme.sizes) == null ? void 0 : t.large} ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
|
|
@@ -378,10 +378,10 @@ const He = ({
|
|
|
378
378
|
closeButtonAriaLabel: b
|
|
379
379
|
}
|
|
380
380
|
) : S === $.DRAWER ? /* @__PURE__ */ a(
|
|
381
|
-
|
|
381
|
+
ne,
|
|
382
382
|
{
|
|
383
383
|
className: "humany-guide-functions-drawer-list",
|
|
384
|
-
animation: { type:
|
|
384
|
+
animation: { type: ae.SlideInBottom },
|
|
385
385
|
header: e,
|
|
386
386
|
items: x,
|
|
387
387
|
trigger: N,
|
|
@@ -405,7 +405,7 @@ const He = ({
|
|
|
405
405
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
406
406
|
}};
|
|
407
407
|
}
|
|
408
|
-
`, Ue = r(
|
|
408
|
+
`, Ue = r(oe)`
|
|
409
409
|
display: block;
|
|
410
410
|
min-height: auto;
|
|
411
411
|
`, Xe = r(T)`
|
|
@@ -483,10 +483,10 @@ const He = ({
|
|
|
483
483
|
renderItem: b
|
|
484
484
|
}
|
|
485
485
|
) : n === $.DRAWER ? /* @__PURE__ */ a(
|
|
486
|
-
|
|
486
|
+
ne,
|
|
487
487
|
{
|
|
488
488
|
className: "humany-guide-languages-drawer-list",
|
|
489
|
-
animation: { type:
|
|
489
|
+
animation: { type: ae.SlideInBottom },
|
|
490
490
|
header: e,
|
|
491
491
|
items: h,
|
|
492
492
|
trigger: u,
|
|
@@ -540,10 +540,10 @@ const He = ({
|
|
|
540
540
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
541
541
|
}};
|
|
542
542
|
}
|
|
543
|
-
`, at = r(
|
|
543
|
+
`, at = r(oe)`
|
|
544
544
|
display: block;
|
|
545
545
|
min-height: auto;
|
|
546
|
-
`, ot = r(
|
|
546
|
+
`, ot = r(_)`
|
|
547
547
|
color: ${(e) => {
|
|
548
548
|
var t, n;
|
|
549
549
|
return e.selected ? (t = e.theme.colors) == null ? void 0 : t.primary : (n = e.theme.colors) == null ? void 0 : n.text;
|
|
@@ -552,7 +552,7 @@ const He = ({
|
|
|
552
552
|
|
|
553
553
|
outline: none;
|
|
554
554
|
&:focus-visible {
|
|
555
|
-
${
|
|
555
|
+
${Z}
|
|
556
556
|
text-decoration: underline;
|
|
557
557
|
}
|
|
558
558
|
`, st = (e) => {
|
|
@@ -663,7 +663,7 @@ const He = ({
|
|
|
663
663
|
params: { connection: D, guide: C }
|
|
664
664
|
} = A(), x = te(), N = pe(), z = ee(), B = E(() => ({
|
|
665
665
|
transform: {
|
|
666
|
-
img: (L) => /* @__PURE__ */ a(
|
|
666
|
+
img: (L) => /* @__PURE__ */ a(we, { attrs: L, htmlBody: (o == null ? void 0 : o.body) || "" }),
|
|
667
667
|
a: (L) => {
|
|
668
668
|
const { children: ie, ...ce } = L, J = ce["data-target"];
|
|
669
669
|
if (J && l.length) {
|
|
@@ -671,9 +671,9 @@ const He = ({
|
|
|
671
671
|
({ connection: de }) => de === J
|
|
672
672
|
);
|
|
673
673
|
if (K)
|
|
674
|
-
return /* @__PURE__ */ a(
|
|
674
|
+
return /* @__PURE__ */ a($e, { ...K, children: ie });
|
|
675
675
|
}
|
|
676
|
-
return
|
|
676
|
+
return ke(x)(L);
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
}), [o, x, l]), R = M(() => {
|
|
@@ -795,7 +795,7 @@ const He = ({
|
|
|
795
795
|
), it = r.div`
|
|
796
796
|
${Le}
|
|
797
797
|
min-width: 0;
|
|
798
|
-
`, ct = r(
|
|
798
|
+
`, ct = r(Ce)`
|
|
799
799
|
${Be}
|
|
800
800
|
${(e) => {
|
|
801
801
|
var t;
|
|
@@ -835,7 +835,7 @@ const He = ({
|
|
|
835
835
|
`, dt = r(Y)`
|
|
836
836
|
border-top: ${(e) => e.theme.border};
|
|
837
837
|
${(e) => e.backButtonShown === "true" && `border-bottom: ${e.theme.border};`}
|
|
838
|
-
`, mt = r(
|
|
838
|
+
`, mt = r(ve)`
|
|
839
839
|
${(e) => {
|
|
840
840
|
var t, n;
|
|
841
841
|
return `padding: 0 ${(t = e.theme.sizes) == null ? void 0 : t.large} ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
|
|
@@ -853,7 +853,7 @@ const He = ({
|
|
|
853
853
|
border-radius: ${(e) => `${e.theme.borderRadius} ${e.theme.borderRadius}`} 0 0;
|
|
854
854
|
background-color: #ffffff;
|
|
855
855
|
`, ut = r.div`
|
|
856
|
-
${
|
|
856
|
+
${Se}
|
|
857
857
|
display: block;
|
|
858
858
|
> a {
|
|
859
859
|
${me}
|
|
@@ -864,7 +864,7 @@ const He = ({
|
|
|
864
864
|
box-shadow: none;
|
|
865
865
|
background-color: #fafafa;
|
|
866
866
|
`}
|
|
867
|
-
`, gt = r(
|
|
867
|
+
`, gt = r(Oe)`
|
|
868
868
|
display: block;
|
|
869
869
|
${(e) => {
|
|
870
870
|
var t, n;
|
|
@@ -900,7 +900,7 @@ const He = ({
|
|
|
900
900
|
font-weight: 300;
|
|
901
901
|
}
|
|
902
902
|
&:focus-visible {
|
|
903
|
-
${
|
|
903
|
+
${De}
|
|
904
904
|
padding: ${(e) => {
|
|
905
905
|
var t, n;
|
|
906
906
|
return `calc(${(t = e.theme.sizes) == null ? void 0 : t.small} / 2) ${(n = e.theme.sizes) == null ? void 0 : n.small}`;
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";const u=require("@telia-ace/knowledge-data-client"),l=require("@telia-ace/knowledge-widget-component-utilities"),b=require("@telia-ace/knowledge-widget-core"),v=require("@telia-ace/knowledge-widget-ui"),k=require("clipboard-polyfill");function w(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return r.default=e,Object.freeze(r)}const m=w(k),y=(e,r)=>{r.actions.create("feedback",a=>{const s=a==="negative"?u.FeedbackType.Negative:u.FeedbackType.Positive,{guide:i,submitButtonLabel:c="Submit"}=r.properties();if(i){const{connection:t,id:n,hasHandover:o}=i;r.writeProperties({feedbackGiven:a,loading:o&&s===u.FeedbackType.Negative});const{events:d}=e.get("$widget");return d.dispatch("tracking:feedback-given",{guide:i,categories:i.categories,feedbackType:s.toLowerCase()}),u.DataClient.getInstance(e).then(h=>h.feedback(n,t,s).then(()=>{if(o&&s===u.FeedbackType.Negative)return h.fetch(u.DataType.ContactMethods,{guideId:n}).then(({contactMethods:p})=>r.actions.dispatch("handover",{handoverContactMethods:p.map(g=>({...g,body:l.updateForm(g,{submit:c})})),loading:!1}))}))}}),r.actions.create("handover",a=>r.writeProperties({...a,loading:!1}))},T=({title:e,body:r})=>{let a="";e&&e.length&&(a=e.trim()),r&&r.length&&(a=`${a.trim()}
|
|
2
|
-
${r.trim()}`);const s=document.createElement("div");s.innerHTML=a;const i=Array.from(s.getElementsByTagName("a"));let c=s.innerText;return i.forEach(t=>{c=c.replace(t.innerText,`[${t.href}] (${t.innerText})`)}),c},C=({title:e,body:r})=>{let a="";return e&&e.length&&(a=`<h2>${e.trim()}</h2>`),r&&r.length&&(a=`${a.trim()}${r.trim()}`),a.trim()},x=e=>{const{events:r}=e.get("$widget"),[a,s]=b.createEventSubscriber(r);return v.createReactComponent(e,"guide",Promise.resolve().then(()=>require("./guide-
|
|
2
|
+
${r.trim()}`);const s=document.createElement("div");s.innerHTML=a;const i=Array.from(s.getElementsByTagName("a"));let c=s.innerText;return i.forEach(t=>{c=c.replace(t.innerText,`[${t.href}] (${t.innerText})`)}),c},C=({title:e,body:r})=>{let a="";return e&&e.length&&(a=`<h2>${e.trim()}</h2>`),r&&r.length&&(a=`${a.trim()}${r.trim()}`),a.trim()},x=e=>{const{events:r}=e.get("$widget"),[a,s]=b.createEventSubscriber(r);return v.createReactComponent(e,"guide",Promise.resolve().then(()=>require("./guide-BU3mplft.js")),i=>{const c=t=>{i.writeProperties({loading:!0,error:void 0,guide:void 0,dialog:void 0,contactMethods:void 0,feedbackGiven:void 0}),i.actions.dispatch("fetch",{params:t})};i.actions.create("copy",t=>{const n=new m.ClipboardItem({"text/html":new Blob([C(t)],{type:"text/html"}),"text/plain":new Blob([T(t)],{type:"text/plain"})});return m.write([n]).then(()=>{r.dispatch("widget:menu-toggled",null)})}),i.actions.create("print",()=>{const t=document.querySelector(".humany-guide .humany-paragraph"),n=window.open("","","height=500, width=500");r.dispatch("widget:menu-toggled",null),t&&n&&(n.document.write(`<html><body>${t.innerHTML}</body></html>`),n.document.close(),n.print())}),i.actions.create("back",(t,n)=>{if(!n.preventDefault)return e.getAsync("router").then(o=>{o.goBack()})}),i.actions.create("fetch",({contactMethods:t=[],dialog:n=[],guide:o,error:d})=>{if(d)return i.actions.dispatch("fetched",{error:d,guide:void 0,contactMethods:[],feedbackGiven:void 0,handoverContactMethods:[],showFeedback:!1,loading:!0});const{showFeedback:h=!0,submitButtonLabel:p="Submit"}=i.properties(),g={showFeedback:h,dialog:n,guide:o,feedbackGiven:void 0,handoverContactMethods:[],contactMethods:t.map(f=>({...f,body:l.updateForm(f,{submit:p})}))};return i.actions.dispatch("fetched",{...g,loading:!0})}),i.actions.create("fetched",t=>i.writeProperties({...t,feedbackGiven:void 0,loading:!1})),e.getAsync("router").then(t=>{const{params:n}=t.getRouteData();c(n)}),a("router:changed",(t,{current:n})=>{c(n.routeData.params)}),y(e,i),l.useForm(e,i),l.useExpand(i)}).then(()=>b.extendComponent(e,"guide",i=>{i.actions.watch("guide.fetch",(c,t)=>{const{params:{guide:n,connection:o}}=c;return n?u.DataClient.getInstance(e).then(d=>d.fetch(u.DataType.Guide,{connection:o,guideId:n})).then(t).catch(d=>{if(d)return t(d)}):t(c)})})).then(()=>{s()})};module.exports=x;
|
package/index.mjs
CHANGED
package/languages.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LanguageProperties } from '../../utilities/src/index.ts';
|
|
2
|
+
import { PickerTypes } from '../../../knowledge/core/src/index.ts';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
import { GuideProps } from './guide-component';
|
|
5
|
+
|
|
6
|
+
export type LanguageListItem = {
|
|
7
|
+
id: string;
|
|
8
|
+
key: string;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
type Props = Merge<{
|
|
12
|
+
header?: string;
|
|
13
|
+
tooltip?: string;
|
|
14
|
+
guide: GuideProps;
|
|
15
|
+
picker?: PickerTypes;
|
|
16
|
+
}, LanguageProperties>;
|
|
17
|
+
declare const Languages: React.FC<Props>;
|
|
18
|
+
export default Languages;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-guide",
|
|
3
|
-
"version": "1.3.41-rc.
|
|
3
|
+
"version": "1.3.41-rc.2",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@telia-ace/knowledge-widget-ui": "^1.3.41-rc.
|
|
14
|
-
"@telia-ace/widget-utilities": "^1.3.41-rc.
|
|
15
|
-
"@telia-ace/knowledge-widget-core": "^1.3.41-rc.
|
|
16
|
-
"@telia-ace/knowledge-widget-adapters": "^1.3.41-rc.
|
|
17
|
-
"@telia-ace/knowledge-widget-component-utilities": "^1.3.41-rc.
|
|
18
|
-
"@telia-ace/widget-forms": "^1.3.41-rc.
|
|
19
|
-
"@telia-ace/widget-routing": "^1.3.41-rc.
|
|
20
|
-
"@telia-ace/widget-types-grid": "^1.3.41-rc.
|
|
21
|
-
"@telia-ace/knowledge-data-client": "^1.3.41-rc.
|
|
13
|
+
"@telia-ace/knowledge-widget-ui": "^1.3.41-rc.2",
|
|
14
|
+
"@telia-ace/widget-utilities": "^1.3.41-rc.2",
|
|
15
|
+
"@telia-ace/knowledge-widget-core": "^1.3.41-rc.2",
|
|
16
|
+
"@telia-ace/knowledge-widget-adapters": "^1.3.41-rc.2",
|
|
17
|
+
"@telia-ace/knowledge-widget-component-utilities": "^1.3.41-rc.2",
|
|
18
|
+
"@telia-ace/widget-forms": "^1.3.41-rc.2",
|
|
19
|
+
"@telia-ace/widget-routing": "^1.3.41-rc.2",
|
|
20
|
+
"@telia-ace/widget-types-grid": "^1.3.41-rc.2",
|
|
21
|
+
"@telia-ace/knowledge-data-client": "^1.3.41-rc.2",
|
|
22
22
|
"@webprovisions/platform": "^1.1.4",
|
|
23
23
|
"clipboard-polyfill": "4.0.0-rc1"
|
|
24
24
|
},
|
|
File without changes
|