Skip to content

Commit c3aa2aa

Browse files
TobiasDuelliclaude
andcommitted
fix: declare Gleap.setStyles with the positional arguments the SDK takes
index.d.ts declared setStyles with one object since v6.4.5, while the runtime takes primaryColor, headerColor, buttonColor and seven optional positional arguments. A call in the declared form threw on the page and injected no styles. Types and changelog only; no runtime change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 21ed65c commit c3aa2aa

2 files changed

Lines changed: 33 additions & 10 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## Unreleased
4+
Fixed: `index.d.ts` declared `Gleap.setStyles` with one object, but the SDK takes positional arguments: `setStyles(primaryColor, headerColor, buttonColor, backgroundColor?, borderRadius?, buttonX?, buttonY?, buttonStyle?, headerColor2?, headerColor3?)`. A call in the declared object form threw an error on the page and injected no styles. TypeScript projects that call `setStyles` with an object now get a compile error pointing at that call, which never worked; pass the values as arguments instead. No runtime change.
5+
36
## 19.9.0
47
Changed: the feedback form's **Record screen** uses the microphone only when **Developer options → Microphone** is on, and then it starts muted until the user turns it on. Until this version, form recordings asked for the microphone whenever the browser had one, regardless of that setting, and on a site that already had microphone permission the browser gave it without a prompt. The mic button is hidden when the setting is off. Projects that want sound in form recordings turn the setting on.
58
Added: product tours and tooltips can point at elements inside open shadow roots. A selector continues into a shadow root with `host >>> inner`, the element picker stores such selectors, and the highlight, the interaction lockout and click-to-continue work for those elements.

‎index.d.ts‎

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,36 @@ export namespace Gleap {
170170
function trackEvent(name: string, data?: any): void;
171171
function setAppBuildNumber(buildNumber: string): void;
172172
function setAppVersionCode(versionCode: string): void;
173-
function setStyles(styles: {
174-
primaryColor: string;
175-
headerColor: string;
176-
buttonColor: string;
177-
backgroundColor: string;
178-
borderRadius?: number;
179-
buttonX?: number;
180-
buttonY?: number;
181-
buttonStyle?: string;
182-
}): void;
173+
/**
174+
* Replaces the widget's stylesheet: colors, corner radius and the launcher's offsets.
175+
* Takes positional arguments. The SDK applies the dashboard's look the same way
176+
* whenever the project's config loads, which replaces an earlier call.
177+
* Colors are six-digit hex colors such as "#485BFF".
178+
* @param primaryColor UI color.
179+
* @param headerColor Header color.
180+
* @param buttonColor Launcher color.
181+
* @param backgroundColor Widget background. Default "#ffffff".
182+
* @param borderRadius Corner radius in px. Default 20.
183+
* @param buttonX Distance of the launcher and widget from the page's side, in px. Default 20.
184+
* @param buttonY Distance of the launcher from the page's bottom, in px. Default 20.
185+
* @param buttonStyle The launcher's position ("BOTTOM_LEFT", "BOTTOM_RIGHT", "BUTTON_CLASSIC",
186+
* "BUTTON_CLASSIC_LEFT", "BUTTON_CLASSIC_BOTTOM" or "BUTTON_NONE"), used to place
187+
* notifications clear of it. Default "BOTTOM_LEFT".
188+
* @param headerColor2 Second header gradient color. Defaults to `headerColor`.
189+
* @param headerColor3 Third header gradient color. Defaults to `headerColor`.
190+
*/
191+
function setStyles(
192+
primaryColor: string,
193+
headerColor: string,
194+
buttonColor: string,
195+
backgroundColor?: string,
196+
borderRadius?: number,
197+
buttonX?: number,
198+
buttonY?: number,
199+
buttonStyle?: string,
200+
headerColor2?: string,
201+
headerColor3?: string
202+
): void;
183203
function disableConsoleLogOverwrite(): void;
184204
function setLiveSite(isLiveSite: boolean): void;
185205
function enableShortcuts(enabled: boolean): void;

0 commit comments

Comments
 (0)