@telia-ace/widget-types-grid 1.0.25-next.0 → 1.0.25-next.10

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.
@@ -0,0 +1,68 @@
1
+ import n, { useState as m, useEffect as p } from "react";
2
+ import f from "react-dom";
3
+ import { useIsMounted as d, useComponentPlatform as E, ContainerContext as y, RoutingContext as R } from "@telia-ace/widget-ui";
4
+ import { Router as _ } from "react-router-dom";
5
+ import { Component as h } from "./index.js";
6
+ import "@emotion/react";
7
+ import "@telia-ace/widget-core";
8
+ import "@emotion/styled";
9
+ import "@telia-ace/widget-utilities";
10
+ import "react-transition-group";
11
+ import "react-router";
12
+ import "@telia-ace/widget-routing";
13
+ import "@telia-ace/widget-services";
14
+ import "@webprovisions/bootstrapping";
15
+ import "@webprovisions/platform";
16
+ var c, u = f;
17
+ if (process.env.NODE_ENV === "production")
18
+ c = u.createRoot, u.hydrateRoot;
19
+ else {
20
+ var l = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
21
+ c = function(e, t) {
22
+ l.usingClientEntryPoint = !0;
23
+ try {
24
+ return u.createRoot(e, t);
25
+ } finally {
26
+ l.usingClientEntryPoint = !1;
27
+ }
28
+ };
29
+ }
30
+ const v = (e) => {
31
+ const [t, r] = m(null), o = d();
32
+ return p(() => {
33
+ e.getAsync("router").then((i) => {
34
+ o.current && r(i);
35
+ });
36
+ }, [e, o]), t;
37
+ }, C = ({ container: e }) => {
38
+ const t = E(e), r = v(e), [o, i] = m(null);
39
+ return p(() => {
40
+ if (t)
41
+ return i(t.nodes.root.children.default[0].id || null), t.events.subscribe(
42
+ "components:root-children-changed",
43
+ (N, { node: s }) => {
44
+ if (s.parent && s.parent.type === "root") {
45
+ const a = s.parent.children.default[0].id;
46
+ i(a);
47
+ }
48
+ }
49
+ );
50
+ }, [t]), !r || !r.history || !t || !o ? null : /* @__PURE__ */ n.createElement(_, {
51
+ history: r.history
52
+ }, /* @__PURE__ */ n.createElement(y.Provider, {
53
+ value: e
54
+ }, /* @__PURE__ */ n.createElement(R.Provider, {
55
+ value: r
56
+ }, /* @__PURE__ */ n.createElement(h, {
57
+ id: o,
58
+ branch: "default"
59
+ }))));
60
+ }, b = C, F = (e, t) => {
61
+ c(t).render(/* @__PURE__ */ n.createElement(b, {
62
+ container: e
63
+ }));
64
+ };
65
+ export {
66
+ F as default
67
+ };
68
+ //# sourceMappingURL=render.f2d6da89.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.f2d6da89.js","sources":["../../../node_modules/react-dom/client.js","../src/ui/use-router.ts","../src/ui/wrapper.tsx","../src/ui/render.tsx"],"sourcesContent":["'use strict';\n\nvar m = require('react-dom');\nif (process.env.NODE_ENV === 'production') {\n exports.createRoot = m.createRoot;\n exports.hydrateRoot = m.hydrateRoot;\n} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n","import { RoutingService } from '@telia-ace/widget-routing';\nimport { useIsMounted } from '@telia-ace/widget-ui';\nimport { Container } from '@webprovisions/platform';\nimport { useEffect, useState } from 'react';\n\nexport default (container: Container): RoutingService | null => {\n const [router, setRouter] = useState<RoutingService | null>(null);\n const isMounted = useIsMounted();\n\n useEffect(() => {\n container.getAsync('router').then((router: RoutingService) => {\n if (isMounted.current) {\n setRouter(router);\n }\n });\n }, [container, isMounted]);\n\n return router;\n};\n","import { ContainerContext, RoutingContext, useComponentPlatform } from '@telia-ace/widget-ui';\nimport { Container } from '@webprovisions/platform';\nimport React, { useEffect, useState } from 'react';\nimport { Router } from 'react-router-dom';\nimport Component from './component';\nimport useRouter from './use-router';\n\nconst keyNavigationKeys = ['Tab', 'ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft'];\n\ntype Props = {\n container: Container;\n};\n\nconst Wrapper: React.FC<Props> = ({ container }) => {\n const components = useComponentPlatform(container);\n const router = useRouter(container);\n const [entry, setEntry] = useState<string | null>(null);\n\n useEffect(() => {\n if (components) {\n setEntry(components.nodes.root.children.default[0].id || null);\n const unsubscribe = components.events.subscribe(\n 'components:root-children-changed',\n (event, { node }) => {\n if (node.parent && node.parent.type === 'root') {\n const entry = node.parent.children.default[0].id;\n setEntry(entry);\n }\n }\n );\n\n return unsubscribe;\n }\n }, [components]);\n\n if (!router || !router.history || !components) {\n return null;\n }\n\n if (!entry) {\n return null;\n }\n\n return (\n <Router history={router.history}>\n <ContainerContext.Provider value={container}>\n <RoutingContext.Provider value={router}>\n <Component id={entry} branch=\"default\" />\n </RoutingContext.Provider>\n </ContainerContext.Provider>\n </Router>\n );\n};\n\nexport default Wrapper;\n","import { Container } from '@webprovisions/platform';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport Wrapper from './wrapper';\n\nexport default (container: Container, element: HTMLElement) => {\n const root = createRoot(element);\n root.render(<Wrapper container={container} />);\n};\n"],"names":["m","require$$0","createRoot","i","c","o","useRouter","container","router","setRouter","useState","isMounted","useIsMounted","useEffect","Wrapper","components","useComponentPlatform","entry","setEntry","event","node","React","Router","ContainerContext","RoutingContext","Component","Wrapper$1","render","element"],"mappings":";;;;;;;;;;;;;;;OAEIA,IAAIC;AACR,IAAI,QAAQ,IAAI,aAAa;AAC3B,EAAAC,IAAqBF,EAAE,YACDA,EAAE;AAAA,KACnB;AACL,MAAIG,IAAIH,EAAE;AACV,EAAAE,IAAqB,SAASE,GAAGC,GAAG;AAClC,IAAAF,EAAE,wBAAwB;AAC1B,QAAI;AACF,aAAOH,EAAE,WAAWI,GAAGC,CAAC;AAAA,IAC9B,UAAc;AACR,MAAAF,EAAE,wBAAwB;AAAA,IAC3B;A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ACJ;AAER,GAEAS,IAAeZ,GCjDfa,IAAe,CAACpB,GAAsBqB,MAAyB;AAE3D,EADa1B,EAAW0B,CAAO,EAC1B,OAAQ,gBAAAP,EAAA,cAAAP,GAAA;AAAA,IAAQ,WAAAP;AAAA,EAAsB,CAAA,CAAE;AACjD;"}
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
2
  declare type Props = {
3
3
  role?: string;
4
+ 'data-width': number;
5
+ 'data-indent': number;
4
6
  className?: string;
7
+ children?: React.ReactNode;
5
8
  };
