@telia-ace/knowledge-widget-types-grid 1.0.54 → 1.1.1-rc.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.
package/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-6e1f4d54.js");require("react/jsx-runtime");require("react");require("react-dom");exports.Component=e.Component;exports.DataClient=e.DataClient;exports.DataType=e.DataType;exports.DetachedComponent=e.DetachedComponent;exports.FeedbackType=e.FeedbackType;exports.GridWidget=e.ExtendedWidget;exports.NotFound=e.NotFound;exports.ServiceClientQueryType=e.ServiceClientQueryType;exports.SortingType=e.SortingType;exports.determineServiceClientQueryType=e.determineServiceClientQueryType;exports.formatLegacyData=e.formatLegacyData;exports.genericComponentStyling=e.styling;
package/index.mjs ADDED
@@ -0,0 +1,18 @@
1
+ import { I as n, D as r, a as p, aG as s, F as m, aJ as y, aI as d, S as c, b as C, d as g, f as D, aH as S } from "./index-f6d7c0ea.mjs";
2
+ import "react/jsx-runtime";
3
+ import "react";
4
+ import "react-dom";
5
+ export {
6
+ n as Component,
7
+ r as DataClient,
8
+ p as DataType,
9
+ s as DetachedComponent,
10
+ m as FeedbackType,
11
+ y as GridWidget,
12
+ d as NotFound,
13
+ c as ServiceClientQueryType,
14
+ C as SortingType,
15
+ g as determineServiceClientQueryType,
16
+ D as formatLegacyData,
17
+ S as genericComponentStyling
18
+ };
package/package.json CHANGED
@@ -1,33 +1,22 @@
1
1
  {
2
2
  "name": "@telia-ace/knowledge-widget-types-grid",
3
- "version": "1.0.54",
4
- "description": "Extended type definition for Grid widget.",
5
- "license": "SEE LICENSE IN LICENSE.txt",
6
- "author": "Telia Company AB",
7
- "keywords": [
8
- "telia"
9
- ],
10
- "main": "dist/index.js",
11
- "sourceMain": "src/index.ts",
12
- "type": "module",
13
- "types": "dist/index.d.ts",
14
- "files": [
15
- "LICENSE.txt",
16
- "README.md",
17
- "dist/"
18
- ],
19
- "publishConfig": {
20
- "access": "public"
3
+ "version": "1.1.1-rc.1",
4
+ "main": "./index.js",
5
+ "types": "./index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./index.mjs",
9
+ "require": "./index.js"
10
+ }
21
11
  },
22
- "sideEffects": false,
23
12
  "dependencies": {
24
- "@telia-ace/knowledge-data-client": "1.0.10",
25
- "@telia-ace/knowledge-widget-adapters": "1.0.53",
26
- "@telia-ace/widget-types-grid": "^1.0.37",
13
+ "@telia-ace/knowledge-widget-core": "^1.1.1-rc.1",
14
+ "@telia-ace/knowledge-data-client": "^1.1.1-rc.1",
15
+ "@telia-ace/widget-types-grid": "^1.1.1-rc.1",
16
+ "@telia-ace/knowledge-widget-adapters": "^1.1.1-rc.1",
27
17
  "@webprovisions/platform": "^1.1.4"
28
18
  },
