tgui-core 5.5.2 → 5.5.9
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/package.json +2 -1
- package/dist/common/collections.d.ts +0 -10
- package/dist/common/collections.js +0 -1
- package/dist/common/color.d.ts +0 -76
- package/dist/common/color.js +0 -1
- package/dist/common/constants.d.ts +0 -106
- package/dist/common/constants.js +0 -1
- package/dist/common/eventbus.d.ts +0 -68
- package/dist/common/eventbus.js +0 -1
- package/dist/common/events.d.ts +0 -32
- package/dist/common/events.js +0 -1
- package/dist/common/exhaustive.d.ts +0 -17
- package/dist/common/exhaustive.js +0 -1
- package/dist/common/format.d.ts +0 -10
- package/dist/common/format.js +0 -1
- package/dist/common/fp.d.ts +0 -18
- package/dist/common/fp.js +0 -1
- package/dist/common/fuzzysearch.d.ts +0 -26
- package/dist/common/fuzzysearch.js +0 -1
- package/dist/common/hotkeys.d.ts +0 -31
- package/dist/common/hotkeys.js +0 -1
- package/dist/common/http.d.ts +0 -2
- package/dist/common/http.js +0 -1
- package/dist/common/keycodes.d.ts +0 -95
- package/dist/common/keycodes.js +0 -1
- package/dist/common/keys.d.ts +0 -118
- package/dist/common/keys.js +0 -1
- package/dist/common/math.d.ts +0 -47
- package/dist/common/math.js +0 -1
- package/dist/common/random.d.ts +0 -16
- package/dist/common/random.js +0 -1
- package/dist/common/react.d.ts +0 -16
- package/dist/common/react.js +0 -1
- package/dist/common/string.d.ts +0 -87
- package/dist/common/string.js +0 -1
- package/dist/common/timer.d.ts +0 -18
- package/dist/common/timer.js +0 -1
- package/dist/common/type-utils.d.ts +0 -10
- package/dist/common/type-utils.js +0 -1
- package/dist/common/ui.d.ts +0 -123
- package/dist/common/ui.js +0 -1
- package/dist/common/uuid.d.ts +0 -10
- package/dist/common/uuid.js +0 -1
- package/dist/common/vector.d.ts +0 -18
- package/dist/common/vector.js +0 -1
- package/dist/components/AnimatedNumber.d.ts +0 -24
- package/dist/components/AnimatedNumber.js +0 -1
- package/dist/components/Autofocus.d.ts +0 -12
- package/dist/components/Autofocus.js +0 -1
- package/dist/components/Blink.d.ts +0 -19
- package/dist/components/Blink.js +0 -1
- package/dist/components/BlockQuote.d.ts +0 -11
- package/dist/components/BlockQuote.js +0 -1
- package/dist/components/Box.d.ts +0 -104
- package/dist/components/Box.js +0 -1
- package/dist/components/Button.d.ts +0 -123
- package/dist/components/Button.js +0 -1
- package/dist/components/ByondUi.d.ts +0 -61
- package/dist/components/ByondUi.js +0 -1
- package/dist/components/Chart.d.ts +0 -24
- package/dist/components/Chart.js +0 -1
- package/dist/components/Collapsible.d.ts +0 -28
- package/dist/components/Collapsible.js +0 -1
- package/dist/components/ColorBox.d.ts +0 -19
- package/dist/components/ColorBox.js +0 -1
- package/dist/components/Dialog.d.ts +0 -39
- package/dist/components/Dialog.js +0 -1
- package/dist/components/Dimmer.d.ts +0 -11
- package/dist/components/Dimmer.js +0 -1
- package/dist/components/Divider.d.ts +0 -17
- package/dist/components/Divider.js +0 -1
- package/dist/components/DmIcon.d.ts +0 -35
- package/dist/components/DmIcon.js +0 -1
- package/dist/components/DraggableControl.d.ts +0 -57
- package/dist/components/DraggableControl.js +0 -1
- package/dist/components/Dropdown.d.ts +0 -60
- package/dist/components/Dropdown.js +0 -1
- package/dist/components/FitText.d.ts +0 -21
- package/dist/components/FitText.js +0 -1
- package/dist/components/Flex.d.ts +0 -130
- package/dist/components/Flex.js +0 -1
- package/dist/components/Floating.d.ts +0 -87
- package/dist/components/Floating.js +0 -1
- package/dist/components/Icon.d.ts +0 -53
- package/dist/components/Icon.js +0 -1
- package/dist/components/Image.d.ts +0 -30
- package/dist/components/Image.js +0 -1
- package/dist/components/ImageButton.d.ts +0 -90
- package/dist/components/ImageButton.js +0 -1
- package/dist/components/InfinitePlane.d.ts +0 -64
- package/dist/components/InfinitePlane.js +0 -1
- package/dist/components/Input.d.ts +0 -98
- package/dist/components/Input.js +0 -1
- package/dist/components/Interactive.d.ts +0 -39
- package/dist/components/Interactive.js +0 -1
- package/dist/components/KeyListener.d.ts +0 -16
- package/dist/components/KeyListener.js +0 -1
- package/dist/components/Knob.d.ts +0 -65
- package/dist/components/Knob.js +0 -1
- package/dist/components/LabeledControls.d.ts +0 -31
- package/dist/components/LabeledControls.js +0 -1
- package/dist/components/LabeledList.d.ts +0 -95
- package/dist/components/LabeledList.js +0 -1
- package/dist/components/MenuBar.d.ts +0 -42
- package/dist/components/MenuBar.js +0 -1
- package/dist/components/Modal.d.ts +0 -21
- package/dist/components/Modal.js +0 -1
- package/dist/components/NoticeBox.d.ts +0 -27
- package/dist/components/NoticeBox.js +0 -1
- package/dist/components/NumberInput.d.ts +0 -60
- package/dist/components/NumberInput.js +0 -1
- package/dist/components/Pointer.d.ts +0 -20
- package/dist/components/Pointer.js +0 -1
- package/dist/components/Popper.d.ts +0 -33
- package/dist/components/Popper.js +0 -1
- package/dist/components/ProgressBar.d.ts +0 -57
- package/dist/components/ProgressBar.js +0 -1
- package/dist/components/RestrictedInput.d.ts +0 -72
- package/dist/components/RestrictedInput.js +0 -1
- package/dist/components/RoundGauge.d.ts +0 -57
- package/dist/components/RoundGauge.js +0 -1
- package/dist/components/Section.d.ts +0 -65
- package/dist/components/Section.js +0 -1
- package/dist/components/Slider.d.ts +0 -61
- package/dist/components/Slider.js +0 -1
- package/dist/components/Stack.d.ts +0 -83
- package/dist/components/Stack.js +0 -1
- package/dist/components/StyleableSection.d.ts +0 -10
- package/dist/components/StyleableSection.js +0 -1
- package/dist/components/Table.d.ts +0 -59
- package/dist/components/Table.js +0 -1
- package/dist/components/Tabs.d.ts +0 -110
- package/dist/components/Tabs.js +0 -1
- package/dist/components/TextArea.d.ts +0 -25
- package/dist/components/TextArea.js +0 -1
- package/dist/components/TimeDisplay.d.ts +0 -18
- package/dist/components/TimeDisplay.js +0 -1
- package/dist/components/Tooltip.d.ts +0 -29
- package/dist/components/Tooltip.js +0 -1
- package/dist/components/TrackOutsideClicks.d.ts +0 -34
- package/dist/components/TrackOutsideClicks.js +0 -1
- package/dist/components/VirtualList.d.ts +0 -11
- package/dist/components/VirtualList.js +0 -1
- package/dist/components/index.d.ts +0 -49
- package/dist/components/index.js +0 -1
package/dist/common/keys.d.ts
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ### Key codes.
|
|
3
|
-
* event.keyCode is deprecated, use this reference instead.
|
|
4
|
-
*
|
|
5
|
-
* Handles modifier keys (Shift, Alt, Control) and arrow keys.
|
|
6
|
-
*
|
|
7
|
-
* For alphabetical keys, use the actual character (e.g. 'a') instead of the key code.
|
|
8
|
-
* Don't access Esc or Escape directly, use isEscape() instead
|
|
9
|
-
*
|
|
10
|
-
* Something isn't here that you want? Just add it:
|
|
11
|
-
* @url https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values
|
|
12
|
-
* @usage
|
|
13
|
-
* ```ts
|
|
14
|
-
* import { KEY } from 'tgui/common/keys';
|
|
15
|
-
*
|
|
16
|
-
* if (event.key === KEY.Enter) {
|
|
17
|
-
* // do something
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
export declare enum KEY {
|
|
24
|
-
A = "a",
|
|
25
|
-
Alt = "Alt",
|
|
26
|
-
Backspace = "Backspace",
|
|
27
|
-
Control = "Control",
|
|
28
|
-
D = "d",
|
|
29
|
-
Delete = "Delete",
|
|
30
|
-
Down = "ArrowDown",
|
|
31
|
-
E = "e",
|
|
32
|
-
End = "End",
|
|
33
|
-
Enter = "Enter",
|
|
34
|
-
Esc = "Esc",
|
|
35
|
-
Escape = "Escape",
|
|
36
|
-
Home = "Home",
|
|
37
|
-
Insert = "Insert",
|
|
38
|
-
Left = "ArrowLeft",
|
|
39
|
-
Minus = "-",
|
|
40
|
-
N = "n",
|
|
41
|
-
PageDown = "PageDown",
|
|
42
|
-
PageUp = "PageUp",
|
|
43
|
-
Plus = "+",
|
|
44
|
-
Right = "ArrowRight",
|
|
45
|
-
S = "s",
|
|
46
|
-
Shift = "Shift",
|
|
47
|
-
Space = " ",
|
|
48
|
-
Tab = "Tab",
|
|
49
|
-
Up = "ArrowUp",
|
|
50
|
-
W = "w",
|
|
51
|
-
Z = "z"
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* ### isEscape
|
|
55
|
-
*
|
|
56
|
-
* Checks if the user has hit the 'ESC' key on their keyboard.
|
|
57
|
-
* There's a weirdness in BYOND where this could be either the string
|
|
58
|
-
* 'Escape' or 'Esc' depending on the browser. This function handles
|
|
59
|
-
* both cases.
|
|
60
|
-
*
|
|
61
|
-
* @param key - the key to check, typically from event.key
|
|
62
|
-
* @returns true if key is Escape or Esc, false otherwise
|
|
63
|
-
*/
|
|
64
|
-
export declare function isEscape(key: string): boolean;
|
|
65
|
-
/**
|
|
66
|
-
* ### isAlphabetic
|
|
67
|
-
*
|
|
68
|
-
* Checks if the user has hit any alphabetic key (a - z)
|
|
69
|
-
*
|
|
70
|
-
* @param key - the key to check, typically from event.key
|
|
71
|
-
* @returns true if key is in the range of a-z
|
|
72
|
-
*/
|
|
73
|
-
export declare function isAlphabetic(key: string): boolean;
|
|
74
|
-
/**
|
|
75
|
-
* ### isNumeric
|
|
76
|
-
*
|
|
77
|
-
* Checks if the user has hit any numeric key (0 - 9)
|
|
78
|
-
*
|
|
79
|
-
* @param key - the key to check, typically from event.key
|
|
80
|
-
* @returns true if key is in the range of 0 - 9
|
|
81
|
-
*/
|
|
82
|
-
export declare function isNumeric(key: string): boolean;
|
|
83
|
-
/**
|
|
84
|
-
* ### isCardinal
|
|
85
|
-
*
|
|
86
|
-
* Checks if the user has hit any cardinal key (n s w e)
|
|
87
|
-
*
|
|
88
|
-
* @param key - the key to check, typically from event.key
|
|
89
|
-
* @returns true if key matches any cardinal n s w e
|
|
90
|
-
*/
|
|
91
|
-
export declare function isCardinal(key: string): boolean;
|
|
92
|
-
/**
|
|
93
|
-
* ### isArrow
|
|
94
|
-
*
|
|
95
|
-
* Checks if the user has hit any arrow key
|
|
96
|
-
*
|
|
97
|
-
* @param key - the key to check, typically from event.key
|
|
98
|
-
* @returns true if key matches any arrow keys
|
|
99
|
-
*/
|
|
100
|
-
export declare function isArrow(key: string): boolean;
|
|
101
|
-
/**
|
|
102
|
-
* ### isWasd
|
|
103
|
-
*
|
|
104
|
-
* Checks if the user has hit any w a s d key
|
|
105
|
-
*
|
|
106
|
-
* @param key - the key to check, typically from event.key
|
|
107
|
-
* @returns true if key matches any w a s d
|
|
108
|
-
*/
|
|
109
|
-
export declare function isWasd(key: string): boolean;
|
|
110
|
-
/**
|
|
111
|
-
* ### isMovement
|
|
112
|
-
*
|
|
113
|
-
* Checks if the user has hit any movement key (w a s d and arrow keys)
|
|
114
|
-
*
|
|
115
|
-
* @param key - the key to check, typically from event.key
|
|
116
|
-
* @returns true if key matches any movement key w a s d and arrow keys
|
|
117
|
-
*/
|
|
118
|
-
export declare function isMovement(key: string): boolean;
|
package/dist/common/keys.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r,e=((r={}).A="a",r.Alt="Alt",r.Backspace="Backspace",r.Control="Control",r.D="d",r.Delete="Delete",r.Down="ArrowDown",r.E="e",r.End="End",r.Enter="Enter",r.Esc="Esc",r.Escape="Escape",r.Home="Home",r.Insert="Insert",r.Left="ArrowLeft",r.Minus="-",r.N="n",r.PageDown="PageDown",r.PageUp="PageUp",r.Plus="+",r.Right="ArrowRight",r.S="s",r.Shift="Shift",r.Space=" ",r.Tab="Tab",r.Up="ArrowUp",r.W="w",r.Z="z",r);function n(r){return"Esc"===r||"Escape"===r}function t(r){return r>="a"&&r<="z"}function o(r){return r>="0"&&r<="9"}function s(r){return"n"===r||"s"===r||"w"===r||"e"===r}function a(r){return"ArrowUp"===r||"ArrowDown"===r||"ArrowLeft"===r||"ArrowRight"===r}function i(r){return"w"===r||"a"===r||"s"===r||"d"===r}function c(r){return i(r)||a(r)}export{e as KEY,t as isAlphabetic,a as isArrow,s as isCardinal,n as isEscape,c as isMovement,o as isNumeric,i as isWasd};
|
package/dist/common/math.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Limits a number to the range between 'min' and 'max'.
|
|
3
|
-
*/
|
|
4
|
-
export declare function clamp(value: number, min: number, max: number): number;
|
|
5
|
-
/**
|
|
6
|
-
* Limits a number between 0 and 1.
|
|
7
|
-
*/
|
|
8
|
-
export declare function clamp01(value: number): number;
|
|
9
|
-
/**
|
|
10
|
-
* Scales a number to fit into the range between min and max.
|
|
11
|
-
*/
|
|
12
|
-
export declare function scale(value: number, min?: number, max?: number): number;
|
|
13
|
-
/**
|
|
14
|
-
* Robust number rounding, similar to PHP's round() function.
|
|
15
|
-
*
|
|
16
|
-
* @url https://stackoverflow.com/questions/53450248/how-to-round-in-javascript-like-php-do/54721202#54721202
|
|
17
|
-
*/
|
|
18
|
-
export declare function round(num: number, dec: number): number;
|
|
19
|
-
/**
|
|
20
|
-
* Returns a string representing a number in fixed point notation.
|
|
21
|
-
*/
|
|
22
|
-
export declare function toFixed(value: number, fractionDigits?: number): string;
|
|
23
|
-
/**
|
|
24
|
-
* Checks whether a value is within the provided range.
|
|
25
|
-
*
|
|
26
|
-
* Range is an array of two numbers, for example: [0, 15].
|
|
27
|
-
*/
|
|
28
|
-
export declare function inRange(value: number, range: number[]): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Walks over the object with ranges, comparing value against every range,
|
|
31
|
-
* and returns the key of the first matching range.
|
|
32
|
-
*
|
|
33
|
-
* Range is an array of two numbers, for example: [0, 15].
|
|
34
|
-
*/
|
|
35
|
-
export declare function keyOfMatchingRange(value: number, ranges: Record<string, any>): string | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Get number of digits following the decimal point in a number
|
|
38
|
-
*/
|
|
39
|
-
export declare function numberOfDecimalDigits(value: number): number;
|
|
40
|
-
/**
|
|
41
|
-
* Ensures the number is valid and not infinite/NaN.
|
|
42
|
-
*/
|
|
43
|
-
export declare function isSafeNumber(value: number): boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Converts a value in radians to degrees.
|
|
46
|
-
*/
|
|
47
|
-
export declare function rad2deg(rad: number): number;
|
package/dist/common/math.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function n(n,t,e){return n<t?t:n>e?e:n}function t(n){return n<0?0:n>1?1:n}function e(n,t=0,r=100){return(n-t)/(r-t)}function r(n,t){return Number.parseFloat((Math.round(n*10**t+1e-4*(n>=0?1:-1))/10**t).toFixed(t))}function u(n,t=0){return Number(n).toFixed(Math.max(t,0))}function i(n,t){return t&&n>=t[0]&&n<=t[1]}function o(n,t){for(let e of Object.keys(t))if(i(n,t[e]))return e}function f(n){return Math.floor(n)!==n&&n.toString().split(".")[1].length||0}function a(n){return"number"==typeof n&&Number.isFinite(n)&&!Number.isNaN(n)}function c(n){return 180/Math.PI*n}export{n as clamp,t as clamp01,i as inRange,a as isSafeNumber,o as keyOfMatchingRange,f as numberOfDecimalDigits,c as rad2deg,r as round,e as scale,u as toFixed};
|
package/dist/common/random.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns random number between lowerBound exclusive and upperBound inclusive
|
|
3
|
-
*/
|
|
4
|
-
export declare function randomNumber(lowerBound: number, upperBound: number): number;
|
|
5
|
-
/**
|
|
6
|
-
* Returns random integer between lowerBound exclusive and upperBound inclusive
|
|
7
|
-
*/
|
|
8
|
-
export declare function randomInteger(lowerBound: number, upperBound: number): number;
|
|
9
|
-
/**
|
|
10
|
-
* Returns random array element
|
|
11
|
-
*/
|
|
12
|
-
export declare function randomPick<T>(array: T[]): T;
|
|
13
|
-
/**
|
|
14
|
-
* Return 1 with probability P percent; otherwise 0
|
|
15
|
-
*/
|
|
16
|
-
export declare function randomProb(probability: number): boolean;
|
package/dist/common/random.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{clamp as r}from"./math.js";function n(r,n){return Math.random()*(n-r)+r}function o(r,n){let o=Math.ceil(r);return Math.floor(Math.random()*(Math.floor(n)-o)+o)}function t(r){return r[Math.floor(Math.random()*r.length)]}function a(n){return Math.random()<=r(n,0,100)/100}export{o as randomInteger,n as randomNumber,t as randomPick,a as randomProb};
|
package/dist/common/react.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helper for conditionally adding/removing classes in React
|
|
3
|
-
*/
|
|
4
|
-
export declare function classes(classNames: (string | BooleanLike)[]): string;
|
|
5
|
-
/**
|
|
6
|
-
* Shallowly checks if two objects are different.
|
|
7
|
-
* Credit: https://github.com/developit/preact-compat
|
|
8
|
-
*/
|
|
9
|
-
export declare function shallowDiffers(a: Record<string, any>, b: Record<string, any>): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* A common case in tgui when you pass a value conditionally. These are
|
|
12
|
-
* the types that can fall through the condition.
|
|
13
|
-
*/
|
|
14
|
-
export type BooleanLike = number | boolean | null | undefined;
|
|
15
|
-
/** A helper to determine whether the object is renderable by React. */
|
|
16
|
-
export declare function canRender(value: unknown): boolean;
|
package/dist/common/react.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function n(n){let e="";for(let r=0;r<n.length;r++){let t=n[r];"string"==typeof t&&(e+=`${t} `)}return e}function e(n,e){let r;for(r in n)if(!(r in e))return!0;for(r in e)if(n[r]!==e[r])return!0;return!1}function r(n){return null!=n&&"boolean"!=typeof n}export{r as canRender,n as classes,e as shallowDiffers};
|
package/dist/common/string.d.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a search terms matcher. Returns true if given string matches the search text.
|
|
3
|
-
*
|
|
4
|
-
* Example:
|
|
5
|
-
*
|
|
6
|
-
* ```tsx
|
|
7
|
-
* type Thing = { id: string; name: string };
|
|
8
|
-
*
|
|
9
|
-
* const objects = [
|
|
10
|
-
* { id: '123', name: 'Test' },
|
|
11
|
-
* { id: '456', name: 'Test' },
|
|
12
|
-
* ];
|
|
13
|
-
*
|
|
14
|
-
* const search = createSearch('123', (obj: Thing) => obj.id);
|
|
15
|
-
*
|
|
16
|
-
* objects.filter(search); // returns [{ id: '123', name: 'Test' }]
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export declare function createSearch<TObj>(searchText: string, stringifier?: (obj: TObj) => string): (obj: TObj) => boolean;
|
|
20
|
-
export declare const VOWELS: string[];
|
|
21
|
-
/**
|
|
22
|
-
* Pluralizes a word based on the number given.
|
|
23
|
-
* Handles -es and -ies.
|
|
24
|
-
*
|
|
25
|
-
* @param override - A custom string to be appended instead for plurals. Useful for words that don't follow the standard rules.
|
|
26
|
-
*
|
|
27
|
-
* Example:
|
|
28
|
-
*
|
|
29
|
-
* ```tsx
|
|
30
|
-
* pluralize('Dog', 1) // Dog
|
|
31
|
-
* pluralize('Dog', 2) // Dogs
|
|
32
|
-
* pluralize('Monarch', 2, "s") // Monarchs
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
export declare function pluralize(str: string, n: number, override?: string): string;
|
|
36
|
-
/**
|
|
37
|
-
* Capitalizes a word and lowercases the rest.
|
|
38
|
-
*
|
|
39
|
-
* Example:
|
|
40
|
-
*
|
|
41
|
-
* ```tsx
|
|
42
|
-
* capitalize('heLLo') // Hello
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export declare function capitalize(str: string): string;
|
|
46
|
-
/**
|
|
47
|
-
* Similar to capitalize, this takes a string and replaces all first letters
|
|
48
|
-
* of any words.
|
|
49
|
-
*
|
|
50
|
-
* Example:
|
|
51
|
-
*
|
|
52
|
-
* ```tsx
|
|
53
|
-
* capitalizeAll('heLLo woRLd') // 'HeLLo WoRLd'
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
export declare function capitalizeAll(str: string): string;
|
|
57
|
-
/**
|
|
58
|
-
* Capitalizes only the first letter of the str, leaving others untouched.
|
|
59
|
-
*
|
|
60
|
-
* Example:
|
|
61
|
-
*
|
|
62
|
-
* ```tsx
|
|
63
|
-
* capitalizeFirst('heLLo woRLd') // 'HeLLo woRLd'
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
export declare function capitalizeFirst(str: string): string;
|
|
67
|
-
/**
|
|
68
|
-
* Converts a string to title case.
|
|
69
|
-
*
|
|
70
|
-
* Example:
|
|
71
|
-
*
|
|
72
|
-
* ```tsx
|
|
73
|
-
* toTitleCase('a tale of two cities') // 'A Tale of Two Cities'
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
export declare function toTitleCase(str: string): string;
|
|
77
|
-
/**
|
|
78
|
-
* Decodes HTML entities and removes unnecessary HTML tags.
|
|
79
|
-
*
|
|
80
|
-
* Example:
|
|
81
|
-
*
|
|
82
|
-
* ```tsx
|
|
83
|
-
* decodeHtmlEntities('&') // returns '&'
|
|
84
|
-
* decodeHtmlEntities('<') // returns '<'
|
|
85
|
-
* ```
|
|
86
|
-
*/
|
|
87
|
-
export declare function decodeHtmlEntities(str: string): string;
|
package/dist/common/string.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(t,r=e=>JSON.stringify(e)){let n=t.toLowerCase().trim();return e=>{if(!n)return!0;let t=r(e);return!!t&&t.toLowerCase().includes(n)}}let t=["a","e","i","o","u"];function r(e,r,n){return 1===r?e:n?e+n:e.endsWith("s")||e.endsWith("x")||e.endsWith("z")||e.endsWith("ch")||e.endsWith("sh")?`${e}es`:e.endsWith("y")&&!t.includes(e.charAt(e.length-2))?`${e.slice(0,-1)}ies`:`${e}s`}function n(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function o(e){return e.replace(/(^\w{1})|(\s+\w{1})/g,e=>e.toUpperCase())}function a(e){return e.replace(/^\w/,e=>e.toUpperCase())}let i=["Id","Tv"],s=["A","An","And","As","At","But","By","For","For","From","In","Into","Near","Nor","Of","On","Onto","Or","The","To","With"];function l(e){if(!e)return e;let t=e.replace(/([^\W_]+[^\s-]*) */g,e=>n(e));for(let e of s){let r=RegExp(`\\s${e}\\s`,"g");t=t.replace(r,e=>e.toLowerCase())}for(let e of i){let r=RegExp(`\\b${e}\\b`,"g");t=t.replace(r,e=>e.toLowerCase())}return t}let p=/&(nbsp|amp|quot|lt|gt|apos|trade|copy);/g,c={amp:"&",apos:"'",cops:"\xa9",gt:">",lt:"<",nbsp:" ",quot:'"',trade:"™"};function u(e){return e?e.replace(/<br>/gi,"\n").replace(/<\/?[a-z0-9-_]+[^>]*>/gi,"").replace(p,(e,t)=>c[t]).replace(/&#?([0-9]+);/gi,(e,t)=>String.fromCharCode(Number.parseInt(t,10))).replace(/&#x?([0-9a-f]+);/gi,(e,t)=>String.fromCharCode(Number.parseInt(t,16))):e}export{t as VOWELS,n as capitalize,o as capitalizeAll,a as capitalizeFirst,e as createSearch,u as decodeHtmlEntities,r as pluralize,l as toTitleCase};
|
package/dist/common/timer.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a function, that, as long as it continues to be invoked, will
|
|
3
|
-
* not be triggered. The function will be called after it stops being
|
|
4
|
-
* called for N milliseconds. If `immediate` is passed, trigger the
|
|
5
|
-
* function on the leading edge, instead of the trailing.
|
|
6
|
-
*/
|
|
7
|
-
export declare function debounce<F extends (...args: any[]) => any>(fn: F, time: number, immediate?: boolean): (...args: Parameters<F>) => void;
|
|
8
|
-
/**
|
|
9
|
-
* Returns a function, that, when invoked, will only be triggered at most once
|
|
10
|
-
* during a given window of time.
|
|
11
|
-
*/
|
|
12
|
-
export declare function throttle<F extends (...args: any[]) => any>(fn: F, time: number): (...args: Parameters<F>) => void;
|
|
13
|
-
/**
|
|
14
|
-
* Suspends an asynchronous function for N milliseconds.
|
|
15
|
-
*
|
|
16
|
-
* @param {number} time
|
|
17
|
-
*/
|
|
18
|
-
export declare function sleep(time: number): Promise<void>;
|
package/dist/common/timer.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(t,n,o=!1){let u;return(...e)=>{let i=o&&!u;clearTimeout(u),u=setTimeout(function(){u=null,o||t(...e)},n),i&&t(...e)}}function t(e,t){let n,o;return function u(...i){let r=Date.now();o&&clearTimeout(o),!n||r-n>=t?(e(...i),n=r):o=setTimeout(()=>u(...i),t-(r-(n??0)))}}function n(e){return new Promise(t=>setTimeout(t,e))}export{e as debounce,n as sleep,t as throttle};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helps visualize highly complex ui data on the fly.
|
|
3
|
-
* Example:
|
|
4
|
-
*
|
|
5
|
-
* ```tsx
|
|
6
|
-
* const { data } = useBackend<CargoData>();
|
|
7
|
-
* logger.log(getShallowTypes(data));
|
|
8
|
-
* ```
|
|
9
|
-
*/
|
|
10
|
-
export declare function getShallowTypes(data: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){let t={};for(let r in e)if(Array.isArray(e[r])){let n=e[r];if(e[r].length>0){t[r]=n[0];continue}t[r]="emptyarray"}else if("object"==typeof e[r]&&null!==e[r])t[r]="Record<string, sometype>";else if("number"==typeof e[r]){let n=Number(e[r]);if(1===n||0===n){t[r]=`${n}, BooleanLike?`;continue}t[r]=e[r]}return t}export{e as getShallowTypes};
|
package/dist/common/ui.d.ts
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import type { DOMAttributes } from 'react';
|
|
2
|
-
import type { BoxProps } from '../components/Box';
|
|
3
|
-
import { type BooleanLike } from './react';
|
|
4
|
-
type UnitMapper = (value: unknown) => string | undefined;
|
|
5
|
-
/**
|
|
6
|
-
* Coverts our rem-like spacing unit into a CSS unit.
|
|
7
|
-
*/
|
|
8
|
-
export declare const unit: UnitMapper;
|
|
9
|
-
/**
|
|
10
|
-
* Same as `unit`, but half the size for integers numbers.
|
|
11
|
-
*/
|
|
12
|
-
export declare const halfUnit: UnitMapper;
|
|
13
|
-
export type StringStyleMap = Partial<{
|
|
14
|
-
/** Align text inside the box. */
|
|
15
|
-
align: string | BooleanLike;
|
|
16
|
-
/** A direct mapping to `position` CSS property. */
|
|
17
|
-
position: string | BooleanLike;
|
|
18
|
-
/** Vertical align property. */
|
|
19
|
-
verticalAlign: string | BooleanLike;
|
|
20
|
-
/** Sets background color. */
|
|
21
|
-
backgroundColor: string | BooleanLike;
|
|
22
|
-
/** Applies an atomic `color-<name>` class to the element. */
|
|
23
|
-
color: string | BooleanLike;
|
|
24
|
-
/** Opacity, from 0 to 1. */
|
|
25
|
-
opacity: string | BooleanLike;
|
|
26
|
-
/** Sets text color. */
|
|
27
|
-
textColor: string | BooleanLike;
|
|
28
|
-
/** Margin on all sides. */
|
|
29
|
-
m: string | BooleanLike;
|
|
30
|
-
/** Bottom margin. */
|
|
31
|
-
mb: string | BooleanLike;
|
|
32
|
-
/** Left margin. */
|
|
33
|
-
ml: string | BooleanLike;
|
|
34
|
-
/** Right margin. */
|
|
35
|
-
mr: string | BooleanLike;
|
|
36
|
-
/** Top margin. */
|
|
37
|
-
mt: string | BooleanLike;
|
|
38
|
-
/** Horizontal margin. */
|
|
39
|
-
mx: string | BooleanLike;
|
|
40
|
-
/** Vertical margin. */
|
|
41
|
-
my: string | BooleanLike;
|
|
42
|
-
/** Bottom margin. */
|
|
43
|
-
bottom: string | BooleanLike;
|
|
44
|
-
/** Left margin. */
|
|
45
|
-
left: string | BooleanLike;
|
|
46
|
-
/** Right margin. */
|
|
47
|
-
right: string | BooleanLike;
|
|
48
|
-
/** Top margin. */
|
|
49
|
-
top: string | BooleanLike;
|
|
50
|
-
/** Gap on all sides. */
|
|
51
|
-
g: string | BooleanLike;
|
|
52
|
-
/** Row gap. */
|
|
53
|
-
gr: string | BooleanLike;
|
|
54
|
-
/** Column gap. */
|
|
55
|
-
gc: string | BooleanLike;
|
|
56
|
-
/** Overflow property. */
|
|
57
|
-
overflow: string | BooleanLike;
|
|
58
|
-
/** Overflow-X property. */
|
|
59
|
-
overflowX: string | BooleanLike;
|
|
60
|
-
/** Overflow-Y property. */
|
|
61
|
-
overflowY: string | BooleanLike;
|
|
62
|
-
/** Padding on all sides. */
|
|
63
|
-
p: string | BooleanLike;
|
|
64
|
-
/** Bottom padding. */
|
|
65
|
-
pb: string | BooleanLike;
|
|
66
|
-
/** Left padding. */
|
|
67
|
-
pl: string | BooleanLike;
|
|
68
|
-
/** Right padding. */
|
|
69
|
-
pr: string | BooleanLike;
|
|
70
|
-
/** Top padding. */
|
|
71
|
-
pt: string | BooleanLike;
|
|
72
|
-
/** Horizontal padding. */
|
|
73
|
-
px: string | BooleanLike;
|
|
74
|
-
/** Vertical padding. */
|
|
75
|
-
py: string | BooleanLike;
|
|
76
|
-
/** Box height. */
|
|
77
|
-
height: string | BooleanLike;
|
|
78
|
-
/** Box maximum height. */
|
|
79
|
-
maxHeight: string | BooleanLike;
|
|
80
|
-
/** Box maximum width. */
|
|
81
|
-
maxWidth: string | BooleanLike;
|
|
82
|
-
/** Box minimum height. */
|
|
83
|
-
minHeight: string | BooleanLike;
|
|
84
|
-
/** Box minimum width. */
|
|
85
|
-
minWidth: string | BooleanLike;
|
|
86
|
-
/** Box width. */
|
|
87
|
-
width: string | BooleanLike;
|
|
88
|
-
/** Font family. */
|
|
89
|
-
fontFamily: string | BooleanLike;
|
|
90
|
-
/** Font size. */
|
|
91
|
-
fontSize: string | BooleanLike;
|
|
92
|
-
/** Font weight. */
|
|
93
|
-
fontWeight: string | BooleanLike;
|
|
94
|
-
/** Directly affects the height of text lines. Useful for adjusting button height. */
|
|
95
|
-
lineHeight: string | BooleanLike;
|
|
96
|
-
/** Align text inside the box. */
|
|
97
|
-
textAlign: string | BooleanLike;
|
|
98
|
-
}>;
|
|
99
|
-
export declare const stringStyleMap: Record<keyof StringStyleMap, any>;
|
|
100
|
-
export type BooleanStyleMap = Partial<{
|
|
101
|
-
/** Make text bold. */
|
|
102
|
-
bold: boolean;
|
|
103
|
-
/** Fill positioned parent. */
|
|
104
|
-
fillPositionedParent: boolean;
|
|
105
|
-
/** Forces the `Box` to appear as an `inline-block`. */
|
|
106
|
-
inline: boolean;
|
|
107
|
-
/** Make text italic. */
|
|
108
|
-
italic: boolean;
|
|
109
|
-
/** Stops text from wrapping. */
|
|
110
|
-
nowrap: boolean;
|
|
111
|
-
/** Preserves line-breaks and spacing in text. */
|
|
112
|
-
preserveWhitespace: boolean;
|
|
113
|
-
}>;
|
|
114
|
-
export declare const booleanStyleMap: Record<keyof BooleanStyleMap, any>;
|
|
115
|
-
export declare function computeBoxProps(props: any): Record<string, any>;
|
|
116
|
-
export declare function computeBoxClassName<TElement = HTMLDivElement>(props: BoxProps<TElement>): string;
|
|
117
|
-
type StyleMap = StringStyleMap & BooleanStyleMap;
|
|
118
|
-
/** Super light implementation of tailwind-like class names. */
|
|
119
|
-
export declare function computeTwClass(input: string | undefined): StyleMap;
|
|
120
|
-
/** Short list of accepted DOM event handlers */
|
|
121
|
-
export declare const eventHandlers: ["onClick", "onContextMenu", "onDoubleClick", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseMove", "onMouseOver", "onMouseUp", "onScroll", "onWheel", "onDrag", "onDragEnd", "onDragEnter", "onDragExit", "onDragLeave", "onDragOver", "onDragStart", "onDrop"];
|
|
122
|
-
export type EventHandlers<TElement = HTMLDivElement> = Pick<DOMAttributes<TElement>, (typeof eventHandlers)[number]>;
|
|
123
|
-
export {};
|
package/dist/common/ui.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{CSS_COLORS as t}from"./constants.js";import{classes as o}from"./react.js";let e=t=>"string"==typeof t?t.endsWith("px")?`${Number.parseFloat(t)/12}rem`:t:"number"==typeof t?`${t}rem`:void 0,n=t=>"string"==typeof t?e(t):"number"==typeof t?e(.5*t):void 0;function i(o){return"string"==typeof o&&t.includes(o)}let r=t=>(o,e)=>{("number"==typeof e||"string"==typeof e)&&(o[t]=e)},l=(t,o)=>(e,n)=>{("number"==typeof n||"string"==typeof n)&&(e[t]=o(n))},p=(t,o)=>(e,n)=>{n&&(e[t]=o)},a=(t,o,e)=>(n,i)=>{if("number"==typeof i||"string"==typeof i)for(let r=0;r<e.length;r++)n[t+e[r]]=o(i)},g=t=>(o,e)=>{i(e)||(o[t]=e)},f={align:r("textAlign"),backgroundColor:g("backgroundColor"),bottom:l("bottom",e),color:g("color"),fontFamily:r("fontFamily"),fontSize:l("fontSize",e),fontWeight:r("fontWeight"),g:l("gap",n),gc:l("columnGap",n),gr:l("rowGap",n),height:l("height",e),left:l("left",e),lineHeight:(t,o)=>{"number"==typeof o?t.lineHeight=o:"string"==typeof o&&(t.lineHeight=e(o))},m:a("margin",n,["Top","Bottom","Left","Right"]),maxHeight:l("maxHeight",e),maxWidth:l("maxWidth",e),mb:l("marginBottom",n),minHeight:l("minHeight",e),minWidth:l("minWidth",e),ml:l("marginLeft",n),mr:l("marginRight",n),mt:l("marginTop",n),mx:a("margin",n,["Left","Right"]),my:a("margin",n,["Top","Bottom"]),opacity:r("opacity"),overflow:r("overflow"),overflowX:r("overflowX"),overflowY:r("overflowY"),p:a("padding",n,["Top","Bottom","Left","Right"]),pb:l("paddingBottom",n),pl:l("paddingLeft",n),position:r("position"),pr:l("paddingRight",n),pt:l("paddingTop",n),px:a("padding",n,["Left","Right"]),py:a("padding",n,["Top","Bottom"]),right:l("right",e),textAlign:r("textAlign"),textColor:g("color"),top:l("top",e),verticalAlign:r("verticalAlign"),width:l("width",e)},m={bold:p("fontWeight","bold"),fillPositionedParent:(t,o)=>{o&&(t.position="absolute",t.top=0,t.bottom=0,t.left=0,t.right=0)},inline:p("display","inline-block"),italic:p("fontStyle","italic"),nowrap:p("whiteSpace","nowrap"),preserveWhitespace:p("whiteSpace","pre-wrap")};function s(t){let o={},e={};for(let n in t){if("style"===n)continue;let i=t[n],r=f[n]||m[n];r?r(e,i):o[n]=i}return o.style={...e,...t.style},o}function u(t){let e=t.textColor||t.color,{backgroundColor:n}=t;return o([i(e)&&`color-${e}`,i(n)&&`color-bg-${n}`])}function c(t){let o={};if(!t)return o;for(let e of t.split(" ")){let[t,n]=e.split("-");if(t)if(t in f){if(""===n)continue;let e=Number(n);!Number.isNaN(e)&&Number.isFinite(e)?o[t]=e:o[t]=n}else t in m?o[t]=!0:console.warn(`Unknown prop ${t}`)}return o}let h=["onClick","onContextMenu","onDoubleClick","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseMove","onMouseOver","onMouseUp","onScroll","onWheel","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"];export{m as booleanStyleMap,u as computeBoxClassName,s as computeBoxProps,c as computeTwClass,h as eventHandlers,n as halfUnit,f as stringStyleMap,e as unit};
|
package/dist/common/uuid.d.ts
DELETED
package/dist/common/uuid.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function x(){let x=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=(x+16*Math.random())%16|0;return x=Math.floor(x/16),("x"===t?e:3&e|8).toString(16)})}export{x as createUuid};
|
package/dist/common/vector.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** Represents a vector as an array of numbers */
|
|
2
|
-
export type Vector = number[];
|
|
3
|
-
/** Adds multiple vectors together element-wise */
|
|
4
|
-
export declare function vecAdd(...vecs: Vector[]): Vector;
|
|
5
|
-
/** Subtracts multiple vectors element-wise */
|
|
6
|
-
export declare function vecSubtract(...vecs: Vector[]): Vector;
|
|
7
|
-
/** Multiplies multiple vectors element-wise */
|
|
8
|
-
export declare function vecMultiply(...vecs: Vector[]): Vector;
|
|
9
|
-
/** Divides multiple vectors element-wise */
|
|
10
|
-
export declare function vecDivide(...vecs: Vector[]): Vector;
|
|
11
|
-
/** Multiplies a vector by a scalar number */
|
|
12
|
-
export declare function vecScale(vec: Vector, n: number): Vector;
|
|
13
|
-
/** Negates all elements of a vector */
|
|
14
|
-
export declare function vecInverse(vec: Vector): Vector;
|
|
15
|
-
/** Calculates the Euclidean length of a vector */
|
|
16
|
-
export declare function vecLength(vec: Vector): number;
|
|
17
|
-
/** Returns a normalized (unit length) version of the vector */
|
|
18
|
-
export declare function vecNormalize(vec: Vector): Vector;
|
package/dist/common/vector.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{zip as e}from"./collections.js";function n(e,n){return e+n}function r(e,n){return e-n}function t(e,n){return e*n}function u(e,n){return e/n}function c(...r){return e(...r).map(e=>e.reduce(n))}function i(...n){return e(...n).map(e=>e.reduce(r))}function o(...n){return e(...n).map(e=>e.reduce(t))}function f(...n){return e(...n).map(e=>e.reduce(u))}function a(e,n){return e.map(e=>e*n)}function m(e){return e.map(e=>-e)}function p(e){return Math.sqrt(o(e,e).reduce(n))}function v(e){let n=p(e);return e.map(e=>e/n)}export{c as vecAdd,f as vecDivide,m as vecInverse,p as vecLength,o as vecMultiply,v as vecNormalize,a as vecScale,i as vecSubtract};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
type Props = {
|
|
2
|
-
/** The target value to approach. */
|
|
3
|
-
value: number;
|
|
4
|
-
} & Partial<{
|
|
5
|
-
/**
|
|
6
|
-
* If provided, a function that formats the inner string. By default,
|
|
7
|
-
* attempts to match the numeric precision of `value`.
|
|
8
|
-
*/
|
|
9
|
-
format: (value: number) => string;
|
|
10
|
-
/**
|
|
11
|
-
* If provided, the initial value displayed. By default, the same as `value`.
|
|
12
|
-
* If `initial` and `value` are different, the component immediately starts
|
|
13
|
-
* animating.
|
|
14
|
-
*/
|
|
15
|
-
initial: number;
|
|
16
|
-
}>;
|
|
17
|
-
/**
|
|
18
|
-
* ## AnimatedNumber
|
|
19
|
-
*
|
|
20
|
-
* An animated number label. Shows a number, formatted with an optionally
|
|
21
|
-
* provided function, and animates it towards its target value.
|
|
22
|
-
*/
|
|
23
|
-
export declare function AnimatedNumber(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{clamp as t,isSafeNumber as n,toFixed as e}from"../common/math.js";import{useEffect as l,useRef as u,useState as c}from"react";let i=1e3/60;function m(m){let o,{format:a,initial:f,value:p}=m,s=u(null),[h,d]=c(void 0!==f&&n(f)?f:n(p)?p:0);l(()=>(h!==p&&null===s.current&&(s.current=setInterval(v,i)),()=>g()),[p]),l(()=>()=>g(),[]);function g(){null!==s.current&&(clearInterval(s.current),s.current=null)}function v(){n(p)?d(r=>{let t=.8333*r+.16669999999999996*p;return Math.abs(p-t)<Math.max(.001,.001*p)?(g(),p):t}):g()}return r("span",{children:n(p)?a?a(h):e(h,t((o=String(p).split(".")[1])?o.length:0,0,8)):String(p)})}export{m as AnimatedNumber};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
type Props = Partial<{
|
|
3
|
-
/** Optional child elements */
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
}>;
|
|
6
|
-
/**
|
|
7
|
-
* ## Autofocus
|
|
8
|
-
*
|
|
9
|
-
* Used to force the window to steal focus on load. Children optional.
|
|
10
|
-
*/
|
|
11
|
-
export declare function Autofocus(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{useEffect as t,useRef as e}from"react";function o(o){let{children:u}=o,n=e(null);return t(()=>{let r=setTimeout(()=>{n.current?.focus()},1);return()=>{clearTimeout(r)}},[]),r("div",{ref:n,tabIndex:-1,children:u})}export{o as Autofocus};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
type Props = {
|
|
3
|
-
/** Things that blink! */
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
} & Partial<{
|
|
6
|
-
/** The interval between blinks, in milliseconds. */
|
|
7
|
-
interval: number;
|
|
8
|
-
/** The time to wait before blinking again, in milliseconds. */
|
|
9
|
-
time: number;
|
|
10
|
-
}>;
|
|
11
|
-
/**
|
|
12
|
-
* ## Blink
|
|
13
|
-
*
|
|
14
|
-
* A component that blinks its children at a specified interval.
|
|
15
|
-
*
|
|
16
|
-
* - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-blink--docs)
|
|
17
|
-
*/
|
|
18
|
-
export declare function Blink(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export {};
|
package/dist/components/Blink.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useEffect as t,useState as r}from"react";function i(i){let{children:n,interval:l=1e3,time:o=1e3}=i,[s,a]=r(!1);return t(()=>{let e=setInterval(()=>{a(!0),setTimeout(()=>{a(!1)},o)},l+o);return()=>{clearInterval(e)}},[l,o]),e("span",{style:{visibility:s?"hidden":"visible"},children:n})}export{i as Blink};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type BoxProps } from './Box';
|
|
2
|
-
/**
|
|
3
|
-
* ## BlockQuote
|
|
4
|
-
*
|
|
5
|
-
* Just a block quote, just like this example in markdown:
|
|
6
|
-
* > Here's an example of a block quote.
|
|
7
|
-
*
|
|
8
|
-
* - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-blockquote--docs)
|
|
9
|
-
* - [View inherited Box props](https://tgstation.github.io/tgui-core/?path=/docs/components-box--docs)
|
|
10
|
-
*/
|
|
11
|
-
export declare function BlockQuote(props: BoxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{classes as r}from"../common/react.js";import{Box as t}from"./Box.js";function m(m){let{className:e,...c}=m;return o(t,{className:r(["BlockQuote",e]),...c})}export{m as BlockQuote};
|