@mml-io/3d-web-experience-client 0.21.6 → 0.23.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.
Files changed (29) hide show
  1. package/build/Networked3dWebExperienceClient.d.ts +15 -14
  2. package/build/avatar-selection-ui/AvatarSelectionUI.d.ts +20 -0
  3. package/build/avatar-selection-ui/AvatarType.d.ts +21 -0
  4. package/build/avatar-selection-ui/components/AvatarPanel/AvatarSectionUIComponent.d.ts +14 -0
  5. package/build/avatar-selection-ui/index.d.ts +2 -0
  6. package/build/chat-ui/TextChatUI.d.ts +25 -0
  7. package/build/chat-ui/components/ChatPanel/TextChatUIComponent.d.ts +9 -0
  8. package/build/chat-ui/components/Input/InputBox.d.ts +9 -0
  9. package/build/chat-ui/components/Message/Message.d.ts +9 -0
  10. package/build/chat-ui/components/Messages/Messages.d.ts +12 -0
  11. package/build/chat-ui/helpers.d.ts +3 -0
  12. package/build/chat-ui/index.d.ts +1 -0
  13. package/build/index.css +875 -0
  14. package/build/index.css.map +7 -0
  15. package/build/index.js +1306 -189
  16. package/build/index.js.map +4 -4
  17. package/build/src/Networked3dWebExperience.module.css.d.ts +4 -0
  18. package/build/src/Networked3dWebExperience.module.d.css.ts +4 -0
  19. package/build/src/avatar-selection-ui/components/AvatarPanel/AvatarSelectionUIComponent.module.css.d.ts +26 -0
  20. package/build/src/avatar-selection-ui/components/AvatarPanel/AvatarSelectionUIComponent.module.d.css.ts +26 -0
  21. package/build/src/chat-ui/components/ChatPanel/TextChatUIComponent.module.css.d.ts +15 -0
  22. package/build/src/chat-ui/components/ChatPanel/TextChatUIComponent.module.d.css.ts +15 -0
  23. package/build/src/chat-ui/components/Input/InputBox.module.css.d.ts +7 -0
  24. package/build/src/chat-ui/components/Input/InputBox.module.d.css.ts +7 -0
  25. package/build/src/chat-ui/components/Message/Message.module.css.d.ts +5 -0
  26. package/build/src/chat-ui/components/Message/Message.module.d.css.ts +5 -0
  27. package/build/src/chat-ui/components/Messages/Messages.module.css.d.ts +5 -0
  28. package/build/src/chat-ui/components/Messages/Messages.module.d.css.ts +5 -0
  29. package/package.json +13 -10
