@livechat/design-system-react-components 1.33.8-beta.2 → 1.34.1

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.
@@ -1,7 +1,7 @@
1
1
  import { FC, MouseEvent } from 'react';
2
2
  import { ProductOption, ProductId } from '../../types';
3
3
  type IProps = {
4
- onClick: (event: MouseEvent, id: ProductId, url: string, redirectUri: string) => void;
4
+ onClick: (event: MouseEvent, id: ProductId) => void;
5
5
  product: ProductOption;
6
6
  isActive?: boolean;
7
7
  };
@@ -1,9 +1,9 @@
1
- import { ProductName, ProductData, ProductId, ProductOption, ProductSubscription } from './types';
2
- export declare const getRedirectURL: (productClientId: string, productRedirectUri: string, organizationId: string, env: 'production' | 'prod' | string | undefined) => string;
1
+ import { ProductName, ProductData, ProductId, ProductOption, ProductSubscription, Env } from './types';
2
+ export declare const getRedirectURL: (productClientId: string, productRedirectUri: string, organizationId: string, mainProductId: ProductId, env: Env) => string;
3
3
  export declare const getTrialDaysLeft: (trialEnd: string) => number;
4
4
  export declare const isVisibleProduct: (productId: ProductId, installedProducts: {
5
5
  product: ProductName;
6
6
  }[]) => boolean;
7
- export declare const createProductOption: (product: ProductOption, redirectData: ProductData[], subscriptions: ProductSubscription, organizationId: string, env?: string) => ProductOption;
8
- export declare const getRedirectDataByEnv: (env: 'labs' | 'staging' | 'prod') => ProductData[];
9
- export declare const openOrFocusTab: (url: string, tabName: string, redirectUri: string) => void;
7
+ export declare const createProductOption: (product: ProductOption, redirectData: ProductData[], subscriptions: ProductSubscription, organizationId: string, mainProductId: ProductId, env: Env) => ProductOption;
8
+ export declare const getRedirectDataByEnv: (env: Env) => ProductData[];
9
+ export declare const getUtmSource: (env: Env, mainProductId: ProductId) => string | undefined;
@@ -1,12 +1,13 @@
1
- import { ProductName, ProductOption, ProductSubscription } from '../types';
1
+ import { Env, ProductId, ProductName, ProductOption, ProductSubscription } from '../types';
2
2
  export interface IProductSwitcherHook {
3
- env?: 'labs' | 'staging' | 'prod';
3
+ env?: Env;
4
4
  installedProducts: {
5
5
  product: ProductName;
6
6
  }[];
7
7
  organizationId: string;
8
8
  subscriptions: ProductSubscription;
9
+ mainProductId: ProductId;
9
10
  }
10
- export declare const useProductSwitcher: ({ env, installedProducts, subscriptions, organizationId, }: IProductSwitcherHook) => {
11
+ export declare const useProductSwitcher: ({ env, installedProducts, subscriptions, organizationId, mainProductId, }: IProductSwitcherHook) => {
11
12
  products: ProductOption[];
12
13
  };
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { IconSource } from '../Icon';
3
3
  export type ProductId = 'livechat' | 'helpdesk' | 'chatbot' | 'openwidget' | 'knowledgebase' | 'hello' | 'accounts';
4
4
  export type ProductName = 'LiveChat' | 'HelpDesk' | 'ChatBot' | 'OpenWidget' | 'KnowledgeBase' | 'Hello' | 'Accounts';
5
+ export type Env = 'labs' | 'staging' | 'prod';
5
6
  export interface ProductSwitcherProps {
6
7
  mainProductId: ProductId;
7
8
  productOptions: ProductOption[];
@@ -34,7 +35,6 @@ export interface ProductOption {
34
35
  };
35
36
  withDivider?: boolean;
36
37
  url: string;
37
- redirectUri: string;
38
38
  }
39
39
  export type ProductData = {
40
40
  clientId: string;