@telia-ace/knowledge-widget-components-guide 1.0.37 → 1.0.38-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.
- package/dist/answer-version-picker.d.ts +1 -10
- package/dist/categories.d.ts +1 -8
- package/dist/feedback.d.ts +1 -7
- package/dist/functions.d.ts +1 -29
- package/dist/guide-component.d.ts +1 -69
- package/dist/guide.d.ts +1 -7
- package/dist/index.d.ts +1 -2
- package/dist/index.js +2 -134
- package/dist/index.js.map +1 -1
- package/dist/languages.d.ts +1 -17
- package/dist/toolbar.d.ts +1 -8
- package/dist/use-feedback.d.ts +1 -4
- package/package.json +9 -9
- package/dist/guide.35a46def.js +0 -859
- package/dist/guide.35a46def.js.map +0 -1
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { AvailablePerspectives, GuideProps } from './guide-component';
|
|
3
|
-
type Props = {
|
|
4
|
-
className?: string;
|
|
5
|
-
defaultAnswerVersionLabel: string;
|
|
6
|
-
availablePerspectives?: AvailablePerspectives[];
|
|
7
|
-
guide: GuideProps;
|
|
8
|
-
};
|
|
9
|
-
declare const AnswerVersionPicker: React.FC<Props>;
|
|
10
|
-
export default AnswerVersionPicker;
|
|
1
|
+
export declare const x: {};
|
package/dist/categories.d.ts
CHANGED
package/dist/feedback.d.ts
CHANGED
package/dist/functions.d.ts
CHANGED
|
@@ -1,29 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { DispatchAction } from '@telia-ace/knowledge-widget-ui';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { GuideProps } from './guide-component';
|
|
5
|
-
export type FunctionListItem = {
|
|
6
|
-
type: string;
|
|
7
|
-
child: React.ReactNode;
|
|
8
|
-
};
|
|
9
|
-
type Props = {
|
|
10
|
-
header?: string;
|
|
11
|
-
tooltip?: string;
|
|
12
|
-
printActionLabel?: string;
|
|
13
|
-
copyActionLabel?: string;
|
|
14
|
-
addFavoriteTooltip?: string;
|
|
15
|
-
removeFavoriteCancelLabel?: string;
|
|
16
|
-
removeFavoriteConfirmLabel?: string;
|
|
17
|
-
removeFavoriteHeader?: string;
|
|
18
|
-
removeFavoriteLabel?: string;
|
|
19
|
-
removeFavoriteTooltip?: string;
|
|
20
|
-
toolbarFunctionsCloseButtonAriaLabel?: string;
|
|
21
|
-
guide: GuideProps;
|
|
22
|
-
allowCopy?: boolean;
|
|
23
|
-
allowPrint?: boolean;
|
|
24
|
-
showFavoriteToggle?: boolean;
|
|
25
|
-
picker?: PickerTypes;
|
|
26
|
-
dispatch: DispatchAction;
|
|
27
|
-
};
|
|
28
|
-
declare const Functions: React.FC<Props>;
|
|
29
|
-
export default Functions;
|
|
1
|
+
export declare const x: {};
|
|
@@ -1,69 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { FavoriteProperties, LanguageProperties, MetaDataProperties } from '@telia-ace/knowledge-widget-component-utilities';
|
|
3
|
-
import { DialogItem, PickerTypes } from '@telia-ace/knowledge-widget-core';
|
|
4
|
-
import { DataError } from '@telia-ace/knowledge-widget-types-grid';
|
|
5
|
-
import { FormComponentInstanceProperties } from '@telia-ace/widget-forms';
|
|
6
|
-
import { Container } from '@webprovisions/platform';
|
|
7
|
-
export type GuideProps = {
|
|
8
|
-
id: string;
|
|
9
|
-
title: string;
|
|
10
|
-
body: string;
|
|
11
|
-
connection: string;
|
|
12
|
-
categories: number[];
|
|
13
|
-
hasHandover: boolean;
|
|
14
|
-
allowFeedback: boolean;
|
|
15
|
-
perspectives: {
|
|
16
|
-
[key: string]: string;
|
|
17
|
-
};
|
|
18
|
-
translations?: {
|
|
19
|
-
[key: string]: string;
|
|
20
|
-
};
|
|
21
|
-
modified?: string;
|
|
22
|
-
published?: string;
|
|
23
|
-
publishedBy?: string | null;
|
|
24
|
-
modifiedBy?: string | null;
|
|
25
|
-
perspective: string | null;
|
|
26
|
-
};
|
|
27
|
-
export type AvailablePerspectives = {
|
|
28
|
-
name: string;
|
|
29
|
-
title: string;
|
|
30
|
-
};
|
|
31
|
-
export type GuideComponentProps = {
|
|
32
|
-
showHeader?: boolean;
|
|
33
|
-
showFeedback?: boolean;
|
|
34
|
-
feedbackDirection?: 'horizontal' | 'vertical';
|
|
35
|
-
feedbackGiven?: 'positive' | 'negative';
|
|
36
|
-
contactMethods?: ContactMethodType[];
|
|
37
|
-
handoverContactMethods?: ContactMethodType[];
|
|
38
|
-
showAnswerVersions?: boolean;
|
|
39
|
-
feedbackHeader?: string;
|
|
40
|
-
contactHeader?: string;
|
|
41
|
-
toolbarFunctionsHeader?: string;
|
|
42
|
-
toolbarLanguageHeader?: string;
|
|
43
|
-
positiveFeedbackLabel?: string;
|
|
44
|
-
negativeFeedbackLabel?: string;
|
|
45
|
-
contactFeedbackLabel?: string;
|
|
46
|
-
feedbackRecognitionLabel?: string;
|
|
47
|
-
defaultAnswerVersionLabel?: string;
|
|
48
|
-
backButtonLabel?: string;
|
|
49
|
-
toolbarFunctionsTooltip?: string;
|
|
50
|
-
toolbarFunctionsCloseButtonAriaLabel?: string;
|
|
51
|
-
copyActionLabel?: string;
|
|
52
|
-
printActionLabel?: string;
|
|
53
|
-
toolbarLanguageTooltip?: string;
|
|
54
|
-
toolbar?: ToolbarProps;
|
|
55
|
-
guide?: GuideProps;
|
|
56
|
-
dialog?: DialogItem[];
|
|
57
|
-
error?: DataError;
|
|
58
|
-
availablePerspectives?: AvailablePerspectives[];
|
|
59
|
-
} & FormComponentInstanceProperties & FavoriteProperties & MetaDataProperties & LanguageProperties;
|
|
60
|
-
export type ToolbarProps = {
|
|
61
|
-
language?: boolean;
|
|
62
|
-
guideCategories?: boolean;
|
|
63
|
-
allowCopy?: boolean;
|
|
64
|
-
allowPrint?: boolean;
|
|
65
|
-
showFavoriteToggle?: boolean;
|
|
66
|
-
picker?: PickerTypes;
|
|
67
|
-
};
|
|
68
|
-
export declare const GuideComponent: (container: Container) => Promise<void>;
|
|
69
|
-
export default GuideComponent;
|
|
1
|
+
export declare const x: {};
|
package/dist/guide.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default GuideComponent;
|
|
1
|
+
export declare const x: {};
|
package/dist/index.js
CHANGED
|
@@ -1,137 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
var $ = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var b = Object.getOwnPropertySymbols;
|
|
4
|
-
var x = Object.prototype.hasOwnProperty, M = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var v = (t, e, i) => e in t ? C(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, u = (t, e) => {
|
|
6
|
-
for (var i in e || (e = {}))
|
|
7
|
-
x.call(e, i) && v(t, i, e[i]);
|
|
8
|
-
if (b)
|
|
9
|
-
for (var i of b(e))
|
|
10
|
-
M.call(e, i) && v(t, i, e[i]);
|
|
11
|
-
return t;
|
|
12
|
-
}, h = (t, e) => T(t, $(e));
|
|
13
|
-
import { updateForm as y, useForm as B, useExpand as F } from "@telia-ace/knowledge-widget-component-utilities";
|
|
14
|
-
import { createEventSubscriber as G, extendComponent as H } from "@telia-ace/knowledge-widget-core";
|
|
15
|
-
import { FeedbackType as f, DataType as k } from "@telia-ace/knowledge-widget-types-grid";
|
|
16
|
-
import { createReactComponent as P } from "@telia-ace/knowledge-widget-ui";
|
|
17
|
-
import * as w from "clipboard-polyfill";
|
|
18
|
-
const A = (t, e) => {
|
|
19
|
-
e.actions.create("feedback", (i) => {
|
|
20
|
-
const d = i === "negative" ? f.Negative : f.Positive, { guide: a, submitButtonLabel: s = "Submit" } = e.properties();
|
|
21
|
-
if (a) {
|
|
22
|
-
const { connection: r, id: n, hasHandover: c } = a;
|
|
23
|
-
e.writeProperties({
|
|
24
|
-
feedbackGiven: i,
|
|
25
|
-
loading: c && d === f.Negative
|
|
26
|
-
});
|
|
27
|
-
const { events: o } = t.get("$widget");
|
|
28
|
-
return o.dispatch("tracking:feedback-given", {
|
|
29
|
-
guide: a,
|
|
30
|
-
categories: a.categories,
|
|
31
|
-
feedbackType: d.toLowerCase()
|
|
32
|
-
}), t.getAsync("dataClient").then((g) => g.feedback(n, r, d).then(() => {
|
|
33
|
-
if (c && d === f.Negative)
|
|
34
|
-
return g.fetch(k.ContactMethods, { guideId: n }).then(({ contactMethods: p }) => e.actions.dispatch("handover", {
|
|
35
|
-
handoverContactMethods: p.map((m) => h(u({}, m), {
|
|
36
|
-
body: y(m, {
|
|
37
|
-
submit: s
|
|
38
|
-
})
|
|
39
|
-
})),
|
|
40
|
-
loading: !1
|
|
41
|
-
}));
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
}), e.actions.create("handover", (i) => e.writeProperties(h(u({}, i), { loading: !1 })));
|
|
45
|
-
}, E = ({ title: t, body: e }) => {
|
|
46
|
-
let i = "";
|
|
47
|
-
t && t.length && (i = t.trim()), e && e.length && (i = `${i.trim()}
|
|
48
|
-
${e.trim()}`);
|
|
49
|
-
const d = document.createElement("div");
|
|
50
|
-
d.innerHTML = i;
|
|
51
|
-
const a = Array.from(d.getElementsByTagName("a"));
|
|
52
|
-
let s = d.innerText;
|
|
53
|
-
return a.forEach((r) => {
|
|
54
|
-
s = s.replace(r.innerText, `[${r.href}] (${r.innerText})`);
|
|
55
|
-
}), s;
|
|
56
|
-
}, L = ({ title: t, body: e }) => {
|
|
57
|
-
let i = "";
|
|
58
|
-
return t && t.length && (i = `<h2>${t.trim()}</h2>`), e && e.length && (i = `${i.trim()}${e.trim()}`), i.trim();
|
|
59
|
-
}, D = (t) => {
|
|
60
|
-
const { events: e } = t.get("$widget"), [i, d] = G(e);
|
|
61
|
-
return P(t, "guide", import("./guide.35a46def.js"), (a) => {
|
|
62
|
-
const s = (r) => {
|
|
63
|
-
a.writeProperties({
|
|
64
|
-
loading: !0,
|
|
65
|
-
error: void 0,
|
|
66
|
-
guide: void 0
|
|
67
|
-
}), a.actions.dispatch("fetch", { params: r });
|
|
68
|
-
};
|
|
69
|
-
a.actions.create("copy", (r) => {
|
|
70
|
-
const n = new w.ClipboardItem({
|
|
71
|
-
"text/html": new Blob([L(r)], { type: "text/html" }),
|
|
72
|
-
"text/plain": new Blob([E(r)], { type: "text/plain" })
|
|
73
|
-
});
|
|
74
|
-
return w.write([n]).then(() => {
|
|
75
|
-
e.dispatch("widget:menu-toggled", null);
|
|
76
|
-
});
|
|
77
|
-
}), a.actions.create("print", () => {
|
|
78
|
-
const r = document.querySelector(".humany-guide .humany-paragraph"), n = window.open("", "", "height=500, width=500");
|
|
79
|
-
e.dispatch("widget:menu-toggled", null), r && n && (n.document.write(`<html><body>${r.innerHTML}</body></html>`), n.document.close(), n.print());
|
|
80
|
-
}), a.actions.create("back", (r, n) => {
|
|
81
|
-
if (!n.preventDefault)
|
|
82
|
-
return t.getAsync("router").then((c) => {
|
|
83
|
-
c.goBack();
|
|
84
|
-
});
|
|
85
|
-
}), a.actions.create(
|
|
86
|
-
"fetch",
|
|
87
|
-
({ contactMethods: r = [], dialog: n = [], guide: c, error: o }) => {
|
|
88
|
-
if (o)
|
|
89
|
-
return a.actions.dispatch("fetched", {
|
|
90
|
-
error: o,
|
|
91
|
-
guide: void 0,
|
|
92
|
-
contactMethods: [],
|
|
93
|
-
feedbackGiven: void 0,
|
|
94
|
-
handoverContactMethods: [],
|
|
95
|
-
showFeedback: !1,
|
|
96
|
-
loading: !0
|
|
97
|
-
});
|
|
98
|
-
const { showFeedback: g = !0, submitButtonLabel: p = "Submit" } = a.properties(), m = {
|
|
99
|
-
showFeedback: g,
|
|
100
|
-
dialog: n,
|
|
101
|
-
guide: c,
|
|
102
|
-
feedbackGiven: void 0,
|
|
103
|
-
handoverContactMethods: [],
|
|
104
|
-
contactMethods: r.map((l) => h(u({}, l), {
|
|
105
|
-
body: y(l, { submit: p })
|
|
106
|
-
}))
|
|
107
|
-
};
|
|
108
|
-
return a.actions.dispatch("fetched", h(u({}, m), {
|
|
109
|
-
loading: !0
|
|
110
|
-
}));
|
|
111
|
-
}
|
|
112
|
-
), a.actions.create("fetched", (r) => a.writeProperties(h(u({}, r), { loading: !1 }))), t.getAsync("router").then((r) => {
|
|
113
|
-
const { params: n } = r.getRouteData();
|
|
114
|
-
s(n);
|
|
115
|
-
}), i("router:changed", (r, { current: n }) => {
|
|
116
|
-
s(n.routeData.params);
|
|
117
|
-
}), A(t, a), B(t, a), F(a);
|
|
118
|
-
}).then(() => H(t, "guide", (a) => {
|
|
119
|
-
a.actions.watch("guide.fetch", (s, r) => {
|
|
120
|
-
const {
|
|
121
|
-
params: { guide: n, connection: c }
|
|
122
|
-
} = s;
|
|
123
|
-
return n ? t.getAsync("dataClient").then(
|
|
124
|
-
(o) => o.fetch(k.Guide, { connection: c, guideId: n })
|
|
125
|
-
).then(r).catch((o) => {
|
|
126
|
-
if (o)
|
|
127
|
-
return r(o);
|
|
128
|
-
}) : r(s);
|
|
129
|
-
});
|
|
130
|
-
})).then(() => {
|
|
131
|
-
d();
|
|
132
|
-
});
|
|
133
|
-
}, j = D;
|
|
1
|
+
const o = {};
|
|
134
2
|
export {
|
|
135
|
-
|
|
3
|
+
o as x
|
|
136
4
|
};
|
|
137
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/use-feedback.ts","../src/guide-component.ts"],"sourcesContent":["import { updateForm } from '@telia-ace/knowledge-widget-component-utilities';\nimport { ComponentNodeController } from '@telia-ace/knowledge-widget-core';\nimport {\n ContactsResult,\n DataClient,\n DataType,\n FeedbackType,\n} from '@telia-ace/knowledge-widget-types-grid';\nimport { Container } from '@webprovisions/platform';\nimport { GuideComponentProps } from './guide-component';\n\nexport default (container: Container, controller: ComponentNodeController) => {\n controller.actions.create('feedback', (input: 'negative' | 'positive') => {\n const type = input === 'negative' ? FeedbackType.Negative : FeedbackType.Positive;\n const { guide, submitButtonLabel = 'Submit' } =\n controller.properties<GuideComponentProps>();\n if (guide) {\n const { connection, id, hasHandover } = guide;\n controller.writeProperties({\n feedbackGiven: input,\n loading: hasHandover && type === FeedbackType.Negative,\n });\n\n const { events } = container.get('$widget');\n events.dispatch('tracking:feedback-given', {\n guide,\n categories: guide.categories,\n feedbackType: type.toLowerCase(),\n });\n\n return container.getAsync('dataClient').then((dataClient: DataClient) => {\n return dataClient.feedback(id, connection, type).then(() => {\n if (hasHandover && type === FeedbackType.Negative) {\n return dataClient\n .fetch(DataType.ContactMethods, { guideId: id })\n .then(({ contactMethods }: ContactsResult) => {\n return controller.actions.dispatch('handover', {\n handoverContactMethods: contactMethods.map((cm) => ({\n ...cm,\n body: updateForm(cm, {\n submit: submitButtonLabel,\n }),\n })),\n loading: false,\n });\n });\n }\n });\n });\n }\n });\n\n controller.actions.create('handover', (input) => {\n return controller.writeProperties({ ...input, loading: false });\n });\n};\n","import { ContactMethodType } from '@telia-ace/knowledge-widget-adapters';\nimport {\n FavoriteProperties,\n LanguageProperties,\n MetaDataProperties,\n updateForm,\n useExpand,\n useForm,\n} from '@telia-ace/knowledge-widget-component-utilities';\nimport {\n createEventSubscriber,\n DialogItem,\n extendComponent,\n PickerTypes,\n} from '@telia-ace/knowledge-widget-core';\nimport {\n DataClient,\n DataError,\n DataType,\n GuideResult,\n} from '@telia-ace/knowledge-widget-types-grid';\nimport { createReactComponent } from '@telia-ace/knowledge-widget-ui';\nimport { FormComponentInstanceProperties } from '@telia-ace/widget-forms';\nimport { RoutingService } from '@telia-ace/widget-routing';\nimport { Container, EventManager } from '@webprovisions/platform';\nimport * as clipboard from 'clipboard-polyfill';\nimport useFeedback from './use-feedback';\n\nexport type GuideProps = {\n id: string;\n title: string;\n body: string;\n connection: string;\n categories: number[];\n hasHandover: boolean;\n allowFeedback: boolean;\n perspectives: { [key: string]: string };\n translations?: { [key: string]: string };\n modified?: string;\n published?: string;\n publishedBy?: string | null;\n modifiedBy?: string | null;\n perspective: string | null;\n};\n\nexport type AvailablePerspectives = {\n name: string;\n title: string;\n};\n\nexport type GuideComponentProps = {\n showHeader?: boolean;\n showFeedback?: boolean;\n feedbackDirection?: 'horizontal' | 'vertical';\n feedbackGiven?: 'positive' | 'negative'; // internal\n contactMethods?: ContactMethodType[]; // internal\n handoverContactMethods?: ContactMethodType[]; // internal\n showAnswerVersions?: boolean;\n feedbackHeader?: string;\n contactHeader?: string;\n toolbarFunctionsHeader?: string;\n toolbarLanguageHeader?: string;\n positiveFeedbackLabel?: string;\n negativeFeedbackLabel?: string;\n contactFeedbackLabel?: string;\n feedbackRecognitionLabel?: string;\n defaultAnswerVersionLabel?: string;\n backButtonLabel?: string;\n toolbarFunctionsTooltip?: string;\n toolbarFunctionsCloseButtonAriaLabel?: string;\n copyActionLabel?: string;\n printActionLabel?: string;\n toolbarLanguageTooltip?: string;\n toolbar?: ToolbarProps;\n guide?: GuideProps; // internal\n dialog?: DialogItem[]; // internal\n error?: DataError; // internal\n availablePerspectives?: AvailablePerspectives[]; // internal\n} & FormComponentInstanceProperties &\n FavoriteProperties &\n MetaDataProperties &\n LanguageProperties;\n\nexport type ToolbarProps = {\n language?: boolean;\n guideCategories?: boolean;\n allowCopy?: boolean;\n allowPrint?: boolean;\n showFavoriteToggle?: boolean;\n picker?: PickerTypes;\n};\n\nconst buildPlainText = ({ title, body }: GuideProps): string => {\n let processedHtml = '';\n\n if (title && title.length) {\n processedHtml = title.trim();\n }\n\n if (body && body.length) {\n processedHtml = `${processedHtml.trim()}\\n${body.trim()}`;\n }\n\n const div = document.createElement('div');\n div.innerHTML = processedHtml;\n const links: HTMLAnchorElement[] = Array.from(div.getElementsByTagName('a'));\n\n let plainText = div.innerText;\n\n links.forEach((a) => {\n plainText = plainText.replace(a.innerText, `[${a.href}] (${a.innerText})`);\n });\n\n return plainText;\n};\n\nconst buildHtml = ({ title, body }: GuideProps): string => {\n let processedHtml = '';\n\n if (title && title.length) {\n processedHtml = `<h2>${title.trim()}</h2>`;\n }\n\n if (body && body.length) {\n processedHtml = `${processedHtml.trim()}${body.trim()}`;\n }\n\n return processedHtml.trim();\n};\n\nexport const GuideComponent = (container: Container) => {\n const { events }: { events: EventManager } = container.get('$widget');\n const [subscribe, unsubscribe] = createEventSubscriber(events);\n\n return createReactComponent(container, 'guide', import('./guide'), (component) => {\n const fetch = (params: { [key: string]: any }) => {\n component.writeProperties({\n loading: true,\n error: undefined,\n guide: undefined,\n });\n component.actions.dispatch('fetch', { params });\n };\n\n component.actions.create('copy', (guide: GuideProps) => {\n const item = new clipboard.ClipboardItem({\n 'text/html': new Blob([buildHtml(guide)], { type: 'text/html' }),\n 'text/plain': new Blob([buildPlainText(guide)], { type: 'text/plain' }),\n });\n\n return clipboard.write([item]).then(() => {\n events.dispatch('widget:menu-toggled', null);\n });\n });\n\n component.actions.create('print', () => {\n const elem = document.querySelector('.humany-guide .humany-paragraph');\n const a = window.open('', '', 'height=500, width=500');\n\n events.dispatch('widget:menu-toggled', null);\n if (elem && a) {\n a.document.write(`<html><body>${elem.innerHTML}</body></html>`);\n a.document.close();\n a.print();\n }\n });\n\n component.actions.create('back', (data, options) => {\n if (options.preventDefault) {\n return;\n }\n\n return container.getAsync('router').then((router: RoutingService) => {\n router.goBack();\n });\n });\n\n component.actions.create(\n 'fetch',\n ({ contactMethods = [], dialog = [], guide, error }: GuideResult) => {\n if (error) {\n return component.actions.dispatch('fetched', {\n error,\n guide: undefined,\n contactMethods: [],\n feedbackGiven: undefined,\n handoverContactMethods: [],\n showFeedback: false,\n loading: true,\n });\n }\n const { showFeedback = true, submitButtonLabel = 'Submit' } =\n component.properties<GuideComponentProps>();\n\n const properties: GuideComponentProps = {\n showFeedback,\n dialog,\n guide,\n feedbackGiven: undefined,\n handoverContactMethods: [],\n contactMethods: contactMethods.map((cm) => ({\n ...cm,\n body: updateForm(cm, { submit: submitButtonLabel }),\n })),\n };\n\n return component.actions.dispatch('fetched', {\n ...properties,\n loading: true,\n });\n }\n );\n\n component.actions.create('fetched', (input) => {\n return component.writeProperties({ ...input, loading: false });\n });\n\n container.getAsync('router').then((router) => {\n const { params } = router.getRouteData();\n fetch(params);\n });\n\n subscribe('router:changed', (event: any, { current }: any) => {\n fetch(current.routeData.params);\n });\n\n useFeedback(container, component);\n useForm(container, component);\n useExpand(component);\n })\n .then(() => {\n return extendComponent(container, 'guide', (component) => {\n component.actions.watch('guide.fetch', (input, next) => {\n const {\n params: { guide, connection },\n } = input;\n\n if (guide) {\n return container\n .getAsync('dataClient')\n .then((dataClient: DataClient) =>\n dataClient.fetch(DataType.Guide, { connection, guideId: guide })\n )\n .then(next)\n .catch((error) => {\n if (error) {\n return next(error);\n }\n });\n }\n\n return next(input);\n });\n });\n })\n .then(() => {\n unsubscribe();\n });\n};\n\nexport default GuideComponent;\n"],"names":["useFeedback","container","controller","input","type","FeedbackType","guide","submitButtonLabel","connection","id","hasHandover","events","dataClient","DataType","contactMethods","cm","__spreadProps","__spreadValues","updateForm","buildPlainText","title","body","processedHtml","div","links","plainText","a","buildHtml","GuideComponent","subscribe","unsubscribe","createEventSubscriber","createReactComponent","component","fetch","params","item","clipboard","elem","data","options","router","dialog","error","showFeedback","properties","event","current","useForm","useExpand","extendComponent","next","GuideComponent$1"],"mappings":";;;;;;;;;;;;;;;;;AAWA,MAAAA,IAAe,CAACC,GAAsBC,MAAwC;AAC1E,EAAAA,EAAW,QAAQ,OAAO,YAAY,CAACC,MAAmC;AACtE,UAAMC,IAAOD,MAAU,aAAaE,EAAa,WAAWA,EAAa,UACnE,EAAE,OAAAC,GAAO,mBAAAC,IAAoB,SAAS,IACxCL,EAAW;AACf,QAAII,GAAO;AACP,YAAM,EAAE,YAAAE,GAAY,IAAAC,GAAI,aAAAC,EAAA,IAAgBJ;AACxC,MAAAJ,EAAW,gBAAgB;AAAA,QACvB,eAAeC;AAAA,QACf,SAASO,KAAeN,MAASC,EAAa;AAAA,MAAA,CACjD;AAED,YAAM,EAAE,QAAAM,EAAW,IAAAV,EAAU,IAAI,SAAS;AAC1C,aAAAU,EAAO,SAAS,2BAA2B;AAAA,QACvC,OAAAL;AAAA,QACA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wC,MAAW;AAC1C,YAAM,EAAE,QAAAN,EAAA,IAAWM,EAAO,aAAa;AACvC,MAAAP,EAAMC,CAAM;AAAA,IAAA,CACf,GAEDN,EAAU,kBAAkB,CAACiB,GAAY,EAAE,SAAAC,QAAmB;AACpD,MAAAb,EAAAa,EAAQ,UAAU,MAAM;AAAA,IAAA,CACjC,GAED/C,EAAYC,GAAWgC,CAAS,GAChCe,EAAQ/C,GAAWgC,CAAS,GAC5BgB,EAAUhB,CAAS;AAAA,EAAA,CACtB,EACI,KAAK,MACKiB,EAAgBjD,GAAW,SAAS,CAACgC,MAAc;AACtD,IAAAA,EAAU,QAAQ,MAAM,eAAe,CAAC9B,GAAOgD,MAAS;AAC9C,YAAA;AAAA,QACF,QAAQ,EAAE,OAAA7C,GAAO,YAAAE,EAAW;AAAA,MAC5B,IAAAL;AAEJ,aAAIG,IACOL,EACF,SAAS,YAAY,EACrB;AAAA,QAAK,CAACW,MACHA,EAAW,MAAMC,EAAS,OAAO,EAAE,YAAAL,GAAY,SAASF,GAAO;AAAA,QAElE,KAAK6C,CAAI,EACT,MAAM,CAACR,MAAU;AACd,YAAIA;AACA,iBAAOQ,EAAKR,CAAK;AAAA,MACrB,CACH,IAGFQ,EAAKhD,CAAK;AAAA,IAAA,CACpB;AAAA,EAAA,CACJ,CACJ,EACA,KAAK,MAAM;AACI,IAAA2B;EAAA,CACf;AACT,GAEAsB,IAAexB;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["// import GuideComponent from './guide-component';\n\n// export default GuideComponent;\nexport const x = {};\n"],"names":["x"],"mappings":"AAGO,MAAMA,IAAI,CAAA;"}
|
package/dist/languages.d.ts
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { PickerTypes } from '@telia-ace/knowledge-widget-core';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { GuideProps } from './guide-component';
|
|
5
|
-
export type LanguageListItem = {
|
|
6
|
-
id: string;
|
|
7
|
-
key: string;
|
|
8
|
-
label: string;
|
|
9
|
-
};
|
|
10
|
-
type Props = Merge<{
|
|
11
|
-
header?: string;
|
|
12
|
-
tooltip?: string;
|
|
13
|
-
guide: GuideProps;
|
|
14
|
-
picker?: PickerTypes;
|
|
15
|
-
}, LanguageProperties>;
|
|
16
|
-
declare const Languages: React.FC<Props>;
|
|
17
|
-
export default Languages;
|
|
1
|
+
export declare const x: {};
|
package/dist/toolbar.d.ts
CHANGED
package/dist/use-feedback.d.ts
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Container } from '@webprovisions/platform';
|
|
3
|
-
declare const _default: (container: Container, controller: ComponentNodeController) => void;
|
|
4
|
-
export default _default;
|
|
1
|
+
export declare const x: {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-guide",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38-experimental.1",
|
|
4
4
|
"description": "Guide component for ACE Knowledge Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@telia-ace/knowledge-widget-adapters": "
|
|
25
|
-
"@telia-ace/knowledge-widget-component-utilities": "
|
|
26
|
-
"@telia-ace/knowledge-widget-core": "
|
|
27
|
-
"@telia-ace/knowledge-widget-types-grid": "
|
|
28
|
-
"@telia-ace/knowledge-widget-ui": "
|
|
29
|
-
"@telia-ace/widget-forms": "^1.0.
|
|
30
|
-
"@telia-ace/widget-routing": "^1.0.
|
|
31
|
-
"@telia-ace/widget-utilities": "^1.0.
|
|
24
|
+
"@telia-ace/knowledge-widget-adapters": "1.0.44-experimental.1",
|
|
25
|
+
"@telia-ace/knowledge-widget-component-utilities": "1.0.38-experimental.1",
|
|
26
|
+
"@telia-ace/knowledge-widget-core": "1.0.34-experimental.1",
|
|
27
|
+
"@telia-ace/knowledge-widget-types-grid": "1.0.45-experimental.1",
|
|
28
|
+
"@telia-ace/knowledge-widget-ui": "1.0.40-experimental.1",
|
|
29
|
+
"@telia-ace/widget-forms": "^1.0.28-experimental.13",
|
|
30
|
+
"@telia-ace/widget-routing": "^1.0.22-experimental.13",
|
|
31
|
+
"@telia-ace/widget-utilities": "^1.0.10-experimental.13",
|
|
32
32
|
"@webprovisions/platform": "^1.1.2",
|
|
33
33
|
"clipboard-polyfill": "4.0.0-rc1"
|
|
34
34
|
},
|