29
- "scripts": {
30
- "clean": "rimraf ./dist",
31
- "build": "rimraf ./dist && tsc -emitDeclarationOnly && vite build"
19
+ "peerDependencies": {
20
+ "@emotion/react": "11.11.1"
32
21
  }
33
22
  }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),h=require("react-dom"),r=require("./index-6e1f4d54.js"),i=require("react");var a,c=h;if(process.env.NODE_ENV==="production")a=c.createRoot,c.hydrateRoot;else{var d=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;a=function(t,e){d.usingClientEntryPoint=!0;try{return c.createRoot(t,e)}finally{d.usingClientEntryPoint=!1}}}const v=t=>{const[e,n]=i.useState(null),s=r.useIsMounted();return i.useEffect(()=>{t.getAsync("router").then(u=>{s.current&&n(u)})},[t,s]),e};var f;const y=r.createCache({key:"css",prepend:!0,nonce:((f=window.webprovisionsEnvironmentVariables)==null?void 0:f.cspNonce)||void 0}),R=({container:t})=>{const e=r.useComponentPlatform(t),n=v(t),[s,u]=i.useState(null);return i.useEffect(()=>{if(e)return u(e.nodes.root.children.default[0].id||null),e.events.subscribe("components:root-children-changed",(x,{node:l})=>{if(l.parent&&l.parent.type==="root"){const p=l.parent.children.default[0].id;u(p)}})},[e]),!n||!n.history||!e||!s?null:o.jsx(r.CacheProvider,{value:y,children:o.jsx(r.Router,{history:n.history,children:o.jsx(r.ContainerContext.Provider,{value:t,children:o.jsx(r.RoutingContext.Provider,{value:n,children:o.jsx(r.Component,{id:s,branch:"default"})})})})})},E=R,_=(t,e)=>{a(e).render(o.jsx(E,{container:t}))};exports.default=_;
