@lumiastream/ui 0.1.0 → 0.2.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.
- package/dist/index.d.ts +327 -1
- package/dist/index.js +1919 -6
- package/package.json +59 -53
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { JSX, ReactNode, HTMLAttributes } from 'react';
|
|
5
|
+
import { SelectProps } from '@mui/material/Select';
|
|
6
|
+
import { CheckboxProps } from '@mui/material/Checkbox';
|
|
7
|
+
import { FieldValues, Path } from 'react-hook-form';
|
|
8
|
+
import { RadioProps } from '@mui/material/Radio';
|
|
9
|
+
import { RadioGroupProps } from '@mui/material/RadioGroup';
|
|
10
|
+
import * as _mui_material from '@mui/material';
|
|
11
|
+
import { AutocompleteRenderOptionState } from '@mui/material/Autocomplete';
|
|
2
12
|
import { CompletionContext } from '@codemirror/autocomplete';
|
|
3
13
|
|
|
4
14
|
interface LSButtonProps {
|
|
@@ -16,6 +26,217 @@ interface LSButtonProps {
|
|
|
16
26
|
/** Primary UI component for user interaction */
|
|
17
27
|
declare const LSButton: ({ primary, size, backgroundColor, label, ...props }: LSButtonProps) => react_jsx_runtime.JSX.Element;
|
|
18
28
|
|
|
29
|
+
interface LSInputPropsChild$1 {
|
|
30
|
+
id?: string;
|
|
31
|
+
name?: string;
|
|
32
|
+
label?: React.ReactNode;
|
|
33
|
+
inputRef?: any;
|
|
34
|
+
inputAfterText?: React.ReactNode;
|
|
35
|
+
inputBeforeText?: React.ReactNode;
|
|
36
|
+
startAdornment?: React.ReactNode;
|
|
37
|
+
endAdornment?: React.ReactNode;
|
|
38
|
+
InputProps?: any;
|
|
39
|
+
InputLabelProps?: any;
|
|
40
|
+
inputProps?: any;
|
|
41
|
+
centerText?: boolean;
|
|
42
|
+
maxWidth?: string;
|
|
43
|
+
$maxWidth?: string;
|
|
44
|
+
readOnly?: boolean;
|
|
45
|
+
onChange?: (event: any, value?: string | number) => void;
|
|
46
|
+
onChangeStart?: (event?: any, value?: string | number) => void;
|
|
47
|
+
onChangeEnd?: (event?: any, value?: string | number) => void;
|
|
48
|
+
$noMinHeight?: boolean;
|
|
49
|
+
$minHeight?: string;
|
|
50
|
+
bypasscolor?: 'inherit' | 'primary' | 'secondary' | 'default';
|
|
51
|
+
textColor?: string;
|
|
52
|
+
}
|
|
53
|
+
type ProtoExntends$2<T, U> = U & Omit<T, keyof U>;
|
|
54
|
+
type LSInputProps$1 = ProtoExntends$2<TextFieldProps, LSInputPropsChild$1>;
|
|
55
|
+
declare const LSInput: React.ForwardRefExoticComponent<Omit<LSInputProps$1, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
56
|
+
|
|
57
|
+
interface LSInputPropsChild {
|
|
58
|
+
name?: string;
|
|
59
|
+
value?: number;
|
|
60
|
+
autoFocus?: boolean;
|
|
61
|
+
defaultValue?: number;
|
|
62
|
+
label?: React.ReactNode;
|
|
63
|
+
inline?: boolean;
|
|
64
|
+
hasInfo?: boolean;
|
|
65
|
+
infoOpen?: () => void;
|
|
66
|
+
infoClose?: () => void;
|
|
67
|
+
type?: string;
|
|
68
|
+
isFloat?: boolean;
|
|
69
|
+
isMiliseconds?: boolean;
|
|
70
|
+
isFloatMiliseconds?: boolean;
|
|
71
|
+
step?: number;
|
|
72
|
+
min?: number;
|
|
73
|
+
max?: number;
|
|
74
|
+
inputAfterText?: string;
|
|
75
|
+
inputProps?: LSInputProps;
|
|
76
|
+
startIcon?: React.ElementType;
|
|
77
|
+
endIcon?: React.ElementType;
|
|
78
|
+
color?: 'primary' | 'secondary';
|
|
79
|
+
labelColor?: 'inherit' | 'initial' | 'primary' | 'secondary' | 'textPrimary' | 'textSecondary' | 'error';
|
|
80
|
+
onChange?: (value: any) => any;
|
|
81
|
+
fullWidth?: boolean;
|
|
82
|
+
helperText?: React.ReactNode;
|
|
83
|
+
hideInput?: boolean;
|
|
84
|
+
hideSlider?: boolean;
|
|
85
|
+
valueLabelFormat?: (value: number) => React.ReactNode;
|
|
86
|
+
}
|
|
87
|
+
type ProtoExntends$1<T, U> = U & Omit<T, keyof U>;
|
|
88
|
+
type LSInputProps = ProtoExntends$1<LSInputProps$1, LSInputPropsChild>;
|
|
89
|
+
declare const LSSliderInput: React.FC<LSInputProps>;
|
|
90
|
+
|
|
91
|
+
interface LSSelectPropsChild {
|
|
92
|
+
noBg?: boolean;
|
|
93
|
+
placeholder?: React.ReactNode | string;
|
|
94
|
+
}
|
|
95
|
+
type ProtoExntends<T, U> = U & Omit<T, keyof U>;
|
|
96
|
+
type LSSelectProps = ProtoExntends<SelectProps, LSSelectPropsChild>;
|
|
97
|
+
declare const LSSelect: React.FC<LSSelectProps>;
|
|
98
|
+
|
|
99
|
+
type LSCheckboxProps = CheckboxProps & {
|
|
100
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
101
|
+
};
|
|
102
|
+
declare const LSCheckbox: React.ForwardRefExoticComponent<Omit<LSCheckboxProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
103
|
+
type LSCheckboxFieldProps<TFieldValues extends FieldValues> = {
|
|
104
|
+
name: Path<TFieldValues>;
|
|
105
|
+
label: React.ReactNode;
|
|
106
|
+
control?: any;
|
|
107
|
+
className?: string;
|
|
108
|
+
disabled?: boolean;
|
|
109
|
+
labelPlacement?: 'end' | 'start' | 'top' | 'bottom';
|
|
110
|
+
checkboxProps?: Omit<LSCheckboxProps, 'checked' | 'onChange' | 'name' | 'inputRef'>;
|
|
111
|
+
};
|
|
112
|
+
declare function LSCheckboxField<TFieldValues extends FieldValues>({ name, label, control, className, disabled, labelPlacement, checkboxProps, }: LSCheckboxFieldProps<TFieldValues>): JSX.Element;
|
|
113
|
+
|
|
114
|
+
type LSColorPickerProps = {
|
|
115
|
+
value?: string;
|
|
116
|
+
onChange: (value: string) => void;
|
|
117
|
+
onBlur?: () => void;
|
|
118
|
+
className?: string;
|
|
119
|
+
name?: string;
|
|
120
|
+
label?: ReactNode;
|
|
121
|
+
helperText?: ReactNode;
|
|
122
|
+
placeholder?: string;
|
|
123
|
+
hideGradientControls?: boolean;
|
|
124
|
+
usePopup?: boolean;
|
|
125
|
+
disabled?: boolean;
|
|
126
|
+
};
|
|
127
|
+
declare const LSColorPicker: ({ value, onChange, onBlur, className, name, label, helperText, placeholder, hideGradientControls, usePopup, disabled }: LSColorPickerProps) => react_jsx_runtime.JSX.Element;
|
|
128
|
+
|
|
129
|
+
interface FontPickerProps {
|
|
130
|
+
value: string;
|
|
131
|
+
onChange: (value: string) => void;
|
|
132
|
+
fonts?: string[];
|
|
133
|
+
localFonts?: string[];
|
|
134
|
+
onLoadFonts?: (fonts: string[]) => void;
|
|
135
|
+
defaultValue?: string;
|
|
136
|
+
placeholder?: string;
|
|
137
|
+
isAlertManager?: boolean;
|
|
138
|
+
label?: React.ReactNode;
|
|
139
|
+
helperText?: React.ReactNode;
|
|
140
|
+
}
|
|
141
|
+
declare const LSFontPicker: React.NamedExoticComponent<FontPickerProps>;
|
|
142
|
+
|
|
143
|
+
type Option = {
|
|
144
|
+
label: string | number;
|
|
145
|
+
value: string;
|
|
146
|
+
};
|
|
147
|
+
type LSMultiSelectProps = {
|
|
148
|
+
options: Option[];
|
|
149
|
+
placeholder?: string;
|
|
150
|
+
value: string[];
|
|
151
|
+
onChange: (selected: string[]) => void;
|
|
152
|
+
label?: string;
|
|
153
|
+
};
|
|
154
|
+
declare const LSMultiSelect: React.FC<LSMultiSelectProps>;
|
|
155
|
+
|
|
156
|
+
declare const LSRadio: React.FC<RadioProps>;
|
|
157
|
+
type LSRadioSelection = {
|
|
158
|
+
value: string;
|
|
159
|
+
label: React.ReactNode;
|
|
160
|
+
disabled?: boolean;
|
|
161
|
+
};
|
|
162
|
+
type LSRadioGroupProps = RadioGroupProps & {
|
|
163
|
+
selections: LSRadioSelection[];
|
|
164
|
+
optionClassName?: string;
|
|
165
|
+
};
|
|
166
|
+
declare const LSRadioGroup: React.FC<LSRadioGroupProps>;
|
|
167
|
+
|
|
168
|
+
type LSTextFieldProps = TextFieldProps & {
|
|
169
|
+
InputLabelProps?: Record<string, unknown>;
|
|
170
|
+
InputProps?: Record<string, unknown>;
|
|
171
|
+
};
|
|
172
|
+
declare const LSTextField: React.ForwardRefExoticComponent<(Omit<_mui_material.FilledTextFieldProps & {
|
|
173
|
+
InputLabelProps?: Record<string, unknown>;
|
|
174
|
+
InputProps?: Record<string, unknown>;
|
|
175
|
+
}, "ref"> | Omit<_mui_material.OutlinedTextFieldProps & {
|
|
176
|
+
InputLabelProps?: Record<string, unknown>;
|
|
177
|
+
InputProps?: Record<string, unknown>;
|
|
178
|
+
}, "ref"> | Omit<_mui_material.StandardTextFieldProps & {
|
|
179
|
+
InputLabelProps?: Record<string, unknown>;
|
|
180
|
+
InputProps?: Record<string, unknown>;
|
|
181
|
+
}, "ref">) & React.RefAttributes<HTMLDivElement>>;
|
|
182
|
+
|
|
183
|
+
interface IVariables {
|
|
184
|
+
name: string;
|
|
185
|
+
system: boolean;
|
|
186
|
+
locked?: boolean;
|
|
187
|
+
origin: string;
|
|
188
|
+
allowedPlaces?: string[];
|
|
189
|
+
description: string;
|
|
190
|
+
counter?: boolean;
|
|
191
|
+
value: string | number;
|
|
192
|
+
}
|
|
193
|
+
type LSVariableInputTranslate = (key: string, fallback?: string, options?: Record<string, unknown>) => string;
|
|
194
|
+
type LSVariableInputContextValue = {
|
|
195
|
+
systemVariables?: Record<string, unknown>;
|
|
196
|
+
functionVariables?: string[];
|
|
197
|
+
translate?: LSVariableInputTranslate;
|
|
198
|
+
onVariableTranslationsNeeded?: () => void;
|
|
199
|
+
};
|
|
200
|
+
declare const LSVariableInputProvider: ({ children, value }: {
|
|
201
|
+
children: ReactNode;
|
|
202
|
+
value: LSVariableInputContextValue;
|
|
203
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
204
|
+
type LSVariableInputFieldProps = {
|
|
205
|
+
name?: string;
|
|
206
|
+
label?: ReactNode;
|
|
207
|
+
type?: string;
|
|
208
|
+
isAutoComplete?: boolean;
|
|
209
|
+
autoCompleteOptions?: Array<{
|
|
210
|
+
label: string;
|
|
211
|
+
value: any;
|
|
212
|
+
}>;
|
|
213
|
+
hideVariables?: boolean;
|
|
214
|
+
allowedVariables?: IVariables[] | string[] | any;
|
|
215
|
+
disabled?: boolean;
|
|
216
|
+
autoFocus?: boolean;
|
|
217
|
+
inputProps?: any;
|
|
218
|
+
multiline?: boolean;
|
|
219
|
+
rows?: number;
|
|
220
|
+
maxRows?: number;
|
|
221
|
+
value?: string | number | any[];
|
|
222
|
+
placeholder?: string;
|
|
223
|
+
renderOption?: (props: HTMLAttributes<HTMLLIElement>, option: any, state: AutocompleteRenderOptionState) => ReactNode;
|
|
224
|
+
variant?: 'standard' | 'filled' | 'outlined';
|
|
225
|
+
ListboxComponent?: any;
|
|
226
|
+
onScrollListBox?: (e: any) => void;
|
|
227
|
+
onHighlightChange?: (e: any, value: any) => void;
|
|
228
|
+
onPopupClose?: (e: any, reason: any) => void;
|
|
229
|
+
onPopupOpen?: (e: any) => void;
|
|
230
|
+
onAutocompleteKeyUp?: (e: any, value: any) => void;
|
|
231
|
+
afterFilter?: (filtered: any[]) => void;
|
|
232
|
+
onChange?: (value: string) => void;
|
|
233
|
+
systemVariables?: Record<string, unknown>;
|
|
234
|
+
functionVariables?: string[];
|
|
235
|
+
translate?: LSVariableInputTranslate;
|
|
236
|
+
onVariableTranslationsNeeded?: () => void;
|
|
237
|
+
};
|
|
238
|
+
declare const LSVariableInputField: React.ForwardRefExoticComponent<LSVariableInputFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
239
|
+
|
|
19
240
|
declare function variableCompletionOptions(context: CompletionContext, variables: {
|
|
20
241
|
label: string;
|
|
21
242
|
displayLabel: string;
|
|
@@ -123,4 +344,109 @@ declare const codeMirrorlinterOptions: (type: "overlay" | "code", language?: "js
|
|
|
123
344
|
};
|
|
124
345
|
};
|
|
125
346
|
|
|
126
|
-
|
|
347
|
+
declare const MEDIA_PREVIEW_USER_LEVEL_VALUES: readonly ["streamer", "moderators", "vips", "tier3", "tier2", "subscribers", "regular", "follower", "anyone"];
|
|
348
|
+
type MediaPreviewUserLevel = (typeof MEDIA_PREVIEW_USER_LEVEL_VALUES)[number];
|
|
349
|
+
type ChatboxMediaPreviewKind = 'image' | 'video' | 'audio' | 'youtube' | 'youtubeShort' | 'spotify';
|
|
350
|
+
type ChatboxMediaPreview = {
|
|
351
|
+
kind: ChatboxMediaPreviewKind;
|
|
352
|
+
src: string;
|
|
353
|
+
title?: string;
|
|
354
|
+
};
|
|
355
|
+
type MessageLinkPart = {
|
|
356
|
+
text: string;
|
|
357
|
+
url?: string;
|
|
358
|
+
};
|
|
359
|
+
type ChatMessageToken = {
|
|
360
|
+
type: 'text';
|
|
361
|
+
text: string;
|
|
362
|
+
} | {
|
|
363
|
+
type: 'link';
|
|
364
|
+
text: string;
|
|
365
|
+
url: string;
|
|
366
|
+
} | {
|
|
367
|
+
type: 'media';
|
|
368
|
+
text: string;
|
|
369
|
+
url: string;
|
|
370
|
+
media: ChatboxMediaPreview;
|
|
371
|
+
};
|
|
372
|
+
type MediaPreviewRoleSettings = {
|
|
373
|
+
previewMediaForViewers: boolean;
|
|
374
|
+
previewMediaForSubscribers: boolean;
|
|
375
|
+
previewMediaForVips: boolean;
|
|
376
|
+
previewMediaForModerators: boolean;
|
|
377
|
+
previewMediaForStreamer: boolean;
|
|
378
|
+
previewMediaForTier3: boolean;
|
|
379
|
+
previewMediaForTier2: boolean;
|
|
380
|
+
previewMediaForRegular: boolean;
|
|
381
|
+
previewMediaForFollower: boolean;
|
|
382
|
+
previewMediaForAnyone: boolean;
|
|
383
|
+
};
|
|
384
|
+
type MediaPreviewRoleSettingsInput = Partial<Record<keyof MediaPreviewRoleSettings, unknown>> & {
|
|
385
|
+
previewMediaUserLevels?: unknown;
|
|
386
|
+
};
|
|
387
|
+
type ChatMessageTokenizationOptions = {
|
|
388
|
+
hyperClickableLinks?: boolean;
|
|
389
|
+
previewMediaInChat?: boolean;
|
|
390
|
+
};
|
|
391
|
+
type ChatterProfileUrlInput = {
|
|
392
|
+
platform?: unknown;
|
|
393
|
+
username?: unknown;
|
|
394
|
+
displayname?: unknown;
|
|
395
|
+
userId?: unknown;
|
|
396
|
+
};
|
|
397
|
+
type ChatMessageEmoteStore = {
|
|
398
|
+
ffz?: Record<string, string>;
|
|
399
|
+
bttv?: Record<string, string>;
|
|
400
|
+
seventv?: Record<string, string>;
|
|
401
|
+
};
|
|
402
|
+
type ChatMessageContentItem = string | {
|
|
403
|
+
id: string;
|
|
404
|
+
urls: string[];
|
|
405
|
+
key: string;
|
|
406
|
+
} | {
|
|
407
|
+
id: string;
|
|
408
|
+
type: 'cheer';
|
|
409
|
+
roundedAmount: number;
|
|
410
|
+
cheerAmount: number;
|
|
411
|
+
bitColor: string;
|
|
412
|
+
key: string;
|
|
413
|
+
};
|
|
414
|
+
type BuildChatMessageContentOptions = {
|
|
415
|
+
message?: string;
|
|
416
|
+
replaceWord?: string;
|
|
417
|
+
filteredWordsRegex?: RegExp;
|
|
418
|
+
emotesRaw?: string;
|
|
419
|
+
emotesPack?: Record<string, any> | any[];
|
|
420
|
+
origin?: string;
|
|
421
|
+
emoteParserType?: string;
|
|
422
|
+
isCheer?: boolean;
|
|
423
|
+
storeEmotes?: ChatMessageEmoteStore;
|
|
424
|
+
youtubeEmotes?: Record<string, string>;
|
|
425
|
+
allowParserTypes?: string[];
|
|
426
|
+
};
|
|
427
|
+
type ChatterProfileResolverPayload = {
|
|
428
|
+
username?: string;
|
|
429
|
+
displayname?: string;
|
|
430
|
+
userId?: string;
|
|
431
|
+
platform?: string;
|
|
432
|
+
extraSettings?: Record<string, any>;
|
|
433
|
+
};
|
|
434
|
+
type ChatterProfileResolver = (payload: ChatterProfileResolverPayload) => Promise<unknown> | unknown;
|
|
435
|
+
type ResolveChatterProfileUrlWithResolversInput = ChatterProfileUrlInput & {
|
|
436
|
+
extraSettings?: Record<string, any>;
|
|
437
|
+
resolvers?: Array<ChatterProfileResolver | null | undefined>;
|
|
438
|
+
};
|
|
439
|
+
declare const parseMessageLinks: (value: string) => MessageLinkPart[];
|
|
440
|
+
declare const tokenizeChatMessage: (value: string, options?: ChatMessageTokenizationOptions) => ChatMessageToken[];
|
|
441
|
+
declare const buildChatMessageContent: ({ message, replaceWord, filteredWordsRegex, emotesRaw, emotesPack, origin, emoteParserType, isCheer, storeEmotes, youtubeEmotes, allowParserTypes, }: BuildChatMessageContentOptions) => ChatMessageContentItem[];
|
|
442
|
+
declare const resolveMediaPreviewSetting: (value: unknown, fallback: boolean) => boolean;
|
|
443
|
+
declare const normalizeMediaPreviewUserLevels: (value: unknown) => MediaPreviewUserLevel[];
|
|
444
|
+
declare const resolveMediaPreviewRoleSettings: (settings: MediaPreviewRoleSettingsInput) => MediaPreviewRoleSettings;
|
|
445
|
+
declare const getNormalizedUserLevels: (value: unknown) => Record<string, boolean>;
|
|
446
|
+
declare const isMediaPreviewAllowedForUser: (userLevelsRaw: unknown, roleSettings: MediaPreviewRoleSettings) => boolean;
|
|
447
|
+
declare const getMediaPreviewFromUrl: (url: string) => ChatboxMediaPreview | null;
|
|
448
|
+
declare const resolvePlatformChatterProfileUrl: ({ platform, username, displayname, userId }: ChatterProfileUrlInput) => string | null;
|
|
449
|
+
declare const normalizeHttpUrl: (value: unknown) => string | null;
|
|
450
|
+
declare const resolveChatterProfileUrlWithResolvers: ({ platform, username, displayname, userId, extraSettings, resolvers, }: ResolveChatterProfileUrlWithResolversInput) => Promise<string | null>;
|
|
451
|
+
|
|
452
|
+
export { type BuildChatMessageContentOptions, type ChatMessageContentItem, type ChatMessageEmoteStore, type ChatMessageToken, type ChatMessageTokenizationOptions, type ChatboxMediaPreview, type ChatboxMediaPreviewKind, type ChatterProfileResolver, type ChatterProfileResolverPayload, type ChatterProfileUrlInput, type IVariables, LSButton, type LSButtonProps, LSCheckbox, LSCheckboxField, LSColorPicker, type LSColorPickerProps, LSFontPicker, LSInput, type LSInputProps$1 as LSInputProps, LSMultiSelect, LSRadio, LSRadioGroup, LSSelect, LSSliderInput, type LSInputProps as LSSliderInputProps, LSTextField, type LSTextFieldProps, type LSVariableInputContextValue, LSVariableInputField, type LSVariableInputFieldProps, LSVariableInputProvider, MEDIA_PREVIEW_USER_LEVEL_VALUES, type MediaPreviewRoleSettings, type MediaPreviewRoleSettingsInput, type MediaPreviewUserLevel, type MessageLinkPart, type ResolveChatterProfileUrlWithResolversInput, buildChatMessageContent, codeMirrorlinterOptions, getMediaPreviewFromUrl, getNormalizedUserLevels, isMediaPreviewAllowedForUser, normalizeHttpUrl, normalizeMediaPreviewUserLevels, parseMessageLinks, resolveChatterProfileUrlWithResolvers, resolveMediaPreviewRoleSettings, resolveMediaPreviewSetting, resolvePlatformChatterProfileUrl, tokenizeChatMessage, variableCompletionOptions };
|