@voiceflow/utils-designer 1.59.51 → 1.60.0
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/build/cjs/widget.util.d.ts +4 -86
- package/build/cjs/widget.util.d.ts.map +1 -1
- package/build/cjs/widget.util.js +39 -21
- package/build/cjs/widget.util.js.map +1 -1
- package/build/esm/widget.util.d.ts +4 -86
- package/build/esm/widget.util.d.ts.map +1 -1
- package/build/esm/widget.util.js +37 -19
- package/build/esm/widget.util.js.map +1 -1
- package/package.json +3 -3
@@ -1,88 +1,6 @@
|
|
1
1
|
import type { WidgetSettings } from '@voiceflow/dtos-interact';
|
2
|
-
export declare const
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
footerLink: {
|
7
|
-
enabled: true;
|
8
|
-
};
|
9
|
-
primaryColor: {
|
10
|
-
palette: {
|
11
|
-
50: string;
|
12
|
-
100: string;
|
13
|
-
200: string;
|
14
|
-
300: string;
|
15
|
-
400: string;
|
16
|
-
500: string;
|
17
|
-
600: string;
|
18
|
-
700: string;
|
19
|
-
800: string;
|
20
|
-
900: string;
|
21
|
-
};
|
22
|
-
color: string;
|
23
|
-
};
|
24
|
-
sideSpacing: string;
|
25
|
-
bottomSpacing: string;
|
26
|
-
position: "right" | "left";
|
27
|
-
launcher: {
|
28
|
-
type: "label" | "icon" | "both";
|
29
|
-
text?: string | undefined;
|
30
|
-
imageURL?: string | null | undefined;
|
31
|
-
};
|
32
|
-
persistence: string;
|
33
|
-
};
|
34
|
-
chat: {
|
35
|
-
disclaimer: {
|
36
|
-
enabled: false;
|
37
|
-
title: string;
|
38
|
-
description: string;
|
39
|
-
primaryButtonText: string;
|
40
|
-
secondaryButtonText: string;
|
41
|
-
secondaryButtonURL: string;
|
42
|
-
};
|
43
|
-
aiDisclaimer: {
|
44
|
-
enabled: true;
|
45
|
-
text: string;
|
46
|
-
};
|
47
|
-
placeholderText: string;
|
48
|
-
voiceInput: boolean;
|
49
|
-
voiceOutput: boolean;
|
50
|
-
renderMode: "embed" | "widget" | "popover";
|
51
|
-
headerImage: {
|
52
|
-
enabled: boolean;
|
53
|
-
url?: string | null | undefined;
|
54
|
-
};
|
55
|
-
agentImage: {
|
56
|
-
enabled: boolean;
|
57
|
-
url?: string | null | undefined;
|
58
|
-
};
|
59
|
-
banner: {
|
60
|
-
title: string;
|
61
|
-
description: string;
|
62
|
-
enabled: boolean;
|
63
|
-
imageURL?: string | null | undefined;
|
64
|
-
};
|
65
|
-
handoffToAgentImageURL?: string | null | undefined;
|
66
|
-
streamingDisabled?: boolean | undefined;
|
67
|
-
};
|
68
|
-
type: "voice" | "chat";
|
69
|
-
voice: {
|
70
|
-
content: {
|
71
|
-
talkingText: string;
|
72
|
-
endButtonText: string;
|
73
|
-
listeningText: string;
|
74
|
-
startButtonText: string;
|
75
|
-
callToActionText: string;
|
76
|
-
imageURL?: string | null | undefined;
|
77
|
-
};
|
78
|
-
renderMode: "full" | "compact" | "expand";
|
79
|
-
};
|
80
|
-
security?: {
|
81
|
-
approvedDomains: {
|
82
|
-
enabled: boolean;
|
83
|
-
domains: string;
|
84
|
-
};
|
85
|
-
disableTranscript: boolean;
|
86
|
-
} | undefined;
|
87
|
-
};
|
2
|
+
export declare const applyWidgetFeatureRestrictions: (widgetSettings: WidgetSettings, { webchatPremiumEnabled, securitySettingsEnabled, }: {
|
3
|
+
webchatPremiumEnabled: boolean;
|
4
|
+
securitySettingsEnabled: boolean;
|
5
|
+
}) => WidgetSettings;
|
88
6
|
//# sourceMappingURL=widget.util.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"widget.util.d.ts","sourceRoot":"","sources":["../../src/widget.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAK/D,eAAO,MAAM,
|
1
|
+
{"version":3,"file":"widget.util.d.ts","sourceRoot":"","sources":["../../src/widget.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAK/D,eAAO,MAAM,8BAA8B,mBACzB,cAAc,uDAI3B;IAAE,qBAAqB,EAAE,OAAO,CAAC;IAAC,uBAAuB,EAAE,OAAO,CAAA;CAAE,KACtE,cAuCF,CAAC"}
|
package/build/cjs/widget.util.js
CHANGED
@@ -1,26 +1,44 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.applyWidgetFeatureRestrictions = void 0;
|
4
4
|
const dtos_interact_1 = require("@voiceflow/dtos-interact");
|
5
5
|
const color_util_1 = require("./color.util");
|
6
|
-
const
|
7
|
-
...widgetSettings
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
6
|
+
const applyWidgetFeatureRestrictions = (widgetSettings, { webchatPremiumEnabled, securitySettingsEnabled, }) => {
|
7
|
+
let nextWidgetSettings = { ...widgetSettings };
|
8
|
+
if (!webchatPremiumEnabled) {
|
9
|
+
nextWidgetSettings = {
|
10
|
+
...nextWidgetSettings,
|
11
|
+
common: {
|
12
|
+
...nextWidgetSettings.common,
|
13
|
+
poweredBy: dtos_interact_1.WIDGET_SETTINGS_DEFAULT_SETTINGS.common.poweredBy,
|
14
|
+
fontFamily: dtos_interact_1.WIDGET_SETTINGS_DEFAULT_SETTINGS.common.fontFamily,
|
15
|
+
footerLink: dtos_interact_1.WIDGET_SETTINGS_DEFAULT_SETTINGS.common.footerLink,
|
16
|
+
primaryColor: {
|
17
|
+
...nextWidgetSettings.common.primaryColor,
|
18
|
+
palette: (0, color_util_1.colorCreatePalette)(nextWidgetSettings.common.primaryColor.color),
|
19
|
+
},
|
20
|
+
},
|
21
|
+
chat: {
|
22
|
+
...nextWidgetSettings.chat,
|
23
|
+
aiDisclaimer: dtos_interact_1.WIDGET_SETTINGS_DEFAULT_SETTINGS.chat.aiDisclaimer,
|
24
|
+
placeholderText: dtos_interact_1.WIDGET_SETTINGS_DEFAULT_SETTINGS.chat.placeholderText,
|
25
|
+
},
|
26
|
+
};
|
27
|
+
}
|
28
|
+
if (!securitySettingsEnabled) {
|
29
|
+
nextWidgetSettings = {
|
30
|
+
...nextWidgetSettings,
|
31
|
+
chat: {
|
32
|
+
...nextWidgetSettings.chat,
|
33
|
+
disclaimer: dtos_interact_1.WIDGET_SETTINGS_DEFAULT_SETTINGS.chat.disclaimer,
|
34
|
+
},
|
35
|
+
security: nextWidgetSettings.security && {
|
36
|
+
...nextWidgetSettings.security,
|
37
|
+
approvedDomains: dtos_interact_1.WIDGET_SETTINGS_DEFAULT_SETTINGS.security.approvedDomains,
|
38
|
+
},
|
39
|
+
};
|
40
|
+
}
|
41
|
+
return nextWidgetSettings;
|
42
|
+
};
|
43
|
+
exports.applyWidgetFeatureRestrictions = applyWidgetFeatureRestrictions;
|
26
44
|
//# sourceMappingURL=widget.util.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"widget.util.js","sourceRoot":"","sources":["../../src/widget.util.ts"],"names":[],"mappings":";;;AACA,4DAA4E;AAE5E,6CAAkD;AAE3C,MAAM,
|
1
|
+
{"version":3,"file":"widget.util.js","sourceRoot":"","sources":["../../src/widget.util.ts"],"names":[],"mappings":";;;AACA,4DAA4E;AAE5E,6CAAkD;AAE3C,MAAM,8BAA8B,GAAG,CAC5C,cAA8B,EAC9B,EACE,qBAAqB,EACrB,uBAAuB,GAC8C,EACvD,EAAE;IAClB,IAAI,kBAAkB,GAAG,EAAE,GAAG,cAAc,EAAE,CAAC;IAE/C,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC3B,kBAAkB,GAAG;YACnB,GAAG,kBAAkB;YACrB,MAAM,EAAE;gBACN,GAAG,kBAAkB,CAAC,MAAM;gBAC5B,SAAS,EAAE,gDAAgC,CAAC,MAAM,CAAC,SAAS;gBAC5D,UAAU,EAAE,gDAAgC,CAAC,MAAM,CAAC,UAAU;gBAC9D,UAAU,EAAE,gDAAgC,CAAC,MAAM,CAAC,UAAU;gBAC9D,YAAY,EAAE;oBACZ,GAAG,kBAAkB,CAAC,MAAM,CAAC,YAAY;oBACzC,OAAO,EAAE,IAAA,+BAAkB,EAAC,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC;iBAC1E;aACF;YACD,IAAI,EAAE;gBACJ,GAAG,kBAAkB,CAAC,IAAI;gBAC1B,YAAY,EAAE,gDAAgC,CAAC,IAAI,CAAC,YAAY;gBAChE,eAAe,EAAE,gDAAgC,CAAC,IAAI,CAAC,eAAe;aACvE;SACF,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC7B,kBAAkB,GAAG;YACnB,GAAG,kBAAkB;YACrB,IAAI,EAAE;gBACJ,GAAG,kBAAkB,CAAC,IAAI;gBAC1B,UAAU,EAAE,gDAAgC,CAAC,IAAI,CAAC,UAAU;aAC7D;YACD,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,IAAI;gBACvC,GAAG,kBAAkB,CAAC,QAAQ;gBAC9B,eAAe,EAAE,gDAAgC,CAAC,QAAQ,CAAC,eAAe;aAC3E;SACF,CAAC;IACJ,CAAC;IAED,OAAO,kBAAkB,CAAC;AAC5B,CAAC,CAAC;AA7CW,QAAA,8BAA8B,kCA6CzC"}
|
@@ -1,88 +1,6 @@
|
|
1
1
|
import type { WidgetSettings } from '@voiceflow/dtos-interact';
|
2
|
-
export declare const
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
footerLink: {
|
7
|
-
enabled: true;
|
8
|
-
};
|
9
|
-
primaryColor: {
|
10
|
-
palette: {
|
11
|
-
50: string;
|
12
|
-
100: string;
|
13
|
-
200: string;
|
14
|
-
300: string;
|
15
|
-
400: string;
|
16
|
-
500: string;
|
17
|
-
600: string;
|
18
|
-
700: string;
|
19
|
-
800: string;
|
20
|
-
900: string;
|
21
|
-
};
|
22
|
-
color: string;
|
23
|
-
};
|
24
|
-
sideSpacing: string;
|
25
|
-
bottomSpacing: string;
|
26
|
-
position: "right" | "left";
|
27
|
-
launcher: {
|
28
|
-
type: "label" | "icon" | "both";
|
29
|
-
text?: string | undefined;
|
30
|
-
imageURL?: string | null | undefined;
|
31
|
-
};
|
32
|
-
persistence: string;
|
33
|
-
};
|
34
|
-
chat: {
|
35
|
-
disclaimer: {
|
36
|
-
enabled: false;
|
37
|
-
title: string;
|
38
|
-
description: string;
|
39
|
-
primaryButtonText: string;
|
40
|
-
secondaryButtonText: string;
|
41
|
-
secondaryButtonURL: string;
|
42
|
-
};
|
43
|
-
aiDisclaimer: {
|
44
|
-
enabled: true;
|
45
|
-
text: string;
|
46
|
-
};
|
47
|
-
placeholderText: string;
|
48
|
-
voiceInput: boolean;
|
49
|
-
voiceOutput: boolean;
|
50
|
-
renderMode: "embed" | "widget" | "popover";
|
51
|
-
headerImage: {
|
52
|
-
enabled: boolean;
|
53
|
-
url?: string | null | undefined;
|
54
|
-
};
|
55
|
-
agentImage: {
|
56
|
-
enabled: boolean;
|
57
|
-
url?: string | null | undefined;
|
58
|
-
};
|
59
|
-
banner: {
|
60
|
-
title: string;
|
61
|
-
description: string;
|
62
|
-
enabled: boolean;
|
63
|
-
imageURL?: string | null | undefined;
|
64
|
-
};
|
65
|
-
handoffToAgentImageURL?: string | null | undefined;
|
66
|
-
streamingDisabled?: boolean | undefined;
|
67
|
-
};
|
68
|
-
type: "voice" | "chat";
|
69
|
-
voice: {
|
70
|
-
content: {
|
71
|
-
talkingText: string;
|
72
|
-
endButtonText: string;
|
73
|
-
listeningText: string;
|
74
|
-
startButtonText: string;
|
75
|
-
callToActionText: string;
|
76
|
-
imageURL?: string | null | undefined;
|
77
|
-
};
|
78
|
-
renderMode: "full" | "compact" | "expand";
|
79
|
-
};
|
80
|
-
security?: {
|
81
|
-
approvedDomains: {
|
82
|
-
enabled: boolean;
|
83
|
-
domains: string;
|
84
|
-
};
|
85
|
-
disableTranscript: boolean;
|
86
|
-
} | undefined;
|
87
|
-
};
|
2
|
+
export declare const applyWidgetFeatureRestrictions: (widgetSettings: WidgetSettings, { webchatPremiumEnabled, securitySettingsEnabled, }: {
|
3
|
+
webchatPremiumEnabled: boolean;
|
4
|
+
securitySettingsEnabled: boolean;
|
5
|
+
}) => WidgetSettings;
|
88
6
|
//# sourceMappingURL=widget.util.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"widget.util.d.ts","sourceRoot":"","sources":["../../src/widget.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAK/D,eAAO,MAAM,
|
1
|
+
{"version":3,"file":"widget.util.d.ts","sourceRoot":"","sources":["../../src/widget.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAK/D,eAAO,MAAM,8BAA8B,mBACzB,cAAc,uDAI3B;IAAE,qBAAqB,EAAE,OAAO,CAAC;IAAC,uBAAuB,EAAE,OAAO,CAAA;CAAE,KACtE,cAuCF,CAAC"}
|
package/build/esm/widget.util.js
CHANGED
@@ -1,22 +1,40 @@
|
|
1
1
|
import { WIDGET_SETTINGS_DEFAULT_SETTINGS } from '@voiceflow/dtos-interact';
|
2
2
|
import { colorCreatePalette } from './color.util.js';
|
3
|
-
export const
|
4
|
-
...widgetSettings
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
3
|
+
export const applyWidgetFeatureRestrictions = (widgetSettings, { webchatPremiumEnabled, securitySettingsEnabled, }) => {
|
4
|
+
let nextWidgetSettings = { ...widgetSettings };
|
5
|
+
if (!webchatPremiumEnabled) {
|
6
|
+
nextWidgetSettings = {
|
7
|
+
...nextWidgetSettings,
|
8
|
+
common: {
|
9
|
+
...nextWidgetSettings.common,
|
10
|
+
poweredBy: WIDGET_SETTINGS_DEFAULT_SETTINGS.common.poweredBy,
|
11
|
+
fontFamily: WIDGET_SETTINGS_DEFAULT_SETTINGS.common.fontFamily,
|
12
|
+
footerLink: WIDGET_SETTINGS_DEFAULT_SETTINGS.common.footerLink,
|
13
|
+
primaryColor: {
|
14
|
+
...nextWidgetSettings.common.primaryColor,
|
15
|
+
palette: colorCreatePalette(nextWidgetSettings.common.primaryColor.color),
|
16
|
+
},
|
17
|
+
},
|
18
|
+
chat: {
|
19
|
+
...nextWidgetSettings.chat,
|
20
|
+
aiDisclaimer: WIDGET_SETTINGS_DEFAULT_SETTINGS.chat.aiDisclaimer,
|
21
|
+
placeholderText: WIDGET_SETTINGS_DEFAULT_SETTINGS.chat.placeholderText,
|
22
|
+
},
|
23
|
+
};
|
24
|
+
}
|
25
|
+
if (!securitySettingsEnabled) {
|
26
|
+
nextWidgetSettings = {
|
27
|
+
...nextWidgetSettings,
|
28
|
+
chat: {
|
29
|
+
...nextWidgetSettings.chat,
|
30
|
+
disclaimer: WIDGET_SETTINGS_DEFAULT_SETTINGS.chat.disclaimer,
|
31
|
+
},
|
32
|
+
security: nextWidgetSettings.security && {
|
33
|
+
...nextWidgetSettings.security,
|
34
|
+
approvedDomains: WIDGET_SETTINGS_DEFAULT_SETTINGS.security.approvedDomains,
|
35
|
+
},
|
36
|
+
};
|
37
|
+
}
|
38
|
+
return nextWidgetSettings;
|
39
|
+
};
|
22
40
|
//# sourceMappingURL=widget.util.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"widget.util.js","sourceRoot":"","sources":["../../src/widget.util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC;AAE5E,OAAO,EAAE,kBAAkB,EAAE,MAA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AAkB,CAAC,QAAQ,IAAI;gBACvC,GAAG,kBAAkB,CAAC,QAAQ;gBAC9B,eAAe,EAAE,gCAAgC,CAAC,QAAQ,CAAC,eAAe;aAC3E;SACF,CAAC;IACJ,CAAC;IAED,OAAO,kBAAkB,CAAC;AAC5B,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@voiceflow/utils-designer",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.60.0",
|
4
4
|
"exports": {
|
5
5
|
".": {
|
6
6
|
"types": "./build/cjs/main.d.ts",
|
@@ -32,7 +32,7 @@
|
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
34
|
"@voiceflow/common": "8.7.1",
|
35
|
-
"@voiceflow/dtos": "1.
|
35
|
+
"@voiceflow/dtos": "1.335.0",
|
36
36
|
"bidirectional-adapter": "1.2.1",
|
37
37
|
"polished": "4.2.2",
|
38
38
|
"slate": "^0.103.0",
|
@@ -44,5 +44,5 @@
|
|
44
44
|
"volta": {
|
45
45
|
"extends": "../../package.json"
|
46
46
|
},
|
47
|
-
"gitHead": "
|
47
|
+
"gitHead": "0a5c41975ff1aa91f726805be8dfe84b7c6b733e"
|
48
48
|
}
|