@telia-ace/knowledge-widget-ui 1.3.33 → 1.3.34

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.
Files changed (3) hide show
  1. package/index.js +32 -32
  2. package/index.mjs +335 -361
  3. package/package.json +4 -4
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),s=require("@telia-ace/widget-ui"),v=require("@telia-ace/widget-utilities"),d=require("@emotion/styled"),u=require("react"),y=require("@emotion/react"),P=({title:e="",className:t,id:a,parent:i,connection:o,type:r,target:l,href:h,children:c,connectionKey:m})=>{const p={},{name:f,params:g}=s.useRouteData();switch(r){case"default":case"guide":const{id:w,title:b}=i;let $=m||o;w!==a&&!m&&($=void 0),p.routeName=f,p.params=v.createParams({...g,guide:a,connection:$,uriName:a===w?v.formatUrl(b):v.formatUrl(e)});break;case"link":p.href=h,p.target=l;break}return n.jsx(s.Link,{className:v.appendClassNames(t,"humany-dialog-link"),...p,children:c||n.jsxs(n.Fragment,{children:[r==="link"&&n.jsx(s.Icon,{faIcon:"link"}),n.jsx("span",{children:e})]})})},ge=u.forwardRef(({className:e,dialog:t,...a},i)=>t.length?n.jsx(pe,{className:v.appendClassNames(e,"humany-dialog"),items:t,renderItem:o=>n.jsx("li",{"data-dialog":o.connection,children:n.jsx(P,{...o})},o.connection),...a,ref:i}):null),pe=d(s.List)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),s=require("@telia-ace/widget-ui"),$=require("@telia-ace/widget-utilities"),d=require("@emotion/styled"),u=require("react"),y=require("@emotion/react"),C=({title:e="",className:t,id:a,parent:i,connection:o,type:r,target:l,href:h,children:c,connectionKey:m})=>{const p={},{name:f,params:g}=s.useRouteData();switch(r){case"default":case"guide":const{id:b,title:v}=i;let w=m||o;b!==a&&!m&&(w=void 0),p.routeName=f,p.params=$.createParams({...g,guide:a,connection:w,uriName:a===b?$.formatUrl(v):$.formatUrl(e)});break;case"link":p.href=h,p.target=l;break}return n.jsx(s.Link,{className:$.appendClassNames(t,"humany-dialog-link"),...p,children:c||n.jsxs(n.Fragment,{children:[r==="link"&&n.jsx(s.Icon,{faIcon:"link"}),n.jsx("span",{children:e})]})})},fe=u.forwardRef(({className:e,dialog:t,...a},i)=>t.length?n.jsx(ge,{className:$.appendClassNames(e,"humany-dialog"),items:t,renderItem:o=>n.jsx("li",{"data-dialog":o.connection,children:n.jsx(C,{...o})},o.connection),...a,ref:i}):null),ge=d(s.List)`
2
2
  ${s.list}
3
3
  a {
4
4
  min-width: 150px;
@@ -11,7 +11,7 @@
11
11
  i {
12
12
  margin: 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}} 0 0;
13
13
  }
14
- `,xe=({trigger:e,header:t,className:a,animation:i,fullScreen:o,onToggle:r,children:l,ref:h,closeButtonAriaLabel:c,...m})=>n.jsx(s.Drawer,{className:v.appendClassNames(a,"humany-drawer-list"),trigger:e,header:t,animation:i,fullScreen:o,onToggle:r,closeButtonAriaLabel:c,children:n.jsx(ye,{...m,children:l})}),ye=d(s.ItemList)`
14
+ `,pe=({trigger:e,header:t,className:a,animation:i,fullScreen:o,onToggle:r,children:l,ref:h,closeButtonAriaLabel:c,...m})=>n.jsx(s.Drawer,{className:$.appendClassNames(a,"humany-drawer-list"),trigger:e,header:t,animation:i,fullScreen:o,onToggle:r,closeButtonAriaLabel:c,children:n.jsx(xe,{...m,children:l})}),xe=d(s.ItemList)`
15
15
  ${s.itemList}
16
16
  font-family: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.type}};
17
17
  padding: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.medium}};
@@ -20,13 +20,13 @@
20
20
  font-weight: 300;
21
21
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
22
22
  }
23
- `,ve=({items:e,renderItem:t,trigger:a,header:i,children:o})=>n.jsx(s.Dropdown,{className:"humany-dropdown-actions",trigger:a,children:n.jsxs($e,{children:[!!i&&n.jsx(be,{children:i}),e&&t&&n.jsx(we,{items:e,renderItem:t}),o]})}),$e=d.div`
23
+ `,ye=({items:e,renderItem:t,trigger:a,header:i,children:o})=>n.jsx(s.Dropdown,{className:"humany-dropdown-actions",trigger:a,children:n.jsxs($e,{children:[!!i&&n.jsx(ve,{children:i}),e&&t&&n.jsx(be,{items:e,renderItem:t}),o]})}),$e=d.div`
24
24
  background: #fff;
25
25
  border: #ccc 1px solid;
26
26
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
27
27
  font-family: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.type}};
28
28
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
29
- `,be=d.div`
29
+ `,ve=d.div`
30
30
  padding: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
31
31
  padding-bottom: 0;
32
32
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
@@ -50,7 +50,7 @@
50
50
  i {
51
51
  margin-right: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}};
52
52
  }
53
- `,we=d(s.List)`
53
+ `,be=d(s.List)`
54
54
  list-style: none;
55
55
  padding: 0;
56
56
  margin: 0;
@@ -73,7 +73,7 @@
73
73
  }
74
74
  }
75
75
  }
76
- `,je=({trigger:e,className:t,children:a,closeButtonAriaLabel:i,...o})=>n.jsx(s.Dropdown,{className:v.appendClassNames(t,"humany-dropdown-list"),closeButtonAriaLabel:i,trigger:e,children:n.jsx(ke,{...o,children:a})}),ke=d(s.ItemList)`
76
+ `,we=({trigger:e,className:t,children:a,closeButtonAriaLabel:i,...o})=>n.jsx(s.Dropdown,{className:$.appendClassNames(t,"humany-dropdown-list"),closeButtonAriaLabel:i,trigger:e,children:n.jsx(je,{...o,children:a})}),je=d(s.ItemList)`
77
77
  ${s.itemList}
78
78
  font-family: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.type}};
79
79
  > div {
@@ -97,7 +97,7 @@
97
97
  }
98
98
  }
99
99
  }
100
- `,q=e=>y.css`
100
+ `,M=e=>y.css`
101
101
  ${e["data-loading"]&&"position: relative;"};
102
102
  ${e["data-loading"]&&"min-height: 150px;"}
103
103
  > * {
@@ -107,17 +107,17 @@
107
107
  .humany-loader {
108
108
  opacity: ${e["data-loading"]?"1":"0"};
109
109
  }
110
- `,Se=d(s.Icon)`
110
+ `,ke=d(s.Icon)`
111
111
  && {
112
112
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.small}};
113
113
  }
114
114
  width: 1.2em;
115
- `,ze=d(s.Text)`
115
+ `,Se=d(s.Text)`
116
116
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.medium}};
117
117
  font-weight: normal;
118
118
  line-height: 1.2em;
119
119
  color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
120
- `,Y=d(s.Button)`
120
+ `,E=d(s.Button)`
121
121
  display: flex;
122
122
  align-items: center;
123
123
 
@@ -142,7 +142,7 @@
142
142
  flex: 1;
143
143
  font-weight: 300;
144
144
  }
145
- `,_=({addFavoriteTooltip:e,removeFavoriteCancelLabel:t,removeFavoriteConfirmLabel:a,removeFavoriteHeader:i,removeFavoriteLabel:o,removeFavoriteTooltip:r,id:l,isFavorite:h,guideTitle:c,buttonLabel:m="",actions:{addFavorite:p,removeFavorite:f}})=>{const g=u.useCallback(()=>{f(l)},[l,f]),w=u.useCallback(()=>{p(l)},[l,p]),b=`${h?r:e}${c?`: "${c}"`:""}`;return h?n.jsx(s.Confirm,{trigger:n.jsxs(M,{className:"humany-favorite-button",title:b,"aria-label":b,"data-favorite":"true","data-has-label":m?"true":"false","data-has-symbol":"true",children:[n.jsx(s.SymbolBadge,{size:16,symbol:{type:"Svg",content:"star-empty"}}),m&&n.jsx(s.StyledText,{children:m})]}),onConfirm:g,cancelLabel:t,confirmLabel:a,header:i,text:o}):n.jsxs(M,{className:"humany-favorite-button",title:b,"aria-label":b,onClick:w,"data-favorite":"false","data-has-label":m?"true":"false","data-has-symbol":"true",children:[n.jsx(s.SymbolBadge,{size:16,symbol:{type:"Svg",content:"star-empty"}}),m&&n.jsx(s.StyledText,{children:m})]})},M=d(Y)`
145
+ `,H=({addFavoriteTooltip:e,removeFavoriteCancelLabel:t,removeFavoriteConfirmLabel:a,removeFavoriteHeader:i,removeFavoriteLabel:o,removeFavoriteTooltip:r,id:l,isFavorite:h,guideTitle:c,buttonLabel:m="",actions:{addFavorite:p,removeFavorite:f}})=>{const g=u.useCallback(()=>{f(l)},[l,f]),b=u.useCallback(()=>{p(l)},[l,p]),v=`${h?r:e}${c?`: "${c}"`:""}`;return h?n.jsx(s.Confirm,{trigger:n.jsxs(F,{className:"humany-favorite-button",title:v,"aria-label":v,"data-favorite":"true","data-has-label":m?"true":"false","data-has-symbol":"true",children:[n.jsx(s.SymbolBadge,{size:16,symbol:{type:"Svg",content:"star-empty"}}),m&&n.jsx(s.StyledText,{children:m})]}),onConfirm:g,cancelLabel:t,confirmLabel:a,header:i,text:o}):n.jsxs(F,{className:"humany-favorite-button",title:v,"aria-label":v,onClick:b,"data-favorite":"false","data-has-label":m?"true":"false","data-has-symbol":"true",children:[n.jsx(s.SymbolBadge,{size:16,symbol:{type:"Svg",content:"star-empty"}}),m&&n.jsx(s.StyledText,{children:m})]})},F=d(E)`
146
146
  grid-area: favorite;
147
147
 
148
148
  &:focus-visible {
@@ -198,12 +198,12 @@
198
198
  }
199
199
  }
200
200
  `}}
