tgui-core 1.1.11 → 1.1.13
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/ProgressBar.module-BkAFfFy0.js +29 -0
- package/dist/Section.module-CLVHJ4yA.js +15 -0
- package/dist/assets/BlockQuote.css +1 -0
- package/dist/assets/Button.css +1 -0
- package/dist/assets/ColorBox.css +1 -0
- package/dist/assets/Dialog.css +1 -0
- package/dist/assets/Dimmer.css +1 -0
- package/dist/assets/Divider.css +1 -0
- package/dist/assets/Flex.css +1 -0
- package/dist/assets/Icon.css +6 -0
- package/dist/assets/Input.css +1 -0
- package/dist/assets/Knob.css +1 -0
- package/dist/assets/LabeledList.css +1 -0
- package/dist/assets/MenuBar.css +1 -0
- package/dist/assets/Modal.css +1 -0
- package/dist/assets/NoticeBox.css +1 -0
- package/dist/assets/NumberInput.css +1 -0
- package/dist/assets/ProgressBar.css +1 -0
- package/dist/assets/RoundGauge.css +1 -0
- package/dist/assets/Section.css +1 -0
- package/dist/assets/Slider.css +1 -0
- package/dist/assets/Stack.css +1 -0
- package/dist/assets/Table.css +1 -0
- package/dist/assets/Tabs.css +1 -0
- package/dist/assets/TextArea.css +1 -0
- package/dist/assets/Tooltip.css +1 -0
- package/dist/common/assets.d.ts +4 -0
- package/dist/common/assets.js +25 -0
- package/dist/common/collections.d.ts +10 -0
- package/dist/common/collections.js +15 -0
- package/dist/common/color.d.ts +25 -0
- package/dist/common/color.js +69 -0
- package/dist/common/constants.d.ts +102 -0
- package/dist/common/constants.js +312 -0
- package/dist/common/events.d.ts +33 -0
- package/dist/common/events.js +147 -0
- package/{lib/common/exhaustive.ts → dist/common/exhaustive.d.ts} +1 -3
- package/dist/common/exhaustive.js +6 -0
- package/dist/common/format.d.ts +11 -0
- package/dist/common/format.js +114 -0
- package/{lib/common/fp.ts → dist/common/fp.d.ts} +2 -16
- package/dist/common/fp.js +9 -0
- package/dist/common/hotkeys.d.ts +25 -0
- package/dist/common/hotkeys.js +112 -0
- package/dist/common/http.d.ts +4 -0
- package/dist/common/http.js +10 -0
- package/dist/common/keycodes.d.ts +85 -0
- package/dist/common/keycodes.js +88 -0
- package/{lib/common/keys.ts → dist/common/keys.d.ts} +21 -24
- package/dist/common/keys.js +8 -0
- package/dist/common/math.d.ts +39 -0
- package/dist/common/math.js +41 -0
- package/dist/common/perf.d.ts +24 -0
- package/dist/common/perf.js +33 -0
- package/dist/common/random.d.ts +16 -0
- package/dist/common/random.js +18 -0
- package/dist/common/react.d.ts +23 -0
- package/dist/common/react.js +30 -0
- package/dist/common/redux.d.ts +64 -0
- package/dist/common/redux.js +72 -0
- package/dist/common/storage.d.ts +24 -0
- package/dist/common/storage.js +133 -0
- package/dist/common/string.d.ts +65 -0
- package/dist/common/string.js +83 -0
- package/dist/common/timer.d.ts +18 -0
- package/dist/common/timer.js +28 -0
- package/dist/common/type-utils.d.ts +9 -0
- package/dist/common/type-utils.js +25 -0
- package/dist/common/uuid.d.ts +9 -0
- package/dist/common/uuid.js +10 -0
- package/dist/components/AnimatedNumber.d.ts +60 -0
- package/dist/components/AnimatedNumber.js +76 -0
- package/dist/components/Autofocus.d.ts +4 -0
- package/dist/components/Autofocus.js +17 -0
- package/dist/components/Blink.d.ts +26 -0
- package/dist/components/Blink.js +56 -0
- package/dist/components/BlockQuote.d.ts +3 -0
- package/dist/components/BlockQuote.js +13 -0
- package/dist/components/BodyZoneSelector.d.ts +28 -0
- package/dist/components/BodyZoneSelector.js +115 -0
- package/dist/components/Box.d.ts +91 -0
- package/dist/components/Box.js +133 -0
- package/dist/components/Button.d.ts +93 -0
- package/dist/components/Button.js +298 -0
- package/dist/components/ByondUi.js +73 -0
- package/dist/components/Chart.d.ts +28 -0
- package/dist/components/Chart.js +95 -0
- package/dist/components/Collapsible.d.ts +15 -0
- package/dist/components/Collapsible.js +27 -0
- package/dist/components/ColorBox.d.ts +8 -0
- package/dist/components/ColorBox.js +24 -0
- package/dist/components/Dialog.d.ts +24 -0
- package/dist/components/Dialog.js +67 -0
- package/dist/components/Dimmer.d.ts +3 -0
- package/dist/components/Dimmer.js +13 -0
- package/dist/components/Divider.d.ts +6 -0
- package/dist/components/Divider.js +22 -0
- package/dist/components/DmIcon.d.ts +33 -0
- package/dist/components/DmIcon.js +29 -0
- package/dist/components/DraggableControl.js +176 -0
- package/dist/components/Dropdown.d.ts +48 -0
- package/dist/components/Dropdown.js +152 -0
- package/dist/components/FakeTerminal.js +38 -0
- package/dist/components/FitText.d.ts +22 -0
- package/dist/components/FitText.js +63 -0
- package/dist/components/Flex.d.ts +93 -0
- package/dist/components/Flex.js +72 -0
- package/dist/components/Icon.d.ts +30 -0
- package/dist/components/Icon.js +51 -0
- package/dist/components/Image.d.ts +14 -0
- package/dist/components/Image.js +35 -0
- package/dist/components/InfinitePlane.js +139 -0
- package/dist/components/Input.d.ts +61 -0
- package/dist/components/Input.js +89 -0
- package/dist/components/KeyListener.d.ts +15 -0
- package/dist/components/KeyListener.js +23 -0
- package/dist/components/Knob.d.ts +49 -0
- package/dist/components/Knob.js +162 -0
- package/dist/components/LabeledControls.d.ts +11 -0
- package/dist/components/LabeledControls.js +39 -0
- package/dist/components/LabeledList.d.ts +57 -0
- package/dist/components/LabeledList.js +94 -0
- package/dist/components/MenuBar.d.ts +28 -0
- package/dist/components/MenuBar.js +174 -0
- package/dist/components/Modal.d.ts +3 -0
- package/dist/components/Modal.js +25 -0
- package/dist/components/NoticeBox.d.ts +20 -0
- package/dist/components/NoticeBox.js +49 -0
- package/dist/components/NumberInput.d.ts +45 -0
- package/dist/components/NumberInput.js +221 -0
- package/dist/components/Popper.d.ts +27 -0
- package/dist/components/Popper.js +177 -0
- package/dist/components/ProgressBar.d.ts +46 -0
- package/dist/components/ProgressBar.js +37 -0
- package/dist/components/RestrictedInput.js +155 -0
- package/dist/components/RoundGauge.d.ts +53 -0
- package/dist/components/RoundGauge.js +147 -0
- package/dist/components/Section.d.ts +63 -0
- package/dist/components/Section.js +62 -0
- package/dist/components/Slider.d.ts +46 -0
- package/dist/components/Slider.js +124 -0
- package/dist/components/Stack.d.ts +27 -0
- package/dist/components/Stack.js +67 -0
- package/dist/components/StyleableSection.d.ts +11 -0
- package/dist/components/StyleableSection.js +16 -0
- package/dist/components/Table.d.ts +29 -0
- package/dist/components/Table.js +67 -0
- package/dist/components/Tabs.d.ts +23 -0
- package/dist/components/Tabs.js +89 -0
- package/dist/components/TextArea.d.ts +39 -0
- package/dist/components/TextArea.js +118 -0
- package/dist/components/TimeDisplay.js +34 -0
- package/dist/components/Tooltip.d.ts +29 -0
- package/dist/components/Tooltip.js +83 -0
- package/dist/components/TrackOutsideClicks.d.ts +13 -0
- package/dist/components/TrackOutsideClicks.js +24 -0
- package/dist/components/VirtualList.d.ts +8 -0
- package/dist/components/VirtualList.js +34 -0
- package/dist/components/index.js +92 -0
- package/dist/popper-CiqSDJTE.js +906 -0
- package/package.json +8 -10
- package/lib/common/assets.ts +0 -38
- package/lib/common/collections.ts +0 -27
- package/lib/common/color.ts +0 -88
- package/lib/common/constants.ts +0 -349
- package/lib/common/events.ts +0 -262
- package/lib/common/format.ts +0 -167
- package/lib/common/hotkeys.ts +0 -207
- package/lib/common/http.ts +0 -16
- package/lib/common/keycodes.ts +0 -86
- package/lib/common/math.ts +0 -76
- package/lib/common/perf.ts +0 -72
- package/lib/common/random.ts +0 -32
- package/lib/common/react.ts +0 -59
- package/lib/common/redux.ts +0 -187
- package/lib/common/storage.ts +0 -207
- package/lib/common/string.ts +0 -169
- package/lib/common/timer.ts +0 -63
- package/lib/common/type-utils.ts +0 -41
- package/lib/common/types.d.ts +0 -12
- package/lib/common/uuid.ts +0 -18
- package/lib/components/AnimatedNumber.tsx +0 -180
- package/lib/components/Autofocus.tsx +0 -23
- package/lib/components/Blink.tsx +0 -91
- package/lib/components/BlockQuote.tsx +0 -9
- package/lib/components/BodyZoneSelector.tsx +0 -149
- package/lib/components/Box.tsx +0 -252
- package/lib/components/Button.tsx +0 -425
- package/lib/components/ByondUi.jsx +0 -110
- package/lib/components/Chart.tsx +0 -155
- package/lib/components/Collapsible.tsx +0 -43
- package/lib/components/ColorBox.tsx +0 -29
- package/lib/components/Dialog.tsx +0 -81
- package/lib/components/Dimmer.tsx +0 -13
- package/lib/components/Divider.tsx +0 -20
- package/lib/components/DmIcon.tsx +0 -86
- package/lib/components/DraggableControl.jsx +0 -276
- package/lib/components/Dropdown.tsx +0 -246
- package/lib/components/FakeTerminal.jsx +0 -52
- package/lib/components/FitText.tsx +0 -99
- package/lib/components/Flex.tsx +0 -159
- package/lib/components/Icon.tsx +0 -95
- package/lib/components/Image.tsx +0 -54
- package/lib/components/InfinitePlane.jsx +0 -192
- package/lib/components/Input.tsx +0 -176
- package/lib/components/KeyListener.tsx +0 -40
- package/lib/components/Knob.tsx +0 -178
- package/lib/components/LabeledControls.tsx +0 -44
- package/lib/components/LabeledList.tsx +0 -154
- package/lib/components/MenuBar.tsx +0 -228
- package/lib/components/Modal.tsx +0 -23
- package/lib/components/NoticeBox.tsx +0 -45
- package/lib/components/NumberInput.tsx +0 -328
- package/lib/components/Popper.tsx +0 -100
- package/lib/components/ProgressBar.tsx +0 -105
- package/lib/components/RestrictedInput.jsx +0 -301
- package/lib/components/RoundGauge.tsx +0 -180
- package/lib/components/Section.tsx +0 -120
- package/lib/components/Slider.tsx +0 -169
- package/lib/components/Stack.tsx +0 -96
- package/lib/components/StyleableSection.tsx +0 -33
- package/lib/components/Table.tsx +0 -84
- package/lib/components/Tabs.tsx +0 -89
- package/lib/components/TextArea.tsx +0 -182
- package/lib/components/TimeDisplay.jsx +0 -64
- package/lib/components/Tooltip.tsx +0 -152
- package/lib/components/TrackOutsideClicks.tsx +0 -35
- package/lib/components/VirtualList.tsx +0 -69
- package/lib/styles/atomic/candystripe.scss +0 -8
- package/lib/styles/atomic/centered-image.scss +0 -7
- package/lib/styles/atomic/color.scss +0 -21
- package/lib/styles/atomic/debug-layout.scss +0 -17
- package/lib/styles/atomic/fit-text.scss +0 -14
- package/lib/styles/atomic/links.scss +0 -12
- package/lib/styles/atomic/outline.scss +0 -47
- package/lib/styles/atomic/text.scss +0 -44
- package/lib/styles/base.scss +0 -32
- package/lib/styles/colors.scss +0 -92
- package/lib/styles/components/BlockQuote.module.scss +0 -20
- package/lib/styles/components/BlockQuote.module.scss.d.ts +0 -4
- package/lib/styles/components/Button.module.scss +0 -157
- package/lib/styles/components/Button.module.scss.d.ts +0 -46
- package/lib/styles/components/ColorBox.module.scss +0 -12
- package/lib/styles/components/ColorBox.module.scss.d.ts +0 -4
- package/lib/styles/components/Dialog.module.scss +0 -60
- package/lib/styles/components/Dialog.module.scss.d.ts +0 -10
- package/lib/styles/components/Dimmer.module.scss +0 -22
- package/lib/styles/components/Dimmer.module.scss.d.ts +0 -4
- package/lib/styles/components/Divider.module.scss +0 -27
- package/lib/styles/components/Divider.module.scss.d.ts +0 -6
- package/lib/styles/components/Dropdown.scss +0 -72
- package/lib/styles/components/Flex.module.scss +0 -13
- package/lib/styles/components/Flex.module.scss.d.ts +0 -5
- package/lib/styles/components/Icon.module.scss +0 -25
- package/lib/styles/components/Icon.module.scss.d.ts +0 -5
- package/lib/styles/components/Input.module.scss +0 -64
- package/lib/styles/components/Input.module.scss.d.ts +0 -8
- package/lib/styles/components/Knob.module.scss +0 -131
- package/lib/styles/components/Knob.module.scss.d.ts +0 -33
- package/lib/styles/components/LabeledList.module.scss +0 -49
- package/lib/styles/components/LabeledList.module.scss.d.ts +0 -8
- package/lib/styles/components/MenuBar.module.scss +0 -75
- package/lib/styles/components/MenuBar.module.scss.d.ts +0 -14
- package/lib/styles/components/Modal.module.scss +0 -14
- package/lib/styles/components/Modal.module.scss.d.ts +0 -4
- package/lib/styles/components/NoticeBox.module.scss +0 -65
- package/lib/styles/components/NoticeBox.module.scss.d.ts +0 -27
- package/lib/styles/components/NumberInput.module.scss +0 -71
- package/lib/styles/components/NumberInput.module.scss.d.ts +0 -9
- package/lib/styles/components/ProgressBar.module.scss +0 -63
- package/lib/styles/components/ProgressBar.module.scss.d.ts +0 -27
- package/lib/styles/components/RoundGauge.module.scss +0 -85
- package/lib/styles/components/RoundGauge.module.scss.d.ts +0 -49
- package/lib/styles/components/Section.module.scss +0 -130
- package/lib/styles/components/Section.module.scss.d.ts +0 -13
- package/lib/styles/components/Slider.module.scss +0 -54
- package/lib/styles/components/Slider.module.scss.d.ts +0 -8
- package/lib/styles/components/Stack.module.scss +0 -60
- package/lib/styles/components/Stack.module.scss.d.ts +0 -12
- package/lib/styles/components/Table.module.scss +0 -44
- package/lib/styles/components/Table.module.scss.d.ts +0 -10
- package/lib/styles/components/Tabs.module.scss +0 -144
- package/lib/styles/components/Tabs.module.scss.d.ts +0 -35
- package/lib/styles/components/TextArea.module.scss +0 -86
- package/lib/styles/components/TextArea.module.scss.d.ts +0 -11
- package/lib/styles/components/Tooltip.module.scss +0 -24
- package/lib/styles/components/Tooltip.module.scss.d.ts +0 -4
- package/lib/styles/functions.scss +0 -79
- package/lib/styles/input.scss +0 -9
- package/lib/styles/main.scss +0 -20
- package/lib/styles/reset.scss +0 -68
- /package/{lib/components/index.ts → dist/components/index.d.ts} +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var a = (i, e, t) => e in i ? n(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var s = (i, e, t) => a(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
5
|
+
import { Component as o } from "react";
|
|
6
|
+
const h = 1e3, m = 1e3;
|
|
7
|
+
class v extends o {
|
|
8
|
+
constructor(t) {
|
|
9
|
+
super(t);
|
|
10
|
+
s(this, "interval");
|
|
11
|
+
s(this, "timer");
|
|
12
|
+
this.state = {
|
|
13
|
+
hidden: !1
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
createTimer() {
|
|
17
|
+
const {
|
|
18
|
+
interval: t = h,
|
|
19
|
+
time: r = m
|
|
20
|
+
} = this.props;
|
|
21
|
+
clearInterval(this.interval), clearTimeout(this.timer), this.setState({
|
|
22
|
+
hidden: !1
|
|
23
|
+
}), this.interval = setInterval(() => {
|
|
24
|
+
this.setState({
|
|
25
|
+
hidden: !0
|
|
26
|
+
}), this.timer = setTimeout(() => {
|
|
27
|
+
this.setState({
|
|
28
|
+
hidden: !1
|
|
29
|
+
});
|
|
30
|
+
}, r);
|
|
31
|
+
}, t + r);
|
|
32
|
+
}
|
|
33
|
+
componentDidMount() {
|
|
34
|
+
this.createTimer();
|
|
35
|
+
}
|
|
36
|
+
componentDidUpdate(t) {
|
|
37
|
+
(t.interval !== this.props.interval || t.time !== this.props.time) && this.createTimer();
|
|
38
|
+
}
|
|
39
|
+
componentWillUnmount() {
|
|
40
|
+
clearInterval(this.interval), clearTimeout(this.timer);
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
return /* @__PURE__ */ l(
|
|
44
|
+
"span",
|
|
45
|
+
{
|
|
46
|
+
style: {
|
|
47
|
+
visibility: this.state.hidden ? "hidden" : "visible"
|
|
48
|
+
},
|
|
49
|
+
children: this.props.children
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
v as Blink
|
|
56
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { classes as e } from "../common/react.js";
|
|
3
|
+
import { Box as r } from "./Box.js";
|
|
4
|
+
import '../assets/BlockQuote.css';const l = "_blockQuote_14fvy_13", m = {
|
|
5
|
+
blockQuote: l
|
|
6
|
+
};
|
|
7
|
+
function f(o) {
|
|
8
|
+
const { className: t, ...s } = o;
|
|
9
|
+
return /* @__PURE__ */ c(r, { className: e([m.blockQuote, t]), ...s });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
f as BlockQuote
|
|
13
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare enum BodyZone {
|
|
4
|
+
Chest = "chest",
|
|
5
|
+
Eyes = "eyes",
|
|
6
|
+
Groin = "groin",
|
|
7
|
+
Head = "head",
|
|
8
|
+
LeftArm = "l_arm",
|
|
9
|
+
LeftLeg = "l_leg",
|
|
10
|
+
Mouth = "mouth",
|
|
11
|
+
RightArm = "r_arm",
|
|
12
|
+
RightLeg = "r_leg"
|
|
13
|
+
}
|
|
14
|
+
type BodyZoneSelectorProps = {
|
|
15
|
+
onClick?: (zone: BodyZone) => void;
|
|
16
|
+
scale?: number;
|
|
17
|
+
selectedZone: BodyZone | null;
|
|
18
|
+
theme?: string;
|
|
19
|
+
};
|
|
20
|
+
type BodyZoneSelectorState = {
|
|
21
|
+
hoverZone: BodyZone | null;
|
|
22
|
+
};
|
|
23
|
+
export declare class BodyZoneSelector extends Component<BodyZoneSelectorProps, BodyZoneSelectorState> {
|
|
24
|
+
ref: import('react').RefObject<HTMLDivElement>;
|
|
25
|
+
state: BodyZoneSelectorState;
|
|
26
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
var g = Object.defineProperty;
|
|
2
|
+
var _ = (e, t, s) => t in e ? g(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var l = (e, t, s) => _(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
+
import { jsxs as d, jsx as h } from "react/jsx-runtime";
|
|
5
|
+
import { Component as v, createRef as $ } from "react";
|
|
6
|
+
import { resolveAsset as p } from "../common/assets.js";
|
|
7
|
+
import { Image as f } from "./Image.js";
|
|
8
|
+
var b = /* @__PURE__ */ ((e) => (e.Chest = "chest", e.Eyes = "eyes", e.Groin = "groin", e.Head = "head", e.LeftArm = "l_arm", e.LeftLeg = "l_leg", e.Mouth = "mouth", e.RightArm = "r_arm", e.RightLeg = "r_leg", e))(b || {});
|
|
9
|
+
const C = (e, t) => {
|
|
10
|
+
if (t < 1)
|
|
11
|
+
return null;
|
|
12
|
+
if (t < 10) {
|
|
13
|
+
if (e > 10 && e < 15)
|
|
14
|
+
return "r_leg";
|
|
15
|
+
if (e > 17 && e < 22)
|
|
16
|
+
return "l_leg";
|
|
17
|
+
} else if (t < 13) {
|
|
18
|
+
if (e > 8 && e < 11)
|
|
19
|
+
return "r_arm";
|
|
20
|
+
if (e > 12 && e < 20)
|
|
21
|
+
return "groin";
|
|
22
|
+
if (e > 21 && e < 24)
|
|
23
|
+
return "l_arm";
|
|
24
|
+
} else if (t < 22) {
|
|
25
|
+
if (e > 8 && e < 11)
|
|
26
|
+
return "r_arm";
|
|
27
|
+
if (e > 12 && e < 20)
|
|
28
|
+
return "chest";
|
|
29
|
+
if (e > 21 && e < 24)
|
|
30
|
+
return "l_arm";
|
|
31
|
+
} else if (t < 30 && e > 12 && e < 20)
|
|
32
|
+
return t > 23 && t < 24 && e > 15 && e < 17 ? "mouth" : t > 25 && t < 27 && e > 14 && e < 18 ? "eyes" : "head";
|
|
33
|
+
return null;
|
|
34
|
+
};
|
|
35
|
+
class A extends v {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments);
|
|
38
|
+
l(this, "ref", $());
|
|
39
|
+
l(this, "state", {
|
|
40
|
+
hoverZone: null
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
const { hoverZone: s } = this.state, { scale: r = 3, selectedZone: n, theme: c = "midnight" } = this.props;
|
|
45
|
+
return /* @__PURE__ */ d(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
ref: this.ref,
|
|
49
|
+
style: {
|
|
50
|
+
width: `${32 * r}px`,
|
|
51
|
+
height: `${32 * r}px`,
|
|
52
|
+
position: "relative"
|
|
53
|
+
},
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ h(
|
|
56
|
+
f,
|
|
57
|
+
{
|
|
58
|
+
src: p(`body_zones.base_${c}.png`),
|
|
59
|
+
onClick: () => {
|
|
60
|
+
const i = this.props.onClick;
|
|
61
|
+
i && this.state.hoverZone && i(this.state.hoverZone);
|
|
62
|
+
},
|
|
63
|
+
onMouseMove: (i) => {
|
|
64
|
+
var u;
|
|
65
|
+
if (!this.props.onClick)
|
|
66
|
+
return;
|
|
67
|
+
const o = (u = this.ref.current) == null ? void 0 : u.getBoundingClientRect();
|
|
68
|
+
if (!o)
|
|
69
|
+
return;
|
|
70
|
+
const a = i.clientX - o.left, m = 32 * r - (i.clientY - o.top);
|
|
71
|
+
this.setState({
|
|
72
|
+
hoverZone: C(a / r, m / r)
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
style: {
|
|
76
|
+
position: "absolute",
|
|
77
|
+
width: `${32 * r}px`,
|
|
78
|
+
height: `${32 * r}px`
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
n && /* @__PURE__ */ h(
|
|
83
|
+
f,
|
|
84
|
+
{
|
|
85
|
+
src: p(`body_zones.${n}.png`),
|
|
86
|
+
style: {
|
|
87
|
+
pointerEvents: "none",
|
|
88
|
+
position: "absolute",
|
|
89
|
+
width: `${32 * r}px`,
|
|
90
|
+
height: `${32 * r}px`
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
s && s !== n && /* @__PURE__ */ h(
|
|
95
|
+
f,
|
|
96
|
+
{
|
|
97
|
+
src: p(`body_zones.${s}.png`),
|
|
98
|
+
style: {
|
|
99
|
+
opacity: "0.5",
|
|
100
|
+
pointerEvents: "none",
|
|
101
|
+
position: "absolute",
|
|
102
|
+
width: `${32 * r}px`,
|
|
103
|
+
height: `${32 * r}px`
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
export {
|
|
113
|
+
b as BodyZone,
|
|
114
|
+
A as BodyZoneSelector
|
|
115
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { CSSProperties, KeyboardEventHandler, MouseEventHandler, ReactNode, UIEventHandler } from 'react';
|
|
2
|
+
import { BooleanLike } from '../common/react';
|
|
3
|
+
|
|
4
|
+
type BooleanProps = Partial<Record<keyof typeof booleanStyleMap, boolean>>;
|
|
5
|
+
type StringProps = Partial<Record<keyof typeof stringStyleMap, string | BooleanLike>>;
|
|
6
|
+
export type EventHandlers = Partial<{
|
|
7
|
+
onClick: MouseEventHandler<HTMLDivElement>;
|
|
8
|
+
onContextMenu: MouseEventHandler<HTMLDivElement>;
|
|
9
|
+
onDoubleClick: MouseEventHandler<HTMLDivElement>;
|
|
10
|
+
onKeyDown: KeyboardEventHandler<HTMLDivElement>;
|
|
11
|
+
onKeyUp: KeyboardEventHandler<HTMLDivElement>;
|
|
12
|
+
onMouseDown: MouseEventHandler<HTMLDivElement>;
|
|
13
|
+
onMouseMove: MouseEventHandler<HTMLDivElement>;
|
|
14
|
+
onMouseOver: MouseEventHandler<HTMLDivElement>;
|
|
15
|
+
onMouseUp: MouseEventHandler<HTMLDivElement>;
|
|
16
|
+
onScroll: UIEventHandler<HTMLDivElement>;
|
|
17
|
+
}>;
|
|
18
|
+
export type BoxProps = Partial<{
|
|
19
|
+
as: string;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
className: string | BooleanLike;
|
|
22
|
+
style: CSSProperties;
|
|
23
|
+
}> & BooleanProps & StringProps & EventHandlers;
|
|
24
|
+
type DangerDoNotUse = {
|
|
25
|
+
dangerouslySetInnerHTML?: {
|
|
26
|
+
__html: any;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Coverts our rem-like spacing unit into a CSS unit.
|
|
31
|
+
*/
|
|
32
|
+
export declare function unit(value: unknown): string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Same as `unit`, but half the size for integers numbers.
|
|
35
|
+
*/
|
|
36
|
+
export declare function halfUnit(value: unknown): string | undefined;
|
|
37
|
+
declare const stringStyleMap: {
|
|
38
|
+
readonly align: (style: any, value: any) => void;
|
|
39
|
+
readonly bottom: (style: any, value: any) => void;
|
|
40
|
+
readonly fontFamily: (style: any, value: any) => void;
|
|
41
|
+
readonly fontSize: (style: any, value: any) => void;
|
|
42
|
+
readonly fontWeight: (style: any, value: any) => void;
|
|
43
|
+
readonly height: (style: any, value: any) => void;
|
|
44
|
+
readonly left: (style: any, value: any) => void;
|
|
45
|
+
readonly maxHeight: (style: any, value: any) => void;
|
|
46
|
+
readonly maxWidth: (style: any, value: any) => void;
|
|
47
|
+
readonly minHeight: (style: any, value: any) => void;
|
|
48
|
+
readonly minWidth: (style: any, value: any) => void;
|
|
49
|
+
readonly opacity: (style: any, value: any) => void;
|
|
50
|
+
readonly overflow: (style: any, value: any) => void;
|
|
51
|
+
readonly overflowX: (style: any, value: any) => void;
|
|
52
|
+
readonly overflowY: (style: any, value: any) => void;
|
|
53
|
+
readonly position: (style: any, value: any) => void;
|
|
54
|
+
readonly right: (style: any, value: any) => void;
|
|
55
|
+
readonly textAlign: (style: any, value: any) => void;
|
|
56
|
+
readonly top: (style: any, value: any) => void;
|
|
57
|
+
readonly verticalAlign: (style: any, value: any) => void;
|
|
58
|
+
readonly width: (style: any, value: any) => void;
|
|
59
|
+
readonly lineHeight: (style: any, value: any) => void;
|
|
60
|
+
readonly m: (style: any, value: any) => void;
|
|
61
|
+
readonly mb: (style: any, value: any) => void;
|
|
62
|
+
readonly ml: (style: any, value: any) => void;
|
|
63
|
+
readonly mr: (style: any, value: any) => void;
|
|
64
|
+
readonly mt: (style: any, value: any) => void;
|
|
65
|
+
readonly mx: (style: any, value: any) => void;
|
|
66
|
+
readonly my: (style: any, value: any) => void;
|
|
67
|
+
readonly p: (style: any, value: any) => void;
|
|
68
|
+
readonly pb: (style: any, value: any) => void;
|
|
69
|
+
readonly pl: (style: any, value: any) => void;
|
|
70
|
+
readonly pr: (style: any, value: any) => void;
|
|
71
|
+
readonly pt: (style: any, value: any) => void;
|
|
72
|
+
readonly px: (style: any, value: any) => void;
|
|
73
|
+
readonly py: (style: any, value: any) => void;
|
|
74
|
+
readonly color: (style: any, value: any) => void;
|
|
75
|
+
readonly textColor: (style: any, value: any) => void;
|
|
76
|
+
readonly backgroundColor: (style: any, value: any) => void;
|
|
77
|
+
};
|
|
78
|
+
declare const booleanStyleMap: {
|
|
79
|
+
readonly bold: (style: any, value: any) => void;
|
|
80
|
+
readonly fillPositionedParent: (style: any, value: any) => void;
|
|
81
|
+
readonly inline: (style: any, value: any) => void;
|
|
82
|
+
readonly italic: (style: any, value: any) => void;
|
|
83
|
+
readonly nowrap: (style: any, value: any) => void;
|
|
84
|
+
readonly preserveWhitespace: (style: any, value: any) => void;
|
|
85
|
+
};
|
|
86
|
+
export declare function computeBoxProps(props: any): Record<string, any>;
|
|
87
|
+
export declare function computeBoxClassName(props: BoxProps): string;
|
|
88
|
+
export declare function Box(props: BoxProps & DangerDoNotUse): import('react').ReactElement<{
|
|
89
|
+
className: string;
|
|
90
|
+
}, string | import('react').JSXElementConstructor<any>>;
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { createElement as y } from "react";
|
|
2
|
+
import { CSS_COLORS as b } from "../common/constants.js";
|
|
3
|
+
import { classes as u } from "../common/react.js";
|
|
4
|
+
function p(o) {
|
|
5
|
+
if (typeof o == "string")
|
|
6
|
+
return o.endsWith("px") ? parseFloat(o) / 12 + "rem" : o;
|
|
7
|
+
if (typeof o == "number")
|
|
8
|
+
return o + "rem";
|
|
9
|
+
}
|
|
10
|
+
function r(o) {
|
|
11
|
+
if (typeof o == "string")
|
|
12
|
+
return p(o);
|
|
13
|
+
if (typeof o == "number")
|
|
14
|
+
return p(o * 0.5);
|
|
15
|
+
}
|
|
16
|
+
function x(o) {
|
|
17
|
+
return !a(o);
|
|
18
|
+
}
|
|
19
|
+
function a(o) {
|
|
20
|
+
return typeof o == "string" && b.includes(o);
|
|
21
|
+
}
|
|
22
|
+
const m = (o) => (t, i) => {
|
|
23
|
+
(typeof i == "number" || typeof i == "string") && (t[o] = i);
|
|
24
|
+
}, n = (o, t) => (i, e) => {
|
|
25
|
+
(typeof e == "number" || typeof e == "string") && (i[o] = t(e));
|
|
26
|
+
}, l = (o, t) => (i, e) => {
|
|
27
|
+
e && (i[o] = t);
|
|
28
|
+
}, g = (o, t, i) => (e, f) => {
|
|
29
|
+
if (typeof f == "number" || typeof f == "string")
|
|
30
|
+
for (let c = 0; c < i.length; c++)
|
|
31
|
+
e[o + "-" + i[c]] = t(f);
|
|
32
|
+
}, s = (o) => (t, i) => {
|
|
33
|
+
x(i) && (t[o] = i);
|
|
34
|
+
}, C = {
|
|
35
|
+
align: m("textAlign"),
|
|
36
|
+
bottom: n("bottom", p),
|
|
37
|
+
fontFamily: m("fontFamily"),
|
|
38
|
+
fontSize: n("fontSize", p),
|
|
39
|
+
fontWeight: m("fontWeight"),
|
|
40
|
+
height: n("height", p),
|
|
41
|
+
left: n("left", p),
|
|
42
|
+
maxHeight: n("maxHeight", p),
|
|
43
|
+
maxWidth: n("maxWidth", p),
|
|
44
|
+
minHeight: n("minHeight", p),
|
|
45
|
+
minWidth: n("minWidth", p),
|
|
46
|
+
opacity: m("opacity"),
|
|
47
|
+
overflow: m("overflow"),
|
|
48
|
+
overflowX: m("overflowX"),
|
|
49
|
+
overflowY: m("overflowY"),
|
|
50
|
+
position: m("position"),
|
|
51
|
+
right: n("right", p),
|
|
52
|
+
textAlign: m("textAlign"),
|
|
53
|
+
top: n("top", p),
|
|
54
|
+
verticalAlign: m("verticalAlign"),
|
|
55
|
+
width: n("width", p),
|
|
56
|
+
lineHeight: (o, t) => {
|
|
57
|
+
typeof t == "number" ? o.lineHeight = t : typeof t == "string" && (o.lineHeight = p(t));
|
|
58
|
+
},
|
|
59
|
+
// Margin
|
|
60
|
+
m: g("margin", r, [
|
|
61
|
+
"Top",
|
|
62
|
+
"Bottom",
|
|
63
|
+
"Left",
|
|
64
|
+
"Right"
|
|
65
|
+
]),
|
|
66
|
+
mb: n("marginBottom", r),
|
|
67
|
+
ml: n("marginLeft", r),
|
|
68
|
+
mr: n("marginRight", r),
|
|
69
|
+
mt: n("marginTop", r),
|
|
70
|
+
mx: g("margin", r, ["Left", "Right"]),
|
|
71
|
+
my: g("margin", r, ["Top", "Bottom"]),
|
|
72
|
+
// Padding
|
|
73
|
+
p: g("padding", r, [
|
|
74
|
+
"Top",
|
|
75
|
+
"Bottom",
|
|
76
|
+
"Left",
|
|
77
|
+
"Right"
|
|
78
|
+
]),
|
|
79
|
+
pb: n("paddingBottom", r),
|
|
80
|
+
pl: n("paddingLeft", r),
|
|
81
|
+
pr: n("paddingRight", r),
|
|
82
|
+
pt: n("paddingTop", r),
|
|
83
|
+
px: g("padding", r, ["Left", "Right"]),
|
|
84
|
+
py: g("padding", r, ["Top", "Bottom"]),
|
|
85
|
+
// Color props
|
|
86
|
+
color: s("color"),
|
|
87
|
+
textColor: s("color"),
|
|
88
|
+
backgroundColor: s("backgroundColor")
|
|
89
|
+
}, w = {
|
|
90
|
+
bold: l("fontWeight", "bold"),
|
|
91
|
+
fillPositionedParent: (o, t) => {
|
|
92
|
+
t && (o.position = "absolute", o.top = 0, o.bottom = 0, o.left = 0, o.right = 0);
|
|
93
|
+
},
|
|
94
|
+
inline: l("display", "inline-block"),
|
|
95
|
+
italic: l("fontStyle", "italic"),
|
|
96
|
+
nowrap: l("whiteSpace", "nowrap"),
|
|
97
|
+
preserveWhitespace: l("whiteSpace", "pre-wrap")
|
|
98
|
+
};
|
|
99
|
+
function S(o) {
|
|
100
|
+
const t = {}, i = {};
|
|
101
|
+
for (const e of Object.keys(o)) {
|
|
102
|
+
if (e === "style")
|
|
103
|
+
continue;
|
|
104
|
+
const f = o[e], c = C[e] || w[e];
|
|
105
|
+
c ? c(i, f) : t[e] = f;
|
|
106
|
+
}
|
|
107
|
+
return t.style = { ...i, ...o.style }, t;
|
|
108
|
+
}
|
|
109
|
+
function d(o) {
|
|
110
|
+
const t = o.textColor || o.color, i = o.backgroundColor;
|
|
111
|
+
return u([
|
|
112
|
+
a(t) && "color-" + t,
|
|
113
|
+
a(i) && "color-bg-" + i
|
|
114
|
+
]);
|
|
115
|
+
}
|
|
116
|
+
function W(o) {
|
|
117
|
+
const { as: t = "div", className: i, children: e, ...f } = o, c = i ? `${i} ${d(f)}` : d(f), h = S(f);
|
|
118
|
+
return y(
|
|
119
|
+
typeof t == "string" ? t : "div",
|
|
120
|
+
{
|
|
121
|
+
...h,
|
|
122
|
+
className: c
|
|
123
|
+
},
|
|
124
|
+
e
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
export {
|
|
128
|
+
W as Box,
|
|
129
|
+
d as computeBoxClassName,
|
|
130
|
+
S as computeBoxProps,
|
|
131
|
+
r as halfUnit,
|
|
132
|
+
p as unit
|
|
133
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Placement } from '@popperjs/core';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { BooleanLike } from '../common/react';
|
|
4
|
+
import { BoxProps } from './Box';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Getting ellipses to work requires that you use:
|
|
8
|
+
* 1. A string rather than a node
|
|
9
|
+
* 2. A fixed width here or in a parent
|
|
10
|
+
* 3. Children prop rather than content
|
|
11
|
+
*/
|
|
12
|
+
type EllipsisUnion = {
|
|
13
|
+
children: string;
|
|
14
|
+
/** @deprecated use children instead */
|
|
15
|
+
content?: never;
|
|
16
|
+
/** Cuts off text with an ellipsis */
|
|
17
|
+
ellipsis: true;
|
|
18
|
+
} | Partial<{
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
/** @deprecated use children instead */
|
|
21
|
+
content: ReactNode;
|
|
22
|
+
ellipsis: undefined;
|
|
23
|
+
}>;
|
|
24
|
+
type Props = Partial<{
|
|
25
|
+
/** Captures keyboard events */
|
|
26
|
+
captureKeys: boolean;
|
|
27
|
+
/** Makes the button circular */
|
|
28
|
+
circular: boolean;
|
|
29
|
+
/** Reduces the padding of the button */
|
|
30
|
+
compact: boolean;
|
|
31
|
+
/** Disables and greys out the button */
|
|
32
|
+
disabled: BooleanLike;
|
|
33
|
+
/** Fill all available horizontal space */
|
|
34
|
+
fluid: boolean;
|
|
35
|
+
/** Adds an icon to the button */
|
|
36
|
+
icon: string | false;
|
|
37
|
+
/** Icon color */
|
|
38
|
+
iconColor: string;
|
|
39
|
+
/** Icon position */
|
|
40
|
+
iconPosition: string;
|
|
41
|
+
/** Icon rotation */
|
|
42
|
+
iconRotation: number;
|
|
43
|
+
/** Makes the icon spin */
|
|
44
|
+
iconSpin: BooleanLike;
|
|
45
|
+
/** Called when element is clicked */
|
|
46
|
+
onClick: (e: any) => void;
|
|
47
|
+
/** Activates the button (gives it a green color) */
|
|
48
|
+
selected: BooleanLike;
|
|
49
|
+
/** A fancy, boxy tooltip, which appears when hovering over the button */
|
|
50
|
+
tooltip: ReactNode;
|
|
51
|
+
/** Position of the tooltip. See [`Popper`](#Popper) for valid options. */
|
|
52
|
+
tooltipPosition: Placement;
|
|
53
|
+
/** Align content vertically using flex. Use lineHeight if the height is static. */
|
|
54
|
+
verticalAlignContent: string;
|
|
55
|
+
}> & EllipsisUnion & BoxProps;
|
|
56
|
+
/** Clickable button. Comes with variants. Read more in the documentation. */
|
|
57
|
+
export declare function Button(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
export declare namespace Button {
|
|
59
|
+
var Checkbox: typeof ButtonCheckbox;
|
|
60
|
+
var Confirm: typeof ButtonConfirm;
|
|
61
|
+
var Input: typeof ButtonInput;
|
|
62
|
+
var File: typeof ButtonFile;
|
|
63
|
+
}
|
|
64
|
+
type CheckProps = Partial<{
|
|
65
|
+
checked: BooleanLike;
|
|
66
|
+
}> & Props;
|
|
67
|
+
/** Visually toggles between checked and unchecked states. */
|
|
68
|
+
export declare function ButtonCheckbox(props: CheckProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
type ConfirmProps = Partial<{
|
|
70
|
+
confirmColor: string;
|
|
71
|
+
confirmContent: ReactNode;
|
|
72
|
+
confirmIcon: string;
|
|
73
|
+
}> & Props;
|
|
74
|
+
/** Requires user confirmation before triggering its action. */
|
|
75
|
+
declare function ButtonConfirm(props: ConfirmProps): import("react/jsx-runtime").JSX.Element;
|
|
76
|
+
type InputProps = Partial<{
|
|
77
|
+
currentValue: string;
|
|
78
|
+
defaultValue: string;
|
|
79
|
+
fluid: boolean;
|
|
80
|
+
maxLength: number;
|
|
81
|
+
onCommit: (e: any, value: string) => void;
|
|
82
|
+
placeholder: string;
|
|
83
|
+
}> & Props;
|
|
84
|
+
/** Accepts and handles user input. */
|
|
85
|
+
declare function ButtonInput(props: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
86
|
+
type FileProps = {
|
|
87
|
+
accept: string;
|
|
88
|
+
multiple?: boolean;
|
|
89
|
+
onSelectFiles: (files: string | string[]) => void;
|
|
90
|
+
} & Props;
|
|
91
|
+
/** Accepts file input */
|
|
92
|
+
declare function ButtonFile(props: FileProps): import("react/jsx-runtime").JSX.Element;
|
|
93
|
+
export {};
|