6
9
  declare const ResolvableComponent: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;
7
10
  export default ResolvableComponent;
@@ -1,17 +1,16 @@
1
- /// <reference types="react" />
2
- export declare const styling: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
3
- 'data-width': number;
4
- 'data-indent': number;
5
- }, import("styled-components").DefaultTheme>>;
6
- export declare const StyledView: import("styled-components").StyledComponent<import("react").FC<{
1
+ import { Theme } from '@emotion/react';
2
+ export declare const styling: (p: {
3
+ 'data-width'?: number;
4
+ 'data-indent'?: number;
5
+ theme: Theme;
6
+ }) => import("@emotion/utils").SerializedStyles;
7
+ export declare const StyledView: import("@emotion/styled").StyledComponent<{
7
8
  className?: string | undefined;
8
- }>, import("styled-components").DefaultTheme, {
9
- 'data-width': number;
10
- 'data-indent': number;
11
- }, never>;
12
- export declare const StyledAnimatedView: import("styled-components").StyledComponent<import("react").FC<{
9
+ } & {
10
+ theme?: Theme | undefined;
11
+ }, {}, {}>;
12
+ export declare const StyledAnimatedView: import("@emotion/styled").StyledComponent<{
13
13
  className?: string | undefined;
14
- }>, import("styled-components").DefaultTheme, {
15
- 'data-width': number;
16
- 'data-indent': number;
17
- }, never>;
14
+ } & {
15
+ theme?: Theme | undefined;
16
+ }, {}, {}>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-types-grid",
3
- "version": "1.0.25-next.0",
3
+ "version": "1.0.25-next.10",
4
4
  "description": "Type definition for Grid widget.",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "Telia Company AB",
@@ -26,28 +26,35 @@
26
26
  },
27
27
  "sideEffects": false,