201
- `,Le=u.forwardRef(({onFeedback:e=()=>{},direction:t="horizontal",className:a,header:i,positive:o,negative:r,selected:l,...h},c)=>n.jsxs(Ce,{className:v.appendClassNames(a,"humany-feedback"),"data-direction":t,...s.convertToStringAttributes(h),ref:c,children:[!!i&&n.jsx(Ne,{children:i}),n.jsxs(O,{className:"humany-feedback-button",disabled:!!l,"data-selected":l==="positive","data-direction":t,onClick:()=>e("positive"),children:[n.jsx(s.Icon,{faIcon:"smile-o"}),n.jsx("span",{children:o})]}),n.jsxs(O,{className:"humany-feedback-button",disabled:!!l,"data-selected":l==="negative","data-direction":t,onClick:()=>e("negative"),children:[n.jsx(s.Icon,{faIcon:"frown-o"}),n.jsx("span",{children:r})]})]})),Ne=d(s.StyledText)`
201
+ `,ze=u.forwardRef(({onFeedback:e=()=>{},direction:t="horizontal",className:a,header:i,positive:o,negative:r,selected:l,...h},c)=>n.jsxs(Ne,{className:$.appendClassNames(a,"humany-feedback"),"data-direction":t,...s.convertToStringAttributes(h),ref:c,children:[!!i&&n.jsx(Le,{children:i}),n.jsxs(P,{className:"humany-feedback-button",disabled:!!l,"data-selected":l==="positive","data-direction":t,onClick:()=>e("positive"),children:[n.jsx(s.Icon,{faIcon:"smile-o"}),n.jsx("span",{children:o})]}),n.jsxs(P,{className:"humany-feedback-button",disabled:!!l,"data-selected":l==="negative","data-direction":t,onClick:()=>e("negative"),children:[n.jsx(s.Icon,{faIcon:"frown-o"}),n.jsx("span",{children:r})]})]})),Le=d(s.StyledText)`
202
202
  font-weight: normal;
