@lumiastream/ui 0.2.8-alpha.1 → 0.2.8-alpha.11
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/README.md +9 -0
- package/dist/LSButton.d.ts +32 -0
- package/dist/LSButton.js +80 -0
- package/dist/LSCheckbox.d.ts +21 -0
- package/dist/LSCheckbox.js +113 -0
- package/dist/LSColorPicker.d.ts +19 -0
- package/dist/LSColorPicker.js +316 -0
- package/dist/LSFontPicker.d.ts +17 -0
- package/dist/LSFontPicker.js +179 -0
- package/dist/LSInput.d.ts +32 -0
- package/dist/LSInput.js +159 -0
- package/dist/LSMultiSelect.d.ts +16 -0
- package/dist/LSMultiSelect.js +274 -0
- package/dist/LSRadio.d.ts +17 -0
- package/dist/LSRadio.js +52 -0
- package/dist/LSSelect.d.ts +12 -0
- package/dist/LSSelect.js +140 -0
- package/dist/LSSliderInput.d.ts +39 -0
- package/dist/LSSliderInput.js +342 -0
- package/dist/LSTextField.d.ts +9 -0
- package/dist/LSTextField.js +63 -0
- package/dist/LSVariableInputField.d.ts +96 -0
- package/dist/LSVariableInputField.js +1402 -0
- package/dist/components.d.ts +21 -0
- package/dist/components.js +2279 -0
- package/dist/index.d.ts +25 -863
- package/dist/index.js +1329 -218
- package/dist/se-import.d.ts +379 -0
- package/dist/se-import.js +6476 -0
- package/dist/utils/chatMedia.d.ts +106 -0
- package/dist/utils/chatMedia.js +611 -0
- package/dist/utils.d.ts +111 -0
- package/dist/utils.js +830 -0
- package/package.json +84 -17
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
|
|
4
|
+
type ModuleType = 'alert' | 'emotebox' | 'emotealert' | 'text' | 'image' | 'audio' | 'video' | 'camera' | 'slideshow' | 'shape' | 'svg' | 'colorbox' | 'goal' | 'timer' | 'gradientlight' | 'browsersource' | 'chatbox' | 'credits' | 'eventlist' | 'eventrotate' | 'hfx' | 'hfxalert' | 'clip' | 'youtube' | 'spinwheel' | 'raffle' | 'viewerqueue' | 'loyaltyleaderboard' | 'viewerprofiles' | 'achievements' | 'poll' | 'tournaments' | 'spotify' | 'nowplaying' | 'youtubemusic' | 'brbscreen' | 'vlc' | 'tts' | 'livecaption' | 'custom' | 'tipjar' | 'hypetrain' | 'streamboss' | 'songrequest' | 'group';
|
|
5
|
+
type OverlayLayerType = 'layer' | 'group';
|
|
6
|
+
type OverlayLayerBounds = {
|
|
7
|
+
height: number;
|
|
8
|
+
width: number;
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
scale: [number, number];
|
|
12
|
+
opacity?: number;
|
|
13
|
+
rotate?: number;
|
|
14
|
+
zIndex?: number;
|
|
15
|
+
matrix?: string;
|
|
16
|
+
clipPath?: string;
|
|
17
|
+
autoWidth?: boolean;
|
|
18
|
+
autoHeight?: boolean;
|
|
19
|
+
};
|
|
20
|
+
type OverlayLayerState = {
|
|
21
|
+
id: string;
|
|
22
|
+
group?: string | null;
|
|
23
|
+
type?: OverlayLayerType;
|
|
24
|
+
state: {
|
|
25
|
+
visible?: boolean;
|
|
26
|
+
locked?: boolean;
|
|
27
|
+
expanded?: boolean;
|
|
28
|
+
};
|
|
29
|
+
bounds: OverlayLayerBounds;
|
|
30
|
+
};
|
|
31
|
+
type OverlayModuleAlertState = {
|
|
32
|
+
events?: Record<string, unknown>;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
};
|
|
35
|
+
type OverlayModuleState = {
|
|
36
|
+
id?: string;
|
|
37
|
+
loaded?: boolean;
|
|
38
|
+
version?: number;
|
|
39
|
+
settings?: {
|
|
40
|
+
title?: string | null;
|
|
41
|
+
type?: ModuleType;
|
|
42
|
+
locked?: boolean;
|
|
43
|
+
};
|
|
44
|
+
lights?: unknown[];
|
|
45
|
+
css?: Record<string, string | number>;
|
|
46
|
+
content?: Record<string, unknown>;
|
|
47
|
+
variables?: Record<string, unknown>;
|
|
48
|
+
events?: Record<string, unknown>;
|
|
49
|
+
alert?: OverlayModuleAlertState;
|
|
50
|
+
};
|
|
51
|
+
type OverlaySettings = {
|
|
52
|
+
layers: OverlayLayerState[];
|
|
53
|
+
metadata: {
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
};
|
|
57
|
+
modules: Record<string, OverlayModuleState>;
|
|
58
|
+
};
|
|
59
|
+
type OverlayState = {
|
|
60
|
+
uuid: string;
|
|
61
|
+
listen_id: string;
|
|
62
|
+
name: string;
|
|
63
|
+
description?: string;
|
|
64
|
+
settings: OverlaySettings;
|
|
65
|
+
metadata?: {
|
|
66
|
+
width: number | null;
|
|
67
|
+
height: number | null;
|
|
68
|
+
} | null;
|
|
69
|
+
layers_count?: number | null;
|
|
70
|
+
hasFullSettings?: boolean;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
interface SEBootstrapResponse {
|
|
74
|
+
overlay: SEOverlay;
|
|
75
|
+
session?: unknown;
|
|
76
|
+
tipping?: unknown;
|
|
77
|
+
channel?: unknown;
|
|
78
|
+
passport?: unknown;
|
|
79
|
+
}
|
|
80
|
+
interface SEOverlay {
|
|
81
|
+
_id: string;
|
|
82
|
+
channel?: string;
|
|
83
|
+
type?: string;
|
|
84
|
+
name?: string;
|
|
85
|
+
settings: {
|
|
86
|
+
width: number;
|
|
87
|
+
height: number;
|
|
88
|
+
name?: string;
|
|
89
|
+
};
|
|
90
|
+
widgets: SEWidget[];
|
|
91
|
+
createdAt?: string;
|
|
92
|
+
updatedAt?: string;
|
|
93
|
+
}
|
|
94
|
+
interface SEWidget {
|
|
95
|
+
id: number | string;
|
|
96
|
+
group?: string | null;
|
|
97
|
+
version?: number | string | null;
|
|
98
|
+
type: string;
|
|
99
|
+
name?: string | null;
|
|
100
|
+
visible?: boolean;
|
|
101
|
+
locked?: boolean;
|
|
102
|
+
listener?: string | null;
|
|
103
|
+
listeners?: Record<string, boolean> | string[] | null;
|
|
104
|
+
provider?: string;
|
|
105
|
+
css: SECss;
|
|
106
|
+
text?: SEText;
|
|
107
|
+
image?: SEImage;
|
|
108
|
+
video?: SEVideo;
|
|
109
|
+
audio?: SEAudio;
|
|
110
|
+
variables?: Record<string, unknown>;
|
|
111
|
+
}
|
|
112
|
+
interface SECss {
|
|
113
|
+
'z-index'?: number;
|
|
114
|
+
width: string | number;
|
|
115
|
+
height: string | number;
|
|
116
|
+
opacity?: number;
|
|
117
|
+
top?: string | number;
|
|
118
|
+
left?: string | number;
|
|
119
|
+
}
|
|
120
|
+
interface SEText {
|
|
121
|
+
type?: string;
|
|
122
|
+
value?: string | null;
|
|
123
|
+
enableShadow?: boolean;
|
|
124
|
+
scrolling?: {
|
|
125
|
+
direction?: string;
|
|
126
|
+
speed?: number;
|
|
127
|
+
enabled?: boolean;
|
|
128
|
+
};
|
|
129
|
+
css?: Record<string, unknown>;
|
|
130
|
+
}
|
|
131
|
+
interface SEImage {
|
|
132
|
+
type?: string;
|
|
133
|
+
src?: string;
|
|
134
|
+
css?: Record<string, unknown>;
|
|
135
|
+
}
|
|
136
|
+
interface SEVideo {
|
|
137
|
+
type?: string;
|
|
138
|
+
src?: string;
|
|
139
|
+
volume?: number;
|
|
140
|
+
css?: Record<string, unknown>;
|
|
141
|
+
}
|
|
142
|
+
interface SEAudio {
|
|
143
|
+
src?: string;
|
|
144
|
+
volume?: number;
|
|
145
|
+
}
|
|
146
|
+
interface ImportCoverage {
|
|
147
|
+
totalWidgets: number;
|
|
148
|
+
mappings: Array<{
|
|
149
|
+
seType: string;
|
|
150
|
+
lumiaType: string;
|
|
151
|
+
status: 'direct' | 'partial' | 'template' | 'placeholder';
|
|
152
|
+
count: number;
|
|
153
|
+
}>;
|
|
154
|
+
notes: string[];
|
|
155
|
+
}
|
|
156
|
+
interface ReviewItem {
|
|
157
|
+
moduleId: string;
|
|
158
|
+
seWidget: SEWidget;
|
|
159
|
+
status: 'placeholder' | 'template';
|
|
160
|
+
reason: string;
|
|
161
|
+
flaggedOff?: boolean;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** Distinct SE CDN URLs referenced anywhere inside the overlay's settings. */
|
|
165
|
+
declare function findSEAssetURLs(overlay: OverlayState): string[];
|
|
166
|
+
/** Return a new overlay with every `oldUrl → newUrl` replacement applied. */
|
|
167
|
+
declare function rewriteAssetURLs(overlay: OverlayState, mapping: Record<string, string>): OverlayState;
|
|
168
|
+
interface AssetMirrorProgress {
|
|
169
|
+
url: string;
|
|
170
|
+
state: 'pending' | 'fetching' | 'uploading' | 'done' | 'failed';
|
|
171
|
+
newUrl?: string;
|
|
172
|
+
error?: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Mirror a single SE asset to Lumia storage via the existing `/overlays/assets`
|
|
176
|
+
* upload endpoint. Returns the new Lumia URL on success.
|
|
177
|
+
*
|
|
178
|
+
* The host call site is responsible for retries and progress reporting; this
|
|
179
|
+
* function is intentionally single-shot. Pass `signal` (AbortSignal) to abort
|
|
180
|
+
* the source-side `fetch` when the modal closes mid-mirror — the upload itself
|
|
181
|
+
* is consumer-defined and the caller decides whether/how to short-circuit it.
|
|
182
|
+
*/
|
|
183
|
+
declare function mirrorOneAsset(url: string, upload: (file: File) => Promise<{
|
|
184
|
+
asset: {
|
|
185
|
+
url: string;
|
|
186
|
+
};
|
|
187
|
+
} | {
|
|
188
|
+
url: string;
|
|
189
|
+
} | unknown>, signal?: AbortSignal): Promise<string>;
|
|
190
|
+
declare function filenameFromURL(url: string): string;
|
|
191
|
+
|
|
192
|
+
interface TransplantedUnit {
|
|
193
|
+
layer: OverlayLayerState;
|
|
194
|
+
module: OverlayModuleState;
|
|
195
|
+
extras?: Array<{
|
|
196
|
+
layer: OverlayLayerState;
|
|
197
|
+
module: OverlayModuleState;
|
|
198
|
+
}>;
|
|
199
|
+
}
|
|
200
|
+
declare function transplantLayer(source: OverlayState, sourceLayerId: string): TransplantedUnit | null;
|
|
201
|
+
declare function listTransplantableLayers(source: OverlayState): Array<{
|
|
202
|
+
id: string;
|
|
203
|
+
label: string;
|
|
204
|
+
type: string;
|
|
205
|
+
}>;
|
|
206
|
+
|
|
207
|
+
declare const SE_WIDGET_TO_MARKETPLACE_CANDIDATES: Record<string, number[]>;
|
|
208
|
+
declare function getMarketplaceCandidates(seWidgetType: string): number[];
|
|
209
|
+
declare function hasMarketplaceCandidates(seWidgetType: string): boolean;
|
|
210
|
+
|
|
211
|
+
declare const SE_IMPORT_FLAGS: {};
|
|
212
|
+
declare function isWidgetFlaggedOff(_seType: string): boolean;
|
|
213
|
+
declare const FLAG_OFF_REASONS: Record<string, string>;
|
|
214
|
+
|
|
215
|
+
interface SEAccountClaims {
|
|
216
|
+
channel: string;
|
|
217
|
+
user: string;
|
|
218
|
+
authToken: string;
|
|
219
|
+
provider: string;
|
|
220
|
+
provider_id: string;
|
|
221
|
+
role: string;
|
|
222
|
+
exp: number;
|
|
223
|
+
jti: string;
|
|
224
|
+
channel_id?: string;
|
|
225
|
+
user_id?: string;
|
|
226
|
+
}
|
|
227
|
+
type SEAuthErrorCode = 'invalid-jwt' | 'expired' | 'unauthorized' | 'forbidden';
|
|
228
|
+
declare class SEAuthError extends Error {
|
|
229
|
+
code: SEAuthErrorCode;
|
|
230
|
+
constructor(code: SEAuthErrorCode, message: string);
|
|
231
|
+
}
|
|
232
|
+
declare function decodeJwtPayload(jwt: string): SEAccountClaims;
|
|
233
|
+
declare class SEClient {
|
|
234
|
+
private readonly claims;
|
|
235
|
+
constructor(claims: SEAccountClaims);
|
|
236
|
+
static fromJwt(jwt: string): SEClient;
|
|
237
|
+
get channelId(): string;
|
|
238
|
+
get provider(): string;
|
|
239
|
+
get providerId(): string;
|
|
240
|
+
get userId(): string;
|
|
241
|
+
get jti(): string;
|
|
242
|
+
get expiresAt(): Date;
|
|
243
|
+
provenance(): {
|
|
244
|
+
jti: string;
|
|
245
|
+
channelId: string;
|
|
246
|
+
provider: string;
|
|
247
|
+
importedAt: string;
|
|
248
|
+
};
|
|
249
|
+
get<T>(path: string): Promise<T>;
|
|
250
|
+
}
|
|
251
|
+
interface SEChannelSummary {
|
|
252
|
+
_id: string;
|
|
253
|
+
provider: string;
|
|
254
|
+
providerId: string;
|
|
255
|
+
username: string;
|
|
256
|
+
alias?: string;
|
|
257
|
+
displayName?: string;
|
|
258
|
+
avatar?: string;
|
|
259
|
+
role?: string;
|
|
260
|
+
authorized?: boolean;
|
|
261
|
+
inactive?: boolean;
|
|
262
|
+
isPartner?: boolean;
|
|
263
|
+
broadcasterType?: string;
|
|
264
|
+
}
|
|
265
|
+
interface SEUsersCurrentResponse {
|
|
266
|
+
_id: string;
|
|
267
|
+
suspended?: boolean;
|
|
268
|
+
channels: SEChannelSummary[];
|
|
269
|
+
}
|
|
270
|
+
declare function fetchUsableChannels(client: SEClient): Promise<SEChannelSummary[]>;
|
|
271
|
+
|
|
272
|
+
interface SEExistingAsset {
|
|
273
|
+
file_name?: string;
|
|
274
|
+
name?: string;
|
|
275
|
+
url: string;
|
|
276
|
+
}
|
|
277
|
+
interface SECustomEmbedProps {
|
|
278
|
+
codeId: string;
|
|
279
|
+
html: string;
|
|
280
|
+
css: string;
|
|
281
|
+
js: string;
|
|
282
|
+
data: unknown;
|
|
283
|
+
}
|
|
284
|
+
interface SEUploadAssetResult {
|
|
285
|
+
url: string;
|
|
286
|
+
file_name?: string;
|
|
287
|
+
name?: string;
|
|
288
|
+
}
|
|
289
|
+
interface SESaveOverlayBody {
|
|
290
|
+
name: string;
|
|
291
|
+
description?: string;
|
|
292
|
+
settings: OverlayState['settings'];
|
|
293
|
+
}
|
|
294
|
+
interface SEImportBindings {
|
|
295
|
+
fetchMarketplaceOverlay: (id: number) => Promise<OverlayState>;
|
|
296
|
+
generateAICustomCode: (prompt: string) => Promise<AIGeneratedCustomOverlay>;
|
|
297
|
+
uploadAsset: (file: File) => Promise<SEUploadAssetResult>;
|
|
298
|
+
existingAssets: SEExistingAsset[];
|
|
299
|
+
saveOverlay: (body: SESaveOverlayBody) => Promise<{
|
|
300
|
+
uuid: string;
|
|
301
|
+
}>;
|
|
302
|
+
onComplete: (result: {
|
|
303
|
+
overlayId: string;
|
|
304
|
+
}) => void;
|
|
305
|
+
onClose: () => void;
|
|
306
|
+
notify: {
|
|
307
|
+
success: (msg: string) => void;
|
|
308
|
+
error: (msg: string) => void;
|
|
309
|
+
warning: (msg: string) => void;
|
|
310
|
+
};
|
|
311
|
+
CustomEmbed?: ComponentType<SECustomEmbedProps>;
|
|
312
|
+
t?: (key: string) => string | undefined;
|
|
313
|
+
onAuthError?: (err: SEAuthError) => void;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
interface SEImportWizardProps {
|
|
317
|
+
bindings: SEImportBindings;
|
|
318
|
+
initialUrl?: string;
|
|
319
|
+
}
|
|
320
|
+
declare function SEImportWizard({ bindings, initialUrl, }: SEImportWizardProps): react_jsx_runtime.JSX.Element;
|
|
321
|
+
|
|
322
|
+
interface MarketplacePickerProps {
|
|
323
|
+
seWidgetType: string;
|
|
324
|
+
fetchMarketplaceOverlay: SEImportBindings['fetchMarketplaceOverlay'];
|
|
325
|
+
CustomEmbed?: SEImportBindings['CustomEmbed'];
|
|
326
|
+
onPick: (transplant: {
|
|
327
|
+
layer: OverlayLayerState;
|
|
328
|
+
module: OverlayModuleState;
|
|
329
|
+
}) => void;
|
|
330
|
+
onCancel: () => void;
|
|
331
|
+
}
|
|
332
|
+
declare function MarketplacePicker({ seWidgetType, fetchMarketplaceOverlay, CustomEmbed, onPick, onCancel }: MarketplacePickerProps): react_jsx_runtime.JSX.Element;
|
|
333
|
+
|
|
334
|
+
interface ImportResult {
|
|
335
|
+
overlay: OverlayState;
|
|
336
|
+
coverage: ImportCoverage;
|
|
337
|
+
reviewItems: ReviewItem[];
|
|
338
|
+
}
|
|
339
|
+
declare function extractSEOverlayId(input: string): string | null;
|
|
340
|
+
declare function extractSEPreviewParts(input: string): {
|
|
341
|
+
overlayId: string;
|
|
342
|
+
apikey: string;
|
|
343
|
+
} | null;
|
|
344
|
+
declare function buildBootstrapUrl(overlayId: string): string;
|
|
345
|
+
declare function fetchSEBootstrap({ overlayId, apikey }: {
|
|
346
|
+
overlayId: string;
|
|
347
|
+
apikey: string;
|
|
348
|
+
}): Promise<SEBootstrapResponse>;
|
|
349
|
+
declare function isSEBootstrap(value: unknown): value is SEBootstrapResponse;
|
|
350
|
+
declare function importSEBootstrap(bootstrap: SEBootstrapResponse): ImportResult;
|
|
351
|
+
interface AIGeneratedCustomOverlay {
|
|
352
|
+
codeId?: string;
|
|
353
|
+
html?: string;
|
|
354
|
+
css?: string;
|
|
355
|
+
js?: string;
|
|
356
|
+
data?: unknown;
|
|
357
|
+
configs?: unknown;
|
|
358
|
+
}
|
|
359
|
+
declare function applyReviewAction(result: ImportResult, moduleId: string, action: 'keep' | 'skip' | 'ai' | 'marketplace', payload?: AIGeneratedCustomOverlay | {
|
|
360
|
+
layer: OverlayLayerState;
|
|
361
|
+
module: OverlayModuleState;
|
|
362
|
+
extras?: Array<{
|
|
363
|
+
layer: OverlayLayerState;
|
|
364
|
+
module: OverlayModuleState;
|
|
365
|
+
}>;
|
|
366
|
+
}): ImportResult;
|
|
367
|
+
declare function getAILandingBounds(widget: SEWidget, canvas?: {
|
|
368
|
+
width: number;
|
|
369
|
+
height: number;
|
|
370
|
+
}): {
|
|
371
|
+
width: number;
|
|
372
|
+
height: number;
|
|
373
|
+
};
|
|
374
|
+
declare function buildAIPromptForSEWidget(widget: SEWidget, canvas?: {
|
|
375
|
+
width: number;
|
|
376
|
+
height: number;
|
|
377
|
+
}): string;
|
|
378
|
+
|
|
379
|
+
export { type AIGeneratedCustomOverlay, type AssetMirrorProgress, FLAG_OFF_REASONS, type ImportCoverage, type ImportResult, MarketplacePicker, type MarketplacePickerProps, type ModuleType, type OverlayLayerBounds, type OverlayLayerState, type OverlayLayerType, type OverlayModuleAlertState, type OverlayModuleState, type OverlaySettings, type OverlayState, type ReviewItem, type SEAccountClaims, SEAuthError, type SEAuthErrorCode, type SEBootstrapResponse, type SEChannelSummary, SEClient, type SECustomEmbedProps, type SEExistingAsset, type SEImportBindings, SEImportWizard, type SEImportWizardProps, type SESaveOverlayBody, type SEUploadAssetResult, type SEUsersCurrentResponse, type SEWidget, SE_IMPORT_FLAGS, SE_WIDGET_TO_MARKETPLACE_CANDIDATES, type TransplantedUnit, applyReviewAction, buildAIPromptForSEWidget, buildBootstrapUrl, decodeJwtPayload, extractSEOverlayId, extractSEPreviewParts, fetchSEBootstrap, fetchUsableChannels, filenameFromURL, findSEAssetURLs, getAILandingBounds, getMarketplaceCandidates, hasMarketplaceCandidates, importSEBootstrap, isSEBootstrap, isWidgetFlaggedOff, listTransplantableLayers, mirrorOneAsset, rewriteAssetURLs, transplantLayer };
|