@unisphere/genie-types 1.50.0 → 1.51.0

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
@@ -2040,6 +2040,38 @@ const floaterCTAVisualSettingsSchema = {
2040
2040
  }
2041
2041
  })
2042
2042
  };
2043
+ const lobbyVisualSettingsSchema = {
2044
+ type: 'object',
2045
+ properties: {
2046
+ button: {
2047
+ type: 'orByType',
2048
+ optional: 'both',
2049
+ schemas: {
2050
+ content: {
2051
+ type: 'object',
2052
+ properties: {
2053
+ type: {
2054
+ type: 'literal',
2055
+ value: 'content'
2056
+ },
2057
+ title: {
2058
+ type: 'primitive',
2059
+ value: 'string'
2060
+ },
2061
+ icon: {
2062
+ type: 'enum',
2063
+ values: ['mic'],
2064
+ optional: true
2065
+ },
2066
+ onClick: {
2067
+ type: 'function'
2068
+ }
2069
+ }
2070
+ }
2071
+ }
2072
+ }
2073
+ }
2074
+ };
2043
2075
  const containedVisualSettingsSchema = {
2044
2076
  type: 'object',
2045
2077
  properties: Object.assign(Object.assign({}, chatCustomizationSchemaProperties), {
@@ -4192,4 +4224,4 @@ function isTextBlock(b) {
4192
4224
  }
4193
4225
  const hasSources = blocks => blocks.some(b => b.type === 'unisphere-tool' && b.runtimeName === 'sources-tool');
4194
4226
 
4195
- export { AVATAR_DEFAULT_CAPABILITIES, AnswerModelEnum, AnswerTypeEnum, AvatarConnectionStatus, AvatarRuntimeName, CHAT_CONTEXT_TYPE, CHAT_CONTEXT_TYPE_GLOBAL, CHAT_DEFAULT_CAPABILITIES, ChatRuntimeName, ChatThreadRuntimeName, DeviceType, DisconnectReasons, INCLUDE_TIME_CAPABILITY, SUPPORTED_LAYOUT_TYPES, TIMEZONE_VARIABLE_NAME, agentModeSchema, avatarContainerModeSchema, avatarRuntimeChatVisualSettingsSchema, avatarRuntimeConnectSettingsSchema, avatarRuntimeContainedVisualSettingsSchema, avatarRuntimeFloaterVisualSettingsSchema, avatarRuntimeHeadFloaterVisualSettingsSchema, avatarRuntimeHeadlessVisualSettingsSchema, avatarRuntimeSettingsSchema, bannerVisualSettingsSchema, blockVisualContextSchema, buildClientRequestVars, chatContextSchema, chatCustomizationSchema, chatCustomizationSchemaProperties, chatRuntimePlayerPluginSettingsSchema, chatRuntimeSettingsSchema, chatThreadRuntimeContainedVisualSettingsSchema, chatThreadRuntimeSettingsSchema, containedVisualSettingsSchema, dynamicVariablesSchema, floaterCTAVisualSettingsSchema, floaterVisualSettingsSchema, getAvatarDefaultCapabilities, getBrowserTimezone, getChatDefaultCapabilities, getResolvedRuntimeName, getResolvedWidgetName, getSourceUrlSchema, hasSources, integrationsSchema, isAvatarConnectionProxyInternalType, isEventChannelsBlock, isEventSessionsBlock, isEventSpeakersBlock, isFlashcardBlock, isFlashcardElement, isFollowupsBlock, isFollowupsElement, isPDFSourceItem, isSourcesBlock, isSourcesElement, isTextBlock, isTextFlashcard, isVideoGalleryFlashcard, isVideoSourceItem, multipleAvatarBehaviorSchema, pageVisualSettingsSchema, popupVisualSettingsSchema, resolveActiveContextType, schemaVersionSchema, shareUrlSchema, speechLanguagesSchema, widgetName };
4227
+ export { AVATAR_DEFAULT_CAPABILITIES, AnswerModelEnum, AnswerTypeEnum, AvatarConnectionStatus, AvatarRuntimeName, CHAT_CONTEXT_TYPE, CHAT_CONTEXT_TYPE_GLOBAL, CHAT_DEFAULT_CAPABILITIES, ChatRuntimeName, ChatThreadRuntimeName, DeviceType, DisconnectReasons, INCLUDE_TIME_CAPABILITY, SUPPORTED_LAYOUT_TYPES, TIMEZONE_VARIABLE_NAME, agentModeSchema, avatarContainerModeSchema, avatarRuntimeChatVisualSettingsSchema, avatarRuntimeConnectSettingsSchema, avatarRuntimeContainedVisualSettingsSchema, avatarRuntimeFloaterVisualSettingsSchema, avatarRuntimeHeadFloaterVisualSettingsSchema, avatarRuntimeHeadlessVisualSettingsSchema, avatarRuntimeSettingsSchema, bannerVisualSettingsSchema, blockVisualContextSchema, buildClientRequestVars, chatContextSchema, chatCustomizationSchema, chatCustomizationSchemaProperties, chatRuntimePlayerPluginSettingsSchema, chatRuntimeSettingsSchema, chatThreadRuntimeContainedVisualSettingsSchema, chatThreadRuntimeSettingsSchema, containedVisualSettingsSchema, dynamicVariablesSchema, floaterCTAVisualSettingsSchema, floaterVisualSettingsSchema, getAvatarDefaultCapabilities, getBrowserTimezone, getChatDefaultCapabilities, getResolvedRuntimeName, getResolvedWidgetName, getSourceUrlSchema, hasSources, integrationsSchema, isAvatarConnectionProxyInternalType, isEventChannelsBlock, isEventSessionsBlock, isEventSpeakersBlock, isFlashcardBlock, isFlashcardElement, isFollowupsBlock, isFollowupsElement, isPDFSourceItem, isSourcesBlock, isSourcesElement, isTextBlock, isTextFlashcard, isVideoGalleryFlashcard, isVideoSourceItem, lobbyVisualSettingsSchema, multipleAvatarBehaviorSchema, pageVisualSettingsSchema, popupVisualSettingsSchema, resolveActiveContextType, schemaVersionSchema, shareUrlSchema, speechLanguagesSchema, widgetName };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/genie-types",
3
- "version": "1.50.0",
3
+ "version": "1.51.0",
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
- "@kaltura-sdk/rtc-core": "^1.27.0",
12
+ "@kaltura-sdk/rtc-core": "^1.28.0",
13
13
  "@unisphere/core": "^1.103.0",
14
14
  "@unisphere/runtime": "^1.103.0",
15
15
  "@unisphere/runtime-js": "^1.98.0"
@@ -102,6 +102,13 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
102
102
  muted: boolean;
103
103
  isSpeaking: boolean;
104
104
  }>;
105
+ /**
106
+ * Observable: the browser's autoplay policy blocked the avatar media (mainly Safari/iOS).
107
+ * The built-in visuals show a prompt; headless hosts should show their own and call resumePlayback().
108
+ */
109
+ playbackBlocked: TinyDataStoreConsumer<boolean>;
110
+ /** Resume avatar media blocked by the autoplay policy. Must be called synchronously from a user gesture. */
111
+ resumePlayback(): Promise<boolean>;
105
112
  /** Observable agent data */
106
113
  agentData: TinyDataStoreConsumer<AgentData>;
107
114
  /** Observable disconnect data, including reason and error if applicable */
@@ -515,6 +515,10 @@ export interface AvatarClientManagerType {
515
515
  readonly audioVolumeLevel: TinyDataStoreConsumer<number>;
516
516
  /** Observable available audio devices */
517
517
  readonly devicesList: TinyDataStoreConsumer<UserDevicesList | null>;
518
+ /** Observable: avatar media is blocked by the browser's autoplay policy and needs a user gesture */
519
+ readonly playbackBlocked: TinyDataStoreConsumer<boolean>;
520
+ /** Resume media blocked by the autoplay policy. Must be called synchronously from a user gesture. */
521
+ resumePlayback(): Promise<boolean>;
518
522
  joinSTV(videoContainerId: string, sessionId: string, stvUrl: string, onConnected: () => void): Promise<void>;
519
523
  leaveSTV(): void;
520
524
  /** Latest server-issued TURN credentials; read at connection time, never cache or log them. */
@@ -145,6 +145,40 @@ export type FloaterCTAVisualSettings = ModeContextVisualSettings & ChatCustomiza
145
145
  showIcon?: boolean;
146
146
  header?: ChatHeaderSettings;
147
147
  };
148
+ /** Lobby start button rendered by the runtime. */
149
+ export type LobbyButtonSettings = {
150
+ type: 'content';
151
+ /** Text shown on the start button */
152
+ title: string;
153
+ /** Icon shown on the start button; no icon when omitted */
154
+ icon?: 'mic';
155
+ /** Called when the start button is clicked */
156
+ onClick: () => void;
157
+ };
158
+ /**
159
+ * Visual settings for the lobby: the avatar preview with a start button.
160
+ * The title and description come from the app init config.
161
+ *
162
+ * `button` behavior:
163
+ * - omitted: the default start button, which launches the avatar
164
+ * - `null`: no start button
165
+ * - `{ type: 'content' }`: a runtime-rendered button; clicking it only calls `onClick`
166
+ *
167
+ * @example
168
+ * ```typescript
169
+ * const settings: LobbyVisualSettings = {
170
+ * button: {
171
+ * type: 'content',
172
+ * title: 'Start roleplay',
173
+ * icon: 'mic',
174
+ * onClick: () => openKnobsModal(),
175
+ * },
176
+ * };
177
+ * ```
178
+ */
179
+ export type LobbyVisualSettings = {
180
+ button?: null | LobbyButtonSettings;
181
+ };
148
182
  export type FloaterVisualSettings = ModeContextVisualSettings & ChatCustomization & {
149
183
  openingPosition?: 'left' | 'right';
150
184
  header?: ChatHeaderSettings;
@@ -152,6 +186,7 @@ export type FloaterVisualSettings = ModeContextVisualSettings & ChatCustomizatio
152
186
  };
153
187
  export declare const floaterVisualSettingsSchema: ValidatorSchema;
154
188
  export declare const floaterCTAVisualSettingsSchema: ValidatorSchema;
189
+ export declare const lobbyVisualSettingsSchema: ValidatorSchema;
155
190
  export declare const containedVisualSettingsSchema: ValidatorSchema;
156
191
  export declare const pageVisualSettingsSchema: ValidatorSchema;
157
192
  export declare const bannerVisualSettingsSchema: ValidatorSchema;