@telia-ace/widget-types-grid 1.0.29 → 1.0.30-experimental.1

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,8 @@
1
+ import { LitElement } from 'lit';
2
+ export declare class WidgetComponentInterface {
3
+ requestInstance(key: string): any;
4
+ nodeId: string;
5
+ }
6
+ type Constructor<T = {}> = new (...args: any[]) => T;
7
+ export declare const WidgetComponent: <T extends Constructor<LitElement>>(Base: T) => Constructor<WidgetComponentInterface> & T;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ const r = (t, n, o) => {
2
+ const e = document.createElement("widget-root");
3
+ e.setAttribute("widgetName", t), o.appendChild(e);
4
+ };
5
+ export {
6
+ r as default
7
+ };
8
+ //# sourceMappingURL=render.9ebba652.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.9ebba652.js","sources":["../src/ui/render.ts"],"sourcesContent":["import { Container } from '@webprovisions/platform';\nimport './widget-component';\nimport './widget-root';\n\nexport default (widgetName: string, container: Container, element: HTMLElement) => {\n const root = document.createElement('widget-root');\n root.setAttribute('widgetName', widgetName);\n element.appendChild(root);\n};\n"],"names":["render","widgetName","container","element","root"],"mappings":"AAIA,MAAAA,IAAe,CAACC,GAAoBC,GAAsBC,MAAyB;AACzE,QAAAC,IAAO,SAAS,cAAc,aAAa;AAC5C,EAAAA,EAAA,aAAa,cAAcH,CAAU,GAC1CE,EAAQ,YAAYC,CAAI;AAC5B;"}
File without changes
@@ -0,0 +1,3 @@
1
+ import { Container } from '@webprovisions/platform';
2
+ declare const _default: (container: Container, element: HTMLElement) => void;
3
+ export default _default;
@@ -1,6 +1,6 @@
1
1
  export { default as AnimatedView } from './animated-view';
2
- export { default as Component } from './component';
3
2
  export { prepareDOMElements, TriggerType } from './prepare-dom';
4
3
  export { default as ResolvableComponent } from './resolvable-component';
5
4
  export { default as View } from './view';
6
5
  export { default as Wrapper } from './wrapper';
6
+ export { default as Component } from './_component';
@@ -1,3 +1,5 @@
1
1
  import { Container } from '@webprovisions/platform';
2
- declare const _default: (container: Container, element: HTMLElement) => void;
2
+ import './widget-component';
3
+ import './widget-root';
4
+ declare const _default: (widgetName: string, container: Container, element: HTMLElement) => void;
3
5
  export default _default;
@@ -0,0 +1,27 @@
1
+ import { Container } from '@webprovisions/platform';
2
+ import { LitElement, nothing } from 'lit';
3
+ declare const WidgetComponent_base: (new (...args: any[]) => import("../mixins/requester").RequesterInterface) & typeof LitElement;
4
+ export declare class WidgetComponent extends WidgetComponent_base {
5
+ static styles: import("lit").CSSResult[];
6
+ container: Container | undefined;
7
+ listeners: any[];
8
+ nodeId: string;
9
+ branch: string;
10
+ protected _descriptor: any;
11
+ protected _properties: {
12
+ [key: string]: any;
13
+ };
14
+ protected _context: {
15
+ [key: string]: any;
16
+ };
17
+ protected _layout: {
18
+ [key: string]: any;
19
+ };
20
+ connectedCallback(): void;
21
+ disconnectedCallback(): void;
22
+ mapProps(): {
23
+ [key: string]: any;
24
+ };
25
+ render(): typeof nothing | import("lit").TemplateResult<1 | 2>;
26
+ }
27
+ export {};
@@ -0,0 +1,21 @@
1
+ import { ComponentPlatform } from '@telia-ace/widget-core';
2
+ import { EventSubscriptionCancellation } from '@webprovisions/platform';
3
+ import { LitElement, nothing } from 'lit';
4
+ import { WidgetController } from '../controllers/widget-controller';
5
+ declare const WidgetRoot_base: (new (...args: any[]) => import("../mixins/provider").ProviderInterface) & typeof LitElement;
6
+ export declare class WidgetRoot extends WidgetRoot_base {
7
+ controller: WidgetController;
8
+ platform: ComponentPlatform | undefined;
9
+ unsubscribe: EventSubscriptionCancellation | undefined;
10
+ static styles: import("lit").CSSResult[];
11
+ protected _entry: string | null;
12
+ widgetName: string;
13
+ protected _child: {
14
+ tag: string;
15
+ nodeId: string;
16
+ } | null;
17
+ constructor();
18
+ connectedCallback(): void;
19
+ render(): typeof nothing | import("lit").TemplateResult<1 | 2>;
20
+ }
21
+ export {};
@@ -0,0 +1 @@
1
+ export declare const componentTagFromType: (type: string) => string;
@@ -0,0 +1,3 @@
1
+ export declare const getComponentWidth: (elem: HTMLElement, layout: {
2
+ [key: string]: any;
3
+ }, definedColumns?: string) => string;
@@ -0,0 +1 @@
1
+ export declare const getWidget: (elem: HTMLElement) => any;
@@ -0,0 +1,5 @@
1
+ export declare const mapContextStyle: (ctx: {
2
+ [key: string]: any;
3
+ }) => {
4
+ [key: string]: string;
5
+ };
@@ -0,0 +1,5 @@
1
+ import { ComponentPlatform, ComponentResolver } from '@telia-ace/widget-core';
2
+ export declare const resolveComponent: (nodeId: string, resolver: ComponentResolver, platform: ComponentPlatform) => Promise<{
3
+ nodeId: string;
4
+ tag: string;
5
+ } | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-types-grid",
3
- "version": "1.0.29",
3
+ "version": "1.0.30-experimental.1",
4
4
  "description": "Type definition for Grid widget.",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "Telia Company AB",