203
203
  margin: 0 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
204
204
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
205
205
  display: block;
206
- `,O=d(s.Button)`
206
+ `,P=d(s.Button)`
207
207
  display: inline-block;
208
208
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
209
209
  font-weight: 300;
@@ -225,7 +225,7 @@
225
225
  i {
226
226
  margin: 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}} 0 0;
227
227
  }
228
- `,Ce=d.div`
228
+ `,Ne=d.div`
229
229
  ${e=>{var t;return e["data-direction"]==="vertical"&&y.css`
230
230
  > button {
231
231
  width: 100%;
@@ -234,16 +234,16 @@
234
234
  }
235
235
  }
236
236
  `}}
237
- `,Te=()=>{const[e,t]=u.useState(null),a=s.useKeyPress("ArrowLeft"),i=s.useKeyPress("ArrowRight"),o=s.useKeyPress("ArrowUp"),r=s.useKeyPress("ArrowDown"),l=()=>{t(a?"left":i?"right":o?"up":r?"down":null)};return u.useEffect(l,[a,i,o,r]),e},Ie=(e,t)=>{const[a,i]=u.useState(e),o=u.useCallback(()=>setTimeout(()=>{i(e)},t),[t,i,e]);return u.useEffect(()=>{const r=o();return()=>{clearTimeout(r)}},[o]),a},K=()=>{const e=s.useContainer(),[t,a]=u.useState([]),i=e.get("favorites");u.useEffect(()=>{if(i){a(i.get());const{events:c}=e.get("$widget");return c.subscribe("widget:favorites-updated",(p,{updated:f})=>{a([...f])})}},[]);const o=c=>i?i.add(c):Promise.resolve([]),r=c=>i?i.remove(c):Promise.resolve([]),l=()=>i?i.clear():Promise.resolve([]),h=u.useCallback(c=>t.indexOf(c)>-1?r(c):o(c),[t]);return[t,u.useMemo(()=>({addFavorite:o,removeFavorite:r,clearFavorites:l,toggleFavorite:h}),[t])]},De=()=>{const[e,t]=u.useState(!1),a=u.useRef(),i=u.useCallback(()=>t(!0),[t]),o=u.useCallback(()=>t(!1),[t]);return s.useEventListener("mouseenter",i,a.current),s.useEventListener("mouseleave",o,a.current),[e,a]},U=({format:e=s.DateFormats.YYYY_MM_DD_HH_MM,className:t="",byLabel:a="",modifiedLabel:i="",publishedLabel:o="",modifiedBy:r="",publishedBy:l="",showModified:h=!1,showPublished:c=!1,modified:m,published:p})=>{const f=c&&p?n.jsx(H,{format:e,timestamp:p}):null,g=h&&m?n.jsx(H,{format:e,timestamp:m}):null;return!f&&!g?null:n.jsxs(F,{className:v.appendClassNames(t,"humany-metadata"),children:[f&&n.jsxs(F,{className:"humany-published",children:[o,f,a&&l&&` ${a.replace("{{editor}}",l)}`]}),g&&n.jsxs(F,{className:"humany-modified",children:[f&&", ",i,g,a&&r&&` ${a.replace("{{editor}}",r)}`]})]})},H=d(s.Timestamp)`
237
+ `,Ce=()=>{const[e,t]=u.useState(null),a=s.useKeyPress("ArrowLeft"),i=s.useKeyPress("ArrowRight"),o=s.useKeyPress("ArrowUp"),r=s.useKeyPress("ArrowDown"),l=()=>{t(a?"left":i?"right":o?"up":r?"down":null)};return u.useEffect(l,[a,i,o,r]),e},Te=(e,t)=>{const[a,i]=u.useState(e),o=u.useCallback(()=>setTimeout(()=>{i(e)},t),[t,i,e]);return u.useEffect(()=>{const r=o();return()=>{clearTimeout(r)}},[o]),a},O=()=>{const e=s.useContainer(),[t,a]=u.useState([]),i=e.get("favorites");u.useEffect(()=>{if(i){a(i.get());const{events:c}=e.get("$widget");return c.subscribe("widget:favorites-updated",(p,{updated:f})=>{a([...f])})}},[]);const o=c=>i?i.add(c):Promise.resolve([]),r=c=>i?i.remove(c):Promise.resolve([]),l=()=>i?i.clear():Promise.resolve([]),h=u.useCallback(c=>t.indexOf(c)>-1?r(c):o(c),[t]);return[t,u.useMemo(()=>({addFavorite:o,removeFavorite:r,clearFavorites:l,toggleFavorite:h}),[t])]},Ie=()=>{const[e,t]=u.useState(!1),a=u.useRef(),i=u.useCallback(()=>t(!0),[t]),o=u.useCallback(()=>t(!1),[t]);return s.useEventListener("mouseenter",i,a.current),s.useEventListener("mouseleave",o,a.current),[e,a]},W=({format:e=s.DateFormats.YYYY_MM_DD_HH_MM,className:t="",byLabel:a="",modifiedLabel:i="",publishedLabel:o="",modifiedBy:r="",publishedBy:l="",showModified:h=!1,showPublished:c=!1,modified:m,published:p})=>{const f=c&&p?n.jsx(A,{format:e,timestamp:p}):null,g=h&&m?n.jsx(A,{format:e,timestamp:m}):null;return!f&&!g?null:n.jsxs(N,{className:$.appendClassNames(t,"humany-metadata"),children:[f&&n.jsxs(N,{className:"humany-published",children:[o,f,a&&l&&` ${a.replace("{{editor}}",l)}`]}),g&&n.jsxs(N,{className:"humany-modified",children:[f&&", ",i,g,a&&r&&` ${a.replace("{{editor}}",r)}`]})]})},A=d(s.Timestamp)`
238
238
  &:not(:first-child) {
239
239
  margin-left: 4px;
240
240
  }
