Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 19.9.2

### Breaking changes
- None.

### Fixed
- In product tours, a sender photo that is not square is centered in its round frame instead of cropped to the top left. ([#242](https://github.com/GleapSDK/JavaScript-SDK/pull/242))

## 19.9.1

### Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion build/browser/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/browser/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/cjs/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/cjs/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/esm/index.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/esm/index.mjs.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"description": "JavaScript and TypeScript SDK for Gleap, an Intercom alternative with AI customer support, live chat, in-app bug reporting and customer feedback.",
"name": "gleap",
"version": "19.9.1",
"version": "19.9.2",
"main": "build/cjs/index.js",
"module": "build/esm/index.mjs",
"exports": {
Expand Down
2 changes: 2 additions & 0 deletions published/19.9.2/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions published/19.9.2/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions published/19.9.2/survey-embed.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion published/latest/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion published/latest/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/UI.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import GleapFeedbackButtonManager from './GleapFeedbackButtonManager';

Check warning on line 1 in src/UI.js

View workflow job for this annotation

GitHub Actions / quality

quality file-lines

[file-lines] src/UI.js:1 file: 3039 -> 3040 code lines (limit 400) Fix: Move one responsibility into its own file next to this one. Never squeeze code onto fewer lines.
import { applyGleapCSPNonce } from './GleapHelper';

const calculateShadeColor = function (col, amt) {
Expand Down Expand Up @@ -179,7 +179,7 @@
</svg>${blurOverlay}</div>`;
};

export const injectStyledCSS = (

Check warning on line 182 in src/UI.js

View workflow job for this annotation

GitHub Actions / quality

quality function-lines

[function-lines] src/UI.js:182 function "injectStyledCSS": 2732 -> 2733 code lines (limit 80) Fix: Split by responsibility: extract a part into its own function or sub-component at module level. Never squeeze code onto fewer lines.
primaryColor,
headerColor,
buttonColor,
Expand Down Expand Up @@ -2664,6 +2664,7 @@
border-radius: 32px;
margin-right: 10px;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}

Expand Down
25 changes: 25 additions & 0 deletions src/UI.tourSender.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* @vitest-environment jsdom
*/
import { afterEach, describe, expect, it } from 'vitest';
import { injectStyledCSS } from './UI';

describe('product tour sender image', () => {
afterEach(() => {
document.head.innerHTML = '';
document.body.innerHTML = '';
});

it('centers a non-square sender photo inside its round frame', () => {
injectStyledCSS('#485BFF', '#485BFF', '#485BFF', 20, '#ffffff', 20, 20, 'BUTTON_NONE');
const image = document.createElement('div');
image.className = 'gleap-tour-sender-image';
image.style.backgroundImage = "url('https://example.com/wide.png')";
document.body.appendChild(image);

const style = window.getComputedStyle(image);

expect(style.backgroundSize).toBe('cover');
expect(['center', 'center center', '50% 50%']).toContain(style.backgroundPosition);
});
});
Loading