@kaltura-apps/genie-chat-react 1.3.1 → 1.3.3

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/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import React, { useMemo, useContext } from 'react';
3
3
  import { UnisphereProvider, ScopedUnisphereWorkspaceProvider, UnisphereRuntimeLoader, ScopedUnisphereWorkspaceContext, UnisphereRuntimeVisual } from '@unisphere/runtime-react';
4
4
 
@@ -1642,7 +1642,8 @@ const GenieChatProvider = ({
1642
1642
  runtimeSettings,
1643
1643
  lang: _lang = 'en',
1644
1644
  theme: _theme = 'light',
1645
- env: _env = 'nvp1'
1645
+ env: _env = 'nvp1',
1646
+ runtimeErrorComponent
1646
1647
  }) => {
1647
1648
  const [workspace, setWorkspace] = React.useState(null);
1648
1649
  const workspaceName = useMemo(() => {
@@ -1671,22 +1672,22 @@ const GenieChatProvider = ({
1671
1672
  return null;
1672
1673
  }
1673
1674
  if (runtimeError) {
1674
- return jsx("div", {
1675
+ return runtimeErrorComponent !== null && runtimeErrorComponent !== void 0 ? runtimeErrorComponent : jsxs("div", {
1675
1676
  style: {
1676
1677
  color: 'red',
1677
1678
  padding: '1rem',
1678
1679
  width: '100%',
1679
1680
  height: '100%',
1680
- display: 'flex',
1681
- alignItems: 'center',
1682
- justifyContent: 'center',
1683
- textAlign: 'center'
1681
+ textAlign: 'center',
1682
+ maxWidth: '25rem'
1684
1683
  },
1685
- children: jsxs("span", {
1686
- children: [jsx("b", {
1687
- children: "Error loading chat runtime:"
1688
- }), " ", runtimeError.message]
1689
- })
1684
+ children: [jsx("p", {
1685
+ children: jsx("b", {
1686
+ children: "Error loading chat runtime"
1687
+ })
1688
+ }), jsx("p", {
1689
+ children: "Try again later"
1690
+ })]
1690
1691
  });
1691
1692
  }
1692
1693
  return jsx(UnisphereProvider, Object.assign({}, themeProps, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaltura-apps/genie-chat-react",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "author": "kaltura",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "types": "./src/index.d.ts",
11
11
  "dependencies": {
12
- "@unisphere/genie-types": "^1.12.0",
12
+ "@unisphere/genie-types": "^1.13.1",
13
13
  "@unisphere/runtime": "^1.90.1",
14
14
  "@unisphere/runtime-react": "^1.83.4",
15
15
  "react": "^19.0.0"
@@ -5,5 +5,6 @@ export type GenieChatProviderProps = {
5
5
  lang?: string;
6
6
  theme?: 'light' | 'dark' | object;
7
7
  runtimeSettings?: Omit<ChatRuntimeSettings, 'schemaVersion'>;
8
+ runtimeErrorComponent?: React.ReactNode;
8
9
  };
9
10
  export declare const GenieChatProvider: React.FC<React.PropsWithChildren<GenieChatProviderProps>>;