@@ -1,6 +1,7 @@
1
- import { AvatarConfiguration } from "@mml-io/3d-web-avatar-selection-ui";
2
- import { AnimationConfig, EnvironmentConfiguration, LoadingScreenConfig } from "@mml-io/3d-web-client-core";
3
- import { StringToHslOptions } from "@mml-io/3d-web-text-chat";
1
+ import { AnimationConfig, EnvironmentConfiguration, LoadingScreenConfig, SpawnConfiguration } from "@mml-io/3d-web-client-core";
2
+ import { ServerBroadcastMessage } from "@mml-io/3d-web-user-networking";
3
+ import { AvatarConfiguration } from "./avatar-selection-ui";
4
+ import { StringToHslOptions } from "./chat-ui";
4
5
  type MMLDocumentConfiguration = {
5
6
  url: string;
6
7
  position?: {
@@ -22,27 +23,26 @@ type MMLDocumentConfiguration = {
22
23
  export type Networked3dWebExperienceClientConfig = {
23
24
  userNetworkAddress: string;
24
25
  sessionToken: string;
25
- allowOrbitalCamera?: boolean;
26
26
  chatVisibleByDefault?: boolean;
27
27
  userNameToColorOptions?: StringToHslOptions;
28
28
  animationConfig: AnimationConfig;
29
29
  voiceChatAddress?: string;
30
30
  updateURLLocation?: boolean;
31
- onServerBroadcast?: (broadcast: {
32
- broadcastType: string;
33
- payload: any;
34
- }) => void;
31
+ onServerBroadcast?: (broadcast: ServerBroadcastMessage) => void;
35
32
  loadingScreen?: LoadingScreenConfig;
36
33
  } & UpdatableConfig;
37
34
  export type UpdatableConfig = {
38
- chatNetworkAddress?: string | null;
35
+ enableChat?: boolean;
39
36
  mmlDocuments?: {
40
37
  [key: string]: MMLDocumentConfiguration;
41
38
  };
42
39
  environmentConfiguration?: EnvironmentConfiguration;
40
+ spawnConfiguration?: SpawnConfiguration;
43
41
  avatarConfiguration?: AvatarConfiguration;
44
42
  allowCustomDisplayName?: boolean;
45
43
  enableTweakPane?: boolean;
44
+ allowOrbitalCamera?: boolean;
45
+ postProcessingEnabled?: boolean;
46
46
  };
47
47
  export declare class Networked3dWebExperienceClient {
48
48
  private holderElement;
@@ -66,27 +66,28 @@ export declare class Networked3dWebExperienceClient {
66
66
  private networkClient;
67
67
  private remoteUserStates;
68
68
  private userProfiles;
69
- private networkChat;
70
69
  private textChatUI;
71
70
  private avatarSelectionUI;
72
- private voiceChatManager;
73
71
  private readonly latestCharacterObject;
74
72
  private characterControllerPaneSet;
73
+ private spawnConfiguration;
75
74
  private initialLoadCompleted;
76
75
  private loadingProgressManager;
77
76
  private loadingScreen;
78
77
  private errorScreen?;
79
- private currentRequestAnimationFrame;
80
78
  private groundPlane;
79
+ private respawnButton;
80
+ private currentRequestAnimationFrame;
81
81
  constructor(holderElement: HTMLElement, config: Networked3dWebExperienceClientConfig);
82
82
  private setGroundPlaneEnabled;
83
83
  updateConfig(config: Partial<UpdatableConfig>): void;
84
84
  static createFullscreenHolder(): HTMLDivElement;
85
+ private createRespawnButton;
85
86
  private resolveCharacterData;
86
- private updateUserProfile;
87
+ private onNetworkUpdate;
87
88
  private sendIdentityUpdateToServer;
88
- private connectToVoiceChat;
89
89
  private setupTweakPane;
90
+ private handleChatMessage;
90
91
  private connectToTextChat;
91
92
  private mountAvatarSelectionUI;
92
93
  update(): void;
@@ -0,0 +1,20 @@
1
+ import { AvatarConfiguration, AvatarType } from "./AvatarType";
2
+ export type AvatarSelectionUIProps = {
3
+ holderElement: HTMLElement;
4
+ visibleByDefault?: boolean;
5
+ displayName: string;
6
+ characterDescription: AvatarType;
7
+ allowCustomDisplayName: boolean;
8
+ sendIdentityUpdateToServer: (displayName: string, characterDescription: AvatarType) => void;
9
+ } & AvatarConfiguration;
10
+ export declare class AvatarSelectionUI {
11
+ private config;
12
+ private root;
13
+ private wrapper;
14
+ constructor(config: AvatarSelectionUIProps);
15
+ private onUpdateUserAvatar;
16
+ private onUpdateDisplayName;
17
+ updateAvatarConfig(avatarConfig: AvatarConfiguration): void;
18
+ updateAllowCustomDisplayName(allowCustomDisplayName: boolean): void;
19
+ init(): void;
20
+ }
@@ -0,0 +1,21 @@
1
+ export type AvatarType = {
2
+ thumbnailUrl?: string;
3
+ name?: string;
4
+ isDefaultAvatar?: boolean;
5
+ } & ({
6
+ meshFileUrl: string;
7
+ mmlCharacterString?: null;
8
+ mmlCharacterUrl?: null;
9
+ } | {
10
+ meshFileUrl?: null;
11
+ mmlCharacterString: string;
12
+ mmlCharacterUrl?: null;
13
+ } | {
14
+ meshFileUrl?: null;
15
+ mmlCharacterString?: null;
16
+ mmlCharacterUrl: string;
17
+ });
18
+ export type AvatarConfiguration = {
19
+ availableAvatars: Array<AvatarType>;
20
+ allowCustomAvatars?: boolean;
21
+ };
@@ -0,0 +1,14 @@
1
+ import { ForwardRefRenderFunction } from "react";
2
+ import { AvatarType } from "../../AvatarType";
3
+ type AvatarSelectionUIProps = {
4
+ onUpdateUserAvatar: (avatar: AvatarType) => void;
5
+ visibleByDefault?: boolean;
6
+ availableAvatars: AvatarType[];
7
+ characterDescription: AvatarType;
8
+ allowCustomAvatars: boolean;
9
+ displayName: string;
10
+ allowCustomDisplayName: boolean;
11
+ onUpdateDisplayName: (displayNameValue: string) => void;
12
+ };
13
+ export declare const AvatarSelectionUIComponent: ForwardRefRenderFunction<any, AvatarSelectionUIProps>;
14
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./AvatarSelectionUI";
2
+ export * from "./AvatarType";
@@ -0,0 +1,25 @@
1
+ export type StringToHslOptions = {
2
+ hueThresholds?: [number, number][];
3
+ saturationThresholds?: [number, number][];
4
+ lightnessThresholds?: [number, number][];
5
+ };
6
+ export declare const DEFAULT_HSL_OPTIONS: StringToHslOptions;
7
+ export type ChatUIInstance = {
8
+ addMessage: (username: string, message: string) => void;
9
+ };
10
+ export type TextChatUIProps = {
11
+ holderElement: HTMLElement;
12
+ sendMessageToServerMethod: (message: string) => void;
13
+ visibleByDefault?: boolean;
14
+ stringToHslOptions?: StringToHslOptions;
15
+ };
16
+ export declare class TextChatUI {
17
+ private config;
18
+ private root;
19
+ private appRef;
20
+ addTextMessage(username: string, message: string): void;
21
+ private wrapper;
22
+ constructor(config: TextChatUIProps);
23
+ dispose(): void;
24
+ init(): void;
25
+ }
@@ -0,0 +1,9 @@
1
+ import { ForwardRefRenderFunction } from "react";
2
+ import { StringToHslOptions, type ChatUIInstance } from "../../TextChatUI";
3
+ type ChatUIProps = {
4
+ sendMessageToServer: (message: string) => void;
5
+ visibleByDefault?: boolean;
6
+ stringToHslOptions?: StringToHslOptions;
7
+ };
8
+ export declare const ChatUIComponent: ForwardRefRenderFunction<ChatUIInstance, ChatUIProps>;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ type InputBoxProps = {
2
+ onSendMessage: (message: string) => void;
3
+ hide: () => void;
4
+ setFocus: () => void;
5
+ };
6
+ export declare const InputBox: import("react").ForwardRefExoticComponent<InputBoxProps & import("react").RefAttributes<{
7
+ focusInput: () => void;
8
+ } | null>>;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import { FC } from "react";
2
+ import { StringToHslOptions } from "../../TextChatUI";
3
+ type MessageProps = {
4
+ username: string;
5
+ message: string;
6
+ stringToHslOptions?: StringToHslOptions;
7
+ };
8
+ declare const Message: FC<MessageProps>;
9
+ export default Message;
@@ -0,0 +1,12 @@
1
+ import { FC } from "react";
2
+ import { StringToHslOptions } from "../../TextChatUI";
3
+ type MessagesProps = {
4
+ messages: Array<{
5
+ username: string;
6
+ message: string;
7
+ }>;
8
+ stringToHslOptions?: StringToHslOptions;
9
+ shouldAutoScroll?: boolean;
10
+ };
11
+ export declare const Messages: FC<MessagesProps>;
12
+ export {};
@@ -0,0 +1,3 @@
1
+ type ClickAwayCallback = (event: MouseEvent | TouchEvent) => void;
2
+ export declare function useClickOutside(cb: ClickAwayCallback): import("react").RefObject<HTMLDivElement | null>;
3
+ export {};
@@ -0,0 +1 @@
1
+ export { TextChatUI, TextChatUIProps, type StringToHslOptions } from "./TextChatUI";