Skip to content

Commit 05ea819

Browse files
committed
v7.0.20
1 parent 2dd1385 commit 05ea819

File tree

10 files changed

+100
-54
lines changed

10 files changed

+100
-54
lines changed

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Gleap.preFillForm({
66
});
77

88
// Gleap.setApiUrl("http://localhost:9000");
9-
//Gleap.setFrameUrl("http://localhost:3000");
9+
//Gleap.setLanguage("en");
10+
Gleap.setFrameUrl("http://localhost:3001");
1011
Gleap.initialize("MMxTvMklWdr6pgZzA3hJk9K0IvOsIT2A");
1112

1213
Gleap.attachCustomData({

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gleap",
3-
"version": "7.0.19",
3+
"version": "7.0.20",
44
"main": "build/index.js",
55
"scripts": {
66
"start": "webpack serve",

published/7.0.20/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

published/latest/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GleapConfigManager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export default class GleapConfigManager {
125125

126126
if (flowConfig.customTranslations) {
127127
GleapTranslationManager.getInstance().setCustomTranslation(flowConfig.customTranslations);
128+
GleapTranslationManager.getInstance().updateRTLSupport();
128129
}
129130

130131
Gleap.enableShortcuts(flowConfig.enableShortcuts ? true : false);

src/GleapFeedbackButtonManager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export default class GleapFeedbackButtonManager {
8282
}
8383

8484
this.feedbackButton.className = "bb-feedback-button gleap-hidden";
85+
this.feedbackButton.setAttribute("dir", GleapTranslationManager.getInstance().isRTLLayout ? "rtl" : "ltr");
8586
if (
8687
flowConfig.feedbackButtonPosition === GleapFeedbackButtonManager.FEEDBACK_BUTTON_CLASSIC ||
8788
flowConfig.feedbackButtonPosition === GleapFeedbackButtonManager.FEEDBACK_BUTTON_CLASSIC_BOTTOM ||

src/GleapFrameManager.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ export default class GleapFrameManager {
9494
if (styleToApply) {
9595
this.gleapFrameContainer.classList.add(styleToApply);
9696
}
97+
98+
this.gleapFrameContainer.setAttribute("dir", GleapTranslationManager.getInstance().isRTLLayout ? "rtl" : "ltr");
9799
}
98100

99101
showWidget() {

src/GleapTranslationManager.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { GleapFrameManager } from "./Gleap";
1+
import { GleapFrameManager, GleapFeedbackButtonManager } from "./Gleap";
22

33
export default class GleapTranslationManager {
44
customTranslation = {};
55
overrideLanguage = "";
6+
isRTLLayout = false;
67

78
// GleapTranslationManager singleton
89
static instance;
@@ -28,6 +29,14 @@ export default class GleapTranslationManager {
2829
setOverrideLanguage(language) {
2930
this.overrideLanguage = language;
3031
GleapFrameManager.getInstance().sendConfigUpdate();
32+
this.updateRTLSupport();
33+
}
34+
35+
updateRTLSupport() {
36+
// Update RTL support.
37+
this.isRTLLayout = GleapTranslationManager.translateText("rtlLang") === "true";
38+
GleapFeedbackButtonManager.getInstance().updateFeedbackButtonState();
39+
GleapFrameManager.getInstance().updateFrameStyle();
3140
}
3241

3342
/**
@@ -67,7 +76,7 @@ export default class GleapTranslationManager {
6776

6877
return customTranslation;
6978
}
70-
79+
7180
var customTranslation = searchForTranslationTable(language);
7281

7382
// Extended search for language match only.

src/UI.js

Lines changed: 79 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -75,38 +75,62 @@ export const injectStyledCSS = (
7575
user-select: none;
7676
}
7777
78-
.gleap-frame-container--animate {
79-
transition: max-height 0.3s ease-in;
80-
}
81-
82-
@keyframes gleapFadeInUp {
83-
from {
84-
opacity: 0;
85-
transform: translate3d(0, 100%, 0);
86-
}
87-
to {
88-
opacity: 1;
89-
transform: translate3d(0, 0, 0);
90-
}
78+
[dir=rtl].gleap-frame-container {
79+
right: auto;
80+
left: 20px;
81+
bottom: 95px;
9182
}
9283
9384
.gleap-frame-container--classic {
9485
right: 20px;
9586
bottom: 20px;
9687
}
9788
89+
[dir=rtl].gleap-frame-container--classic {
90+
right: auto;
91+
left: 20px;
92+
bottom: 20px;
93+
}
94+
9895
.gleap-frame-container--classic-left {
9996
right: auto;
10097
left: 20px;
10198
bottom: 20px;
10299
}
103100
101+
[dir=rtl].gleap-frame-container--classic-left {
102+
left: auto;
103+
right: 20px;
104+
bottom: 20px;
105+
}
106+
104107
.gleap-frame-container--modern-left {
105108
right: auto;
106109
left: 20px;
107110
bottom: 95px;
108111
}
109112
113+
[dir=rtl].gleap-frame-container--modern-left {
114+
left: auto;
115+
right: 20px;
116+
bottom: 95px;
117+
}
118+
119+
.gleap-frame-container--animate {
120+
transition: max-height 0.3s ease-in;
121+
}
122+
123+
@keyframes gleapFadeInUp {
124+
from {
125+
opacity: 0;
126+
transform: translate3d(0, 100%, 0);
127+
}
128+
to {
129+
opacity: 1;
130+
transform: translate3d(0, 0, 0);
131+
}
132+
}
133+
110134
.gleap-frame-container-inner {
111135
width: 100%;
112136
height: 100%;
@@ -152,24 +176,31 @@ export const injectStyledCSS = (
152176
align-items: center;
153177
padding: 0px;
154178
}
155-
156-
.bb-feedback-button--disabled .bb-feedback-button-icon {
157-
display: none !important;
158-
}
159-
160-
.bb-feedback-button--disabled .bb-feedback-button-text {
161-
display: none;
179+
180+
[dir=rtl].bb-feedback-button {
181+
bottom: 20px;
182+
right: auto;
183+
left: 20px;
162184
}
163185
164186
.bb-feedback-button--bottomleft {
165187
bottom: 20px;
166188
right: auto;
167189
left: 20px;
168190
}
191+
192+
[dir=rtl].bb-feedback-button--bottomleft {
193+
bottom: 20px;
194+
right: 20px;
195+
left: auto;
196+
}
169197
170-
.bb-feedback-button--bottomleft .bb-feedback-button-shoutout {
171-
right: auto;
172-
left: 94px;
198+
.bb-feedback-button--disabled .bb-feedback-button-icon {
199+
display: none !important;
200+
}
201+
202+
.bb-feedback-button--disabled .bb-feedback-button-text {
203+
display: none;
173204
}
174205
175206
.bb-feedback-button-text {
@@ -255,6 +286,14 @@ export const injectStyledCSS = (
255286
animation-fill-mode: both;
256287
animation-name: bbFadeInOpacity;
257288
}
289+
290+
[dir=rtl].bb-feedback-button .bb-feedback-button-classic {
291+
top: 50%;
292+
left: 0px;
293+
right: auto;
294+
transform: rotate(90deg) translate(-50%, -100%);
295+
transform-origin: 0% 0%;
296+
}
258297
259298
.bb-feedback-button-classic--left {
260299
top: 50%;
@@ -263,12 +302,29 @@ export const injectStyledCSS = (
263302
transform: rotate(90deg) translate(-50%, -100%);
264303
transform-origin: 0% 0%;
265304
}
305+
306+
[dir=rtl].bb-feedback-button .bb-feedback-button-classic--left {
307+
top: 50%;
308+
right: 0px;
309+
left: auto;
310+
transform: rotate(-90deg) translate(50%, -50%);
311+
transform-origin: 100% 50%;
312+
}
266313
267314
.bb-feedback-button-classic--bottom {
268315
top: auto;
269316
bottom: 0px;
270317
transform: none;
271318
right: 20px;
319+
left: auto;
320+
}
321+
322+
[dir=rtl].bb-feedback-button .bb-feedback-button-classic--bottom {
323+
top: auto;
324+
bottom: 0px;
325+
transform: none;
326+
left: 20px;
327+
right: auto;
272328
}
273329
274330
.bb-feedback-button--open .bb-feedback-button-classic {
@@ -316,11 +372,6 @@ export const injectStyledCSS = (
316372
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25), 0px 0px 20px rgba(0, 0, 0, 0.2);
317373
}
318374
319-
.bb-feedback-button--bottomleft.bb-feedback-button--open {
320-
padding-left: 0px;
321-
padding-right: 5px;
322-
}
323-
324375
.bb-feedback-button--open .bb-feedback-button-text {
325376
animation-name: bbFadeOutDown;
326377
}
@@ -329,21 +380,6 @@ export const injectStyledCSS = (
329380
display: flex;
330381
}
331382
332-
.bb-feedback-button--bottomleft .bb-feedback-dialog {
333-
right: auto;
334-
left: 16px;
335-
}
336-
337-
.bb-feedback-button--classic .bb-feedback-dialog,
338-
.bb-feedback-button--disabled .bb-feedback-dialog {
339-
bottom: 20px;
340-
}
341-
342-
.bb-feedback-button--classic-left .bb-feedback-dialog {
343-
right: auto;
344-
left: 16px;
345-
}
346-
347383
.bb-capture-svg {
348384
position: absolute;
349385
z-index: ${zIndexBase + 14};
@@ -925,11 +961,6 @@ export const injectStyledCSS = (
925961
display: none;
926962
}
927963
928-
.bb-feedback-button--bottomleft .bb-feedback-dialog {
929-
left: 10px;
930-
right: 10px;
931-
}
932-
933964
.bb-capture-editor-borderlayer {
934965
border-width: 4px;
935966
}

0 commit comments

Comments
 (0)