@@ -0,0 +1,51 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import h from "react-dom";
3
+ import { y as v, z as m, B as y, E, R, G as _, H as C, I as b } from "./index-f6d7c0ea.mjs";
4
+ import { useState as d, useEffect as p } from "react";
5
+ var c, i = h;
6
+ if (process.env.NODE_ENV === "production")
7
+ c = i.createRoot, i.hydrateRoot;
8
+ else {
9
+ var a = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
10
+ c = function(r, e) {
11
+ a.usingClientEntryPoint = !0;
12
+ try {
13
+ return i.createRoot(r, e);
14
+ } finally {
15
+ a.usingClientEntryPoint = !1;
16
+ }
17
+ };
18
+ }
19
+ const P = (r) => {
20
+ const [e, t] = d(null), o = v();
21
+ return p(() => {
22
+ r.getAsync("router").then((s) => {
23
+ o.current && t(s);
24
+ });
25
+ }, [r, o]), e;
26
+ };
27
+ var l;
28
+ const N = m({
29
+ key: "css",
30
+ prepend: !0,
31
+ nonce: ((l = window.webprovisionsEnvironmentVariables) == null ? void 0 : l.cspNonce) || void 0
32
+ }), O = ({ container: r }) => {
33
+ const e = y(r), t = P(r), [o, s] = d(null);
34
+ return p(() => {
35
+ if (e)
36
+ return s(e.nodes.root.children.default[0].id || null), e.events.subscribe(
37
+ "components:root-children-changed",
38
+ (x, { node: u }) => {
39
+ if (u.parent && u.parent.type === "root") {
40
+ const f = u.parent.children.default[0].id;
41
+ s(f);
42
+ }
43
+ }
44
+ );
45
+ }, [e]), !t || !t.history || !e || !o ? null : /* @__PURE__ */ n(E, { value: N, children: /* @__PURE__ */ n(R, { history: t.history, children: /* @__PURE__ */ n(_.Provider, { value: r, children: /* @__PURE__ */ n(C.Provider, { value: t, children: /* @__PURE__ */ n(b, { id: o, branch: "default" }) }) }) }) });
46
+ }, g = O, M = (r, e) => {
47
+ c(e).render(/* @__PURE__ */ n(g, { container: r }));
48
+ };
49
+ export {
50
+ M as default
51
+ };
@@ -0,0 +1,5 @@
1
+ import { unmountComponentAtNode as t } from "react-dom";
2
+ const m = (o) => t(o);
3
+ export {
4
+ m as default
5
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react-dom"),o=t=>e.unmountComponentAtNode(t);exports.default=o;
@@ -1,3 +1,3 @@
1
1
  import { Container } from '@webprovisions/platform';
2
- export declare const createContactMethodPlatform: (container: Container) => Promise<import("@telia-ace/knowledge-widget-adapters/dist/contact-methods/platform").default>;
2
+ export declare const createContactMethodPlatform: (container: Container) => Promise<import("libs/knowledge/adapters/src/contact-methods/platform").default>;
3
3
  export declare const createDataClient: (container: Container) => Promise<import("@telia-ace/knowledge-data-client").DataClient>;
package/LICENSE.txt DELETED
@@ -1,6 +0,0 @@
1
- Copyright © 2021, Telia Company AB. All rights reserved.
2
-
3
- THIS PACKAGE AND CONTAINING SOFTWARE IS PART OF
4
- THE HUMANY SERVICE. BY USING THIS SOFTWARE YOU
5
- AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
6
- http://www.humany.com/legal
package/README.md DELETED
@@ -1,4 +0,0 @@
1
- # `@telia-ace/knowledge-widget-types-grid`
2
-
3
- Extended type definition for ACE One Widget (exported as `GridWidget`).
4
- Adds DataClient and ContactMethodPlatform to the grid widget type.
package/dist/index.js DELETED
@@ -1,20 +0,0 @@
1
- export * from "@telia-ace/knowledge-data-client";
2
- import { Widget as r } from "@telia-ace/widget-types-grid";
3
- import { Component as m, DetachedComponent as p, NotFound as h, genericComponentStyling as g } from "@telia-ace/widget-types-grid";
4
- const n = (e) => import("@telia-ace/knowledge-widget-adapters").then(({ ContactMethodPlatform: t }) => t.create(e)), o = (e) => import("@telia-ace/knowledge-data-client").then(({ DataClient: t }) => t.create(e));
5
- class c extends r {
6
- constructor(t) {
7
- super(t), this.container.registerAsync(
8
- "contactMethods",
9
- () => n(this.container)
10
- ), this.container.registerAsync("dataClient", () => o(this.container));
11
- }
12
- }
13
- export {
14
- m as Component,
15
- p as DetachedComponent,
16
- c as GridWidget,
17
- h as NotFound,
18
- g as genericComponentStyling
19
- };
20
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/widget/services.ts","../src/widget/extended-widget.ts"],"sourcesContent":["import { Container } from '@webprovisions/platform';\n\nexport const createContactMethodPlatform = (container: Container) => {\n return import('@telia-ace/knowledge-widget-adapters').then(({ ContactMethodPlatform }) => {\n return ContactMethodPlatform.create(container);\n });\n};\n\nexport const createDataClient = (container: Container) => {\n return import('@telia-ace/knowledge-data-client').then(({ DataClient }) => {\n return DataClient.create(container);\n });\n};\n","import { Widget } from '@telia-ace/widget-types-grid';\nimport { Container } from '@webprovisions/platform';\nimport { createContactMethodPlatform, createDataClient } from './services';\n\nexport default class ExtendedWidget extends Widget {\n constructor(container: Container) {\n super(container);\n\n this.container.registerAsync('contactMethods', () =>\n createContactMethodPlatform(this.container)\n );\n this.container.registerAsync('dataClient', () => createDataClient(this.container));\n }\n}\n"],"names":["createContactMethodPlatform","container","ContactMethodPlatform","createDataClient","DataClient","ExtendedWidget","Widget"],"mappings":";;;AAEa,MAAAA,IAA8B,CAACC,MACjC,OAAO,wCAAwC,KAAK,CAAC,EAAE,uBAAAC,QACnDA,EAAsB,OAAOD,CAAS,CAChD,GAGQE,IAAmB,CAACF,MACtB,OAAO,oCAAoC,KAAK,CAAC,EAAE,YAAAG,QAC/CA,EAAW,OAAOH,CAAS,CACrC;ACPL,MAAqBI,UAAuBC,EAAO;AAAA,EAC/C,YAAYL,GAAsB;AAC9B,UAAMA,CAAS,GAEf,KAAK,UAAU;AAAA,MAAc;AAAA,MAAkB,MAC3CD,EAA4B,KAAK,SAAS;AAAA,IAAA,GAE9C,KAAK,UAAU,cAAc,cAAc,MAAMG,EAAiB,KAAK,SAAS,CAAC;AAAA,EACrF;AACJ;"}
File without changes
File without changes
File without changes