@vlprojects-chat/chat 0.0.49 → 0.0.52

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.
@@ -12,7 +12,7 @@ declare const Channel_base: import("mobx-keystone")._Model<unknown, {
12
12
  externalId: import("mobx-keystone").OptionalModelProp<string>;
13
13
  type: import("mobx-keystone").OptionalModelProp<ChannelTypeEnum>;
14
14
  messages: import("mobx-keystone").OptionalModelProp<import("mobx-keystone").ObjectMap<Message>>;
15
- users: import("mobx-keystone").OptionalModelProp<import("mobx-keystone").ObjectMap<Ref<User>>>;
15
+ directUsersOnly: import("mobx-keystone").OptionalModelProp<User[]>;
16
16
  polls: import("mobx-keystone").OptionalModelProp<Poll[]>;
17
17
  activePoll: import("mobx-keystone").ModelProp<Ref<Poll> | undefined, Ref<Poll> | null | undefined, Ref<Poll> | undefined, Ref<Poll> | null | undefined, string, false, string>;
18
18
  pinnedMessages: import("mobx-keystone").OptionalModelProp<PinnedMessage[]>;
@@ -22,7 +22,7 @@ declare const Channel_base: import("mobx-keystone")._Model<unknown, {
22
22
  externalId: import("mobx-keystone").OptionalModelProp<string>;
23
23
  type: import("mobx-keystone").OptionalModelProp<ChannelTypeEnum>;
24
24
  messages: import("mobx-keystone").OptionalModelProp<import("mobx-keystone").ObjectMap<Message>>;
25
- users: import("mobx-keystone").OptionalModelProp<import("mobx-keystone").ObjectMap<Ref<User>>>;
25
+ directUsersOnly: import("mobx-keystone").OptionalModelProp<User[]>;
26
26
  polls: import("mobx-keystone").OptionalModelProp<Poll[]>;
27
27
  activePoll: import("mobx-keystone").ModelProp<Ref<Poll> | undefined, Ref<Poll> | null | undefined, Ref<Poll> | undefined, Ref<Poll> | null | undefined, string, false, string>;
28
28
  pinnedMessages: import("mobx-keystone").OptionalModelProp<PinnedMessage[]>;
@@ -32,7 +32,7 @@ declare const Channel_base: import("mobx-keystone")._Model<unknown, {
32
32
  externalId: import("mobx-keystone").OptionalModelProp<string>;
33
33
  type: import("mobx-keystone").OptionalModelProp<ChannelTypeEnum>;
34
34
  messages: import("mobx-keystone").OptionalModelProp<import("mobx-keystone").ObjectMap<Message>>;
35
- users: import("mobx-keystone").OptionalModelProp<import("mobx-keystone").ObjectMap<Ref<User>>>;
35
+ directUsersOnly: import("mobx-keystone").OptionalModelProp<User[]>;
36
36
  polls: import("mobx-keystone").OptionalModelProp<Poll[]>;
37
37
  activePoll: import("mobx-keystone").ModelProp<Ref<Poll> | undefined, Ref<Poll> | null | undefined, Ref<Poll> | undefined, Ref<Poll> | null | undefined, string, false, string>;
38
38
  pinnedMessages: import("mobx-keystone").OptionalModelProp<PinnedMessage[]>;
@@ -58,8 +58,8 @@ export default class Channel extends Channel_base {
58
58
  findLastMessageForUser(msgIdx: number): Message | undefined;
59
59
  get lastMessage(): Message | undefined;
60
60
  get messagesCount(): number;
61
- get userList(): User[];
62
61
  get getActivePoll(): Poll | undefined;
62
+ get isPollsInProgress(): boolean;
63
63
  get getPinnedMessages(): PinnedMessage[];
64
64
  get lastPinnedMessage(): PinnedMessage;
65
65
  get getPollTemplates(): Poll[];
@@ -30,7 +30,7 @@ export default class Chat extends Chat_base {
30
30
  userId: number;
31
31
  name: string;
32
32
  }): void;
33
- addUsers(users: IRUser[]): void;
33
+ addUsers(users?: IRUser[]): void;
34
34
  addChannels(channels: IRChannel[]): void;
35
35
  addPubs(pubs: IRPub[]): void;
36
36
  }
@@ -12,7 +12,7 @@ declare const Poll_base: import("mobx-keystone")._Model<unknown, {
12
12
  createdAt: import("mobx-keystone").MaybeOptionalModelProp<string>;
13
13
  stoppedAt: import("mobx-keystone").MaybeOptionalModelProp<string>;
14
14
  status: import("mobx-keystone").ModelProp<IPollStatus, IPollStatus | null | undefined, IPollStatus, IPollStatus | null | undefined, string, false, string>;
15
- votes: import("mobx-keystone").MaybeOptionalModelProp<IServerPollVote[]>;
15
+ votes: import("mobx-keystone").OptionalModelProp<IServerPollVote[]>;
16
16
  }, import("mobx-keystone").SnapshotInOfObject<import("mobx-keystone").ModelPropsToCreationData<{
17
17
  id: import("mobx-keystone").MaybeOptionalModelProp<string>;
18
18
  question: import("mobx-keystone").OptionalModelProp<string>;
@@ -25,7 +25,7 @@ declare const Poll_base: import("mobx-keystone")._Model<unknown, {
25
25
  createdAt: import("mobx-keystone").MaybeOptionalModelProp<string>;
26
26
  stoppedAt: import("mobx-keystone").MaybeOptionalModelProp<string>;
27
27
  status: import("mobx-keystone").ModelProp<IPollStatus, IPollStatus | null | undefined, IPollStatus, IPollStatus | null | undefined, string, false, string>;
28
- votes: import("mobx-keystone").MaybeOptionalModelProp<IServerPollVote[]>;
28
+ votes: import("mobx-keystone").OptionalModelProp<IServerPollVote[]>;
29
29
  }>>, import("mobx-keystone").SnapshotOutOfObject<import("mobx-keystone").ModelPropsToData<{
30
30
  id: import("mobx-keystone").MaybeOptionalModelProp<string>;
31
31
  question: import("mobx-keystone").OptionalModelProp<string>;
@@ -38,10 +38,11 @@ declare const Poll_base: import("mobx-keystone")._Model<unknown, {
38
38
  createdAt: import("mobx-keystone").MaybeOptionalModelProp<string>;
39
39
  stoppedAt: import("mobx-keystone").MaybeOptionalModelProp<string>;
40
40
  status: import("mobx-keystone").ModelProp<IPollStatus, IPollStatus | null | undefined, IPollStatus, IPollStatus | null | undefined, string, false, string>;
41
- votes: import("mobx-keystone").MaybeOptionalModelProp<IServerPollVote[]>;
41
+ votes: import("mobx-keystone").OptionalModelProp<IServerPollVote[]>;
42
42
  }>>>;
43
43
  export default class Poll extends Poll_base {
44
44
  changeStatus(status: IPollStatus): void;
45
+ addVote(vote: IServerPollVote): void;
45
46
  }
46
47
  export declare const pollRef: import("mobx-keystone").RefConstructor<Poll>;
47
48
  export {};
@@ -0,0 +1,3 @@
1
+ import { IRUser } from 'types/serverResponses';
2
+ import User from './chat/user';
3
+ export declare const createUserFactory: (user: IRUser) => User;
@@ -24,7 +24,7 @@ declare const Root_base: import("mobx-keystone")._Model<unknown, {
24
24
  }>>>;
25
25
  export declare class Root extends Root_base {
26
26
  get currentChannel(): import("./chat/channel").default | undefined;
27
+ init(): void;
27
28
  }
28
- export declare const createRootStore: () => Root;
29
29
  declare const useKeystone: () => Root;
30
30
  export default useKeystone;
@@ -92,6 +92,8 @@ declare const _default: {
92
92
  done: string;
93
93
  in_progress: string;
94
94
  new: string;
95
+ areYouSure: string;
96
+ anotherPollInProgress: string;
95
97
  };
96
98
  ru: {
97
99
  loadingSocket: string;
@@ -185,6 +187,8 @@ declare const _default: {
185
187
  done: string;
186
188
  in_progress: string;
187
189
  new: string;
190
+ areYouSure: string;
191
+ anotherPollInProgress: string;
188
192
  };
189
193
  };
190
194
  export default _default;
@@ -42,6 +42,7 @@ export declare const COLOURS: {
42
42
  GREEN: string;
43
43
  ORANGE: string;
44
44
  ERROR: string;
45
+ ACTIVE: string;
45
46
  AVATAR1_BURGUNDY: string;
46
47
  AVATAR2_RED: string;
47
48
  AVATAR3_DARK_PINK: string;
@@ -24,7 +24,7 @@ export interface IRChannel {
24
24
  name: string;
25
25
  externalId: string;
26
26
  type: ChannelTypeEnum;
27
- userIds: string[];
27
+ users?: IRUser[];
28
28
  messages: IRChannelMessage[];
29
29
  polls: IServerPoll[];
30
30
  }
@@ -7,6 +7,7 @@ declare enum SocketEventsEnum {
7
7
  PollStart = "poll-start",
8
8
  PollStop = "poll-stop",
9
9
  PollVote = "poll-vote",
10
+ PollVoteOpenEnded = "poll-vote-open-ended",
10
11
  UserUpdateProfile = "user-update-profile",
11
12
  MessagePinned = "message-pinned",
12
13
  DeleteMessages = "delete-messages",
@@ -0,0 +1,19 @@
1
+ import { InputUnstyledProps } from '@mui/base/InputUnstyled';
2
+ import React, { KeyboardEvent } from 'react';
3
+ interface IProps extends Omit<InputUnstyledProps, 'onChange'> {
4
+ placeholder?: string;
5
+ onChange?: (v: string) => void;
6
+ onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
7
+ className?: string;
8
+ type?: string;
9
+ value?: string;
10
+ id?: string;
11
+ variant?: 'text' | 'outlined';
12
+ size?: 'medium' | 'large';
13
+ fullWidth?: boolean;
14
+ rightIcon?: React.ReactNode;
15
+ inputProps?: Record<string, string | number>;
16
+ errorText?: React.ReactNode | string;
17
+ }
18
+ declare const CustomInput: React.ForwardRefExoticComponent<Pick<IProps, "aria-describedby" | "aria-label" | "aria-labelledby" | "autoComplete" | "autoFocus" | "className" | "components" | "componentsProps" | "endAdornment" | "id" | "multiline" | "name" | "onKeyDown" | "onKeyUp" | "placeholder" | "readOnly" | "rows" | "startAdornment" | "minRows" | "maxRows" | "type" | "value" | "defaultValue" | "disabled" | "error" | "onBlur" | "onClick" | "onChange" | "onFocus" | "required" | "slot" | "style" | "title" | "key" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "component" | "variant" | "size" | "fullWidth" | "rightIcon" | "inputProps" | "errorText"> & React.RefAttributes<HTMLDivElement>>;
19
+ export default CustomInput;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { Theme } from '@mui/system';
3
+ declare const StyledInputElement: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme> & {
4
+ theme: Theme;
5
+ error: boolean;
6
+ }, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {}>;
7
+ declare const StyledTextareaElement: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme> & {
8
+ theme: Theme;
9
+ maxRows: number;
10
+ }, import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, {}>;
11
+ export { StyledInputElement, StyledTextareaElement };
@@ -1,15 +1 @@
1
- import React, { KeyboardEvent } from 'react';
2
- interface IProps {
3
- placeholder?: string;
4
- onChange?: (v: string) => void;
5
- onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
6
- className?: string;
7
- type?: string;
8
- value?: string;
9
- id?: string;
10
- variant?: 'text' | 'outlined';
11
- size?: 'medium' | 'large';
12
- fullWidth?: boolean;
13
- }
14
- declare const Input: React.FC<IProps>;
15
- export default Input;
1
+ export { default } from './Input';
@@ -1,2 +1,2 @@
1
- declare const _default: (props?: any) => import("@mui/styles").ClassNameMap<"input" | "medium" | "text" | "large" | "fullWidth" | "outlined">;
1
+ declare const _default: (props?: any) => import("@mui/styles").ClassNameMap<"medium" | "text" | "large" | "input" | "fullWidth" | "outlined">;
2
2
  export default _default;
@@ -0,0 +1,10 @@
1
+ import { CSSProperties, ReactElement } from 'react';
2
+ interface IProps {
3
+ className?: string;
4
+ width?: number;
5
+ height?: number;
6
+ fill?: string;
7
+ style?: CSSProperties;
8
+ }
9
+ declare const _default: (props: IProps) => ReactElement;
10
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { CSSProperties, ReactElement } from 'react';
2
+ interface IProps {
3
+ className?: string;
4
+ width?: number;
5
+ height?: number;
6
+ fill?: string;
7
+ style?: CSSProperties;
8
+ }
9
+ declare const _default: (props: IProps) => ReactElement;
10
+ export default _default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vlprojects-chat/chat",
3
3
  "author": "vlprojects",
4
- "version": "0.0.49",
4
+ "version": "0.0.52",
5
5
  "description": "chat",
6
6
  "license": "ISC",
7
7
  "main": "dist/index.js",
@@ -1,2 +0,0 @@
1
- declare const _default: (props?: any) => import("@mui/styles").ClassNameMap<"root" | "inputSearch" | "userCounter" | "userListWrapper">;
2
- export default _default;