@@ -21,14 +21,18 @@
21
21
  },
22
22
  "sideEffects": false,
23
23
  "dependencies": {
24
- "@telia-ace/widget-core": "1.0.20",
25
- "@telia-ace/widget-forms": "1.0.27",
26
- "@telia-ace/widget-routing": "1.0.21",
27
- "@telia-ace/widget-services": "1.0.20",
28
- "@telia-ace/widget-ui": "1.0.27",
29
- "@telia-ace/widget-utilities": "1.0.9",
24
+ "@open-wc/dedupe-mixin": "^1.3.1",
25
+ "@open-wc/lit-helpers": "^0.5.1",
26
+ "@telia-ace/widget-core": "1.0.21-experimental.1",
27
+ "@telia-ace/widget-forms": "1.0.28-experimental.1",
28
+ "@telia-ace/widget-routing": "1.0.22-experimental.1",
29
+ "@telia-ace/widget-services": "1.0.21-experimental.1",
30
+ "@telia-ace/widget-ui": "1.0.28-experimental.1",
31
+ "@telia-ace/widget-utilities": "1.0.10-experimental.1",
30
32
  "@webprovisions/bootstrapping": "^1.0.12",
31
- "@webprovisions/platform": "^1.1.2"
33
+ "@webprovisions/platform": "^1.1.2",
34
+ "lit": "^2.6.0",
35
+ "page": "^1.11.6"
32
36
  },
