@telia-ace/widget-types-grid 1.3.42 → 1.3.43-rc.0

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 +1 -1
  2. package/index.mjs +15 -13
  3. package/package.json +8 -8
package/index.js CHANGED
@@ -50,7 +50,7 @@
50
50
  `,Se=v.forwardRef(({className:t="",children:n,...e},i)=>{const s=h.useComponent(),{name:o,type:r,id:a}=h.useComponentDescriptor(),c=v.useMemo(()=>s?P(s)`
51
51
  ${W}
52
52
  ${h.filterCssPropsStyle}
53
- `:null,[s]);return typeof s>"u"?null:s===null||c===null?process.env.NODE_ENV!=="production"?f.jsx(ve,{...e,title:`type: ${r}, definition-id: ${o}, instance-id: ${a}`,className:M.appendClassNames(t,"humany-non-resolved-component"),children:f.jsx(h.Typography,{variant:"h5",children:"Non Resolved Component Type"})}):null:f.jsx(v.Suspense,{fallback:null,children:f.jsx(c,{ref:i,...e,className:M.appendClassNames(t,"humany-component",`humany-component-${o}`),children:n})})}),Ce=t=>{const n=h.useComponentNode(t),e=h.useComponentPlatform(),[i,s]=v.useState({}),o=h.useIsMounted();return v.useEffect(()=>{n&&o.current&&s(n.attributes.properties)},[n,t,o]),v.useEffect(()=>{if(e){const r=e.events.subscribe("components:properties-changed",(a,c)=>{n===c.node&&o.current&&s(c.node.attributes.properties)});return()=>{r()}}},[e,o,t,n]),i},Oe=(t,n)=>n?!0:typeof t=="string"?t==="full":t>0,T=v.forwardRef(({className:t="",id:n,branch:e,node:i,ariaLabel:s,tabIndex:o,context:r,...a},c)=>{const g=h.useComponentPlatform(),d=h.useContainer(),[u,p]=v.useState(),b=h.useColumns(),y=h.useContext(n),m=Ce(n),{size:S="none",indent:C=0}=h.useLayout(n),A=Oe(S,i);if(v.useEffect(()=>{if(g){if(n&&!i){const x=g.nodes.get(n);if(x&&(p(w.asDescriptor(x,e)),A)){const j=x.mount(d);return()=>{j()}}}else if(i){p(w.asDescriptor(i,e));const x=i.mount(d);return()=>{x()}}}},[g,n,i,A]),!u||!A)return null;const k={...y,...r||{}},{cardinal:D,fonts:E={},accessibility:B={},...O}=k,N={type:E.type,base:E.base||"16px",small:E.small||"0.8em",normal:E.normal||"1em",medium:E.medium||"1.2em",large:E.large||"1.6em",huge:E.huge||"2.5em"},R={...O,fonts:N,accessibility:{...B}};return typeof D=="number"&&(R.sizes={cardinal:D,small:`${D}px`,normal:`${D*3}px`,medium:`${D*5}px`,large:`${D*8}px`}),f.jsx(z.ThemeProvider,{theme:R,children:f.jsx(h.ComponentNodeContext.Provider,{value:u,children:f.jsx(h.ComponentPropertyContext.Provider,{value:m,children:(()=>{const x={"data-width":S==="full"?b:Math.min(S,b),"data-indent":C,"data-name":u.name,"data-node-id":u.id,"data-component-type":u.type,"aria-label":s,tabIndex:o,id:u.id,role:m.role?m&&m.role:null,...a};if(u.type==="view")return typeof m.animation=="string"&&m.animation!=="none"?f.jsx(we,{...x,className:t}):f.jsx(ye,{...x,className:t});{const j=h.filterCssProps(m);return f.jsx(Se,{ref:c,...x,...j,className:t})}})()})})})}),J=({builder:t})=>{const n=h.useContainer(),[e,i]=v.useState(null);return v.useEffect(()=>{n.getAsync("components").then(s=>t(s).then(o=>{i(o)}))},[]),v.useEffect(()=>()=>{e&&n.getAsync("components").then(s=>{s.nodes.detached=s.nodes.detached.filter(o=>o.id!==e.id)})},[e]),e?f.jsx(T,{id:e.id,node:e,branch:"default"}):null},Ee=Object.freeze(Object.defineProperty({__proto__:null,default:J},Symbol.toStringTag,{value:"Module"})),xe=v.lazy(()=>Promise.resolve().then(()=>Ee)),Me=({showSearch:t=!1})=>{const n=z.useTheme(),e=h.useContainer();return f.jsx(v.Suspense,{fallback:null,children:f.jsx(xe,{builder:i=>e.get("settings").then(s=>{var g;const{properties:o,context:r}=Object.keys(s.components).reduce((d,u)=>(s.components[u].type==="not-found"&&(d.properties=s.components[u].properties,d.context=s.components[u].context),d),{properties:{},context:{}});o.showSearch=t;const a=i.createNode("area",{detached:!0});if(a.name="not-found-area",a.writeLayout({size:"full"}),t){const d=Object.keys(s.components).reduce((p,b)=>s.components[b].type==="search"?s.components[b].properties:p,{}),u=i.createNode("search",{detached:!0});u.writeLayout({size:"full"}),u.writeProperties({"css-margin-bottom":((g=n==null?void 0:n.sizes)==null?void 0:g.normal)||"15px",...d}),a.appendChild(u)}const c=i.createNode("not-found",{detached:!0});return c.writeLayout({size:"full"}),c.writeProperties(o),c.writeContext(r),a.appendChild(c),a})})})},Ae=t=>{if(t){const{type:n,content:e}=t;switch(n){case"FontAwesome":return`<i class="humany-icon fa fa-${e}"></i>`;case"Uri":return`<i class="humany-icon humany-custom-icon" style="background: url(${e}) no-repeat center center;background-size: contain;"></i>`;default:return""}}},De=t=>{const n=(s,o)=>{s&&(o?s.classList.add("humany-tabbing"):s.classList.remove("humany-tabbing"))},e=s=>{s.key==="Tab"?n(t,!0):s.key==="Enter"&&document.activeElement&&document.activeElement.classList.contains("humany-trigger")||n(t,!1)},i=s=>{document.activeElement&&document.activeElement.classList.contains("humany-trigger")&&document.activeElement.classList.contains("humany-tabbing")||n(t,!1)};return document.addEventListener("keydown",e),document.addEventListener("click",i),()=>{document.removeEventListener("keydown",e),document.removeEventListener("click",i)}};function Ne(t,n){const{symbol:e,widgetName:i,label:s="",ariaLabel:o="",tooltip:r=""}=n;t.classList.add("humany-trigger"),t.classList.add(`humany_${i}`),s.length&&t.classList.add("humany-has-text"),o.length&&!t.getAttribute("aria-label")&&t.setAttribute("aria-label",o),o.length&&!t.getAttribute("tabindex")&&t.setAttribute("tabindex","0"),r.length&&!t.getAttribute("title")&&t.setAttribute("title",r);const a=Ae(e)||"";return t.innerHTML=`${a}
53
+ `:null,[s]);return typeof s>"u"?null:s===null||c===null?process.env.NODE_ENV!=="production"?f.jsx(ve,{...e,title:`type: ${r}, definition-id: ${o}, instance-id: ${a}`,className:M.appendClassNames(t,"humany-non-resolved-component"),children:f.jsx(h.Typography,{variant:"h5",children:"Non Resolved Component Type"})}):null:f.jsx(v.Suspense,{fallback:null,children:f.jsx(c,{ref:i,...e,className:M.appendClassNames(t,"humany-component",`humany-component-${o}`),children:n})})}),Ce=t=>{const n=h.useComponentNode(t),e=h.useComponentPlatform(),[i,s]=v.useState({}),o=h.useIsMounted();return v.useEffect(()=>{n&&o.current&&s(n.attributes.properties)},[n,t,o]),v.useEffect(()=>{if(e){const r=e.events.subscribe("components:properties-changed",(a,c)=>{n===c.node&&o.current&&s(c.node.attributes.properties)});return()=>{r()}}},[e,o,t,n]),i},Oe=(t,n)=>n?!0:typeof t=="string"?t==="full":t>0,T=v.forwardRef(({className:t="",id:n,branch:e,node:i,ariaLabel:s,tabIndex:o,context:r,...a},c)=>{const g=h.useComponentPlatform(),d=h.useContainer(),[u,p]=v.useState(),b=h.useColumns(),y=h.useContext(n),m=Ce(n),{size:S="none",indent:C=0}=h.useLayout(n),A=Oe(S,i);if(v.useEffect(()=>{if(g){if(n&&!i){const x=g.nodes.get(n);if(x&&(p(w.asDescriptor(x,e)),A)){const j=x.mount(d);return()=>{j()}}}else if(i){p(w.asDescriptor(i,e));const x=i.mount(d);return()=>{x()}}}},[g,n,i,A]),!u||!A)return null;const k={...y,...r||{}},{cardinal:D,fonts:E={},accessibility:B={},...O}=k,N={type:E.type,base:E.base||"16px",small:E.small||"0.8em",normal:E.normal||"1em",medium:E.medium||"1.2em",large:E.large||"1.6em",huge:E.huge||"2.5em"},R={...O,fonts:N,accessibility:{...B}};return typeof D=="number"&&(R.sizes={cardinal:D,small:`${D}px`,normal:`${D*3}px`,medium:`${D*5}px`,large:`${D*8}px`}),f.jsx(z.ThemeProvider,{theme:R,children:f.jsx(h.ComponentNodeContext.Provider,{value:u,children:f.jsx(h.ComponentPropertyContext.Provider,{value:m,children:(()=>{const x={"data-width":S==="full"?b:Math.min(S,b),"data-indent":C,"data-name":u.name,"data-node-id":u.id,"data-component-type":u.type,"aria-label":s,tabIndex:o,id:u.id,role:m.role?m&&m.role:null,...a};switch(u.type){case"view":return typeof m.animation=="string"&&m.animation!=="none"?f.jsx(we,{...x,className:t}):f.jsx(ye,{...x,className:t});default:{const j=h.filterCssProps(m);return f.jsx(Se,{ref:c,...x,...j,className:t})}}})()})})})}),J=({builder:t})=>{const n=h.useContainer(),[e,i]=v.useState(null);return v.useEffect(()=>{n.getAsync("components").then(s=>t(s).then(o=>{i(o)}))},[]),v.useEffect(()=>()=>{e&&n.getAsync("components").then(s=>{s.nodes.detached=s.nodes.detached.filter(o=>o.id!==e.id)})},[e]),e?f.jsx(T,{id:e.id,node:e,branch:"default"}):null},Ee=Object.freeze(Object.defineProperty({__proto__:null,default:J},Symbol.toStringTag,{value:"Module"})),xe=v.lazy(()=>Promise.resolve().then(()=>Ee)),Me=({showSearch:t=!1})=>{const n=z.useTheme(),e=h.useContainer();return f.jsx(v.Suspense,{fallback:null,children:f.jsx(xe,{builder:i=>e.get("settings").then(s=>{var g;const{properties:o,context:r}=Object.keys(s.components).reduce((d,u)=>(s.components[u].type==="not-found"&&(d.properties=s.components[u].properties,d.context=s.components[u].context),d),{properties:{},context:{}});o.showSearch=t;const a=i.createNode("area",{detached:!0});if(a.name="not-found-area",a.writeLayout({size:"full"}),t){const d=Object.keys(s.components).reduce((p,b)=>s.components[b].type==="search"?s.components[b].properties:p,{}),u=i.createNode("search",{detached:!0});u.writeLayout({size:"full"}),u.writeProperties({"css-margin-bottom":((g=n==null?void 0:n.sizes)==null?void 0:g.normal)||"15px",...d}),a.appendChild(u)}const c=i.createNode("not-found",{detached:!0});return c.writeLayout({size:"full"}),c.writeProperties(o),c.writeContext(r),a.appendChild(c),a})})})},Ae=t=>{if(t){const{type:n,content:e}=t;switch(n){case"FontAwesome":return`<i class="humany-icon fa fa-${e}"></i>`;case"Uri":return`<i class="humany-icon humany-custom-icon" style="background: url(${e}) no-repeat center center;background-size: contain;"></i>`;default:return""}}},De=t=>{const n=(s,o)=>{s&&(o?s.classList.add("humany-tabbing"):s.classList.remove("humany-tabbing"))},e=s=>{s.key==="Tab"?n(t,!0):s.key==="Enter"&&document.activeElement&&document.activeElement.classList.contains("humany-trigger")||n(t,!1)},i=s=>{document.activeElement&&document.activeElement.classList.contains("humany-trigger")&&document.activeElement.classList.contains("humany-tabbing")||n(t,!1)};return document.addEventListener("keydown",e),document.addEventListener("click",i),()=>{document.removeEventListener("keydown",e),document.removeEventListener("click",i)}};function Ne(t,n){const{symbol:e,widgetName:i,label:s="",ariaLabel:o="",tooltip:r=""}=n;t.classList.add("humany-trigger"),t.classList.add(`humany_${i}`),s.length&&t.classList.add("humany-has-text"),o.length&&!t.getAttribute("aria-label")&&t.setAttribute("aria-label",o),o.length&&!t.getAttribute("tabindex")&&t.setAttribute("tabindex","0"),r.length&&!t.getAttribute("title")&&t.setAttribute("title",r);const a=Ae(e)||"";return t.innerHTML=`${a}
54
54
  <span class="humany-close">
