@wistia/vhs 5.0.5 → 6.0.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/dist/index.d.ts +7 -605
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1324 -2015
- package/dist/index.js.map +1 -1
- package/package.json +24 -24
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { DefaultTheme, IStyledComponent, RuleSet, css } from "styled-components";
|
|
3
|
-
import { ChangeEvent, ComponentClass, ComponentProps, ComponentPropsWithRef, ComponentPropsWithoutRef, ComponentType, DetailedHTMLProps,
|
|
3
|
+
import { ChangeEvent, ComponentClass, ComponentProps, ComponentPropsWithRef, ComponentPropsWithoutRef, ComponentType, DetailedHTMLProps, ElementType, FC, FocusEvent, ForwardRefExoticComponent, HTMLAttributes, HTMLInputTypeAttribute, JSX, KeyboardEvent, MemoExoticComponent, MouseEvent, PropsWithChildren, ReactElement, ReactNode, Ref, RefAttributes, RefObject } from "react";
|
|
4
4
|
import { Field, FormikErrors, FormikHelpers, FormikProps, useFormikContext } from "formik";
|
|
5
5
|
import { ReactEditor } from "slate-react";
|
|
6
6
|
import { BaseEditor, Descendant, Editor } from "slate";
|
|
@@ -220,510 +220,12 @@ interface VHSTheme {
|
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
222
|
//#endregion
|
|
223
|
-
//#region src/helpers/copyToClipboard/copyToClipboard.d.ts
|
|
224
|
-
/**
|
|
225
|
-
* Copies a string to user's clipboard for easy pasting in another location
|
|
226
|
-
*
|
|
227
|
-
* @param {string} textToCopy - the string that will be copied to users clipboard
|
|
228
|
-
* @returns {Promise} - Promise object that represents the copied string
|
|
229
|
-
*/
|
|
230
|
-
declare const copyToClipboard: (textToCopy: string) => Promise<void>;
|
|
231
|
-
//#endregion
|
|
232
|
-
//#region src/helpers/datetimeHelpers/datetimeHelpers.d.ts
|
|
233
|
-
type DateOnlyStringOptions = {
|
|
234
|
-
timeZone?: string;
|
|
235
|
-
omitYear?: boolean;
|
|
236
|
-
};
|
|
237
|
-
type TimeAgoOptions = {
|
|
238
|
-
nowAnchor?: Date;
|
|
239
|
-
includeTime?: boolean;
|
|
240
|
-
};
|
|
241
|
-
type Duration = {
|
|
242
|
-
seconds: number;
|
|
243
|
-
minutes: number;
|
|
244
|
-
hours: number;
|
|
245
|
-
};
|
|
246
|
-
type WistiaDateTimeObject = {
|
|
247
|
-
minutes: number;
|
|
248
|
-
hours: number;
|
|
249
|
-
dayOfMonth: number;
|
|
250
|
-
year: number;
|
|
251
|
-
month: number;
|
|
252
|
-
};
|
|
253
|
-
/**
|
|
254
|
-
* @param {*} date - possible date value - unknown type
|
|
255
|
-
* @returns {boolean} - whether it is a date object
|
|
256
|
-
*/
|
|
257
|
-
declare const isDate: (date: unknown) => date is Date;
|
|
258
|
-
/**
|
|
259
|
-
* Converts a Date object into a date only string.
|
|
260
|
-
*
|
|
261
|
-
* e.g. Jun 3, 2021
|
|
262
|
-
* @param {*} date a Date object you want to convert into a string - gracefully handles any input
|
|
263
|
-
* @param {object} options -
|
|
264
|
-
* @param {string} options.timeZone - the timezone you want date displayed in, defaults to current users time zone
|
|
265
|
-
* @returns {string} a formatted date string
|
|
266
|
-
*/
|
|
267
|
-
declare const dateOnlyString: (date: unknown, {
|
|
268
|
-
timeZone
|
|
269
|
-
}?: DateOnlyStringOptions) => string;
|
|
270
|
-
/**
|
|
271
|
-
* Converts a Date object into a date only string formatted numerically.
|
|
272
|
-
*
|
|
273
|
-
* e.g. 06/03/2021
|
|
274
|
-
* @param {*} date a Date object you want to convert into a string - gracefully handles any input
|
|
275
|
-
* @param {object} options -
|
|
276
|
-
* @param {string} options.timeZone - the timezone you want date displayed in, defaults to current users time zone
|
|
277
|
-
* @returns {string} a formatted date string
|
|
278
|
-
*/
|
|
279
|
-
declare const dateOnlyStringNumeric: (date: unknown, {
|
|
280
|
-
timeZone
|
|
281
|
-
}?: DateOnlyStringOptions) => string;
|
|
282
|
-
/**
|
|
283
|
-
* Converts a Date object into a date only string formatted to ISO8601.
|
|
284
|
-
*
|
|
285
|
-
* e.g. 2021-06-03
|
|
286
|
-
* @param {*} date a Date object you want to convert into a string - gracefully handles any input
|
|
287
|
-
* @param {object} options -
|
|
288
|
-
* @param {string} options.timeZone - the timezone you want date displayed in, defaults to current users time zone
|
|
289
|
-
* @returns {string} a formatted date string
|
|
290
|
-
*/
|
|
291
|
-
declare const dateOnlyISOString: (date: unknown, {
|
|
292
|
-
timeZone
|
|
293
|
-
}?: DateOnlyStringOptions) => string;
|
|
294
|
-
/**
|
|
295
|
-
* Converts a Date object into a month and day string formatted numerically.
|
|
296
|
-
*
|
|
297
|
-
* e.g. 06/03/2021
|
|
298
|
-
* @param {*} date a Date object you want to convert into a string - gracefully handles any value
|
|
299
|
-
* @param {object} options -
|
|
300
|
-
* @param {string} options.timeZone - the timezone you want date displayed in, defaults to current users time zone
|
|
301
|
-
* @returns {string} a formatted date string
|
|
302
|
-
*/
|
|
303
|
-
declare const monthDayStringNumeric: (date: unknown, {
|
|
304
|
-
timeZone
|
|
305
|
-
}?: DateOnlyStringOptions) => string;
|
|
306
|
-
/**
|
|
307
|
-
* Converts a Date object into a month and day string formatted numerically.
|
|
308
|
-
*
|
|
309
|
-
* e.g. Thursday
|
|
310
|
-
* @param {Date} date a Date object you want to convert into a string
|
|
311
|
-
* @param {object} options -
|
|
312
|
-
* @param {string} options.timeZone - the timezone you want date displayed in, defaults to current users time zone
|
|
313
|
-
* @returns {string} a formatted date string
|
|
314
|
-
*/
|
|
315
|
-
declare const dayOfWeekString: (date: Date | null, {
|
|
316
|
-
timeZone
|
|
317
|
-
}?: DateOnlyStringOptions) => string;
|
|
318
|
-
/**
|
|
319
|
-
* Converts a Date object into a time only string.
|
|
320
|
-
*
|
|
321
|
-
* e.g. 7:30 AM
|
|
322
|
-
* @param {*} date a Date object you want to convert into a string - gracefully handles any value
|
|
323
|
-
* @param {object} options -
|
|
324
|
-
* @param {string} options.timeZone - the timezone you want date displayed in, defaults to current users time zone
|
|
325
|
-
* @returns {string} a formatted date string
|
|
326
|
-
*/
|
|
327
|
-
declare const timeOnlyString: (date: unknown, {
|
|
328
|
-
timeZone
|
|
329
|
-
}?: DateOnlyStringOptions) => string;
|
|
330
|
-
/**
|
|
331
|
-
* Converts a Date object into a date and time string.
|
|
332
|
-
*
|
|
333
|
-
* e.g. Jun 3, 2021, 11:52 AM
|
|
334
|
-
*
|
|
335
|
-
* NOTE: you should probably use timeAgoString when trying to display
|
|
336
|
-
* an updated/created timestamp.
|
|
337
|
-
*
|
|
338
|
-
* @param {*} date - a Date object you want to convert into a string - gracefully handles any value
|
|
339
|
-
* @param {object} options -
|
|
340
|
-
* @param {string} options.timeZone - the timezone you want date displayed in, defaults to current users time zone
|
|
341
|
-
* @returns {string} a formatted date string
|
|
342
|
-
*/
|
|
343
|
-
declare const dateTimeString: (date: Date | number | string | null | undefined, {
|
|
344
|
-
timeZone,
|
|
345
|
-
omitYear
|
|
346
|
-
}?: DateOnlyStringOptions) => string;
|
|
347
|
-
/**
|
|
348
|
-
* Converts a Date object into a date and time string
|
|
349
|
-
* for use in a sentence.
|
|
350
|
-
*
|
|
351
|
-
* e.g. June 3, 2021, 11:52 AM
|
|
352
|
-
*
|
|
353
|
-
* NOTE: you should probably use timeAgoString when trying to display
|
|
354
|
-
* an updated/created timestamp.
|
|
355
|
-
*
|
|
356
|
-
* @param {*} date - a Date object you want to convert into a string - gracefully handles any value
|
|
357
|
-
* @param {object} options -
|
|
358
|
-
* @param {string} options.timeZone - the timezone you want date displayed in, defaults to current users time zone
|
|
359
|
-
* @returns {string} a formatted date string
|
|
360
|
-
*/
|
|
361
|
-
declare const dateTimeStringForSentence: (date: unknown, {
|
|
362
|
-
timeZone
|
|
363
|
-
}?: DateOnlyStringOptions) => string;
|
|
364
|
-
/**
|
|
365
|
-
* Converts a Date object into a date only string
|
|
366
|
-
* for use in a sentence.
|
|
367
|
-
*
|
|
368
|
-
* e.g. June 3, 2021
|
|
369
|
-
*
|
|
370
|
-
* @param {*} date - a Date object you want to convert into a string - gracefully handles any value
|
|
371
|
-
* @param {object} options -
|
|
372
|
-
* @param {string} options.timeZone - the timezone you want date displayed in, defaults to current users time zone
|
|
373
|
-
* @returns {string} a formatted date string
|
|
374
|
-
*/
|
|
375
|
-
declare const dateOnlyStringForSentence: (date: unknown, {
|
|
376
|
-
timeZone
|
|
377
|
-
}?: DateOnlyStringOptions) => string;
|
|
378
|
-
/**
|
|
379
|
-
* Shows time ago relative to current time.
|
|
380
|
-
*
|
|
381
|
-
* examples:
|
|
382
|
-
*
|
|
383
|
-
* < 1 minute ago
|
|
384
|
-
*
|
|
385
|
-
* 33 minutes ago
|
|
386
|
-
*
|
|
387
|
-
* Today, 3:30 PM
|
|
388
|
-
*
|
|
389
|
-
* Yesterday, 6:22 AM
|
|
390
|
-
*
|
|
391
|
-
* Nov 11, 11:32 AM
|
|
392
|
-
*
|
|
393
|
-
* Feb 23, 2020, 1:55 PM
|
|
394
|
-
*
|
|
395
|
-
* or when `includeTime` is false:
|
|
396
|
-
*
|
|
397
|
-
* Today
|
|
398
|
-
*
|
|
399
|
-
* Yesterday
|
|
400
|
-
*
|
|
401
|
-
* on Thursday
|
|
402
|
-
*
|
|
403
|
-
* Nov 11
|
|
404
|
-
*
|
|
405
|
-
* Feb 23, 2020
|
|
406
|
-
*
|
|
407
|
-
* NOTE: timeAgoString doesn't support multiple time zones since doing so would
|
|
408
|
-
* complicate calculations for whether to use "Today" or "Yesterday".
|
|
409
|
-
* @param {Date} date - the date relative to now
|
|
410
|
-
* @param {object} options -
|
|
411
|
-
* @param {Date} options.nowAnchor - The date used to calculate relative to now. Defaults to current date but can be overwritten for tests.
|
|
412
|
-
* @param {boolean} options.includeTime - Whether to include the time in the output. Defaults to true.
|
|
413
|
-
* @returns {string} - a string representation of the date.
|
|
414
|
-
*/
|
|
415
|
-
declare const timeAgoString: (date: Date, {
|
|
416
|
-
nowAnchor,
|
|
417
|
-
includeTime
|
|
418
|
-
}?: TimeAgoOptions) => string;
|
|
419
|
-
/**
|
|
420
|
-
* Given a date, shows the UTC offset.
|
|
421
|
-
* @param {Date} date a Date object for calculating offset.
|
|
422
|
-
* @returns {string} - string representing the UTC offset
|
|
423
|
-
*/
|
|
424
|
-
declare const dateUTCOffset: (date: Date) => string;
|
|
425
|
-
/**
|
|
426
|
-
* @typedef {Object} Duration
|
|
427
|
-
* @property {number} seconds - number of seconds
|
|
428
|
-
* @property {number} minutes - number of minutes
|
|
429
|
-
* @property {number} hours - number of hours
|
|
430
|
-
*/
|
|
431
|
-
/**
|
|
432
|
-
* Returns an object representing the duration in seconds, minutes and hours.
|
|
433
|
-
*
|
|
434
|
-
* @param {number} numberOfMilliseconds - number of milliseconds
|
|
435
|
-
* @returns {Duration} -
|
|
436
|
-
*/
|
|
437
|
-
declare const buildTimeDuration: (numberOfMilliseconds: number) => Duration;
|
|
438
|
-
/**
|
|
439
|
-
* A string representation of a duration for a media. Assumes most medias
|
|
440
|
-
* are under an hour so only shows hours if media is over hour.
|
|
441
|
-
*
|
|
442
|
-
* @param {number} numberOfMilliseconds - number of milliseconds
|
|
443
|
-
* @returns {string} - a string representation for duration
|
|
444
|
-
*/
|
|
445
|
-
declare const mediaDurationString: (numberOfMilliseconds: number) => string;
|
|
446
|
-
/**
|
|
447
|
-
* A string representation of a duration for a user session. Assumes that
|
|
448
|
-
* sessions may or may not be more than an hour. To prevent confusion all
|
|
449
|
-
* times show hours, even those that are less than an hour.
|
|
450
|
-
*
|
|
451
|
-
* @param {number} numberOfMilliseconds - number of milliseconds
|
|
452
|
-
* @returns {string} - a string representation of duration
|
|
453
|
-
*/
|
|
454
|
-
declare const sessionDurationString: (numberOfMilliseconds: number) => string;
|
|
455
|
-
/**
|
|
456
|
-
* @typedef {Object} WistiaDateTimeObject
|
|
457
|
-
* @property {number} minutes - number of minutes
|
|
458
|
-
* @property {number} hours - number of hours
|
|
459
|
-
* @property {number} dayOfMonth - day of the month
|
|
460
|
-
* @property {number} year - year
|
|
461
|
-
* @property {number} month - month
|
|
462
|
-
*/
|
|
463
|
-
/**
|
|
464
|
-
* @param {Date | null | undefined} date - a Date object
|
|
465
|
-
* @returns {WistiaDateTimeObject | null} - replaceMe
|
|
466
|
-
*/
|
|
467
|
-
declare const dateToDateTime: (date: Date | null | undefined) => WistiaDateTimeObject | null;
|
|
468
|
-
/**
|
|
469
|
-
* @param {Partial<WistiaDateTimeObject> | null} dateTime - a dateTime object
|
|
470
|
-
* @returns {Date | null} - the converted date or null if anything is missing
|
|
471
|
-
*/
|
|
472
|
-
declare const dateTimeToDate: (dateTime: Partial<WistiaDateTimeObject> | null | undefined) => Date | null;
|
|
473
|
-
/**
|
|
474
|
-
* @param {Partial<WistiaDateTimeObject>} dateTime - a dateTime object
|
|
475
|
-
* @returns {string | null} - string with the ISO-8601 string or null
|
|
476
|
-
*/
|
|
477
|
-
declare const dateTimeToISO: (dateTime: Partial<WistiaDateTimeObject>) => string | null;
|
|
478
|
-
type DateTimeRoundedOverload = {
|
|
479
|
-
(dateTime: Date, toISOString?: true): string | null;
|
|
480
|
-
(dateTime: Date, toISOString: false): Date | null;
|
|
481
|
-
};
|
|
482
|
-
/**
|
|
483
|
-
* @param {Date} dateTime - a dateTime object
|
|
484
|
-
* @param {boolean} toISOString - whether the return value should be an ISO string
|
|
485
|
-
* @returns {string | Date | null} - string or date depending on if toIsoString is true or false. Could be null if there's an error.
|
|
486
|
-
*/
|
|
487
|
-
declare const dateTimeRounded: DateTimeRoundedOverload;
|
|
488
|
-
/**
|
|
489
|
-
* Given number of miliseconds, returns the iso8601 string rounded down from
|
|
490
|
-
* number of seconds. Mainly copied from https://github.com/wistia/player-modern/blob/master/src/utilities/iso8601Helper.js#L54
|
|
491
|
-
* but modified to support milliseconds
|
|
492
|
-
*
|
|
493
|
-
* @param {number} numberOfMilliseconds - number of milliseconds
|
|
494
|
-
* @returns {string} an iso8601 string format of duration
|
|
495
|
-
*/
|
|
496
|
-
declare const millisecondsToDurationISOString: (numberOfMilliseconds: number) => string;
|
|
497
|
-
//#endregion
|
|
498
|
-
//#region src/helpers/datetimeHelpers/index.d.ts
|
|
499
|
-
declare const datetimeHelpers: {
|
|
500
|
-
isDate: typeof isDate;
|
|
501
|
-
dateOnlyString: typeof dateOnlyString;
|
|
502
|
-
dateOnlyStringNumeric: typeof dateOnlyStringNumeric;
|
|
503
|
-
dateOnlyISOString: typeof dateOnlyISOString;
|
|
504
|
-
monthDayStringNumeric: typeof monthDayStringNumeric;
|
|
505
|
-
dayOfWeekString: typeof dayOfWeekString;
|
|
506
|
-
timeOnlyString: typeof timeOnlyString;
|
|
507
|
-
dateTimeString: typeof dateTimeString;
|
|
508
|
-
dateTimeStringForSentence: typeof dateTimeStringForSentence;
|
|
509
|
-
dateOnlyStringForSentence: typeof dateOnlyStringForSentence;
|
|
510
|
-
timeAgoString: typeof timeAgoString;
|
|
511
|
-
dateUTCOffset: typeof dateUTCOffset;
|
|
512
|
-
buildTimeDuration: typeof buildTimeDuration;
|
|
513
|
-
mediaDurationString: typeof mediaDurationString;
|
|
514
|
-
sessionDurationString: typeof sessionDurationString;
|
|
515
|
-
dateToDateTime: typeof dateToDateTime;
|
|
516
|
-
dateTimeToDate: typeof dateTimeToDate;
|
|
517
|
-
dateTimeToISO: typeof dateTimeToISO;
|
|
518
|
-
dateTimeRounded: typeof dateTimeRounded;
|
|
519
|
-
millisecondsToDurationISOString: typeof millisecondsToDurationISOString;
|
|
520
|
-
};
|
|
521
|
-
//#endregion
|
|
522
|
-
//#region src/helpers/getBackgroundGradient/getBackgroundGradient.d.ts
|
|
523
|
-
type GradientNameType = "defaultDarkOne" | "defaultDarkTwo" | "defaultLightOne" | "defaultLightTwo" | "defaultMidOne" | "defaultMidTwo" | "green" | "greenWithPop" | "pink" | "pinkWithPop" | "playfulGradientOne" | "playfulGradientTwo" | "purple" | "purpleWithPop" | "yellow" | "yellowWithPop";
|
|
524
|
-
type GetBackgroundGradientType = GradientNameType | undefined;
|
|
525
|
-
/**
|
|
526
|
-
* Retrieves the CSS background gradient corresponding to the given gradient name.
|
|
527
|
-
* If the specified gradient name is not found, the default gradient ('defaultDarkOne') is returned.
|
|
528
|
-
* @param {GradientName} gradientName - The name of the gradient to retrieve.
|
|
529
|
-
* @returns {FlattenSimpleInterpolation} The CSS string representing the specified gradient.
|
|
530
|
-
*/
|
|
531
|
-
declare const getBackgroundGradient: (gradientName?: GetBackgroundGradientType) => ReturnType<typeof css>;
|
|
532
|
-
//#endregion
|
|
533
|
-
//#region src/helpers/getBackgroundGradient/getSemiRandomBackgroundGradient.d.ts
|
|
534
|
-
/**
|
|
535
|
-
* Retrieves a semi-random background gradient based on the given id.
|
|
536
|
-
*
|
|
537
|
-
* @param {string} id - The id to use to generate the semi-random background gradient.
|
|
538
|
-
* @returns {GradientName} gradientName
|
|
539
|
-
*/
|
|
540
|
-
declare const getSemiRandomBackgroundGradient: (id: string) => GradientNameType | undefined;
|
|
541
|
-
//#endregion
|
|
542
|
-
//#region src/helpers/mq/mq.d.ts
|
|
543
|
-
type MqFn = <T extends DefaultTheme = DefaultTheme>(props: {
|
|
544
|
-
theme: T;
|
|
545
|
-
}) => string;
|
|
546
|
-
declare const mq: {
|
|
547
|
-
xsAndUp: MqFn;
|
|
548
|
-
smAndUp: MqFn;
|
|
549
|
-
mdAndUp: MqFn;
|
|
550
|
-
lgAndUp: MqFn;
|
|
551
|
-
xlAndUp: MqFn;
|
|
552
|
-
xsAndDown: MqFn;
|
|
553
|
-
smAndDown: MqFn;
|
|
554
|
-
mdAndDown: MqFn;
|
|
555
|
-
lgAndDown: MqFn;
|
|
556
|
-
xlAndDown: MqFn;
|
|
557
|
-
};
|
|
558
|
-
//#endregion
|
|
559
|
-
//#region src/helpers/objectHelpers/isObject.d.ts
|
|
560
|
-
/**
|
|
561
|
-
* Determines if a given value is an object
|
|
562
|
-
*
|
|
563
|
-
* @param {*} value - value of any type
|
|
564
|
-
* @returns {boolean} - whether value is an object
|
|
565
|
-
*/
|
|
566
|
-
declare const isObject: (value: unknown) => value is Record<string, unknown>;
|
|
567
|
-
//#endregion
|
|
568
|
-
//#region src/helpers/objectHelpers/deepFreeze.d.ts
|
|
569
|
-
/**
|
|
570
|
-
* Recursively Object.freeze() objects
|
|
571
|
-
*
|
|
572
|
-
* @param {Object} obj - any object to freeze
|
|
573
|
-
* @returns {Object} - new object
|
|
574
|
-
*/
|
|
575
|
-
declare const deepFreeze: (obj: Record<string, unknown>) => Record<string, unknown>;
|
|
576
|
-
//#endregion
|
|
577
|
-
//#region src/helpers/objectHelpers/merge.d.ts
|
|
578
|
-
/**
|
|
579
|
-
* Merges two or more objects
|
|
580
|
-
*
|
|
581
|
-
* @param {Object} target - object that subsequent objects will be merged into
|
|
582
|
-
* @param {...Object} sources - one or more objects
|
|
583
|
-
* @returns {Object} - new object
|
|
584
|
-
*/
|
|
585
|
-
declare const merge: (target: Record<string, unknown>, ...sources: Record<string, unknown>[]) => Record<string, unknown>;
|
|
586
|
-
//#endregion
|
|
587
|
-
//#region src/helpers/objectHelpers/selectKeys.d.ts
|
|
588
|
-
/**
|
|
589
|
-
* Creates an object composed of the selected keys
|
|
590
|
-
*
|
|
591
|
-
* @param {Object} obj - object we want a sub-selection of
|
|
592
|
-
* @param {string[]} keys - array of keys to be selected from object
|
|
593
|
-
* @returns {Object} - new object with only the selected keys (and their values) present
|
|
594
|
-
*/
|
|
595
|
-
declare const selectKeys: (obj: Record<string, unknown>, keys: string[]) => Record<string, unknown>;
|
|
596
|
-
//#endregion
|
|
597
|
-
//#region src/helpers/objectHelpers/index.d.ts
|
|
598
|
-
declare const objectHelpers: {
|
|
599
|
-
isObject: typeof isObject;
|
|
600
|
-
deepFreeze: typeof deepFreeze;
|
|
601
|
-
merge: typeof merge;
|
|
602
|
-
selectKeys: typeof selectKeys;
|
|
603
|
-
};
|
|
604
|
-
//#endregion
|
|
605
|
-
//#region src/helpers/stringHelpers/camelCase.d.ts
|
|
606
|
-
/**
|
|
607
|
-
* Converts a string to camel case
|
|
608
|
-
*
|
|
609
|
-
* @param {string} str - the string to convert
|
|
610
|
-
* @returns {string} - the camelcased string
|
|
611
|
-
*/
|
|
612
|
-
declare const camelCase: (str?: string) => string;
|
|
613
|
-
//#endregion
|
|
614
|
-
//#region src/helpers/stringHelpers/coerceToBoolean.d.ts
|
|
615
|
-
/**
|
|
616
|
-
* Converts a boolean string value `value` into a boolean. If passed
|
|
617
|
-
* something other than 'true' or 'false' will coerce value to boolean.
|
|
618
|
-
*
|
|
619
|
-
* @param {*} value - a value of any type
|
|
620
|
-
* @returns {boolean} - that value as a boolean
|
|
621
|
-
*/
|
|
622
|
-
declare const coerceToBoolean: (value: unknown) => boolean;
|
|
623
|
-
//#endregion
|
|
624
|
-
//#region src/helpers/stringHelpers/coerceToString.d.ts
|
|
625
|
-
/**
|
|
626
|
-
* Coerces a value `value` into a string. If passed a null or undefined
|
|
627
|
-
* value, returns an empty string.
|
|
628
|
-
*
|
|
629
|
-
* @param {*} value - a value of any type
|
|
630
|
-
* @returns {string} - that value as a string
|
|
631
|
-
*/
|
|
632
|
-
declare const coerceToString: (value: unknown) => string;
|
|
633
|
-
//#endregion
|
|
634
|
-
//#region src/helpers/stringHelpers/isHttpUrl.d.ts
|
|
635
|
-
/**
|
|
636
|
-
* Validates an http URL string
|
|
637
|
-
*
|
|
638
|
-
* @param {*} str - the url string to validate - could be an unknown type
|
|
639
|
-
* @return {boolean} - whether string is a valid http url
|
|
640
|
-
*/
|
|
641
|
-
declare const isHttpUrl: (str: unknown) => boolean;
|
|
642
|
-
//#endregion
|
|
643
|
-
//#region src/helpers/stringHelpers/isString.d.ts
|
|
644
|
-
/**
|
|
645
|
-
* Determines if a given value is a string
|
|
646
|
-
*
|
|
647
|
-
* @param {*} value - a value of any type
|
|
648
|
-
* @returns {boolean} - whether value is a string
|
|
649
|
-
*/
|
|
650
|
-
declare const isString: (value: unknown) => value is string;
|
|
651
|
-
//#endregion
|
|
652
|
-
//#region src/helpers/stringHelpers/isUrl.d.ts
|
|
653
|
-
/**
|
|
654
|
-
* Loosely validates a URL string
|
|
655
|
-
*
|
|
656
|
-
* @param {*} str - a string to validate - could be an unknown type
|
|
657
|
-
* @return {boolean} - whether string appears to be a url
|
|
658
|
-
*/
|
|
659
|
-
declare const isUrl: (str: unknown) => boolean;
|
|
660
|
-
//#endregion
|
|
661
|
-
//#region src/helpers/stringHelpers/lowerFirst.d.ts
|
|
662
|
-
/**
|
|
663
|
-
* Converts the first character of string to lower case
|
|
664
|
-
*
|
|
665
|
-
* @param {string} str - the string to convert
|
|
666
|
-
* @returns {string} - the lowercased string
|
|
667
|
-
*/
|
|
668
|
-
declare const lowerFirst: (str?: string) => string;
|
|
669
|
-
//#endregion
|
|
670
|
-
//#region src/helpers/stringHelpers/removeNewlines.d.ts
|
|
671
|
-
/**
|
|
672
|
-
* Removes newlines (\n) from string
|
|
673
|
-
*
|
|
674
|
-
* @param {string} str - string to have new lines removed from
|
|
675
|
-
* @returns {string} - string with newlines removed
|
|
676
|
-
*/
|
|
677
|
-
declare const removeNewlines: (str: string) => string;
|
|
678
|
-
//#endregion
|
|
679
|
-
//#region src/helpers/stringHelpers/stripExtension.d.ts
|
|
680
|
-
/**
|
|
681
|
-
* Removes file extension from string
|
|
682
|
-
*
|
|
683
|
-
* @param {string} str - string to have file extension removed from
|
|
684
|
-
* @returns {string} - string with file extension removed
|
|
685
|
-
*/
|
|
686
|
-
declare const stripExtension: (str: string) => string;
|
|
687
|
-
//#endregion
|
|
688
|
-
//#region src/helpers/stringHelpers/truncate.d.ts
|
|
689
|
-
/**
|
|
690
|
-
* Truncates a string to desired char count and appends an ellipsis on the end
|
|
691
|
-
*
|
|
692
|
-
* @param {string} str - string to be truncated
|
|
693
|
-
* @param {number} maxChars - maximum numbers of characters the string should have
|
|
694
|
-
* @returns {string} - truncated string
|
|
695
|
-
*/
|
|
696
|
-
declare const truncate: (str: string, maxChars: number) => string;
|
|
697
|
-
//#endregion
|
|
698
|
-
//#region src/helpers/stringHelpers/upperFirst.d.ts
|
|
699
|
-
/**
|
|
700
|
-
* Converts the first character of string to upper case
|
|
701
|
-
* @param {string} str - the string to convert
|
|
702
|
-
* @returns {string} - the uppercased string
|
|
703
|
-
*/
|
|
704
|
-
declare const upperFirst: (str?: string) => string;
|
|
705
|
-
//#endregion
|
|
706
|
-
//#region src/helpers/stringHelpers/index.d.ts
|
|
707
|
-
declare const stringHelpers: {
|
|
708
|
-
camelCase: typeof camelCase;
|
|
709
|
-
coerceToBoolean: typeof coerceToBoolean;
|
|
710
|
-
coerceToString: typeof coerceToString;
|
|
711
|
-
isHttpUrl: typeof isHttpUrl;
|
|
712
|
-
isString: typeof isString;
|
|
713
|
-
isUrl: typeof isUrl;
|
|
714
|
-
lowerFirst: typeof lowerFirst;
|
|
715
|
-
removeNewlines: typeof removeNewlines;
|
|
716
|
-
stripExtension: typeof stripExtension;
|
|
717
|
-
truncate: typeof truncate;
|
|
718
|
-
upperFirst: typeof upperFirst;
|
|
719
|
-
};
|
|
720
|
-
//#endregion
|
|
721
223
|
//#region src/components/Link/Link.d.ts
|
|
722
224
|
type LinkURLParameters = Record<string, string>;
|
|
723
225
|
type LinkTypes = "default" | "email" | "external" | "phone";
|
|
724
226
|
type DefaultLinkWrapperProps = {
|
|
725
227
|
[anchorProps: string]: unknown;
|
|
726
|
-
RenderedLink:
|
|
228
|
+
RenderedLink: ElementType;
|
|
727
229
|
children: ReactNode;
|
|
728
230
|
};
|
|
729
231
|
type LinkProps = ComponentPropsWithoutRef<"a"> & {
|
|
@@ -800,103 +302,6 @@ declare const VHSProvider: ({
|
|
|
800
302
|
Link
|
|
801
303
|
}: VHSProviderProps) => ReactNode;
|
|
802
304
|
//#endregion
|
|
803
|
-
//#region src/hooks/useBoolean/useBoolean.d.ts
|
|
804
|
-
type UseBooleanReturn = [boolean, () => void, () => void, () => void, Dispatch<SetStateAction<boolean>>];
|
|
805
|
-
declare const useBoolean: (initialValue?: boolean) => UseBooleanReturn;
|
|
806
|
-
//#endregion
|
|
807
|
-
//#region src/hooks/useClipboard/useClipboard.d.ts
|
|
808
|
-
declare const useClipboard: (textToCopy: string, timeout?: number) => [() => Promise<void>, boolean, boolean];
|
|
809
|
-
//#endregion
|
|
810
|
-
//#region src/hooks/useElementObserver/useElementObserver.d.ts
|
|
811
|
-
type Rect = {
|
|
812
|
-
width: number;
|
|
813
|
-
height: number;
|
|
814
|
-
top: number;
|
|
815
|
-
left: number;
|
|
816
|
-
bottom: number;
|
|
817
|
-
right: number;
|
|
818
|
-
x: number;
|
|
819
|
-
y: number;
|
|
820
|
-
};
|
|
821
|
-
declare const useElementObserver: <T extends HTMLElement>() => [RefObject<T | null>, Rect];
|
|
822
|
-
//#endregion
|
|
823
|
-
//#region src/hooks/useEvent/useEvent.d.ts
|
|
824
|
-
type AddEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
|
|
825
|
-
type RemoveEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
|
|
826
|
-
declare const useEvent: <T extends Event>(eventName: Parameters<AddEventListenerType>[0], eventHandler: (event: T) => unknown, eventTarget?: unknown, eventOptions?: Parameters<RemoveEventListenerType>[2]) => void;
|
|
827
|
-
//#endregion
|
|
828
|
-
//#region src/hooks/useFocusTrap/useFocusTrap.d.ts
|
|
829
|
-
type UseFocusTrapOptions = {
|
|
830
|
-
disableAriaHider?: boolean;
|
|
831
|
-
focusSelector?: HTMLElement | RefObject<HTMLElement | null> | string | null | undefined;
|
|
832
|
-
};
|
|
833
|
-
declare const useFocusTrap: (active?: boolean, options?: UseFocusTrapOptions) => ((node: HTMLElement | null | undefined) => void);
|
|
834
|
-
//#endregion
|
|
835
|
-
//#region src/hooks/useForceUpdate/useForceUpdate.d.ts
|
|
836
|
-
declare const useForceUpdate: () => (() => void);
|
|
837
|
-
//#endregion
|
|
838
|
-
//#region src/hooks/useIsHovered/useIsHovered.d.ts
|
|
839
|
-
type HoverProps = {
|
|
840
|
-
onFocus: () => void;
|
|
841
|
-
onMouseEnter: () => void;
|
|
842
|
-
onBlur: () => void;
|
|
843
|
-
onMouseLeave: () => void;
|
|
844
|
-
onMouseMove?: () => void;
|
|
845
|
-
};
|
|
846
|
-
declare const useIsHovered: () => [boolean, HoverProps, (hovered: boolean) => void];
|
|
847
|
-
//#endregion
|
|
848
|
-
//#region src/hooks/useKey/useKey.d.ts
|
|
849
|
-
type KeyFilterPredicate = (evt: KeyboardEvent) => boolean;
|
|
850
|
-
type KeyFilter = KeyFilterPredicate | boolean | string | null | undefined;
|
|
851
|
-
type EventHandler = (event: KeyboardEvent) => unknown;
|
|
852
|
-
type UseKeyOptions = {
|
|
853
|
-
eventName?: string;
|
|
854
|
-
eventTarget?: Parameters<typeof useEvent>[2];
|
|
855
|
-
eventOptions?: Parameters<typeof useEvent>[3];
|
|
856
|
-
};
|
|
857
|
-
declare const useKey: (key: KeyFilter, eventHandler: EventHandler, options?: UseKeyOptions, dependencies?: unknown[]) => void;
|
|
858
|
-
//#endregion
|
|
859
|
-
//#region src/hooks/useKeyPress/useKeyPress.d.ts
|
|
860
|
-
type KeyPressState = [boolean, KeyboardEvent | null];
|
|
861
|
-
declare const useKeyPress: (keyFilter: Parameters<typeof useKey>[0]) => KeyPressState;
|
|
862
|
-
//#endregion
|
|
863
|
-
//#region src/hooks/useKeyPressOnce/useKeyPressOnce.d.ts
|
|
864
|
-
type KeyEventHandler = (keyboardEvent: KeyboardEvent) => unknown;
|
|
865
|
-
declare const useKeyPressOnce: (key: Parameters<typeof useKeyPress>[0], keydownHandler?: KeyEventHandler | null, keyupHandler?: KeyEventHandler | null) => void;
|
|
866
|
-
//#endregion
|
|
867
|
-
//#region src/hooks/useLocalStorage/useLocalStorage.d.ts
|
|
868
|
-
type SetItemType = Storage["setItem"];
|
|
869
|
-
declare const useLocalStorage: <T, _>(key: Parameters<SetItemType>[0], initialValue: T, storage?: Storage) => [T | undefined, (newValue: T) => void, () => void];
|
|
870
|
-
//#endregion
|
|
871
|
-
//#region src/hooks/useMergedRefs/useMergedRefs.d.ts
|
|
872
|
-
type AcceptedElementTypes = HTMLElement | JSX.Element | ReactNode;
|
|
873
|
-
type AcceptedRefs = MutableRefObject<unknown> | ((element: AcceptedElementTypes) => unknown) | null | undefined;
|
|
874
|
-
declare const useMergedRefs: (refs: AcceptedRefs[]) => ((element: AcceptedElementTypes) => void);
|
|
875
|
-
//#endregion
|
|
876
|
-
//#region src/hooks/useMq/useMq.d.ts
|
|
877
|
-
type MediaQueryBooleans = {
|
|
878
|
-
isXsAndUp: boolean;
|
|
879
|
-
isSmAndUp: boolean;
|
|
880
|
-
isMdAndUp: boolean;
|
|
881
|
-
isLgAndUp: boolean;
|
|
882
|
-
isXlAndUp: boolean;
|
|
883
|
-
isXsAndDown: boolean;
|
|
884
|
-
isSmAndDown: boolean;
|
|
885
|
-
isMdAndDown: boolean;
|
|
886
|
-
isLgAndDown: boolean;
|
|
887
|
-
isXlAndDown: boolean;
|
|
888
|
-
};
|
|
889
|
-
declare const useMq: () => MediaQueryBooleans;
|
|
890
|
-
//#endregion
|
|
891
|
-
//#region src/hooks/useOnClickOutside/useOnClickOutside.d.ts
|
|
892
|
-
declare const useOnClickOutside: (ref: RefObject<HTMLElement | null | undefined>, handler: (event: Event) => unknown) => void;
|
|
893
|
-
//#endregion
|
|
894
|
-
//#region src/hooks/usePreventScroll/usePreventScroll.d.ts
|
|
895
|
-
declare const usePreventScroll: (locked: boolean) => void;
|
|
896
|
-
//#endregion
|
|
897
|
-
//#region src/hooks/usePreviousValue/usePreviousValue.d.ts
|
|
898
|
-
declare const usePreviousValue: <T>(value: T) => T | undefined;
|
|
899
|
-
//#endregion
|
|
900
305
|
//#region src/hooks/useTheme/useTheme.d.ts
|
|
901
306
|
declare const useTheme: <T extends DefaultTheme = DefaultTheme>() => T;
|
|
902
307
|
//#endregion
|
|
@@ -909,12 +314,6 @@ type UseThemeColor = {
|
|
|
909
314
|
};
|
|
910
315
|
declare const useThemeColor: UseThemeColor;
|
|
911
316
|
//#endregion
|
|
912
|
-
//#region src/hooks/useWindowSize/useWindowSize.d.ts
|
|
913
|
-
declare const useWindowSize: (interval?: number) => {
|
|
914
|
-
width: number;
|
|
915
|
-
height: number;
|
|
916
|
-
};
|
|
917
|
-
//#endregion
|
|
918
317
|
//#region src/components/ModalBase/ModalBase.d.ts
|
|
919
318
|
type OnBeforeHideInterface = {
|
|
920
319
|
shouldShowMessage: boolean;
|
|
@@ -2499,7 +1898,7 @@ type LinkButtonProps = ComponentPropsWithoutRef<"button"> & {
|
|
|
2499
1898
|
/**
|
|
2500
1899
|
* Callback function invoked when the button is clicked
|
|
2501
1900
|
*/
|
|
2502
|
-
onClick?: (event: KeyboardEvent
|
|
1901
|
+
onClick?: (event: KeyboardEvent | MouseEvent) => void;
|
|
2503
1902
|
/**
|
|
2504
1903
|
* Will only display an underline when the Link is in a hover state
|
|
2505
1904
|
*/
|
|
@@ -3316,6 +2715,9 @@ type TextProps = ComponentPropsWithoutRef<"div"> & {
|
|
|
3316
2715
|
};
|
|
3317
2716
|
declare const Text: ForwardRefExoticComponent<TextProps & RefAttributes<HTMLElement>>;
|
|
3318
2717
|
//#endregion
|
|
2718
|
+
//#region src/private/helpers/getBackgroundGradient/getBackgroundGradient.d.ts
|
|
2719
|
+
type GradientNameType = "defaultDarkOne" | "defaultDarkTwo" | "defaultLightOne" | "defaultLightTwo" | "defaultMidOne" | "defaultMidTwo" | "green" | "greenWithPop" | "pink" | "pinkWithPop" | "playfulGradientOne" | "playfulGradientTwo" | "purple" | "purpleWithPop" | "yellow" | "yellowWithPop";
|
|
2720
|
+
//#endregion
|
|
3319
2721
|
//#region src/components/Thumbnail/Thumbnail.d.ts
|
|
3320
2722
|
type IconThumbnailProps = {
|
|
3321
2723
|
/**
|
|
@@ -3561,5 +2963,5 @@ type WistiaLogoProps = Omit<ComponentPropsWithoutRef<"svg">, "href"> & {
|
|
|
3561
2963
|
};
|
|
3562
2964
|
declare const WistiaLogo: FC<WistiaLogoProps>;
|
|
3563
2965
|
//#endregion
|
|
3564
|
-
export { ActionModal, type ActionModalProps, Avatar, type AvatarInstanceType, type AvatarProps, Backdrop, type BackdropProps, BackgroundImage, type BackgroundImageProps, Badge, type BadgeColorScheme, type BadgeProps, Banner, type BannerProps, Box, type BoxProps, Button, ButtonGroup, type ButtonGroupProps, ButtonLink, type ButtonLinkProps, type ButtonProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, CheckboxMenuItem, type CheckboxMenuItemProps, type CheckboxProps, ClickArea, type ClickAreaProps, CloseButton, type CloseButtonProps, CollapsibleGroup, type CollapsibleGroupProps, Divider, type DividerProps, Ellipsis, type EllipsisProps, FileSelect, type FileSelectProps, Form, FormButtons, type FormButtonsProps, FormField, FormFieldError, type FormFieldErrorProps, type FormFieldProps, FormGlobalError, type FormProps, type FormState, FullScreenModal, type FullScreenModalProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, type InputProps, type KeyboardKeys, KeyboardShortcut, Label, LabelDescription, type LabelDescriptionProps, type LabelProps, Link$1 as Link, LinkButton, type LinkButtonProps, type LinkProps, List, ListItem, type ListItemProps, type ListProps, Menu, MenuButton, type MenuButtonProps, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuRadioGroup, Modal, ModalBase, type ModalBaseContentProps, ModalBody, ModalCloseButton, type ModalCloseButtonProps, ModalFooter, ModalHeader, type ModalProps, type NodeElementObject, type OnBeforeHideInterface, type OptionsType, Paper, type PaperProps, ProgressBar, type ProgressBarProps, Radio, RadioGroup, type RadioGroupProps, RadioMenuItem, type RadioMenuItemProps, type RadioProps, RangeSelector, type RangeSelectorProps, RichTextEditor, type RichTextEditorProps, ScreenReaderOnly, type ScreenReaderOnlyProps, Select, type SelectProps, Slider, type SliderProps, Stack, type StackProps, SubMenu, Switch, type SwitchProps, Text, type TextProps, Thumbnail, ThumbnailCollage, type ThumbnailCollageProps, type ThumbnailProps, Toast, type ToastProps, ToastProvider, type ToastVariants, Tooltip, type TooltipProps, Truncate, type TruncateProps, VHSProvider, VHSProviderProps, type VHSTheme, WistiaLogo, type WistiaLogoProps, type WrapperProviderLinkType,
|
|
2966
|
+
export { ActionModal, type ActionModalProps, Avatar, type AvatarInstanceType, type AvatarProps, Backdrop, type BackdropProps, BackgroundImage, type BackgroundImageProps, Badge, type BadgeColorScheme, type BadgeProps, Banner, type BannerProps, Box, type BoxProps, Button, ButtonGroup, type ButtonGroupProps, ButtonLink, type ButtonLinkProps, type ButtonProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, CheckboxMenuItem, type CheckboxMenuItemProps, type CheckboxProps, ClickArea, type ClickAreaProps, CloseButton, type CloseButtonProps, CollapsibleGroup, type CollapsibleGroupProps, Divider, type DividerProps, Ellipsis, type EllipsisProps, FileSelect, type FileSelectProps, Form, FormButtons, type FormButtonsProps, FormField, FormFieldError, type FormFieldErrorProps, type FormFieldProps, FormGlobalError, type FormProps, type FormState, FullScreenModal, type FullScreenModalProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, type InputProps, type KeyboardKeys, KeyboardShortcut, Label, LabelDescription, type LabelDescriptionProps, type LabelProps, Link$1 as Link, LinkButton, type LinkButtonProps, type LinkProps, List, ListItem, type ListItemProps, type ListProps, Menu, MenuButton, type MenuButtonProps, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuRadioGroup, Modal, ModalBase, type ModalBaseContentProps, ModalBody, ModalCloseButton, type ModalCloseButtonProps, ModalFooter, ModalHeader, type ModalProps, type NodeElementObject, type OnBeforeHideInterface, type OptionsType, Paper, type PaperProps, ProgressBar, type ProgressBarProps, Radio, RadioGroup, type RadioGroupProps, RadioMenuItem, type RadioMenuItemProps, type RadioProps, RangeSelector, type RangeSelectorProps, RichTextEditor, type RichTextEditorProps, ScreenReaderOnly, type ScreenReaderOnlyProps, Select, type SelectProps, Slider, type SliderProps, Stack, type StackProps, SubMenu, Switch, type SwitchProps, Text, type TextProps, Thumbnail, ThumbnailCollage, type ThumbnailCollageProps, type ThumbnailProps, Toast, type ToastProps, ToastProvider, type ToastVariants, Tooltip, type TooltipProps, Truncate, type TruncateProps, VHSProvider, VHSProviderProps, type VHSTheme, WistiaLogo, type WistiaLogoProps, type WrapperProviderLinkType, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, rteDeserializeHTML, rteFormatTypes, rteSerializeToHTML, screenReaderOnlyStyle, useFormikContext, useTheme, useThemeColor, useToast };
|
|
3565
2967
|
//# sourceMappingURL=index.d.ts.map
|