@tugitark/vue-widget 1.3.0 → 1.4.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/index.d.ts +9 -14
- package/index.js +1 -88
- package/package.json +4 -3
package/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type Props } from '@tugitark/declarative-widget';
|
|
2
1
|
import type { PropType } from 'vue';
|
|
2
|
+
import type { Props, TugiWidget, WidgetInitializeOptions, WidgetFreeVersionOptions, TugiWidgetEvents, WidgetFreeSection } from '@tugitark/declarative-widget';
|
|
3
|
+
export type { Props, TugiWidget, WidgetInitializeOptions, WidgetFreeVersionOptions, TugiWidgetEvents, WidgetFreeSection, };
|
|
3
4
|
type Sections = NonNullable<Props['sections']>;
|
|
4
5
|
type Customise = NonNullable<Props['customize']>;
|
|
5
|
-
declare const
|
|
6
|
-
data()
|
|
6
|
+
declare const TugiWidget: {
|
|
7
|
+
data: () => {
|
|
7
8
|
firstTime_: boolean;
|
|
8
|
-
props_: {};
|
|
9
9
|
};
|
|
10
10
|
props: {
|
|
11
11
|
user: StringConstructor;
|
|
@@ -39,21 +39,16 @@ declare const _default: {
|
|
|
39
39
|
ticketLanguageCode: StringConstructor;
|
|
40
40
|
};
|
|
41
41
|
methods: {
|
|
42
|
-
onNotification_(hasNotification: any)
|
|
43
|
-
onReady_()
|
|
44
|
-
onOpened_(): void;
|
|
45
|
-
onClosed_(): void;
|
|
46
|
-
onError_(e: any): void;
|
|
42
|
+
onNotification_: (hasNotification: any) => void;
|
|
43
|
+
onReady_: () => void;
|
|
47
44
|
};
|
|
48
|
-
watc(): void;
|
|
49
45
|
watch: {
|
|
50
46
|
$props: {
|
|
51
|
-
handler(props: any)
|
|
47
|
+
handler: (props: any) => void;
|
|
52
48
|
deep: boolean;
|
|
53
49
|
immediate: boolean;
|
|
54
50
|
};
|
|
55
51
|
};
|
|
56
|
-
render()
|
|
52
|
+
render: () => any;
|
|
57
53
|
};
|
|
58
|
-
export default
|
|
59
|
-
//# sourceMappingURL=index.d.ts.map
|
|
54
|
+
export default TugiWidget;
|
package/index.js
CHANGED
|
@@ -1,88 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import render from '@tugitark/declarative-widget';
|
|
3
|
-
// Weirdly, this way of declaring a `vue` component has absolutly no dependencies on `vue`...
|
|
4
|
-
export default {
|
|
5
|
-
data() {
|
|
6
|
-
return {
|
|
7
|
-
firstTime_: true,
|
|
8
|
-
props_: {},
|
|
9
|
-
};
|
|
10
|
-
},
|
|
11
|
-
props: {
|
|
12
|
-
// Full props.
|
|
13
|
-
user: String,
|
|
14
|
-
jwtFn: Function,
|
|
15
|
-
tenantId: String,
|
|
16
|
-
brandId: String,
|
|
17
|
-
brandName: String,
|
|
18
|
-
language: String,
|
|
19
|
-
customize: Object,
|
|
20
|
-
httpUrl: String,
|
|
21
|
-
wsUrl: String,
|
|
22
|
-
// Free props.
|
|
23
|
-
chatDisabledReason: String,
|
|
24
|
-
title: String,
|
|
25
|
-
body: String,
|
|
26
|
-
sections: Array,
|
|
27
|
-
// Display props.
|
|
28
|
-
open: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: undefined,
|
|
31
|
-
},
|
|
32
|
-
visible: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: undefined,
|
|
35
|
-
},
|
|
36
|
-
onNotification: Function,
|
|
37
|
-
onReady: Function,
|
|
38
|
-
onOpened: Function,
|
|
39
|
-
onClosed: Function,
|
|
40
|
-
onError: Function,
|
|
41
|
-
// Two of these are required to open a message.
|
|
42
|
-
proactiveMessage: String,
|
|
43
|
-
proactiveContext: String,
|
|
44
|
-
ticketLanguageCode: String,
|
|
45
|
-
},
|
|
46
|
-
methods: {
|
|
47
|
-
onNotification_(hasNotification) {
|
|
48
|
-
if (this.jwtFn == null && this.user == null) {
|
|
49
|
-
if (!this.firstTime_) {
|
|
50
|
-
// Replicate FAQ internal behaviour at a per-component level.
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
this.onNotification && this.onNotification(hasNotification);
|
|
55
|
-
},
|
|
56
|
-
onReady_() {
|
|
57
|
-
if (this.firstTime_) {
|
|
58
|
-
this.firstTime_ = false;
|
|
59
|
-
this.onReady && this.onReady();
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
onOpened_() { this.onOpened && this.onOpened(); },
|
|
63
|
-
onClosed_() { this.onClosed && this.onClosed(); },
|
|
64
|
-
onError_(e) { this.onError && this.onError(e); },
|
|
65
|
-
},
|
|
66
|
-
watc() {
|
|
67
|
-
return render(this.props_);
|
|
68
|
-
},
|
|
69
|
-
watch: {
|
|
70
|
-
$props: {
|
|
71
|
-
handler(props) {
|
|
72
|
-
render({
|
|
73
|
-
...props,
|
|
74
|
-
onNotification: this.onNotification_,
|
|
75
|
-
onReady: this.onReady_,
|
|
76
|
-
onOpened: this.onOpened_,
|
|
77
|
-
onClosed: this.onClosed_,
|
|
78
|
-
onError: this.onError_,
|
|
79
|
-
});
|
|
80
|
-
},
|
|
81
|
-
deep: true,
|
|
82
|
-
immediate: true,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
render() {
|
|
86
|
-
return null;
|
|
87
|
-
},
|
|
88
|
-
};
|
|
1
|
+
import a from"@tugitark/declarative-widget";var n,t=String,e=Function,o={type:Boolean,default:void 0},r={data:function(){return{firstTime_:!0}},props:{user:t,jwtFn:e,tenantId:t,brandId:t,brandName:t,language:t,customize:Object,httpUrl:t,wsUrl:t,chatDisabledReason:t,title:t,body:t,sections:Array,open:o,visible:o,onNotification:e,onReady:e,onOpened:e,onClosed:e,onError:e,proactiveMessage:t,proactiveContext:t,ticketLanguageCode:t},methods:{onNotification_:function(i){this.jwtFn==null&&this.user==null&&!this.firstTime_||(n=this.onNotification)&&n(i)},onReady_:function(){this.firstTime_&&(this.firstTime_=!1,(n=this.onReady)&&n())}},watch:{$props:{handler:function(i){i=Object.assign({},i,{onNotification:this.onNotification_,onReady:this.onReady_}),a(i)},deep:!0,immediate:!0}},render:function(){return null}};export default r;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tugitark/vue-widget",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Wraps the tugitark widget in a Vue component.",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "npx
|
|
6
|
+
"build": "npx esbuild index.ts --target=es6 --outfile=index.js && sed -i 's/\\bconst\\b/var/g' index.js && sed -i 's/\\blet\\b/var/g' index.js && npx esbuild index.js --allow-overwrite --minify --target=es5 --outfile=index.js && npx tsc --noErrorTruncation --declaration --emitDeclarationOnly --target es6 --module nodenext --moduleResolution nodenext --outDir . index.ts",
|
|
7
7
|
"release": "npm publish --access public",
|
|
8
8
|
"prerelease": "npm run build"
|
|
9
9
|
},
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"vue": "^3.0.0",
|
|
23
|
-
"
|
|
23
|
+
"esbuild": "^0.27.2",
|
|
24
|
+
"typescript": "^5.9.3"
|
|
24
25
|
},
|
|
25
26
|
"keywords": [
|
|
26
27
|
"Typescript",
|