55
55
  <svg width="18" height="9" viewBox="0 0 18 9" fill="none" xmlns="http://www.w3.org/2000/svg">
56
56
  <path d="M9 9C8.81794 9.00045 8.63759 8.96634 8.46939 8.89965C8.3012 8.83295 8.14851 8.735 8.02015 8.61145L0.194523 1.12367C0.068294 0.99862 -0.00155266 0.831133 2.61958e-05 0.657285C0.00160506 0.483436 0.0744832 0.317136 0.202964 0.194202C0.331445 0.0712675 0.505249 0.00153576 0.686941 2.50649e-05C0.868634 -0.00148563 1.04368 0.0653456 1.17437 0.186125L9 7.6739L16.8256 0.186125C16.9563 0.0653456 17.1314 -0.00148563 17.3131 2.50649e-05C17.4948 0.00153576 17.6686 0.0712675 17.797 0.194202C17.9255 0.317136 17.9984 0.483436 18 0.657285C18.0016 0.831133 17.9317 0.99862 17.8055 1.12367L9.97985 8.61145C9.85149 8.735 9.6988 8.83295 9.53061 8.89965C9.36241 8.96634 9.18206 9.00045 9 9Z" fill="white"/>
package/index.mjs CHANGED
@@ -311,19 +311,21 @@ const Ht = (e, n, t) => typeof t[e] == "number" && typeof t[n] == "number" && t[
311
311
  role: h.role ? h && h.role : null,
312
312
  ...a
313
313
  };