28
28
  "dependencies": {
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",
29
+ "@telia-ace/knowledge-serviceclient": "next",
30
+ "@telia-ace/widget-core": "^1.0.16-next.10",
31
+ "@telia-ace/widget-forms": "^1.0.23-next.10",
32
+ "@telia-ace/widget-routing": "^1.0.17-next.10",
33
+ "@telia-ace/widget-services": "^1.0.16-next.10",
34
+ "@telia-ace/widget-ui": "^1.0.23-next.10",
35
+ "@telia-ace/widget-utilities": "next",
36
36
  "@webprovisions/bootstrapping": "^1.0.12",
37
37
  "@webprovisions/platform": "^1.1.2"
38
38
  },
39
39
  "peerDependencies": {
40
+ "@emotion/react": "^11.10.4",
41
+ "@emotion/styled": "^11.10.4",
40
42
  "react": "^18.2.0",
41
43
  "react-dom": "^18.2.0",
42
44
  "react-router": "^5.3.4",
43
45
  "react-router-dom": "^5.3.4",
44
- "react-transition-group": "^4.4.5",
45
- "styled-components": "^5.3.6"
46
+ "react-transition-group": "^4.4.5"
46
47
  },
47
48
  "devDependencies": {
49
+ "@emotion/react": "^11.10.4",
50
+ "@emotion/styled": "^11.10.4",
48
51
  "@types/react-router-dom": "^5.1.0",
49
52
  "@types/react-transition-group": "^4.4.5",
50
- "@types/styled-components": "^5.1.26"
53
+ "react": "^18.2.0",
54
+ "react-dom": "^18.2.0",
55
+ "react-router": "^5.3.4",
56
+ "react-router-dom": "^5.3.4",
57
+ "react-transition-group": "^4.4.5"
51
58
  },
52
- "gitHead": "e783dc2d2efafddafb638fb68d0b6842a204ca59"
59
+ "gitHead": "b75b1d3e5fe072e68412cb690410e8704ad23699"
53
60
  }