241
241
  &:not(:last-child) {
242
242
  margin-right: 4px;
243
243
  }
244
- `,F=d(s.Text)`
244
+ `,N=d(s.Text)`
245
245
  font-style: italic;
246
- `,Be=({tags:e})=>e.filter(t=>t.symbol).length?n.jsx(Ee,{className:"humany-guide-list-tags",items:e,renderItem:({id:t,symbol:a,title:i})=>a&&n.jsx("li",{"data-tag":t,children:n.jsx(Me,{size:18,symbol:a,title:i})},t)}):null,Fe=u.forwardRef(({title:e,id:t,route:a,symbolSize:i,collapseUri:o,children:r},l)=>{const{params:h}=s.useRouteData();return n.jsxs(Pe,{ref:l,"data-guide":t,children:[n.jsx(s.TextLink,{"aria-expanded":!0,title:e,"aria-label":e,routeName:a,params:v.createParams({...h,uriName:o||void 0,id:void 0,guide:void 0,accordion:void 0}),text:e,children:n.jsx(s.SymbolBadge,{size:i,symbol:{type:"Svg",content:"caret-up"}})}),r]})}),Pe=d.li`
246
+ `,De=({tags:e})=>e.filter(t=>t.symbol).length?n.jsx(Re,{className:"humany-guide-list-tags",items:e,renderItem:({id:t,symbol:a,title:i})=>a&&n.jsx("li",{"data-tag":t,children:n.jsx(Me,{size:18,symbol:a,title:i})},t)}):null,Be=u.forwardRef(({title:e,id:t,route:a,symbolSize:i,collapseUri:o,children:r},l)=>{const{params:h}=s.useRouteData();return n.jsxs(Fe,{ref:l,"data-guide":t,children:[n.jsx(s.TextLink,{"aria-expanded":!0,title:e,"aria-label":e,routeName:a,params:$.createParams({...h,uriName:o||void 0,id:void 0,guide:void 0,accordion:void 0}),text:e,children:n.jsx(s.SymbolBadge,{size:i,symbol:{type:"Svg",content:"caret-up"}})}),r]})}),Fe=d.li`
247
247
  > a {
248
248
  grid-column: 1/-1;
249
249
  font-weight: bold;
@@ -253,7 +253,7 @@
253
253
  > div {
254
254
  grid-column: 1/-1;
255
255
  }
256
- `,Ae=u.forwardRef(({expandable:e=!1,routing:t={},paramMappers:a={},symbolSize:i=11,pageRole:o="link",pageCaret:r="down",showTags:l=!1,showFavoriteToggle:h=!1,localPaging:c=!1,onItemClick:m=()=>{},dispatch:p=()=>{},metadata:f={},pageLabel:g,className:w,children:b,items:$,renderItem:S,addFavoriteTooltip:J,removeFavoriteCancelLabel:Q,removeFavoriteConfirmLabel:X,removeFavoriteHeader:Z,removeFavoriteLabel:ee,removeFavoriteTooltip:te,searchResultsEmptyLabel:se,...A},ae)=>{const R=s.useIsTabbing(),L=u.useRef(),N=s.usePrevious($),{guide:ne="guide",page:ie="index"}=t,{guide:oe=({id:x})=>v.createParams({guide:x}),page:E=()=>v.createParams()}=a,[re,le]=K(),ce=s.useContainer(),{events:de}=ce.get("$widget");u.useImperativeHandle(ae,()=>L.current);const D=x=>{const{id:j,title:k,tags:z,published:T,modified:C,publishedBy:I,modifiedBy:B}=x;return n.jsxs("li",{"data-guide":j,"has-metadata":(!!(f!=null&&f.showPublished)&&!!T||!!(f!=null&&f.showModified)&&!!C).toString(),children:[n.jsx(s.TextLink,{className:"humany-guide-link",routeName:ne,onClick:fe=>{m(fe,x),de.dispatch("tracking:guide-list-item-clicked",{guide:x})},params:oe(x),text:k,children:n.jsx(s.SymbolBadge,{size:i,symbol:{type:"Svg",content:e?"caret-down":"caret-right"}})}),h&&n.jsx(_,{guideTitle:k,addFavoriteTooltip:J,removeFavoriteCancelLabel:Q,removeFavoriteConfirmLabel:X,removeFavoriteHeader:Z,removeFavoriteLabel:ee,removeFavoriteTooltip:te,isFavorite:re.indexOf(j)>-1,actions:le,id:j}),l&&n.jsx(Be,{tags:z}),n.jsx(Oe,{...f,indent:e?void 0:i,modified:C,published:T,publishedBy:I,modifiedBy:B})]},j)},me=u.useCallback((x,j,k)=>S?S(x,j,k,D):D(x),[S,D]),he=u.useCallback(x=>{c&&(x.preventDefault(),p("page",E()))},[p,c]);u.useEffect(()=>{if(N&&N.length<$.length&&L.current){const x=L.current.querySelectorAll(".humany-guide-list > ul > li"),j=x[N.length];if(x.length===$.length&&N.length){const k=x[N.length];if(k){const z=k.querySelector(".humany-guide-link");z&&z.focus()}}else j&&new MutationObserver((z,T)=>{z.forEach(C=>{if(C.addedNodes){const I=Array.from(C.addedNodes).find(B=>B.tagName==="A");I&&v.htmlParentContains(L.current,document.activeElement)&&(R&&I.focus(),T.disconnect())}})}).observe(j,{attributes:!1,characterData:!1,childList:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})}});const ue=!!Object.keys(f).filter(x=>typeof f[x]<"u").length;return n.jsxs(Re,{className:v.appendClassNames(w,"humany-guide-list"),"data-item-count":$.length,items:$,renderItem:me,isTabbing:R,expandable:e?"true":"false","grid-items":l||h||ue?"true":"false",...s.convertToStringAttributes(A),ref:L,children:[g?n.jsx(s.TextLink,{text:g,title:g,"aria-label":g,routeName:ie,role:o,params:E(),onClick:he,children:n.jsx(s.SymbolBadge,{size:i,symbol:{type:"Svg",content:`caret-${r}`}})}):null,b,!A["data-loading"]&&$.length===0&&n.jsx("p",{children:se})]})}),Re=d(s.ItemList)`
256
+ `,Pe=u.forwardRef(({expandable:e=!1,routing:t={},paramMappers:a={},symbolSize:i=11,pageRole:o="link",pageCaret:r="down",showTags:l=!1,showFavoriteToggle:h=!1,localPaging:c=!1,onItemClick:m=()=>{},dispatch:p=()=>{},metadata:f={},pageLabel:g,className:b,children:v,items:w,renderItem:k,addFavoriteTooltip:_,removeFavoriteCancelLabel:K,removeFavoriteConfirmLabel:U,removeFavoriteHeader:G,removeFavoriteLabel:V,removeFavoriteTooltip:J,searchResultsEmptyLabel:Q,...T},X)=>{const Z=s.useIsTabbing(),z=u.useRef(),{guide:ee="guide",page:te="index"}=t,{guide:se=({id:x})=>$.createParams({guide:x}),page:I=()=>$.createParams()}=a,[ae,ne]=O(),ie=s.useContainer(),{events:oe}=ie.get("$widget");u.useImperativeHandle(X,()=>z.current);const L=x=>{const{id:j,title:S,tags:de,published:D,modified:B,publishedBy:me,modifiedBy:he}=x;return n.jsxs("li",{"data-guide":j,"has-metadata":(!!(f!=null&&f.showPublished)&&!!D||!!(f!=null&&f.showModified)&&!!B).toString(),children:[n.jsx(s.TextLink,{className:"humany-guide-link",routeName:ee,onClick:ue=>{m(ue,x),oe.dispatch("tracking:guide-list-item-clicked",{guide:x})},params:se(x),text:S,children:n.jsx(s.SymbolBadge,{size:i,symbol:{type:"Svg",content:e?"caret-down":"caret-right"}})}),h&&n.jsx(H,{guideTitle:S,addFavoriteTooltip:_,removeFavoriteCancelLabel:K,removeFavoriteConfirmLabel:U,removeFavoriteHeader:G,removeFavoriteLabel:V,removeFavoriteTooltip:J,isFavorite:ae.indexOf(j)>-1,actions:ne,id:j}),l&&n.jsx(De,{tags:de}),n.jsx(Ee,{...f,indent:e?void 0:i,modified:B,published:D,publishedBy:me,modifiedBy:he})]},j)},re=u.useCallback((x,j,S)=>k?k(x,j,S,L):L(x),[k,L]),le=u.useCallback(x=>{c&&(x.preventDefault(),p("page",I()))},[p,c]);u.useEffect(()=>{var j;const x=(j=z.current)==null?void 0:j.querySelector(".humany-guide-list > ul > li .humany-guide-link");x&&s.getHumanyIsTabbing()&&(x.focus(),s.setHumanyIsTabbing(!1))},[w]);const ce=!!Object.keys(f).filter(x=>typeof f[x]<"u").length;return n.jsxs(Ae,{className:$.appendClassNames(b,"humany-guide-list"),"data-item-count":w.length,items:w,renderItem:re,isTabbing:Z,expandable:e?"true":"false","grid-items":l||h||ce?"true":"false",...s.convertToStringAttributes(T),ref:z,children:[g?n.jsx(s.TextLink,{text:g,title:g,"aria-label":g,routeName:te,role:o,params:I(),onClick:le,children:n.jsx(s.SymbolBadge,{size:i,symbol:{type:"Svg",content:`caret-${r}`}})}):null,v,!T["data-loading"]&&w.length===0&&n.jsx("p",{children:Q})]})}),Ae=d(s.ItemList)`
257
257
  ${s.itemList}
258
258
  padding: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.large}};