33
37
  "peerDependencies": {
34
38
  "@emotion/cache": "^11.10.5",
@@ -44,7 +48,7 @@
44
48
  "@emotion/cache": "^11.10.5",
45
49
  "@emotion/react": "^11.10.5",
46
50
  "@emotion/styled": "^11.10.5",
47
- "@telia-ace/widget-developer-tools": "1.0.15",
51
+ "@telia-ace/widget-developer-tools": "1.0.16-experimental.1",
48
52
  "@types/react": "^18.0.26",
49
53
  "@types/react-dom": "^18.0.10",
50
54
  "@types/react-router": "^5.1.20",
@@ -1,61 +0,0 @@
1
- import o, { useState as m, useEffect as l } from "react";
2
- import f from "react-dom";
3
- import d from "@emotion/cache";
4
- import { CacheProvider as E } from "@emotion/react";
5
- import { useIsMounted as y, useComponentPlatform as h, ContainerContext as v, RoutingContext as R } from "@telia-ace/widget-ui";
6
- import { Router as _ } from "react-router-dom";
7
- import { Component as C } from "./index.js";
8
- import "@telia-ace/widget-core";
9
- import "@emotion/styled";
10
- import "@telia-ace/widget-utilities";
11
- import "react-transition-group";
12
- import "react-router";
13
- import "@telia-ace/widget-routing";
14
- import "@telia-ace/widget-services";
15
- import "@webprovisions/bootstrapping";
16
- import "@webprovisions/platform";
17
- var c, s = f;
18
- if (process.env.NODE_ENV === "production")
19
- c = s.createRoot, s.hydrateRoot;
20
- else {
21
- var a = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
22
- c = function(t, e) {
23
- a.usingClientEntryPoint = !0;
24
- try {
25
- return s.createRoot(t, e);
26
- } finally {
27
- a.usingClientEntryPoint = !1;
28
- }
29
- };
30
- }
31
- const b = (t) => {
32
- const [e, r] = m(null), n = y();
33
- return l(() => {
34
- t.getAsync("router").then((i) => {
35
- n.current && r(i);
36
- });
37
- }, [t, n]), e;
38
- }, P = d({
39
- key: "css",
40
- prepend: !0
41
- }), g = ({ container: t }) => {
42
- const e = h(t), r = b(t), [n, i] = m(null);
43
- return l(() => {
44
- if (e)
45
- return i(e.nodes.root.children.default[0].id || null), e.events.subscribe(
46
- "components:root-children-changed",
47
- (I, { node: u }) => {
48
- if (u.parent && u.parent.type === "root") {
49
- const p = u.parent.children.default[0].id;
50
- i(p);
51
- }
52
- }
53
- );
54
- }, [e]), !r || !r.history || !e || !n ? null : /* @__PURE__ */ o.createElement(E, { value: P }, /* @__PURE__ */ o.createElement(_, { history: r.history }, /* @__PURE__ */ o.createElement(v.Provider, { value: t }, /* @__PURE__ */ o.createElement(R.Provider, { value: r }, /* @__PURE__ */ o.createElement(C, { id: n, branch: "default" })))));
55
- }, N = g, j = (t, e) => {
56
- c(e).render(/* @__PURE__ */ o.createElement(N, { container: t }));
57
- };
58
- export {
59
- j as default
60
- };
61
- //# sourceMappingURL=render.0b9431cd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render.0b9431cd.js","sources":["../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/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","\nimport createCache from '@emotion/cache';\nimport { CacheProvider } from '@emotion/react';\nimport { 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 cacheProvider = createCache({\n key: 'css',\n prepend: true,\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 <CacheProvider value={cacheProvider}>\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 </CacheProvider>\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","cacheProvider","createCache","Wrapper","components","useComponentPlatform","entry","setEntry","event","node","React","CacheProvider","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;AAAA,EACL;AASA;ACnBA,MAAeG,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,GCFMM,IAAgBC,EAAY;AAAA,EAC9B,KAAK;AAAA,EACL,SAAS;AACb,CAAC,GAEKC,IAA2B,CAAC,EAAE,WAAAT,QAAgB;AAC1C,QAAAU,IAAaC,EAAqBX,CAAS,GAC3CC,IAASF,EAAUC,CAAS,GAC5B,CAACY,GAAOC,CAAQ,IAAIV,EAAwB,IAAI;AAuBtD,SArBAG,EAAU,MAAM;AACZ,QAAII;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,CAACT,KAAU,CAACA,EAAO,WAAW,CAACS,KAI/B,CAACE,IACM,OAIN,gBAAAI,EAAA,cAAAC,GAAA,EAAc,OAAOV,EAAA,GACjB,gBAAAS,EAAA,cAAAE,GAAA,EAAO,SAASjB,EAAO,QACpB,GAAA,gBAAAe,EAAA,cAACG,EAAiB,UAAjB,EAA0B,OAAOnB,KAC7B,gBAAAgB,EAAA,cAAAI,EAAe,UAAf,EAAwB,OAAOnB,EAAA,GAC3B,gBAAAe,EAAA,cAAAK,GAAA,EAAU,IAAIT,GAAO,QAAO,WAAU,CAC3C,CACJ,CACJ,CACJ;AAER,GAEAU,IAAeb,GC3Dfc,IAAe,CAACvB,GAAsBwB,MAAyB;AAE3D,EADa7B,EAAW6B,CAAO,EAC1B,OAAO,gBAAAR,EAAA,cAACP,GAAQ,EAAA,WAAAT,EAAsB,CAAA,CAAE;AACjD;"}