@telia-ace/widget-types-grid 1.0.23 → 1.0.25-next.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-types-grid",
3
- "version": "1.0.23",
3
+ "version": "1.0.25-next.0",
4
4
  "description": "Type definition for Grid widget.",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "Telia Company AB",
@@ -8,6 +8,7 @@
8
8
  "telia"
9
9
  ],
10
10
  "main": "dist/index.js",
11
+ "sourceMain": "src/index.ts",
11
12
  "type": "module",
12
13
  "types": "dist/index.d.ts",
13
14
  "files": [
@@ -25,30 +26,28 @@
25
26
  },
26
27
  "sideEffects": false,
27
28
  "dependencies": {
28
- "@telia-ace/knowledge-serviceclient": "^1.0.7",
29
- "@telia-ace/widget-core": "^1.0.14",
30
- "@telia-ace/widget-forms": "^1.0.21",
31
- "@telia-ace/widget-routing": "^1.0.15",
32
- "@telia-ace/widget-services": "^1.0.14",
33
- "@telia-ace/widget-ui": "^1.0.21",
34
- "@telia-ace/widget-utilities": "^1.0.3",
29
+ "@telia-ace/knowledge-serviceclient": "^1.0.8",
30
+ "@telia-ace/widget-core": "^1.0.16-next.0",
31
+ "@telia-ace/widget-forms": "^1.0.23-next.0",
32
+ "@telia-ace/widget-routing": "^1.0.17-next.0",
33
+ "@telia-ace/widget-services": "^1.0.16-next.0",
34
+ "@telia-ace/widget-ui": "^1.0.23-next.0",
35
+ "@telia-ace/widget-utilities": "^1.0.4",
35
36
  "@webprovisions/bootstrapping": "^1.0.12",
36
37
  "@webprovisions/platform": "^1.1.2"
37
38
  },
38
39
  "peerDependencies": {
39
- "react": "^16.8.0",
40
- "react-dom": "^16.8.0",
41
- "react-router": "^5.0.0",
42
- "react-router-dom": "^5.0.0",
43
- "react-transition-group": "^4.2.2",
44
- "styled-components": "^4.3.2"
40
+ "react": "^18.2.0",
41
+ "react-dom": "^18.2.0",
42
+ "react-router": "^5.3.4",
43
+ "react-router-dom": "^5.3.4",
44
+ "react-transition-group": "^4.4.5",
45
+ "styled-components": "^5.3.6"
45
46
  },
46
47
  "devDependencies": {
47
- "@types/react": "^16.8.0",
48
- "@types/react-dom": "^16.8.0",
49
48
  "@types/react-router-dom": "^5.1.0",
50
- "@types/react-transition-group": "^4.4.4",
51
- "@types/styled-components": "^5.1.7"
49
+ "@types/react-transition-group": "^4.4.5",
50
+ "@types/styled-components": "^5.1.26"
52
51
  },
53
- "gitHead": "e9e22ff408d32106cc60212d14fb1ff63dd5c1e1"
52
+ "gitHead": "e783dc2d2efafddafb638fb68d0b6842a204ca59"
54
53
  }