@@ -1,51 +0,0 @@
1
- import n, { useState as i, useEffect as m } from "react";
2
- import { render as p } from "react-dom";
3
- import { useIsMounted as l, useComponentPlatform as a, ContainerContext as d, RoutingContext as f } from "@telia-ace/widget-ui";
4
- import { Router as h } from "react-router-dom";
5
- import { Component as y } from "./index.js";
6
- import "@telia-ace/widget-core";
7
- import "styled-components";
8
- import "@telia-ace/widget-utilities";
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 b = (e) => {
16
- const [t, r] = i(null), o = l();
17
- return m(() => {
18
- e.getAsync("router").then((s) => {
19
- o.current && r(s);
20
- });
21
- }, [e, o]), t;
22
- }, E = ({ container: e }) => {
23
- const t = a(e), r = b(e), [o, s] = i(null);
24
- return m(() => {
25
- if (t)
26
- return s(t.nodes.root.children.default[0].id || null), t.events.subscribe(
27
- "components:root-children-changed",
28
- (R, { node: u }) => {
29
- if (u.parent && u.parent.type === "root") {
30
- const c = u.parent.children.default[0].id;
31
- s(c);
32
- }
33
- }
34
- );
35
- }, [t]), !r || !r.history || !t || !o ? null : /* @__PURE__ */ n.createElement(h, {
36
- history: r.history
37
- }, /* @__PURE__ */ n.createElement(d.Provider, {
38
- value: e
39
- }, /* @__PURE__ */ n.createElement(f.Provider, {
40
- value: r
41
- }, /* @__PURE__ */ n.createElement(y, {
42
- id: o,
43
- branch: "default"
44
- }))));
45
- }, v = E, B = (e, t) => p(/* @__PURE__ */ n.createElement(v, {
46
- container: e
47
- }), t);
48
- export {
49
- B as default
50
- };
51
- //# sourceMappingURL=render.1ff5268d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render.1ff5268d.js","sources":["../src/ui/use-router.ts","../src/ui/wrapper.tsx","../src/ui/render.tsx"],"sourcesContent":["import { RoutingService } from '@telia-ace/widget-routing';\nimport { useIsMounted } from '@telia-ace/widget-ui';\nimport { Container } from '@webprovisions/platform';\nimport { useEffect, useState } from 'react';\n\nexport default (container: Container): RoutingService | null => {\n const [router, setRouter] = useState<RoutingService | null>(null);\n const isMounted = useIsMounted();\n\n useEffect(() => {\n container.getAsync('router').then((router: RoutingService) => {\n if (isMounted.current) {\n setRouter(router);\n }\n });\n }, [container, isMounted]);\n\n return router;\n};\n","import { ContainerContext, RoutingContext, useComponentPlatform } from '@telia-ace/widget-ui';\nimport { Container } from '@webprovisions/platform';\nimport React, { useEffect, useState } from 'react';\nimport { Router } from 'react-router-dom';\nimport Component from './component';\nimport useRouter from './use-router';\n\nconst keyNavigationKeys = ['Tab', 'ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft'];\n\ntype Props = {\n container: Container;\n};\n\nconst Wrapper: React.FC<Props> = ({ container }) => {\n const components = useComponentPlatform(container);\n const router = useRouter(container);\n const [entry, setEntry] = useState<string | null>(null);\n\n useEffect(() => {\n if (components) {\n setEntry(components.nodes.root.children.default[0].id || null);\n const unsubscribe = components.events.subscribe(\n 'components:root-children-changed',\n (event, { node }) => {\n if (node.parent && node.parent.type === 'root') {\n const entry = node.parent.children.default[0].id;\n setEntry(entry);\n }\n }\n );\n\n return unsubscribe;\n }\n }, [components]);\n\n if (!router || !router.history || !components) {\n return null;\n }\n\n if (!entry) {\n return null;\n }\n\n return (\n <Router history={router.history}>\n <ContainerContext.Provider value={container}>\n <RoutingContext.Provider value={router}>\n <Component id={entry} branch=\"default\" />\n </RoutingContext.Provider>\n </ContainerContext.Provider>\n </Router>\n );\n};\n\nexport default Wrapper;\n","import { Container } from '@webprovisions/platform';\nimport React from 'react';\nimport { render } from 'react-dom';\nimport Wrapper from './wrapper';\n\nexport default (container: Container, element: HTMLElement) =>\n render(<Wrapper container={container} />, element);\n"],"names":["useRouter","container","router","setRouter","useState","isMounted","useIsMounted","useEffect","Wrapper","components","useComponentPlatform","entry","setEntry","event","node","React","Router","ContainerContext","RoutingContext","Component","Wrapper$1","render","element"],"mappings":";;;;;;;;;;;;;;AAKA,MAAeA,IAAA,CAACC,MAAgD;AAC5D,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAgC,IAAI,GAC1DC,IAAYC;AAElB,SAAAC,EAAU,MAAM;AACZ,IAAAN,EAAU,SAAS,QAAQ,EAAE,KAAK,CAACC,MAA2B;AAC1D,MAAIG,EAAU,WACVF,EAAUD,CAAM;AAAA,IACpB,CACH;AAAA,EAAA,GACF,CAACD,GAAWI,CAAS,CAAC,GAElBH;AACX,GCLMM,IAA2B,CAAC,EAAE,WAAAP,QAAgB;AAC1C,QAAAQ,IAAaC,EAAqBT,CAAS,GAC3CC,IAASF,EAAUC,CAAS,GAC5B,CAACU,GAAOC,CAAQ,IAAIR,EAAwB,IAAI;AAuBtD,SArBAG,EAAU,MAAM;AACZ,QAAIE;AACA,aAAAG,EAASH,EAAW,MAAM,KAAK,SAAS,QAAQ,GAAG,MAAM,IAAI,GACzCA,EAAW,OAAO;AAAA,QAClC;AAAA,QACA,CAACI,GAAO,EAAE,MAAAC,QAAW;AACjB,cAAIA,EAAK,UAAUA,EAAK,OAAO,SAAS,QAAQ;AAC5C,kBAAMH,IAAQG,EAAK,OAAO,SAAS,QAAQ,GAAG;AAC9C,YAAAF,EAASD,CAAK;AAAA,UAClB;AAAA,QACJ;AAAA,MAAA;AAAA,EAIR,GACD,CAACF,CAAU,CAAC,GAEX,CAACP,KAAU,CAACA,EAAO,WAAW,CAACO,KAI/B,CAACE,IACM,OAIN,gBAAAI,EAAA,cAAAC,GAAA;AAAA,IAAO,SAASd,EAAO;AAAA,EACpB,GAAA,gBAAAa,EAAA,cAACE,EAAiB,UAAjB;AAAA,IAA0B,OAAOhB;AAAA,EAC9B,GAAA,gBAAAc,EAAA,cAACG,EAAe,UAAf;AAAA,IAAwB,OAAOhB;AAAA,EAAA,GAC3B,gBAAAa,E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