259
259
  overflow: auto;
@@ -371,7 +371,7 @@
371
371
  text-decoration: underline;
372
372
  }
373
373
  }
374
- `,Ee=d(s.List)`
374
+ `,Re=d(s.List)`
375
375
  ${s.list}
376
376
  display: flex;
377
377
  margin: 0 0 0 auto;
@@ -393,7 +393,7 @@
393
393
  `;if(e.symbol.type==="FontAwesome")return`
394
394
  font-size: ${e.size}px;
395
395
  `}}
396
- `,Oe=d(U)`
396
+ `,Ee=d(W)`
397
397
  grid-area: metadata;
398
398
  text-overflow: ellipsis;
399
399
  overflow: hidden;
@@ -403,7 +403,7 @@
403
403
  100% {
404
404
  transform: rotate(360deg);
405
405
  }
406
- `,We=y.keyframes`
406
+ `,Oe=y.keyframes`
407
407
  0% {
408
408
  stroke-dasharray: 1, 200;
409
409
  stroke-dashoffset: 0;
@@ -416,7 +416,7 @@
416
416
  stroke-dasharray: 89, 200;
417
417
  stroke-dashoffset: -124px;
418
418
  }
419
- `,qe=d.svg`
419
+ `,We=d.svg`
420
420
  animation: ${He} 2s linear infinite;
421
421
  height: 100%;
422
422
  transform-origin: center center;
@@ -428,7 +428,7 @@
428
428
  right: 0;
429
429
  margin: auto;
430
430
  transition: 200ms ease-out opacity;
431
- `,V=d.div`
431
+ `,Y=d.div`
432
432
  position: absolute;
433
433
  top: 0;
434
434
  bottom: 0;
@@ -456,14 +456,14 @@
456
456
  display: block;
457
457
  padding-top: 100%;
458
458
  }
459
- `,_e=d.circle`
459
+ `,qe=d.circle`
460
460
  stroke-dasharray: 1, 200;
461
461
  stroke-dashoffset: 0;
462
- animation: ${We} 1.5s ease-in-out infinite;
462
+ animation: ${Oe} 1.5s ease-in-out infinite;
463
463
  stroke-linecap: round;
464
464
  stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
465
465
  stroke-width: 2px;
466
- `,G=({loading:e=!1})=>n.jsx(V,{className:"humany-loader","data-loading":e,children:n.jsx(Ye,{className:"humany-spinner",children:n.jsx(qe,{className:"humany-spinner-svg",viewBox:"25 25 50 50",children:n.jsx(_e,{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"2","stroke-miterlimit":"10"})})})}),Ke=({className:e,showHeader:t,notificationList:a,loading:i,...o})=>{const[r,l]=u.useState(null),{id:h,title:c,symbol:m,notifications:p=[],defaultHeaderOptions:f={visible:!0}}=a||{};return!p.length&&!i?null:n.jsx(Ve,{...o,"data-loading":i,"data-show-header":typeof t=="boolean"?t:f.visible,className:v.appendClassNames(e,"humany-notification-list"),"data-notification-category":h,header:c,symbol:m,items:p,renderItem:({id:g,title:w,body:b,modified:$,expandable:S})=>n.jsx(Ge,{"data-notification":g,"data-expanded":S?r===g:!0,children:S?n.jsxs(n.Fragment,{children:[n.jsxs(Ue,{title:w,"aria-label":w,"aria-expanded":r===g,onClick:()=>l(r===g?null:g),children:[n.jsx("span",{children:w}),n.jsx(Je,{size:11,symbol:{type:"Svg",content:`caret-${r===g?"up":"down"}`}})]}),n.jsx(W,{html:b}),$&&n.jsx(Qe,{format:s.DateFormats.YYYY_MM_DD,timestamp:$})]}):n.jsx(W,{html:b})},g),children:n.jsx(G,{loading:i})})},Ue=d(s.Button)`
466
+ `,q=({loading:e=!1})=>n.jsx(Y,{className:"humany-loader","data-loading":e,children:n.jsx(Ye,{className:"humany-spinner",children:n.jsx(We,{className:"humany-spinner-svg",viewBox:"25 25 50 50",children:n.jsx(qe,{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"2","stroke-miterlimit":"10"})})})}),_e=({className:e,showHeader:t,notificationList:a,loading:i,...o})=>{const[r,l]=u.useState(null),{id:h,title:c,symbol:m,notifications:p=[],defaultHeaderOptions:f={visible:!0}}=a||{};return!p.length&&!i?null:n.jsx(Ue,{...o,"data-loading":i,"data-show-header":typeof t=="boolean"?t:f.visible,className:$.appendClassNames(e,"humany-notification-list"),"data-notification-category":h,header:c,symbol:m,items:p,renderItem:({id:g,title:b,body:v,modified:w,expandable:k})=>n.jsx(Ge,{"data-notification":g,"data-expanded":k?r===g:!0,children:k?n.jsxs(n.Fragment,{children:[n.jsxs(Ke,{title:b,"aria-label":b,"aria-expanded":r===g,onClick:()=>l(r===g?null:g),children:[n.jsx("span",{children:b}),n.jsx(Ve,{size:11,symbol:{type:"Svg",content:`caret-${r===g?"up":"down"}`}})]}),n.jsx(R,{html:v}),w&&n.jsx(Je,{format:s.DateFormats.YYYY_MM_DD,timestamp:w})]}):n.jsx(R,{html:v})},g),children:n.jsx(q,{loading:i})})},Ke=d(s.Button)`
467
467
  display: flex;
468
468
  justify-content: space-between;
469
469
  align-items: center;
@@ -488,8 +488,8 @@
488
488
  text-decoration: underline;
489
489
  }
490
490
  }
491
- `,Ve=d(s.ItemList)`
492
- ${q}
491
+ `,Ue=d(s.ItemList)`
492
+ ${M}
493
493
  ${s.itemList}
494
494
  overflow: hidden;
495
495
  justify-content: flex-start;
@@ -507,7 +507,7 @@
507
507
  text-decoration: underline;
508
508
  }
509
509
  }
510
- `,W=d(s.Paragraph)`
510
+ `,R=d(s.Paragraph)`
511
511
  ${s.genericHtml}
512
512
  font-weight: 300;
513
513
 
@@ -535,12 +535,12 @@
535
535
  font-weight: 300;
536
536
  color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.accent}};
537
537
  }
538
- `,Je=d(s.SymbolBadge)`
538
+ `,Ve=d(s.SymbolBadge)`
539
539
  margin: 0 0 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}};
540
540
  line {
541
541
  stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
542
542
  }
543
- `,Qe=d(s.Timestamp)`
543
+ `,Je=d(s.Timestamp)`
544
544
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.small}};
545
545
  font-weight: 300;
546
- `,Xe=e=>new RegExp("^#","i").test(e),Ze=e=>({children:t,...a})=>{const{implementation:i,name:o}=e.get("$widget"),{href:r=""}=a;if(Xe(r))return n.jsx(s.AnchorLink,{smooth:!0,to:r,children:t});const l=i.bindings.map(m=>m.replace(/\./g,"\\.")).join("|"),c=new RegExp(`^((http[s]?:)?//)?(${l})/([^\\s]+)`).exec(r);if(c&&c.length>=4){const m=c[4];if(i.widgets.get(m)&&!m.startsWith("blob?")&&!m.startsWith(o))return n.jsx(s.WidgetLink,{widgetName:m,children:t})}return n.jsx("a",{...a,children:t})},et=(e,t=[])=>({transform:{a:a=>{const{children:i,...o}=a,r=o["data-target"];if(r&&t.length){const h=t.find(({connection:c})=>c===r);if(h)return n.jsx(P,{...h,children:i})}return Ze(e)(a)}}});exports.AccordionListItem=Fe;exports.DialogLink=P;exports.DialogList=ge;exports.DrawerList=xe;exports.DropdownActions=ve;exports.DropdownList=je;exports.FavoriteButton=_;exports.Feedback=Le;exports.GuideList=Ae;exports.Loader=G;exports.LoaderWrapper=V;exports.Metadata=U;exports.NotificationList=Ke;exports.SmallCaret=Se;exports.StyledHeaderText=ze;exports.StyledListButton=Y;exports.guideRenderInstructions=et;exports.loadingOpacity=q;exports.useArrowKeys=Te;exports.useDebounce=Ie;exports.useFavorites=K;exports.useHover=De;Object.keys(s).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>s[e]})});
546
+ `,Qe=e=>new RegExp("^#","i").test(e),Xe=e=>({children:t,...a})=>{const{implementation:i,name:o}=e.get("$widget"),{href:r=""}=a;if(Qe(r))return n.jsx(s.AnchorLink,{smooth:!0,to:r,children:t});const l=i.bindings.map(m=>m.replace(/\./g,"\\.")).join("|"),c=new RegExp(`^((http[s]?:)?//)?(${l})/([^\\s]+)`).exec(r);if(c&&c.length>=4){const m=c[4];if(i.widgets.get(m)&&!m.startsWith("blob?")&&!m.startsWith(o))return n.jsx(s.WidgetLink,{widgetName:m,children:t})}return n.jsx("a",{...a,children:t})},Ze=(e,t=[])=>({transform:{a:a=>{const{children:i,...o}=a,r=o["data-target"];if(r&&t.length){const h=t.find(({connection:c})=>c===r);if(h)return n.jsx(C,{...h,children:i})}return Xe(e)(a)}}});exports.AccordionListItem=Be;exports.DialogLink=C;exports.DialogList=fe;exports.DrawerList=pe;exports.DropdownActions=ye;exports.DropdownList=we;exports.FavoriteButton=H;exports.Feedback=ze;exports.GuideList=Pe;exports.Loader=q;exports.LoaderWrapper=Y;exports.Metadata=W;exports.NotificationList=_e;exports.SmallCaret=ke;exports.StyledHeaderText=Se;exports.StyledListButton=E;exports.guideRenderInstructions=Ze;exports.loadingOpacity=M;exports.useArrowKeys=Ce;exports.useDebounce=Te;exports.useFavorites=O;exports.useHover=Ie;Object.keys(s).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>s[e]})});