@telia-ace/knowledge-widget-core 1.0.24-next.0 → 1.0.24-next.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/dist/data-types.d.ts +10 -10
- package/dist/index.d.ts +1 -6
- package/dist/index.js +18 -104
- package/dist/index.js.map +1 -1
- package/dist/load-implementation.d.ts +2 -3
- package/package.json +4 -4
- package/dist/bootstrap.d.ts +0 -15
- package/dist/humany.d.ts +0 -48
- package/dist/implementation.d.ts +0 -7
- package/dist/plugin.d.ts +0 -7
- package/dist/version.d.ts +0 -2
- package/dist/widget-type.d.ts +0 -7
package/dist/data-types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Symbol = {
|
|
2
2
|
type: 'Uri' | 'Svg' | 'FontAwesome' | 'Text' | string;
|
|
3
3
|
content: string;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type Guide = {
|
|
6
6
|
id: string;
|
|
7
7
|
title: string;
|
|
8
8
|
tags: Tag[];
|
|
@@ -11,7 +11,7 @@ export declare type Guide = {
|
|
|
11
11
|
publishedBy?: string;
|
|
12
12
|
modifiedBy?: string;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type Category = {
|
|
15
15
|
id: string;
|
|
16
16
|
title: string;
|
|
17
17
|
symbol?: Symbol;
|
|
@@ -20,7 +20,7 @@ export declare type Category = {
|
|
|
20
20
|
items?: Category[];
|
|
21
21
|
matches?: number;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type Tag = {
|
|
24
24
|
id: string;
|
|
25
25
|
title: string;
|
|
26
26
|
symbol?: Symbol;
|
|
@@ -33,7 +33,7 @@ export declare enum DialogItemType {
|
|
|
33
33
|
link = "link",
|
|
34
34
|
default = "default"
|
|
35
35
|
}
|
|
36
|
-
export
|
|
36
|
+
export type DialogItem = {
|
|
37
37
|
id: string;
|
|
38
38
|
title: string;
|
|
39
39
|
parent: Guide;
|
|
@@ -42,7 +42,7 @@ export declare type DialogItem = {
|
|
|
42
42
|
href?: string;
|
|
43
43
|
target?: string;
|
|
44
44
|
};
|
|
45
|
-
export
|
|
45
|
+
export type GuideCategoryBrowserList = {
|
|
46
46
|
id: string;
|
|
47
47
|
title: string;
|
|
48
48
|
symbol?: Symbol;
|
|
@@ -50,14 +50,14 @@ export declare type GuideCategoryBrowserList = {
|
|
|
50
50
|
paging: boolean;
|
|
51
51
|
pager?: string;
|
|
52
52
|
};
|
|
53
|
-
export
|
|
53
|
+
export type Notification = {
|
|
54
54
|
id: string;
|
|
55
55
|
title: string;
|
|
56
56
|
body: string;
|
|
57
57
|
modified?: string;
|
|
58
58
|
expandable?: boolean;
|
|
59
59
|
};
|
|
60
|
-
export
|
|
60
|
+
export type NotificationList = {
|
|
61
61
|
id: string;
|
|
62
62
|
title?: string;
|
|
63
63
|
symbol?: Symbol;
|
|
@@ -66,12 +66,12 @@ export declare type NotificationList = {
|
|
|
66
66
|
visible: boolean;
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
|
-
export
|
|
69
|
+
export type Tab = {
|
|
70
70
|
title: string;
|
|
71
71
|
name: string;
|
|
72
72
|
aliases: string[];
|
|
73
73
|
};
|
|
74
|
-
export
|
|
74
|
+
export type WidgetEntry = {
|
|
75
75
|
id: string;
|
|
76
76
|
type: string;
|
|
77
77
|
content: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
export * from '@telia-ace/widget-core';
|
|
2
|
+
export { Environment as Humany } from '@telia-ace/widget-core';
|
|
2
3
|
export { supportBootstrapping } from '@webprovisions/bootstrapping';
|
|
3
4
|
export type { BootstrappingActivationData } from '@webprovisions/bootstrapping';
|
|
4
5
|
export { destroyWidget as destroy, Widget } from '@webprovisions/platform';
|
|
5
|
-
export { default as bootstrap } from './bootstrap';
|
|
6
6
|
export * from './data-types';
|
|
7
|
-
export { default as Humany } from './humany';
|
|
8
|
-
export { default as Implementation } from './implementation';
|
|
9
7
|
export { default as loadImplementation } from './load-implementation';
|
|
10
|
-
export { default as Plugin } from './plugin';
|
|
11
8
|
export { default as verifyAuth } from './verify-auth';
|
|
12
|
-
export { default as version } from './version';
|
|
13
|
-
export { default as WidgetType } from './widget-type';
|
package/dist/index.js
CHANGED
|
@@ -1,111 +1,25 @@
|
|
|
1
|
-
var g = Object.defineProperty;
|
|
2
|
-
var f = Object.getOwnPropertySymbols;
|
|
3
|
-
var l = Object.prototype.hasOwnProperty, h = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var c = (e, t, n) => t in e ? g(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, a = (e, t) => {
|
|
5
|
-
for (var n in t || (t = {}))
|
|
6
|
-
l.call(t, n) && c(e, n, t[n]);
|
|
7
|
-
if (f)
|
|
8
|
-
for (var n of f(t))
|
|
9
|
-
h.call(t, n) && c(e, n, t[n]);
|
|
10
|
-
return e;
|
|
11
|
-
};
|
|
12
|
-
var u = (e, t, n) => (c(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
13
1
|
export * from "@telia-ace/widget-core";
|
|
14
|
-
import {
|
|
15
|
-
import { supportBootstrapping as
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const i = e.container.get("$runtimecfg").map((r) => {
|
|
23
|
-
const o = r[0];
|
|
24
|
-
if (typeof o == "function")
|
|
25
|
-
return o;
|
|
26
|
-
if (x(o)(e))
|
|
27
|
-
return r[1];
|
|
28
|
-
}).filter((r) => !!r);
|
|
29
|
-
return (t ? [t] : []).concat(i);
|
|
30
|
-
},
|
|
31
|
-
n.rootElementResolver || (() => document.body)
|
|
32
|
-
);
|
|
33
|
-
var W = /* @__PURE__ */ ((e) => (e.guide = "guide", e.link = "link", e.default = "default", e))(W || {}), w = /* @__PURE__ */ ((e) => (e.MODAL = "modal", e.DRAWER = "drawer", e.DROPDOWN = "dropdown", e.NONE = "none", e))(w || {});
|
|
34
|
-
const O = "002fa46", p = class extends E {
|
|
35
|
-
constructor(t, n = []) {
|
|
36
|
-
super(t, n, {
|
|
37
|
-
transformPluginSettings: (i, r, o) => {
|
|
38
|
-
const s = o.get("$settings"), d = s.plugins && r ? s.plugins[r] || {} : {};
|
|
39
|
-
return a(a({}, d), i);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
createImplementation(t) {
|
|
44
|
-
const n = super.createImplementation(t);
|
|
45
|
-
return n.bindings = t.bindings, n;
|
|
46
|
-
}
|
|
47
|
-
navigate(t, n, i) {
|
|
48
|
-
this.widgets.query(t).forEach((r) => r.invoke("navigate", { route: n, params: i }));
|
|
49
|
-
}
|
|
50
|
-
static create(t = {}) {
|
|
51
|
-
const n = [$].concat(
|
|
52
|
-
t.configurationApiExtensions || []
|
|
53
|
-
);
|
|
54
|
-
return new p("humany", n);
|
|
55
|
-
}
|
|
56
|
-
static createFromGlobal(t, n = {}) {
|
|
57
|
-
if (this.isRuntime(t))
|
|
58
|
-
return t.patch(n), t;
|
|
59
|
-
const i = [], r = t && t._c;
|
|
60
|
-
r && r.forEach((s) => i.push(s));
|
|
61
|
-
const o = this.create(n);
|
|
62
|
-
return o.container.register("$runtimecfg", i), o;
|
|
63
|
-
}
|
|
64
|
-
static isRuntime(t) {
|
|
65
|
-
return !!(t && typeof t == "object" && t.container && typeof t.container.get == "function" && t.container.get("$environment") === t && t.container.owner === t);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
let m = p;
|
|
69
|
-
u(m, "version", `${O} (${I})`);
|
|
70
|
-
class G extends _ {
|
|
71
|
-
constructor() {
|
|
72
|
-
super(...arguments);
|
|
73
|
-
u(this, "bindings", []);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
const C = (e, t) => fetch(t + "/config.json").then((n) => n.json()).then((n) => n.implementation).then(
|
|
77
|
-
(n) => e.createImplementation(n)
|
|
78
|
-
), k = C;
|
|
79
|
-
class q extends A {
|
|
80
|
-
constructor(t, n) {
|
|
81
|
-
super(t, n);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
const y = (e, t) => {
|
|
85
|
-
const n = `${e}${t}/interfaceauthorized`;
|
|
2
|
+
import { Environment as h } from "@telia-ace/widget-core";
|
|
3
|
+
import { supportBootstrapping as p } from "@webprovisions/bootstrapping";
|
|
4
|
+
import { Widget as x, destroyWidget as A } from "@webprovisions/platform";
|
|
5
|
+
var r = /* @__PURE__ */ ((t) => (t.guide = "guide", t.link = "link", t.default = "default", t))(r || {}), a = /* @__PURE__ */ ((t) => (t.MODAL = "modal", t.DRAWER = "drawer", t.DROPDOWN = "dropdown", t.NONE = "none", t))(a || {});
|
|
6
|
+
const d = (t, e) => fetch(e + "/config.json").then((n) => n.json()).then((n) => n.implementation).then(
|
|
7
|
+
(n) => t.createImplementation(n)
|
|
8
|
+
), u = d, i = (t, e) => {
|
|
9
|
+
const n = `${t}${e}/interfaceauthorized`;
|
|
86
10
|
return fetch(n, {
|
|
87
11
|
method: "GET",
|
|
88
12
|
credentials: "include"
|
|
89
|
-
}).then((
|
|
90
|
-
},
|
|
91
|
-
class B extends R {
|
|
92
|
-
constructor(t) {
|
|
93
|
-
super(t);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
13
|
+
}).then((o) => o.status === 200 && o.ok);
|
|
14
|
+
}, m = i;
|
|
96
15
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
U as destroy,
|
|
106
|
-
k as loadImplementation,
|
|
107
|
-
J as supportBootstrapping,
|
|
108
|
-
z as verifyAuth,
|
|
109
|
-
O as version
|
|
16
|
+
r as DialogItemType,
|
|
17
|
+
h as Humany,
|
|
18
|
+
a as PickerTypes,
|
|
19
|
+
x as Widget,
|
|
20
|
+
A as destroy,
|
|
21
|
+
u as loadImplementation,
|
|
22
|
+
p as supportBootstrapping,
|
|
23
|
+
m as verifyAuth
|
|
110
24
|
};
|
|
111
25
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/bootstrap.ts","../src/data-types.ts","../src/version.ts","../src/humany.ts","../src/implementation.ts","../src/load-implementation.ts","../src/plugin.ts","../src/verify-auth.ts","../src/widget-type.ts"],"sourcesContent":["import { bootstrapImplementation, BootstrappedImplementation } from '@webprovisions/bootstrapping';\nimport { ConfigureCallback, selectImplementations } from '@webprovisions/platform';\nimport Implementation from './implementation';\n\nexport type BootstrapOptions = {\n /**\n * Resolver function for the root element to base the bootstrapping on.\n */\n rootElementResolver?: () => HTMLElement;\n};\n\n/**\n * Bootstraps an `Implementation` by scanning trigger elements and attaches them to\n * their corresponding widgets.\n */\nexport default (\n implementation: Implementation,\n configure: ConfigureCallback,\n options: BootstrapOptions = {}\n): Promise<BootstrappedImplementation> => {\n return bootstrapImplementation(\n implementation as any,\n implementation.bindings,\n () => {\n const runtimeConfigurationHandlers = implementation.container\n .get('$runtimecfg')\n .map((cfgHandlerArgs: any) => {\n const fnOrSelector = cfgHandlerArgs[0];\n if (typeof fnOrSelector === 'function') {\n return fnOrSelector;\n }\n if (selectImplementations(fnOrSelector)(implementation)) {\n return cfgHandlerArgs[1];\n }\n })\n .filter((handler: any) => !!handler);\n return (configure ? [configure] : []).concat(runtimeConfigurationHandlers);\n },\n options.rootElementResolver || (() => document.body)\n );\n};\n","export type Symbol = {\n type: 'Uri' | 'Svg' | 'FontAwesome' | 'Text' | string;\n content: string;\n};\n\nexport type Guide = {\n id: string;\n title: string;\n tags: Tag[];\n published?: string;\n modified?: string;\n publishedBy?: string;\n modifiedBy?: string;\n};\n\nexport type Category = {\n id: string;\n title: string;\n symbol?: Symbol;\n activeSymbol?: Symbol;\n description?: string;\n items?: Category[];\n matches?: number;\n};\n\nexport type Tag = {\n id: string;\n title: string;\n symbol?: Symbol;\n matches?: number;\n defaultIcon?: Symbol;\n activeIcon?: Symbol;\n};\n\nexport enum DialogItemType {\n guide = 'guide',\n link = 'link',\n default = 'default',\n}\n\nexport type DialogItem = {\n id: string;\n title: string;\n parent: Guide;\n type: DialogItemType;\n connection?: string;\n href?: string;\n target?: string;\n};\n\nexport type GuideCategoryBrowserList = {\n id: string;\n title: string;\n symbol?: Symbol;\n guides: Guide[];\n paging: boolean;\n pager?: string;\n};\n\nexport type Notification = {\n id: string;\n title: string;\n body: string;\n modified?: string;\n expandable?: boolean;\n};\n\nexport type NotificationList = {\n id: string;\n title?: string;\n symbol?: Symbol;\n notifications: Notification[];\n defaultHeaderOptions?: {\n visible: boolean;\n };\n};\n\nexport type Tab = {\n title: string;\n name: string;\n aliases: string[];\n};\n\nexport type WidgetEntry = {\n id: string;\n type: string;\n content: {\n open: boolean;\n };\n origin: string;\n};\n\nexport enum PickerTypes {\n MODAL = 'modal',\n DRAWER = 'drawer',\n DROPDOWN = 'dropdown',\n NONE = 'none',\n}\n","export default '#____version____#';\n","import {\n BootstrappedImplementationConfiguration,\n ConfigurationApi as BootstrappingConfigurationApi,\n} from '@webprovisions/bootstrapping';\nimport {\n ConfigurationApiDefinition,\n Environment,\n version as webprovisionsVersion,\n WidgetSelector,\n} from '@webprovisions/platform';\nimport Implementation from './implementation';\nimport version from './version';\n\nexport interface HumanyConfiguration {\n /**\n * Extensions for the configuration API (optional).\n */\n configurationApiExtensions?: ConfigurationApiDefinition[];\n}\n\n/**\n * The Humany widget runtime.\n */\nexport default class Humany extends Environment {\n /**\n * Version of the Humany runtime.\n */\n static version: string = `${version} (${webprovisionsVersion})`;\n\n constructor(name: string, configurationApiExtensions: ConfigurationApiDefinition[] = []) {\n super(name, configurationApiExtensions, {\n transformPluginSettings: (settings, name, container) => {\n const $settings = container.get('$settings');\n const configPluginSettings =\n $settings.plugins && name ? $settings.plugins[name] || {} : {};\n return {\n ...configPluginSettings,\n ...settings,\n };\n },\n });\n }\n\n createImplementation(configuration: BootstrappedImplementationConfiguration): Implementation {\n const implementation = <Implementation>super.createImplementation(configuration);\n implementation.bindings = configuration.bindings;\n return implementation;\n }\n\n /**\n * Performs navigation for widgets matching the specified selector by invoking a\n * 'navigate' command.\n * @param selector Widget selector matching the widget(s) to perform navigation on.\n * @param route Route name.\n * @param params Route params.\n */\n navigate(selector: WidgetSelector, route: string, params: { [key: string]: string }) {\n this.widgets\n .query(selector)\n .forEach((widget) => widget.invoke('navigate', { route, params }));\n }\n\n /**\n * Creates a `Humany` runtime based on provided configuration.\n * @param configuration Runtime configuration.\n */\n static create(configuration: HumanyConfiguration = {}): Humany {\n const configurationApiExtensions = [BootstrappingConfigurationApi].concat(\n (configuration.configurationApiExtensions as any) || []\n );\n return new Humany('humany', configurationApiExtensions as any);\n }\n\n /**\n * Creates a `Humany` runtime based on provided configuration and retains configuration handlers\n * registered on global context. Use this factory to fully support the default embed script.\n * Will return any existing `Humany` runtime if available.\n * @param configuration Runtime configuration.\n * @param global Object to read configuration handlers from (default: window).\n */\n static createFromGlobal(globalHumany: any, configuration: HumanyConfiguration = {}): Humany {\n if (this.isRuntime(globalHumany)) {\n (globalHumany as Humany).patch(configuration);\n return globalHumany;\n }\n\n const runtimeConfiguration: any[] = [];\n\n const tempRuntimeConfiguration = globalHumany && globalHumany._c;\n if (tempRuntimeConfiguration) {\n tempRuntimeConfiguration.forEach((args: any) => runtimeConfiguration.push(args));\n }\n\n const runtime = this.create(configuration);\n runtime.container.register('$runtimecfg', runtimeConfiguration);\n return runtime;\n }\n\n /**\n * Determines whether the specified object is a valid `Humany` runtime.\n * @param obj Object to compare.\n */\n static isRuntime(obj: any): boolean {\n if (\n obj &&\n typeof obj === 'object' &&\n obj.container &&\n typeof obj.container.get === 'function' &&\n obj.container.get('$environment') === obj &&\n obj.container.owner === obj\n ) {\n return true;\n }\n return false;\n }\n}\n","import { Implementation as ImplementationBase } from '@webprovisions/platform';\n\n/**\n * Represents a Humany implementation.\n */\nexport default class Implementation extends ImplementationBase {\n bindings: string[] = [];\n}\n","import { BootstrappedImplementationConfiguration } from '@webprovisions/bootstrapping';\nimport Humany from './humany';\nimport Implementation from './implementation';\n\n/**\n * Loads a Humany implementation by fetching the configuration from the specified URL.\n * @param implementationPath Implementation URL.\n */\nconst loadImplementation = (humany: Humany, url: string): Promise<Implementation> => {\n return fetch(url + '/config.json')\n .then((response) => response.json())\n .then((json) => json.implementation)\n .then((configuration: BootstrappedImplementationConfiguration) =>\n humany.createImplementation(configuration)\n );\n};\nexport default loadImplementation;\n","import { Container, Plugin as PluginBase } from '@webprovisions/platform';\n\n/**\n * Base class for a Humany plugin.\n */\nexport default class Plugin extends PluginBase {\n constructor(container: Container, settings?: any) {\n super(container, settings);\n }\n}\n","const verifyAuth = (host: string, widgetName: string): Promise<boolean> => {\n const url = `${host}${widgetName}/interfaceauthorized`;\n\n return fetch(url, {\n method: 'GET',\n credentials: 'include',\n }).then((response) => response.status === 200 && response.ok);\n};\n\nexport default verifyAuth;\n","import { Container, WidgetType as WidgetTypeBase } from '@webprovisions/platform';\n\n/**\n * Base class for a Humany widget.\n */\nexport default class WidgetType extends WidgetTypeBase {\n constructor(container: Container) {\n super(container);\n }\n}\n"],"names":["bootstrap","implementation","configure","options","bootstrapImplementation","runtimeConfigurationHandlers","cfgHandlerArgs","fnOrSelector","selectImplementations","handler","DialogItemType","PickerTypes","version","_Humany","Environment","name","configurationApiExtensions","settings","container","$settings","configPluginSettings","__spreadValues","configuration","selector","route","params","widget","BootstrappingConfigurationApi","globalHumany","runtimeConfiguration","tempRuntimeConfiguration","args","runtime","obj","Humany","__publicField","webprovisionsVersion","Implementation","ImplementationBase","loadImplementation","humany","url","response","json","loadImplementation$1","Plugin","PluginBase","verifyAuth","host","widgetName","verifyAuth$1","WidgetType","WidgetTypeBase"],"mappings":";;;;;;;;;;;;;;;;;AAeA,MAAeA,IAAA,CACXC,GACAC,GACAC,IAA4B,OAErBC;AAAA,EACHH;AAAA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B,GAAsBD,GAAgB;AAC9C,UAAMC,GAAWD,CAAQ;AAAA,EAC7B;AACJ;ACTA,MAAM8B,IAAa,CAACC,GAAcC,MAAyC;AACjE,QAAAR,IAAM,GAAGO,IAAOC;AAEtB,SAAO,MAAMR,GAAK;AAAA,IACd,QAAQ;AAAA,IACR,aAAa;AAAA,EAAA,CAChB,EAAE,KAAK,CAACC,MAAaA,EAAS,WAAW,OAAOA,EAAS,EAAE;AAChE,GAEAQ,IAAeH;ACJf,MAAqBI,UAAmBC,EAAe;AAAA,EACnD,YAAYlC,GAAsB;AAC9B,UAAMA,CAAS;AAAA,EACnB;AACJ;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/data-types.ts","../src/load-implementation.ts","../src/verify-auth.ts"],"sourcesContent":["export type Symbol = {\n type: 'Uri' | 'Svg' | 'FontAwesome' | 'Text' | string;\n content: string;\n};\n\nexport type Guide = {\n id: string;\n title: string;\n tags: Tag[];\n published?: string;\n modified?: string;\n publishedBy?: string;\n modifiedBy?: string;\n};\n\nexport type Category = {\n id: string;\n title: string;\n symbol?: Symbol;\n activeSymbol?: Symbol;\n description?: string;\n items?: Category[];\n matches?: number;\n};\n\nexport type Tag = {\n id: string;\n title: string;\n symbol?: Symbol;\n matches?: number;\n defaultIcon?: Symbol;\n activeIcon?: Symbol;\n};\n\nexport enum DialogItemType {\n guide = 'guide',\n link = 'link',\n default = 'default',\n}\n\nexport type DialogItem = {\n id: string;\n title: string;\n parent: Guide;\n type: DialogItemType;\n connection?: string;\n href?: string;\n target?: string;\n};\n\nexport type GuideCategoryBrowserList = {\n id: string;\n title: string;\n symbol?: Symbol;\n guides: Guide[];\n paging: boolean;\n pager?: string;\n};\n\nexport type Notification = {\n id: string;\n title: string;\n body: string;\n modified?: string;\n expandable?: boolean;\n};\n\nexport type NotificationList = {\n id: string;\n title?: string;\n symbol?: Symbol;\n notifications: Notification[];\n defaultHeaderOptions?: {\n visible: boolean;\n };\n};\n\nexport type Tab = {\n title: string;\n name: string;\n aliases: string[];\n};\n\nexport type WidgetEntry = {\n id: string;\n type: string;\n content: {\n open: boolean;\n };\n origin: string;\n};\n\nexport enum PickerTypes {\n MODAL = 'modal',\n DRAWER = 'drawer',\n DROPDOWN = 'dropdown',\n NONE = 'none',\n}\n","import { Environment, Implementation } from '@telia-ace/widget-core';\nimport { BootstrappedImplementationConfiguration } from '@webprovisions/bootstrapping';\n\n/**\n * Loads a Humany implementation by fetching the configuration from the specified URL.\n * @param implementationPath Implementation URL.\n */\nconst loadImplementation = (humany: Environment, url: string): Promise<Implementation> => {\n return fetch(url + '/config.json')\n .then((response) => response.json())\n .then((json) => json.implementation)\n .then((configuration: BootstrappedImplementationConfiguration) =>\n humany.createImplementation(configuration)\n );\n};\nexport default loadImplementation;\n","const verifyAuth = (host: string, widgetName: string): Promise<boolean> => {\n const url = `${host}${widgetName}/interfaceauthorized`;\n\n return fetch(url, {\n method: 'GET',\n credentials: 'include',\n }).then((response) => response.status === 200 && response.ok);\n};\n\nexport default verifyAuth;\n"],"names":["DialogItemType","PickerTypes","loadImplementation","humany","url","response","json","configuration","loadImplementation$1","verifyAuth","host","widgetName","verifyAuth$1"],"mappings":";;;;AAkCY,IAAAA,sBAAAA,OACRA,EAAA,QAAQ,SACRA,EAAA,OAAO,QACPA,EAAA,UAAU,WAHFA,IAAAA,KAAA,CAAA,CAAA,GA0DAC,sBAAAA,OACRA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,WAAW,YACXA,EAAA,OAAO,QAJCA,IAAAA,KAAA,CAAA,CAAA;ACrFZ,MAAMC,IAAqB,CAACC,GAAqBC,MACtC,MAAMA,IAAM,cAAc,EAC5B,KAAK,CAACC,MAAaA,EAAS,KAAM,CAAA,EAClC,KAAK,CAACC,MAASA,EAAK,cAAc,EAClC;AAAA,EAAK,CAACC,MACHJ,EAAO,qBAAqBI,CAAa;AAAA,GAGrDC,IAAeN,GCfTO,IAAa,CAACC,GAAcC,MAAyC;AACjE,QAAAP,IAAM,GAAGM,IAAOC;AAEtB,SAAO,MAAMP,GAAK;AAAA,IACd,QAAQ;AAAA,IACR,aAAa;AAAA,EAAA,CAChB,EAAE,KAAK,CAACC,MAAaA,EAAS,WAAW,OAAOA,EAAS,EAAE;AAChE,GAEAO,IAAeH;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Implementation from './implementation';
|
|
1
|
+
import { Environment, Implementation } from '@telia-ace/widget-core';
|
|
3
2
|
/**
|
|
4
3
|
* Loads a Humany implementation by fetching the configuration from the specified URL.
|
|
5
4
|
* @param implementationPath Implementation URL.
|
|
6
5
|
*/
|
|
7
|
-
declare const loadImplementation: (humany:
|
|
6
|
+
declare const loadImplementation: (humany: Environment, url: string) => Promise<Implementation>;
|
|
8
7
|
export default loadImplementation;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-core",
|
|
3
|
-
"version": "1.0.24-next.
|
|
3
|
+
"version": "1.0.24-next.1",
|
|
4
4
|
"description": "Core framework for ACE Knowledge widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@telia-ace/widget-core": "^1.0.
|
|
25
|
-
"@telia-ace/widget-utilities": "^1.0.
|
|
24
|
+
"@telia-ace/widget-core": "^1.0.18-next.1",
|
|
25
|
+
"@telia-ace/widget-utilities": "^1.0.7-next.1",
|
|
26
26
|
"@webprovisions/bootstrapping": "^1.0.12",
|
|
27
27
|
"@webprovisions/platform": "^1.1.2"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"clean": "rimraf ./dist",
|
|
31
|
-
"build": "rimraf ./dist && tsc -emitDeclarationOnly && vite build
|
|
31
|
+
"build": "rimraf ./dist && tsc -emitDeclarationOnly && vite build"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/dist/bootstrap.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BootstrappedImplementation } from '@webprovisions/bootstrapping';
|
|
2
|
-
import { ConfigureCallback } from '@webprovisions/platform';
|
|
3
|
-
import Implementation from './implementation';
|
|
4
|
-
export declare type BootstrapOptions = {
|
|
5
|
-
/**
|
|
6
|
-
* Resolver function for the root element to base the bootstrapping on.
|
|
7
|
-
*/
|
|
8
|
-
rootElementResolver?: () => HTMLElement;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Bootstraps an `Implementation` by scanning trigger elements and attaches them to
|
|
12
|
-
* their corresponding widgets.
|
|
13
|
-
*/
|
|
14
|
-
declare const _default: (implementation: Implementation, configure: ConfigureCallback, options?: BootstrapOptions) => Promise<BootstrappedImplementation>;
|
|
15
|
-
export default _default;
|
package/dist/humany.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { BootstrappedImplementationConfiguration } from '@webprovisions/bootstrapping';
|
|
2
|
-
import { ConfigurationApiDefinition, Environment, WidgetSelector } from '@webprovisions/platform';
|
|
3
|
-
import Implementation from './implementation';
|
|
4
|
-
export interface HumanyConfiguration {
|
|
5
|
-
/**
|
|
6
|
-
* Extensions for the configuration API (optional).
|
|
7
|
-
*/
|
|
8
|
-
configurationApiExtensions?: ConfigurationApiDefinition[];
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* The Humany widget runtime.
|
|
12
|
-
*/
|
|
13
|
-
export default class Humany extends Environment {
|
|
14
|
-
/**
|
|
15
|
-
* Version of the Humany runtime.
|
|
16
|
-
*/
|
|
17
|
-
static version: string;
|
|
18
|
-
constructor(name: string, configurationApiExtensions?: ConfigurationApiDefinition[]);
|
|
19
|
-
createImplementation(configuration: BootstrappedImplementationConfiguration): Implementation;
|
|
20
|
-
/**
|
|
21
|
-
* Performs navigation for widgets matching the specified selector by invoking a
|
|
22
|
-
* 'navigate' command.
|
|
23
|
-
* @param selector Widget selector matching the widget(s) to perform navigation on.
|
|
24
|
-
* @param route Route name.
|
|
25
|
-
* @param params Route params.
|
|
26
|
-
*/
|
|
27
|
-
navigate(selector: WidgetSelector, route: string, params: {
|
|
28
|
-
[key: string]: string;
|
|
29
|
-
}): void;
|
|
30
|
-
/**
|
|
31
|
-
* Creates a `Humany` runtime based on provided configuration.
|
|
32
|
-
* @param configuration Runtime configuration.
|
|
33
|
-
*/
|
|
34
|
-
static create(configuration?: HumanyConfiguration): Humany;
|
|
35
|
-
/**
|
|
36
|
-
* Creates a `Humany` runtime based on provided configuration and retains configuration handlers
|
|
37
|
-
* registered on global context. Use this factory to fully support the default embed script.
|
|
38
|
-
* Will return any existing `Humany` runtime if available.
|
|
39
|
-
* @param configuration Runtime configuration.
|
|
40
|
-
* @param global Object to read configuration handlers from (default: window).
|
|
41
|
-
*/
|
|
42
|
-
static createFromGlobal(globalHumany: any, configuration?: HumanyConfiguration): Humany;
|
|
43
|
-
/**
|
|
44
|
-
* Determines whether the specified object is a valid `Humany` runtime.
|
|
45
|
-
* @param obj Object to compare.
|
|
46
|
-
*/
|
|
47
|
-
static isRuntime(obj: any): boolean;
|
|
48
|
-
}
|
package/dist/implementation.d.ts
DELETED
package/dist/plugin.d.ts
DELETED
package/dist/version.d.ts
DELETED