314
- if (l.type === "view")
315
- return typeof h.animation == "string" && h.animation !== "none" ? /* @__PURE__ */ m(Jt, { ...E, className: e }) : /* @__PURE__ */ m(Zt, { ...E, className: e });
316
- {
317
- const V = $t(h);
318
- return /* @__PURE__ */ m(
319
- te,
320
- {
321
- ref: c,
322
- ...E,
323
- ...V,
324
- className: e
325
- }
326
- );
314
+ switch (l.type) {
315
+ case "view":
316
+ return typeof h.animation == "string" && h.animation !== "none" ? /* @__PURE__ */ m(Jt, { ...E, className: e }) : /* @__PURE__ */ m(Zt, { ...E, className: e });
317
+ default: {
318
+ const V = $t(h);
319
+ return /* @__PURE__ */ m(
320
+ te,
321
+ {
322
+ ref: c,
323
+ ...E,
324
+ ...V,
325
+ className: e
326
+ }
327
+ );
328
+ }
327
329
  }
328
330
  })() }) }) });
329
331
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-types-grid",
3
- "version": "1.3.42",
3
+ "version": "1.3.43-rc.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -10,18 +10,18 @@
10
10
  }
11
11
  },
12
12
  "dependencies": {
13
- "@telia-ace/widget-core": "^1.3.42",
14
- "@telia-ace/widget-routing": "^1.3.42",
15
- "@telia-ace/widget-services": "^1.3.42",
16
- "@telia-ace/widget-ui": "^1.3.42",
17
- "@telia-ace/widget-utilities": "^1.3.42",
13
+ "@telia-ace/widget-core": "^1.3.43-rc.0",
14
+ "@telia-ace/widget-routing": "^1.3.43-rc.0",
15
+ "@telia-ace/widget-services": "^1.3.43-rc.0",
16
+ "@telia-ace/widget-ui": "^1.3.43-rc.0",
17
+ "@telia-ace/widget-utilities": "^1.3.43-rc.0",
18
18
  "@webprovisions/bootstrapping": "^1.0.14",
19
19
  "@webprovisions/platform": "^1.1.4"
20
20
  },
21
21
  "peerDependencies": {
22
- "react": "18.2.0",
22
+ "react": "^18.2.0",
23
23
  "react-transition-group": "4.4.5",
24
- "react-dom": "18.2.0",
24
+ "react-dom": "^18.2.0",
25
25
  "react-router": "^5.3.4",
26
26
  "@emotion/cache": "^11.10.5",
27
27
  "@emotion/react": "11.11.1",