@@ -1,59 +0,0 @@
1
- import s, { useState as u, useEffect as m } from "react";
2
- import { render as b } from "react-dom";
3
- import { useIsMounted as w, useComponentPlatform as g, ContainerContext as y, RoutingContext as h } from "@telia-ace/widget-ui";
4
- import { appendClassNames as E } from "@telia-ace/widget-utilities";
5
- import { Router as k } from "react-router-dom";
6
- import { Component as v } from "./index.js";
7
- import "@telia-ace/widget-core";
8
- import "styled-components";
9
- import "react-transition-group";
10
- import "react-router";
11
- import "@telia-ace/widget-routing";
12
- import "@telia-ace/widget-services";
13
- import "@webprovisions/bootstrapping";
14
- import "@webprovisions/platform";
15
- const C = (t) => {
16
- const [r, o] = u(null), e = w();
17
- return m(() => {
18
- t.getAsync("router").then((i) => {
19
- e.current && o(i);
20
- });
21
- }, [t, e]), r;
22
- }, R = ["Tab", "ArrowDown", "ArrowUp", "ArrowRight", "ArrowLeft"], T = ({ container: t }) => {
23
- const r = g(t), o = C(t), e = t.get("$environment"), [i, l] = u((e == null ? void 0 : e.container.get("isTabbing")) || !1), [d, p] = u(null);
24
- return m(() => {
25
- const a = (n) => {
26
- R.indexOf(n.key) > -1 && (i || e == null || e.container.register("isTabbing", !0), l(!0));
27
- }, c = (n) => {
28
- n.screenX === 0 && n.screenY === 0 || (i && (e == null || e.container.register("isTabbing", !1)), l(!1));
29
- };
30
- return window.addEventListener("keydown", a), window.addEventListener("click", c), () => {
31
- window.removeEventListener("keydown", a), window.removeEventListener("click", c);
32
- };
33
- }, []), m(() => {
34
- if (r)
35
- return p(r.nodes.root.children.default[0].id || null), r.events.subscribe("components:root-children-changed", (c, { node: n }) => {
36
- if (n.parent && n.parent.type === "root") {
37
- const f = n.parent.children.default[0].id;
38
- p(f);
39
- }
40
- });
41
- }, [r]), !o || !o.history || !r || !d ? null : /* @__PURE__ */ s.createElement(k, {
42
- history: o.history
43
- }, /* @__PURE__ */ s.createElement(y.Provider, {
44
- value: t
45
- }, /* @__PURE__ */ s.createElement(h.Provider, {
46
- value: o
47
- }, /* @__PURE__ */ s.createElement(v, {
48
- className: E([i, "humany-is-tabbing"]),
49
- isTabbing: i,
50
- id: d,
51
- branch: "default"
52
- }))));
53
- }, A = T, Y = (t, r) => b(/* @__PURE__ */ s.createElement(A, {
54
- container: t
55
- }), r);
56
- export {
57
- Y as default
58
- };
59
- //# sourceMappingURL=render.20e0f363.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render.20e0f363.js","sources":["../src/ui/use-router.ts","../src/ui/wrapper.tsx","../src/ui/render.tsx"],"sourcesContent":["import { RoutingService } from '@telia-ace/widget-routing';\r\nimport { useIsMounted } from '@telia-ace/widget-ui';\r\nimport { Container } from '@webprovisions/platform';\r\nimport { useEffect, useState } from 'react';\r\n\r\nexport default (container: Container): RoutingService | null => {\r\n const [router, setRouter] = useState<RoutingService | null>(null);\r\n const isMounted = useIsMounted();\r\n\r\n useEffect(() => {\r\n container.getAsync('router').then((router: RoutingService) => {\r\n if (isMounted.current) {\r\n setRouter(router);\r\n }\r\n });\r\n }, [container, isMounted]);\r\n\r\n return router;\r\n};\r\n","import { ContainerContext, RoutingContext, useComponentPlatform } from '@telia-ace/widget-ui';\r\nimport { appendClassNames } from '@telia-ace/widget-utilities';\r\nimport { Container } from '@webprovisions/platform';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { Router } from 'react-router-dom';\r\nimport Component from './component';\r\nimport useRouter from './use-router';\r\n\r\nconst keyNavigationKeys = ['Tab', 'ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft'];\r\n\r\ntype Props = {\r\n container: Container;\r\n};\r\n\r\nconst Wrapper: React.SFC<Props> = ({ container }) => {\r\n const components = useComponentPlatform(container);\r\n const router = useRouter(container);\r\n const env = container.get('$environment');\r\n const [isTabbing, setIsTabbing] = useState(env?.container.get('isTabbing') || false);\r\n const [entry, setEntry] = useState<string | null>(null);\r\n\r\n useEffect(() => {\r\n const keydown = (event: KeyboardEvent) => {\r\n if (keyNavigationKeys.indexOf(event.key) > -1) {\r\n if (!isTabbing) {\r\n env?.container.register('isTabbing', true);\r\n }\r\n setIsTabbing(true);\r\n }\r\n };\r\n const click = (event: any) => {\r\n if (event.screenX === 0 && event.screenY === 0) {\r\n return;\r\n }\r\n if (isTabbing) {\r\n env?.container.register('isTabbing', false);\r\n }\r\n setIsTabbing(false);\r\n };\r\n window.addEventListener('keydown', keydown);\r\n window.addEventListener('click', click);\r\n return () => {\r\n window.removeEventListener('keydown', keydown);\r\n window.removeEventListener('click', click);\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (components) {\r\n setEntry(components.nodes.root.children.default[0].id || null);\r\n const unsubscribe = components.events.subscribe(\r\n 'components:root-children-changed',\r\n (event, { node }) => {\r\n if (node.parent && node.parent.type === 'root') {\r\n const entry = node.parent.children.default[0].id;\r\n setEntry(entry);\r\n }\r\n }\r\n );\r\n\r\n return unsubscribe;\r\n }\r\n }, [components]);\r\n\r\n if (!router || !router.history || !components) {\r\n return null;\r\n }\r\n\r\n if (!entry) {\r\n return null;\r\n }\r\n\r\n return (\r\n <Router history={router.history}>\r\n <ContainerContext.Provider value={container}>\r\n <RoutingContext.Provider value={router}>\r\n <Component\r\n className={appendClassNames([isTabbing, 'humany-is-tabbing'])}\r\n isTabbing={isTabbing}\r\n id={entry}\r\n branch=\"default\"\r\n />\r\n </RoutingContext.Provider>\r\n </ContainerContext.Provider>\r\n </Router>\r\n );\r\n};\r\n\r\nexport default Wrapper;\r\n","import { Container } from '@webprovisions/platform';\r\nimport React from 'react';\r\nimport { render } from 'react-dom';\r\nimport Wrapper from './wrapper';\r\n\r\nexport default (container: Container, element: HTMLElement) =>\r\n render(<Wrapper container={container} />, element);\r\n"],"names":["render","Wrapper"],"mappings":";;;;;;;;;;;;;;AAKA,MAAe,IAAA,CAAC,MAAgD;AAC5D,QAAM,CAAC,GAAQ,KAAa,EAAgC,IAAI,GAC1D,IAAY;AAElB,WAAU,MAAM;AACZ,MAAU,SAAS,QAAQ,EAAE,KAAK,CAAC,MAA2B;AAC1D,MAAI,EAAU,WACV,EAAU,CAAM;AAAA,IACpB,CACH;AAAA,EAAA,GACF,CAAC,GAAW,CAAS,CAAC,GAElB;AACX,GCVM,IAAoB,CAAC,OAAO,aAAa,WAAW,cAAc,WAAW,GAM7E,IAA4B,CAAC,EAAE,mBAAgB;AAC3C,QAAA,IAAa,EAAqB,CAAS,GAC3C,IAAS,EAAU,CAAS,GAC5B,IAAM,EAAU,IAAI,cAAc,GAClC,CAAC,GAAW,KAAgB,EAAS,wBAAK,UAAU,IAAI,iBAAgB,EAAK,GAC7E,CAAC,GAAO,KAAY,EAAwB,IAAI;AAiDtD,SA/CA,EAAU,MAAM;AACN,UAAA,IAAU,CAAC,MAAyB;AACtC,MAAI,EAAkB,QAAQ,EAAM,GAAG,IAAI,MAClC,MACI,eAAA,UAAU,SAAS,aAAa,KAEzC,EAAa,EAAI;AAAA,IACrB,GAEE,IAAQ,CAAC,MAAe;AAC1B,MAAI,EAAM,YAAY,KAAK,EAAM,YAAY,KAGzC,MACK,gBAAA,UAAU,SAAS,aAAa,MAEzC,EAAa,EAAK;AAAA,IAAA;AAEf,kBAAA,iBAAiB,WAAW,CAAO,GACnC,OAAA,iBAAiB,SAAS,CAAK,GAC/B,MAAM;AACF,aAAA,oBAAoB,WAAW,CAAO,GAC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