@chat21/chat21-web-widget 5.1.25-rc1 → 5.1.25
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/.github/workflows/docker-community-push-latest.yml +13 -23
- package/.github/workflows/docker-image-tag-community-tag-push.yml +12 -22
- package/CHANGELOG.md +11 -63
- package/Dockerfile +5 -4
- package/angular.json +1 -2
- package/deploy_amazon_beta.sh +7 -17
- package/deploy_amazon_prod.sh +41 -0
- package/package.json +1 -1
- package/src/app/app.component.html +1 -8
- package/src/app/app.component.scss +0 -59
- package/src/app/app.component.ts +27 -62
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +4 -18
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +0 -25
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +0 -1
- package/src/app/component/launcher-button/launcher-button.component.html +1 -1
- package/src/app/component/launcher-button/launcher-button.component.ts +2 -3
- package/src/app/providers/translator.service.ts +0 -2
- package/src/app/utils/globals.ts +1 -1
- package/src/assets/i18n/en.json +0 -1
- package/src/assets/i18n/es.json +0 -1
- package/src/assets/i18n/fr.json +0 -1
- package/src/assets/i18n/it.json +0 -1
- package/src/chat21-core/providers/tiledesk/tiledesk-requests.service.ts +1 -1
- package/src/chat21-core/utils/utils.ts +2 -5
- package/src/iframe-style.css +5 -5
- package/src/launch.js +61 -6
- package/src/launch_template.js +61 -6
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
name: Docker Image Community latest CI
|
|
2
2
|
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
5
|
branches: [ master ]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ master ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ master ]
|
|
8
8
|
|
|
9
9
|
jobs:
|
|
10
10
|
push_to_registry:
|
|
@@ -12,22 +12,12 @@ jobs:
|
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
13
|
|
|
14
14
|
steps:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
25
|
-
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
26
|
-
|
|
27
|
-
- name: Build and push multiarch Docker image
|
|
28
|
-
uses: docker/build-push-action@v3
|
|
29
|
-
with:
|
|
30
|
-
context: .
|
|
31
|
-
push: true
|
|
32
|
-
platforms: linux/amd64,linux/arm64
|
|
33
|
-
tags: chat21/chat21-web-widget:latest
|
|
15
|
+
- uses: actions/checkout@v2
|
|
16
|
+
name: Check out the repo
|
|
17
|
+
- uses: docker/build-push-action@v1
|
|
18
|
+
with:
|
|
19
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
20
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
21
|
+
repository: chat21/chat21-web-widget
|
|
22
|
+
push: true
|
|
23
|
+
tags: latest
|
|
@@ -3,30 +3,20 @@ name: Publish Docker Community image tags
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
tags:
|
|
6
|
-
- '**'
|
|
7
|
-
|
|
6
|
+
- '**' # Push events to every tag including hierarchical tags like
|
|
8
7
|
jobs:
|
|
8
|
+
|
|
9
9
|
push_to_registry:
|
|
10
10
|
name: Push Docker image to Docker Hub
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
|
-
|
|
13
12
|
steps:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
25
|
-
|
|
26
|
-
- name: Build and push multiarch Docker image
|
|
27
|
-
uses: docker/build-push-action@v3
|
|
28
|
-
with:
|
|
29
|
-
context: .
|
|
30
|
-
push: true
|
|
31
|
-
platforms: linux/amd64,linux/arm64
|
|
32
|
-
tags: chat21/chat21-web-widget:${{ github.ref_name }}
|
|
13
|
+
- name: Check out the repo
|
|
14
|
+
uses: actions/checkout@v2
|
|
15
|
+
- name: Push to Docker Hub
|
|
16
|
+
uses: docker/build-push-action@v1
|
|
17
|
+
with:
|
|
18
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
19
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
20
|
+
repository: chat21/chat21-web-widget
|
|
21
|
+
push: true
|
|
22
|
+
tag_with_ref: true
|
package/CHANGELOG.md
CHANGED
|
@@ -6,29 +6,26 @@
|
|
|
6
6
|
### **Copyrigth**:
|
|
7
7
|
*Tiledesk SRL*
|
|
8
8
|
|
|
9
|
-
# 5.1.25
|
|
9
|
+
# 5.1.25
|
|
10
10
|
- **bug fixed**: attachment buttons in messages now respect the container max width and wrap/break long labels instead of being clipped
|
|
11
11
|
|
|
12
|
-
# 5.1.24
|
|
13
|
-
- **bug fixed**: minor fix in marked pipe to avoid rendering html tags
|
|
14
|
-
|
|
15
|
-
# 5.1.24-rc1
|
|
12
|
+
# 5.1.24
|
|
16
13
|
- **security**: hardened Markdown link rendering by blocking dangerous protocols (e.g. `javascript:`, `data:`, `vbscript:`) and preventing unsafe links from being rendered as anchors
|
|
17
14
|
- **changed**: refactored `MarkedPipe` to simplify Markdown parsing, improve link rendering via a custom `marked` renderer, and streamline newline handling (`\\n` → `\n`)
|
|
18
15
|
|
|
19
|
-
# 5.1.
|
|
16
|
+
# 5.1.23
|
|
17
|
+
- **changed**: API for upload a file/iamges
|
|
18
|
+
|
|
19
|
+
# 5.1.22
|
|
20
|
+
- **changed**: Updated Launch.js for Wix and Shopify by bypassing scrdoc
|
|
21
|
+
|
|
22
|
+
# 5.1.21
|
|
20
23
|
- **bug fixed**: saved the widget's size state to local storage (in HP conversations)
|
|
21
24
|
|
|
22
|
-
# 5.1.20
|
|
23
|
-
- **changed**: API for upload a file/iamges
|
|
25
|
+
# 5.1.20
|
|
24
26
|
- **changed**: marked pipe do not render /n
|
|
25
27
|
|
|
26
|
-
# 5.1.20-rc1
|
|
27
|
-
- **changed**: API for upload a file/iamges
|
|
28
|
-
|
|
29
28
|
# 5.1.19
|
|
30
|
-
|
|
31
|
-
# 5.1.19-rc1
|
|
32
29
|
- **bug fixed**: show bottom scroll button and unread message badge only when I'm not at the bottom of the page
|
|
33
30
|
- **changed**: allow HTML code to be inserted into messages, but do not parse the code. Ensure coexistence with Markdown.
|
|
34
31
|
- **bug fixed**: after sending a multi-line message, the text area remains open on multiple lines.
|
|
@@ -38,7 +35,6 @@
|
|
|
38
35
|
- **changed**: saved the widget's size state to local storage. The parameter flow is (default → storage → settings → URL)
|
|
39
36
|
|
|
40
37
|
# 5.1.18
|
|
41
|
-
# 5.1.15-rc3
|
|
42
38
|
- **added**: Implemented Shadow DOM in the text component to isolate HTML and Markdown rendering in a safe and protected context
|
|
43
39
|
- **changed**: Adapted text component styles to support Shadow DOM (removed ::ng-deep, added styles for common markdown elements)
|
|
44
40
|
- **security**: HTML/Markdown content is now rendered in an isolated Shadow DOM, improving security and preventing interference with the rest of the application
|
|
@@ -49,12 +45,6 @@
|
|
|
49
45
|
# 5.1.16
|
|
50
46
|
- **changed**: "close chat" header conversation menu button enabled in chatbot-panel.html
|
|
51
47
|
|
|
52
|
-
# 5.1.15-rc2
|
|
53
|
-
- **bug-fixed**: Bug fix for ifame message width
|
|
54
|
-
|
|
55
|
-
# 5.1.15-rc1
|
|
56
|
-
- **changed**: Load local translations before remote ones
|
|
57
|
-
|
|
58
48
|
# 5.1.15
|
|
59
49
|
- **changed**: Load local translations before remote ones
|
|
60
50
|
|
|
@@ -63,56 +53,14 @@
|
|
|
63
53
|
|
|
64
54
|
# 5.1.13
|
|
65
55
|
- **bug-fixed**: set default widget size
|
|
66
|
-
|
|
67
|
-
# 5.1.7-rc16
|
|
68
|
-
- **bug-fixed**: set default widget size
|
|
69
|
-
|
|
70
|
-
# 5.1.7-rc15
|
|
71
|
-
- **bug-fixed**: set the color of the buttons with visibility control to the font color
|
|
72
|
-
|
|
73
|
-
# 5.1.7-rc14
|
|
74
|
-
- **bug-fixed**: departmentId and departmentName is incorrect in attributes
|
|
75
|
-
|
|
76
|
-
# 5.1.7-rc13
|
|
77
|
-
- **changed**: Force authentication if ageChangeVisibilityDesktop or PageChangeVisibilityMobile is OPEN
|
|
78
|
-
|
|
79
|
-
# 5.1.7-rc12
|
|
80
|
-
- **changed**: Set the default autoStart value to false
|
|
81
|
-
- **added**: Added the open widget loading spinner
|
|
82
|
-
- **changed**: Load the widget without authentication and display the speech bubble
|
|
83
|
-
|
|
84
|
-
# 5.1.7-rc11
|
|
85
|
-
- **changed**: set default value autoStart false
|
|
86
|
-
- **added**:added loading spinner
|
|
87
|
-
|
|
88
|
-
# 5.1.7-rc10
|
|
89
|
-
- **changed**: load widget without authentication and display the balloon
|
|
90
|
-
|
|
91
|
-
# 5.1.7-rc9
|
|
92
|
-
- **removed**: 'DOMAIN_NOT_ALLOWED' in textarea footer component
|
|
93
|
-
|
|
94
|
-
# 5.1.7-rc8
|
|
95
|
-
# changes in the branch
|
|
96
|
-
- **changed**: Load local translations before remote ones
|
|
97
|
-
- **bug-fixed**: set default widget size
|
|
98
56
|
- **changed**: Updated the translations of the tooltips in the footer-component
|
|
99
57
|
- **changed**: Refactored the network-offline component and made it generic for displaying errors (now error-alert.component)
|
|
100
|
-
|
|
101
|
-
# 5.1.7-rc7
|
|
102
|
-
- **bug-fixed**: button new_conversation always appear. added subscription to conversationAdded
|
|
103
|
-
|
|
104
|
-
# 5.1.7-rc6
|
|
105
|
-
- **added**: Added MAX_ATTACHMENT_ERROR error message when uploading a file larger than 10 MB
|
|
58
|
+
- **bug-fixed**: set the color of the buttons with visibility control to the font color (setButtonColors function)
|
|
106
59
|
|
|
107
60
|
# 5.1.12
|
|
108
61
|
- **bug-fixed**: check showEmojiFooterButton to enable/disable emojii
|
|
109
62
|
- **bug-fixed**: markdown is fired as an emojii and blocked by isEmojii check fn
|
|
110
63
|
|
|
111
|
-
# 5.1.7-rc7
|
|
112
|
-
- **bug-fixed**: button new_conversation always appear. added subscription to conversationAdded
|
|
113
|
-
|
|
114
|
-
# 5.1.7-rc6
|
|
115
|
-
- **added**: Added MAX_ATTACHMENT_ERROR error message when uploading a file larger than 10 MB
|
|
116
64
|
|
|
117
65
|
# 5.1.7-rc5
|
|
118
66
|
- **bug-fixed**: bug fixed BUTTON STYLES
|
package/Dockerfile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
### STAGE 1: Build ###
|
|
2
2
|
|
|
3
3
|
# We label our stage as ‘builder’
|
|
4
|
-
FROM
|
|
4
|
+
FROM node:20.12.2-alpine3.19 as builder
|
|
5
5
|
|
|
6
6
|
COPY package.json package-lock.json ./
|
|
7
7
|
|
|
@@ -15,11 +15,12 @@ COPY . .
|
|
|
15
15
|
|
|
16
16
|
## Build the angular app in production mode and store the artifacts in dist folder
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
RUN npx ng build --configuration="prod" --output-path=dist --base-href=./ --output-hashing=none
|
|
20
19
|
|
|
20
|
+
|
|
21
21
|
### STAGE 2: Setup ###
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
FROM nginx:1.14.1-alpine
|
|
23
24
|
|
|
24
25
|
## Copy our default nginx config
|
|
25
26
|
COPY nginx.conf /etc/nginx/nginx.conf
|
|
@@ -32,4 +33,4 @@ COPY --from=builder /ng-app/dist/browser /usr/share/nginx/html
|
|
|
32
33
|
|
|
33
34
|
RUN echo "Chat21 Web Widget Started!!"
|
|
34
35
|
|
|
35
|
-
CMD ["/bin/sh",
|
|
36
|
+
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/widget-config-template.json > /usr/share/nginx/html/widget-config.json && exec nginx -g 'daemon off;'"]
|
package/angular.json
CHANGED
|
@@ -44,8 +44,7 @@
|
|
|
44
44
|
"src/environments/real_data/widget-config-docker.json",
|
|
45
45
|
"src/environments/real_data/widget-config-native-mqtt.json",
|
|
46
46
|
"src/environments/real_data/widget-config-native-prod.json",
|
|
47
|
-
"src/environments/real_data/widget-config-aws-stage.json"
|
|
48
|
-
"src/environments/real_data/widget-config-aws-aruba.json"
|
|
47
|
+
"src/environments/real_data/widget-config-aws-stage.json"
|
|
49
48
|
],
|
|
50
49
|
"styles": [
|
|
51
50
|
"src/app/sass/styles.scss"
|
package/deploy_amazon_beta.sh
CHANGED
|
@@ -2,16 +2,8 @@
|
|
|
2
2
|
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
3
|
echo "version $version"
|
|
4
4
|
|
|
5
|
-
npm i
|
|
6
|
-
|
|
7
|
-
cp src/environments/real_data/environment.pre.ts src/environments/environment.pre.ts
|
|
8
|
-
|
|
9
5
|
ng build --configuration="pre" --aot=true --base-href
|
|
10
6
|
|
|
11
|
-
### SET HASHING : START ###
|
|
12
|
-
cp ./src/launch_template.js ./dist/browser/launch.js
|
|
13
|
-
node ./src/build_launch.js
|
|
14
|
-
### SET HASHING : END ###
|
|
15
7
|
|
|
16
8
|
# ########## --->>>> NATIVE-MQTT folder START <<<<<------ ########## #
|
|
17
9
|
|
|
@@ -31,17 +23,15 @@ node ./src/build_launch.js
|
|
|
31
23
|
|
|
32
24
|
|
|
33
25
|
# ########## --->>>> FIREBASE folder START <<<<<------ ########## #
|
|
34
|
-
cd dist
|
|
35
|
-
aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control max-age=300
|
|
36
|
-
aws s3 sync . s3://tiledesk-widget-pre/v5
|
|
37
|
-
|
|
38
|
-
aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
39
|
-
cd ../..
|
|
26
|
+
cd dist
|
|
27
|
+
aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control max-age=300
|
|
28
|
+
aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control max-age=300
|
|
29
|
+
cd ..
|
|
40
30
|
|
|
41
|
-
aws cloudfront create-invalidation --distribution-id
|
|
42
|
-
|
|
43
|
-
git restore src/environments/environment.pre.ts
|
|
31
|
+
#aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
|
|
32
|
+
cd ..
|
|
44
33
|
|
|
34
|
+
aws cloudfront create-invalidation --distribution-id E2V5O0YPR61V8P --paths "/*"
|
|
45
35
|
# echo new version deployed $NEW_VER/$NEW_BUILD/ on s3://tiledesk-widget-pre/v2
|
|
46
36
|
echo new version deployed $version/ on s3://tiledesk-widget-pre/v5 and s3://tiledesk-widget-pre/v5/$version/
|
|
47
37
|
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget-pre/v5/index.html
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# npm version patch
|
|
2
|
+
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
|
+
echo "version $version"
|
|
4
|
+
|
|
5
|
+
npm i
|
|
6
|
+
|
|
7
|
+
cp src/environments/real_data/environment.prod.ts src/environments/environment.prod.ts
|
|
8
|
+
|
|
9
|
+
# --build-optimizer=false if localstorage is disabled (webview) appears https://github.com/firebase/angularfire/issues/970
|
|
10
|
+
ng build --configuration="prod" --aot=true
|
|
11
|
+
##--base-href='./v5/' --output-hashing none
|
|
12
|
+
|
|
13
|
+
### SET HASHING : START ###
|
|
14
|
+
cp ./src/launch_template.js ./dist/browser/launch.js
|
|
15
|
+
node ./src/build_launch.js
|
|
16
|
+
### SET HASHING : END ###
|
|
17
|
+
|
|
18
|
+
#### FIREBASE #####
|
|
19
|
+
# cd dist
|
|
20
|
+
# # aws s3 sync . s3://tiledesk-widget/v5/latest/
|
|
21
|
+
# aws s3 sync . s3://tiledesk-widget/v5/$version/ --cache-control max-age=300
|
|
22
|
+
# aws s3 sync . s3://tiledesk-widget/v5/ --cache-control max-age=300
|
|
23
|
+
# cd ..
|
|
24
|
+
|
|
25
|
+
# #### MQTT #####
|
|
26
|
+
cd dist/browser
|
|
27
|
+
# aws s3 sync . s3://tiledesk-widget/v5/latest/
|
|
28
|
+
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control max-age=86400 --exclude='launch.js' #8days
|
|
29
|
+
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
30
|
+
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control max-age=86400 --exclude='launch.js' #8days
|
|
31
|
+
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
32
|
+
cd ../..
|
|
33
|
+
|
|
34
|
+
aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
|
|
35
|
+
|
|
36
|
+
git restore src/environments/environment.prod.ts
|
|
37
|
+
|
|
38
|
+
echo new version deployed $version on s3://tiledesk-widget/v6
|
|
39
|
+
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget/v6/index.html
|
|
40
|
+
echo https://widget.tiledesk.com/v6/index.html
|
|
41
|
+
echo https://widget.tiledesk.com/v6/$version/index.html
|
package/package.json
CHANGED
|
@@ -145,12 +145,5 @@
|
|
|
145
145
|
<chat-launcher-button *ngIf="isInitialized"
|
|
146
146
|
(onButtonClicked)="onOpenCloseWidget($event)">
|
|
147
147
|
</chat-launcher-button>
|
|
148
|
-
|
|
149
|
-
<!-- Loading Spinner -->
|
|
150
|
-
<div *ngIf="loading" class="tiledesk-loading-overlay">
|
|
151
|
-
<div class="tiledesk-loading-spinner">
|
|
152
|
-
<div class="spinner-circle"></div>
|
|
153
|
-
<div class="loading-text">{{ translationMap.get('LABEL_LOADING') }}</div>
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
148
|
+
|
|
156
149
|
</div>
|
|
@@ -761,63 +761,4 @@ chat-root {
|
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
763
|
|
|
764
|
-
// ========= BEGIN: LOADING SPINNER ========= //
|
|
765
|
-
.tiledesk-loading-overlay {
|
|
766
|
-
position: absolute;
|
|
767
|
-
top: 0;
|
|
768
|
-
left: 0;
|
|
769
|
-
width: 100%;
|
|
770
|
-
height: 100%;
|
|
771
|
-
background-color: rgba(248, 249, 250, 0.95);
|
|
772
|
-
display: flex;
|
|
773
|
-
justify-content: center;
|
|
774
|
-
align-items: center;
|
|
775
|
-
z-index: 9999;
|
|
776
|
-
backdrop-filter: blur(2px);
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
.tiledesk-loading-spinner {
|
|
780
|
-
display: flex;
|
|
781
|
-
flex-direction: column;
|
|
782
|
-
align-items: center;
|
|
783
|
-
gap: 16px;
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
.spinner-circle {
|
|
787
|
-
width: 50px;
|
|
788
|
-
height: 50px;
|
|
789
|
-
border: 4px solid rgba(59, 130, 246, 0.2);
|
|
790
|
-
border-top-color: #3b82f6;
|
|
791
|
-
border-radius: 50%;
|
|
792
|
-
animation: spin 0.8s linear infinite;
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
@keyframes spin {
|
|
796
|
-
0% {
|
|
797
|
-
transform: rotate(0deg);
|
|
798
|
-
}
|
|
799
|
-
100% {
|
|
800
|
-
transform: rotate(360deg);
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
.loading-text {
|
|
805
|
-
font-family: var(--font-family-bubble-message, 'Roboto', 'Google Sans', Helvetica, Arial, sans-serif);
|
|
806
|
-
font-size: 14px;
|
|
807
|
-
font-weight: 500;
|
|
808
|
-
color: #3b82f6;
|
|
809
|
-
letter-spacing: 0.5px;
|
|
810
|
-
animation: pulse 1.5s ease-in-out infinite;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
@keyframes pulse {
|
|
814
|
-
0%, 100% {
|
|
815
|
-
opacity: 1;
|
|
816
|
-
}
|
|
817
|
-
50% {
|
|
818
|
-
opacity: 0.5;
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
// ========= END: LOADING SPINNER ========= //
|
|
822
|
-
|
|
823
764
|
}
|
package/src/app/app.component.ts
CHANGED
|
@@ -106,10 +106,6 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
106
106
|
|
|
107
107
|
forceDisconnect: boolean = false;
|
|
108
108
|
|
|
109
|
-
//network status
|
|
110
|
-
isOnline: boolean = true;
|
|
111
|
-
loading: boolean = false;
|
|
112
|
-
|
|
113
109
|
// alert error message
|
|
114
110
|
isShowErrorMessage: boolean = false;
|
|
115
111
|
errorMessage: string = '';
|
|
@@ -153,7 +149,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
153
149
|
this.logger.info('[APP-CONF]---------------- ngAfterViewInit: APP.COMPONENT ---------------- ')
|
|
154
150
|
|
|
155
151
|
// Initialize translation map and enable buttons
|
|
156
|
-
const keys = ['MAXIMIZE', 'MINIMIZE', 'CENTER', 'BUTTON_CLOSE_TO_ICON'
|
|
152
|
+
const keys = ['MAXIMIZE', 'MINIMIZE', 'CENTER', 'BUTTON_CLOSE_TO_ICON'];
|
|
157
153
|
this.translationMap = this.translateService.translateLanguage(keys);
|
|
158
154
|
this.isButtonsDisabled = false;
|
|
159
155
|
|
|
@@ -320,15 +316,8 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
320
316
|
this.g.setIsOpen(isOpen)
|
|
321
317
|
this.appStorageService.setItem('isOpen', isOpen)
|
|
322
318
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
this.logger.debug('[APP-COMP2] ------this.g.isOpen: ', this.g.isOpen)
|
|
326
|
-
if(this.g.isOpen){
|
|
327
|
-
this.g.autoStart = true;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
|
|
319
|
+
|
|
320
|
+
|
|
332
321
|
/**CHECK IF JWT IS IN URL PARAMETERS */
|
|
333
322
|
this.logger.debug('[APP-COMP] check if token is passed throw url: ', this.g.jwt);
|
|
334
323
|
if (this.g.jwt) {
|
|
@@ -365,6 +354,10 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
365
354
|
this.subscriptions.push(obsSettingsService);
|
|
366
355
|
this.globalSettingsService.initWidgetParamiters(this.g, this.el);
|
|
367
356
|
|
|
357
|
+
// SET AUDIO
|
|
358
|
+
this.audio = new Audio();
|
|
359
|
+
this.audio.src = this.g.baseLocation + URL_SOUND_LIST_CONVERSATION;
|
|
360
|
+
this.audio.load();
|
|
368
361
|
}
|
|
369
362
|
|
|
370
363
|
private initAll() {
|
|
@@ -455,7 +448,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
455
448
|
that.triggerOnAuthStateChanged(that.stateLoggedUser);
|
|
456
449
|
that.logger.debug('[APP-COMP] 1 - IMPOSTO STATO CONNESSO UTENTE ', autoStart);
|
|
457
450
|
|
|
458
|
-
|
|
451
|
+
|
|
459
452
|
|
|
460
453
|
new Promise(async (resolve, reject)=> {
|
|
461
454
|
that.typingService.initialize(this.g.tenant);
|
|
@@ -481,30 +474,26 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
481
474
|
that.listenToWidgetClick()
|
|
482
475
|
}
|
|
483
476
|
|
|
484
|
-
/** DDP IF AUTOSTART IS FALSE, SHOW WIDGET */
|
|
485
|
-
if(!autoStart){
|
|
486
|
-
that.logger.info('[APP-COMP] AUTOSTART IS FALSE AND LOGGED SUCCESSFULLY ');
|
|
487
|
-
this.g.setParameter('isShown', true, true);
|
|
488
|
-
}
|
|
489
477
|
|
|
490
478
|
|
|
491
479
|
} else if (state && state === AUTH_STATE_OFFLINE && !this.forceDisconnect) {
|
|
492
480
|
/** non sono loggato */
|
|
493
481
|
that.logger.info('[APP-COMP] OFFLINE - NO CURRENT USER AUTENTICATE: ');
|
|
494
482
|
that.g.setParameter('isLogged', false);
|
|
495
|
-
|
|
483
|
+
that.hideWidget();
|
|
496
484
|
// that.g.setParameter('isShown', false, true);
|
|
497
485
|
that.triggerOnAuthStateChanged(that.stateLoggedUser);
|
|
498
|
-
if (autoStart
|
|
486
|
+
if (autoStart) {
|
|
499
487
|
that.authenticate();
|
|
500
488
|
}
|
|
501
|
-
}
|
|
489
|
+
}else if(state && state === AUTH_STATE_CLOSE ){
|
|
502
490
|
that.logger.info('[APP-COMP] CLOSE - CHANNEL CLOSED: ', this.chatManager);
|
|
503
491
|
if(this.g.recipientId){
|
|
504
492
|
this.chatManager.removeConversationHandler(this.g.recipientId)
|
|
505
493
|
this.g.recipientId = null;
|
|
506
494
|
}
|
|
507
|
-
}
|
|
495
|
+
}
|
|
496
|
+
|
|
508
497
|
|
|
509
498
|
});
|
|
510
499
|
this.subscriptions.push(subAuthStateChanged);
|
|
@@ -749,8 +738,6 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
749
738
|
// divWidgetContainer.style.display = 'block';
|
|
750
739
|
// }
|
|
751
740
|
// }, 500);
|
|
752
|
-
|
|
753
|
-
this.loading = false;
|
|
754
741
|
}
|
|
755
742
|
// ========= end:: START UI ============//
|
|
756
743
|
|
|
@@ -859,13 +846,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
859
846
|
this.appStorageService.setItem('attributes', JSON.stringify(attributes));
|
|
860
847
|
return attributes;
|
|
861
848
|
}
|
|
862
|
-
|
|
863
|
-
// SET AUDIO
|
|
864
|
-
private initAudioNotification(){
|
|
865
|
-
this.audio = new Audio();
|
|
866
|
-
this.audio.src = this.g.baseLocation + URL_SOUND_LIST_CONVERSATION;
|
|
867
|
-
this.audio.load();
|
|
868
|
-
}
|
|
849
|
+
|
|
869
850
|
|
|
870
851
|
private async initConversationsHandler(tenant: string, senderId: string) {
|
|
871
852
|
this.logger.debug('[APP-COMP] initialize: ListConversationsComponent');
|
|
@@ -1624,46 +1605,23 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
1624
1605
|
this.f21_close();
|
|
1625
1606
|
}
|
|
1626
1607
|
|
|
1627
|
-
|
|
1628
|
-
/** DDP reload widget */
|
|
1629
|
-
async reloadWidget() {
|
|
1630
|
-
this.openCloseWidget();
|
|
1631
|
-
this.logger.debug('[APP-COMP-1] AAA - hideWidget');
|
|
1632
|
-
await Promise.all([
|
|
1633
|
-
this.authenticate(),
|
|
1634
|
-
// this.initAll()
|
|
1635
|
-
]);
|
|
1636
|
-
this.logger.debug('[APP-COMP-1] CCC - showWidget');
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
1608
|
/**
|
|
1641
1609
|
* LAUNCHER BUTTON:
|
|
1642
1610
|
* onClick button open/close widget
|
|
1643
1611
|
*/
|
|
1644
1612
|
onOpenCloseWidget($event) {
|
|
1645
|
-
this.logger.debug('[APP-COMP] onOpenCloseWidget', $event, this.g.isLogged);
|
|
1646
|
-
if(!this.g.isLogged){
|
|
1647
|
-
this.reloadWidget();
|
|
1648
|
-
} else {
|
|
1649
|
-
this.openCloseWidget();
|
|
1650
|
-
}
|
|
1651
|
-
}
|
|
1652
|
-
|
|
1653
|
-
/** DDP show widget */
|
|
1654
|
-
openCloseWidget() {
|
|
1655
1613
|
this.g.setParameter('displayEyeCatcherCard', 'none');
|
|
1656
1614
|
// const conversationActive: ConversationModel = JSON.parse(this.appStorageService.getItem('activeConversation'));
|
|
1657
1615
|
const recipientId : string = this.appStorageService.getItem('recipientId')
|
|
1658
1616
|
this.g.setParameter('recipientId', recipientId);
|
|
1659
1617
|
this.logger.debug('[APP-COMP] openCloseWidget', recipientId, this.g.isOpen, this.g.startFromHome);
|
|
1660
|
-
|
|
1661
1618
|
if (this.g.isOpen === false) {
|
|
1662
1619
|
if(this.forceDisconnect){
|
|
1663
1620
|
this.logger.log('[FORCE] onOpenCloseWidget --> reconnect', this.forceDisconnect)
|
|
1664
1621
|
this.messagingAuthService.createCustomToken(this.g.tiledeskToken)
|
|
1665
1622
|
this.forceDisconnect = false;
|
|
1666
1623
|
}
|
|
1624
|
+
|
|
1667
1625
|
if (!recipientId) {
|
|
1668
1626
|
if(this.g.singleConversation){
|
|
1669
1627
|
this.isOpenHome = false;
|
|
@@ -1683,22 +1641,29 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
1683
1641
|
this.isOpenHome = false;
|
|
1684
1642
|
this.isOpenConversation = true;
|
|
1685
1643
|
this.startUI()
|
|
1644
|
+
// this.isOpenSelectionDepartment = false;
|
|
1686
1645
|
}
|
|
1646
|
+
// if (!conversationActive && !this.g.startFromHome) {
|
|
1647
|
+
// this.isOpenHome = false;
|
|
1648
|
+
// this.isOpenConversation = true;
|
|
1649
|
+
// this.startNwConversation();
|
|
1650
|
+
// } else if (conversationActive) {
|
|
1651
|
+
// this.isOpenHome = false;
|
|
1652
|
+
// this.isOpenConversation = true;
|
|
1653
|
+
// }
|
|
1654
|
+
// this.g.startFromHome = true;
|
|
1687
1655
|
this.triggerOnOpenEvent();
|
|
1656
|
+
|
|
1688
1657
|
} else {
|
|
1689
1658
|
this.triggerOnCloseEvent();
|
|
1690
1659
|
}
|
|
1691
1660
|
//change status to the widget
|
|
1692
1661
|
this.g.setIsOpen(!this.g.isOpen);
|
|
1693
1662
|
this.appStorageService.setItem('isOpen', this.g.isOpen);
|
|
1694
|
-
|
|
1695
|
-
if(this.g.isOpen === true && !this.g.isLogged){
|
|
1696
|
-
this.loading = true;
|
|
1697
|
-
}
|
|
1663
|
+
|
|
1698
1664
|
// this.saveBadgeNewConverstionNumber();
|
|
1699
1665
|
}
|
|
1700
1666
|
|
|
1701
|
-
|
|
1702
1667
|
/**
|
|
1703
1668
|
* MODAL SELECTION DEPARTMENT:
|
|
1704
1669
|
* selected department
|
|
@@ -470,7 +470,7 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
470
470
|
return this.isConversationArchived;
|
|
471
471
|
}
|
|
472
472
|
|
|
473
|
-
//
|
|
473
|
+
//FALLBACK TO TILEDESK
|
|
474
474
|
const requests_list = await this.tiledeskRequestService.getMyRequests().catch(err => {
|
|
475
475
|
this.logger.error('[CONV-COMP] getConversationDetail: error getting request from Tiledesk', err);
|
|
476
476
|
this.isConversationArchived=true
|
|
@@ -488,9 +488,9 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
488
488
|
return this.isConversationArchived
|
|
489
489
|
}
|
|
490
490
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
491
|
+
this.isConversationArchived = true;
|
|
492
|
+
return null;
|
|
493
|
+
}
|
|
494
494
|
|
|
495
495
|
/**
|
|
496
496
|
* this.g.recipientId:
|
|
@@ -840,20 +840,6 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
840
840
|
this.subscriptions.push(subscribe);
|
|
841
841
|
}
|
|
842
842
|
|
|
843
|
-
subscribtionKey = 'conversationsAdded';
|
|
844
|
-
subscribtion = this.subscriptions.find(item => item.key === subscribtionKey);
|
|
845
|
-
if(!subscribtion){
|
|
846
|
-
|
|
847
|
-
subscribtion = this.chatManager.conversationsHandlerService.conversationChanged.pipe(takeUntil(this.unsubscribe$)).subscribe((conversation) => {
|
|
848
|
-
this.logger.debug('[CONV-COMP] ***** DATAIL conversationsChanged *****', conversation, this.conversationWith, this.isConversationArchived);
|
|
849
|
-
if(conversation && conversation.recipient === this.conversationId){
|
|
850
|
-
this.isConversationArchived = false
|
|
851
|
-
}
|
|
852
|
-
});
|
|
853
|
-
const subscribe = {key: subscribtionKey, value: subscribtion };
|
|
854
|
-
this.subscriptions.push(subscribe);
|
|
855
|
-
}
|
|
856
|
-
|
|
857
843
|
subscribtionKey = 'messageWait';
|
|
858
844
|
subscribtion = this.subscriptions.find(item => item.key === subscribtionKey);
|
|
859
845
|
if (!subscribtion) {
|
package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss
CHANGED
|
@@ -419,28 +419,3 @@ textarea:active{
|
|
|
419
419
|
border: none;
|
|
420
420
|
// margin: -2px -2px 0px;
|
|
421
421
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
// aggiungi un'animazione di fade in e fade out quando .star-rating-widget è visibile con transition
|
|
425
|
-
.star-rating-widget {
|
|
426
|
-
transition: all 0.5s ease-in-out;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
.star-rating-widget {
|
|
430
|
-
position: absolute;
|
|
431
|
-
left: 0;
|
|
432
|
-
right: 0;
|
|
433
|
-
bottom: -52px;
|
|
434
|
-
height: 100%;
|
|
435
|
-
width: 100%;
|
|
436
|
-
flex-direction: row;
|
|
437
|
-
justify-content: center;
|
|
438
|
-
background-color: rgb(255, 255, 255);
|
|
439
|
-
flex-wrap: nowrap;
|
|
440
|
-
&.active {
|
|
441
|
-
bottom: 0px;
|
|
442
|
-
}
|
|
443
|
-
&.inactive {
|
|
444
|
-
bottom: -52px;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- tabindex="000"-->
|
|
2
2
|
|
|
3
3
|
<button aflauncherbutton #aflauncherbutton id="c21-launcher-button" class="c21-button-clean scale-in-center"
|
|
4
|
-
*ngIf="g.isOpen == false"
|
|
4
|
+
*ngIf="g.isLogged == true && g.isOpen == false"
|
|
5
5
|
[ngClass]="{'c21-align-left' : g.align === 'left', 'c21-align-right' : g.align !== 'left'}"
|
|
6
6
|
[ngStyle]="{ 'background-color': g.baloonImage? null: g.themeColor, 'bottom': g.marginY+'px!important', 'left':(g.align==='left')?g.marginX+'px!important':'', 'right':(g.align==='right')?g.marginX+'px!important':'', 'width': g.launcherWidth, 'height': g.launcherHeight, 'border-radius': g.baloonShape}"
|
|
7
7
|
(click)="openCloseWidget()"
|
|
@@ -67,9 +67,8 @@ export class LauncherButtonComponent implements OnInit, AfterViewInit {
|
|
|
67
67
|
// this.g.isOpen = !this.g.isOpen;
|
|
68
68
|
// this.g.setIsOpen(!this.g.isOpen);
|
|
69
69
|
// this.appStorageService.setItem('isOpen', this.g.isOpen);
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
this.onButtonClicked.emit( this.g.isOpen );
|
|
70
|
+
this.onButtonClicked.emit( this.g.isOpen );
|
|
71
|
+
}
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
}
|
|
@@ -302,7 +302,6 @@ export class TranslatorService {
|
|
|
302
302
|
'CLOSED',
|
|
303
303
|
'LABEL_PREVIEW',
|
|
304
304
|
'MAX_ATTACHMENT',
|
|
305
|
-
'MAX_ATTACHMENT_ERROR',
|
|
306
305
|
'EMOJI'
|
|
307
306
|
];
|
|
308
307
|
|
|
@@ -359,7 +358,6 @@ export class TranslatorService {
|
|
|
359
358
|
globals.LABEL_PREVIEW = res['LABEL_PREVIEW']
|
|
360
359
|
globals.LABEL_ERROR_FIELD_REQUIRED= res['LABEL_ERROR_FIELD_REQUIRED']
|
|
361
360
|
globals.MAX_ATTACHMENT = res['MAX_ATTACHMENT']
|
|
362
|
-
globals.MAX_ATTACHMENT_ERROR = res['MAX_ATTACHMENT_ERROR']
|
|
363
361
|
globals.EMOJI = res['EMOJI']
|
|
364
362
|
|
|
365
363
|
|
package/src/app/utils/globals.ts
CHANGED
|
@@ -247,7 +247,7 @@ export class Globals {
|
|
|
247
247
|
|
|
248
248
|
// ============ BEGIN: SET EXTERNAL PARAMETERS ==============//
|
|
249
249
|
this.baseLocation = 'https://widget.tiledesk.com/v2';
|
|
250
|
-
this.autoStart =
|
|
250
|
+
this.autoStart = true;
|
|
251
251
|
/** start Authentication and startUI */
|
|
252
252
|
this.startHidden = false;
|
|
253
253
|
/** show/hide all widget -> js call: showAllWidget */
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -96,6 +96,5 @@
|
|
|
96
96
|
"EMOJI_NOT_ELLOWED":"Emoji not allowed",
|
|
97
97
|
"DOMAIN_NOT_ALLOWED":"URL contains a non-allowed domain",
|
|
98
98
|
"MAX_ATTACHMENT": "Max allowed size {{FILE_SIZE_LIMIT}}Mb",
|
|
99
|
-
"MAX_ATTACHMENT_ERROR": "The file exceeds the maximum allowed size",
|
|
100
99
|
"EMOJI": "Emoji"
|
|
101
100
|
}
|
package/src/assets/i18n/es.json
CHANGED
|
@@ -96,6 +96,5 @@
|
|
|
96
96
|
"EMOJI_NOT_ELLOWED":"Emoji no permitido",
|
|
97
97
|
"DOMAIN_NOT_ALLOWED":"La URL contiene un dominio no permitido",
|
|
98
98
|
"MAX_ATTACHMENT": "Tamaño máximo permitido {{FILE_SIZE_LIMIT}}Mb",
|
|
99
|
-
"MAX_ATTACHMENT_ERROR": "El archivo supera el tamaño máximo permitido",
|
|
100
99
|
"EMOJI": "Emoji"
|
|
101
100
|
}
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -96,6 +96,5 @@
|
|
|
96
96
|
"EMOJI_NOT_ELLOWED":"Emoji non autorisé",
|
|
97
97
|
"DOMAIN_NOT_ALLOWED":"L'URL contient un domaine non autorisé",
|
|
98
98
|
"MAX_ATTACHMENT": "Taille maximale autorisée {{FILE_SIZE_LIMIT}}Mo",
|
|
99
|
-
"MAX_ATTACHMENT_ERROR": "Le fichier dépasse la taille maximale autorisée",
|
|
100
99
|
"EMOJI": "Emoji"
|
|
101
100
|
}
|
package/src/assets/i18n/it.json
CHANGED
|
@@ -94,6 +94,5 @@
|
|
|
94
94
|
"EMOJI_NOT_ELLOWED":"Emoji non consentiti",
|
|
95
95
|
"DOMAIN_NOT_ALLOWED":"L'URL contiene un dominio non consentito",
|
|
96
96
|
"MAX_ATTACHMENT": "Dimensione massima consentita {{FILE_SIZE_LIMIT}}Mb",
|
|
97
|
-
"MAX_ATTACHMENT_ERROR": "Il file supera la dimensione massima consentita",
|
|
98
97
|
"EMOJI": "Emoji"
|
|
99
98
|
}
|
|
@@ -71,7 +71,7 @@ export class TiledeskRequestsService {
|
|
|
71
71
|
|
|
72
72
|
public getMyRequests(): Promise<{ requests: Array<any>}> {
|
|
73
73
|
this.tiledeskToken = this.appStorage.getItem('tiledeskToken')
|
|
74
|
-
const url = this.URL_TILEDESK_REQUEST + 'me?preflight=true'
|
|
74
|
+
const url = this.URL_TILEDESK_REQUEST + '/me?preflight=true'
|
|
75
75
|
this.logger.log('[TILEDESK-SERVICE] - GET REQUEST url ', url);
|
|
76
76
|
const httpOptions = {
|
|
77
77
|
headers: new HttpHeaders({
|
|
@@ -773,11 +773,6 @@ export function isAllowedUrlInText(text: string, allowedUrls: string[]) {
|
|
|
773
773
|
return nonWhitelistedDomains.length === 0;
|
|
774
774
|
}
|
|
775
775
|
|
|
776
|
-
// function extractUrls(text: string): string[] {
|
|
777
|
-
// const urlRegex = /https?:\/\/[^\s]+/g;
|
|
778
|
-
// return text.match(urlRegex) || [];
|
|
779
|
-
// }
|
|
780
|
-
|
|
781
776
|
function extractUrls(text: string): string[] {
|
|
782
777
|
// Rileva URL con o senza protocollo (http/https)
|
|
783
778
|
const urlRegex = /\b((https?:\/\/)?(www\.)?[a-z0-9.-]+\.[a-z]{2,})(\/[^\s]*)?/gi;
|
|
@@ -792,3 +787,5 @@ function extractUrls(text: string): string[] {
|
|
|
792
787
|
}
|
|
793
788
|
|
|
794
789
|
|
|
790
|
+
|
|
791
|
+
|
package/src/iframe-style.css
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
bottom: 0px;
|
|
14
14
|
width: auto;
|
|
15
15
|
height: auto;
|
|
16
|
-
display:
|
|
16
|
+
display: none;
|
|
17
17
|
z-index: 3000000000; /*999999*/;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -84,12 +84,12 @@
|
|
|
84
84
|
max-width: 1024px;
|
|
85
85
|
max-height: 100%;
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
transition:
|
|
88
88
|
width 300ms,
|
|
89
89
|
height 300ms,
|
|
90
90
|
max-height 300ms,
|
|
91
91
|
transform 300ms cubic-bezier(0, 1.2, 1, 1),
|
|
92
|
-
opacity 300ms ease-out;
|
|
92
|
+
opacity 300ms ease-out;
|
|
93
93
|
/* per migliorare le prestazioni quando si usa transform */
|
|
94
94
|
will-change: transform, opacity, width, height;
|
|
95
95
|
}
|
|
@@ -175,14 +175,14 @@
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
#tiledesk-container.open #tiledeskdiv.min-size {
|
|
178
|
-
|
|
178
|
+
transition: width 200ms, height 200ms, max-height 200ms, transform 300ms cubic-bezier(0, 1.2, 1, 1), opacity 83ms ease-out;
|
|
179
179
|
width: var(--iframeMinWidth);
|
|
180
180
|
height: var(--iframeMinHeight);
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
#tiledesk-container.open #tiledeskdiv.max-size {
|
|
184
184
|
/* transition: width 1s, height 1s; */
|
|
185
|
-
|
|
185
|
+
transition: width 200ms, height 200ms, max-height 200ms, transform 300ms cubic-bezier(0, 1.2, 1, 1), opacity 83ms ease-out;
|
|
186
186
|
width: var(--iframeMaxWidth);
|
|
187
187
|
height: var(--iframeMaxHeight);
|
|
188
188
|
}
|
package/src/launch.js
CHANGED
|
@@ -217,13 +217,68 @@ function loadIframe(tiledeskScriptBaseLocation) {
|
|
|
217
217
|
|
|
218
218
|
iDiv.appendChild(ifrm);
|
|
219
219
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
220
|
+
// Funzione helper per caricare iframe con fallback per compatibilità CSP (Wix, etc.)
|
|
221
|
+
// Usa Blob URL come metodo principale (più compatibile con CSP) con fallback a srcdoc e document.write
|
|
222
|
+
function loadIframeContent(iframe, htmlContent, baseLocation) {
|
|
223
|
+
var isLocalhost = baseLocation.includes('localhost');
|
|
224
|
+
var blobUrl = null;
|
|
225
|
+
|
|
226
|
+
// Metodo 1: Blob URL (più compatibile con CSP di Wix e altre piattaforme)
|
|
227
|
+
// Usa Blob URL come metodo principale perché è meno spesso bloccato da CSP rispetto a srcdoc
|
|
228
|
+
if (typeof Blob !== 'undefined' && typeof URL !== 'undefined' && URL.createObjectURL) {
|
|
229
|
+
try {
|
|
230
|
+
var blob = new Blob([htmlContent], { type: 'text/html;charset=utf-8' });
|
|
231
|
+
blobUrl = URL.createObjectURL(blob);
|
|
232
|
+
iframe.src = blobUrl;
|
|
233
|
+
|
|
234
|
+
// Cleanup del blob URL dopo il caricamento per liberare memoria
|
|
235
|
+
var originalOnload = iframe.onload;
|
|
236
|
+
iframe.onload = function() {
|
|
237
|
+
// Revoca il blob URL dopo un delay per assicurarsi che tutto sia caricato
|
|
238
|
+
setTimeout(function() {
|
|
239
|
+
if (blobUrl) {
|
|
240
|
+
try {
|
|
241
|
+
URL.revokeObjectURL(blobUrl);
|
|
242
|
+
blobUrl = null;
|
|
243
|
+
} catch(e) {
|
|
244
|
+
console.warn('Error revoking blob URL:', e);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}, 1000);
|
|
248
|
+
if (originalOnload) originalOnload.call(this);
|
|
249
|
+
};
|
|
250
|
+
return; // Blob URL impostato con successo
|
|
251
|
+
} catch(e) {
|
|
252
|
+
console.warn('Blob URL not available, trying srcdoc:', e);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// Metodo 2: srcdoc (fallback se Blob URL non disponibile)
|
|
257
|
+
// Skip per localhost (usa document.write per compatibilità sviluppo)
|
|
258
|
+
if (!isLocalhost && 'srcdoc' in iframe) {
|
|
259
|
+
try {
|
|
260
|
+
iframe.srcdoc = htmlContent;
|
|
261
|
+
return; // srcdoc impostato
|
|
262
|
+
} catch(e) {
|
|
263
|
+
console.warn('srcdoc not allowed, trying document.write:', e);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Metodo 3: document.write (fallback finale, funziona su localhost e browser vecchi)
|
|
268
|
+
if (isLocalhost || (iframe.contentWindow && iframe.contentWindow.document)) {
|
|
269
|
+
try {
|
|
270
|
+
iframe.contentWindow.document.open();
|
|
271
|
+
iframe.contentWindow.document.write(htmlContent);
|
|
272
|
+
iframe.contentWindow.document.close();
|
|
273
|
+
return; // document.write completato
|
|
274
|
+
} catch(e) {
|
|
275
|
+
console.error('All iframe loading methods failed:', e);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
226
278
|
}
|
|
279
|
+
|
|
280
|
+
// Carica il contenuto dell'iframe con fallback automatico
|
|
281
|
+
loadIframeContent(ifrm, srcTileDesk, tiledeskScriptBaseLocation);
|
|
227
282
|
|
|
228
283
|
|
|
229
284
|
}
|
package/src/launch_template.js
CHANGED
|
@@ -218,13 +218,68 @@ function loadIframe(tiledeskScriptBaseLocation) {
|
|
|
218
218
|
|
|
219
219
|
iDiv.appendChild(ifrm);
|
|
220
220
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
221
|
+
// Funzione helper per caricare iframe con fallback per compatibilità CSP (Wix, etc.)
|
|
222
|
+
// Usa Blob URL come metodo principale (più compatibile con CSP) con fallback a srcdoc e document.write
|
|
223
|
+
function loadIframeContent(iframe, htmlContent, baseLocation) {
|
|
224
|
+
var isLocalhost = baseLocation.includes('localhost');
|
|
225
|
+
var blobUrl = null;
|
|
226
|
+
|
|
227
|
+
// Metodo 1: Blob URL (più compatibile con CSP di Wix e altre piattaforme)
|
|
228
|
+
// Usa Blob URL come metodo principale perché è meno spesso bloccato da CSP rispetto a srcdoc
|
|
229
|
+
if (typeof Blob !== 'undefined' && typeof URL !== 'undefined' && URL.createObjectURL) {
|
|
230
|
+
try {
|
|
231
|
+
var blob = new Blob([htmlContent], { type: 'text/html;charset=utf-8' });
|
|
232
|
+
blobUrl = URL.createObjectURL(blob);
|
|
233
|
+
iframe.src = blobUrl;
|
|
234
|
+
|
|
235
|
+
// Cleanup del blob URL dopo il caricamento per liberare memoria
|
|
236
|
+
var originalOnload = iframe.onload;
|
|
237
|
+
iframe.onload = function() {
|
|
238
|
+
// Revoca il blob URL dopo un delay per assicurarsi che tutto sia caricato
|
|
239
|
+
setTimeout(function() {
|
|
240
|
+
if (blobUrl) {
|
|
241
|
+
try {
|
|
242
|
+
URL.revokeObjectURL(blobUrl);
|
|
243
|
+
blobUrl = null;
|
|
244
|
+
} catch(e) {
|
|
245
|
+
console.warn('Error revoking blob URL:', e);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}, 1000);
|
|
249
|
+
if (originalOnload) originalOnload.call(this);
|
|
250
|
+
};
|
|
251
|
+
return; // Blob URL impostato con successo
|
|
252
|
+
} catch(e) {
|
|
253
|
+
console.warn('Blob URL not available, trying srcdoc:', e);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Metodo 2: srcdoc (fallback se Blob URL non disponibile)
|
|
258
|
+
// Skip per localhost (usa document.write per compatibilità sviluppo)
|
|
259
|
+
if (!isLocalhost && 'srcdoc' in iframe) {
|
|
260
|
+
try {
|
|
261
|
+
iframe.srcdoc = htmlContent;
|
|
262
|
+
return; // srcdoc impostato
|
|
263
|
+
} catch(e) {
|
|
264
|
+
console.warn('srcdoc not allowed, trying document.write:', e);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Metodo 3: document.write (fallback finale, funziona su localhost e browser vecchi)
|
|
269
|
+
if (isLocalhost || (iframe.contentWindow && iframe.contentWindow.document)) {
|
|
270
|
+
try {
|
|
271
|
+
iframe.contentWindow.document.open();
|
|
272
|
+
iframe.contentWindow.document.write(htmlContent);
|
|
273
|
+
iframe.contentWindow.document.close();
|
|
274
|
+
return; // document.write completato
|
|
275
|
+
} catch(e) {
|
|
276
|
+
console.error('All iframe loading methods failed:', e);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
227
279
|
}
|
|
280
|
+
|
|
281
|
+
// Carica il contenuto dell'iframe con fallback automatico
|
|
282
|
+
loadIframeContent(ifrm, srcTileDesk, tiledeskScriptBaseLocation);
|
|
228
283
|
|
|
229
284
|
|
|
230
285
|
}
|