tgui-core 1.5.5 → 1.5.7

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.
@@ -2,7 +2,7 @@ import { AnimatedNumber as e } from "./AnimatedNumber.js";
2
2
  import { Autofocus as m } from "./Autofocus.js";
3
3
  import { Blink as x } from "./Blink.js";
4
4
  import { BlockQuote as i } from "./BlockQuote.js";
5
- import { Box as n } from "./Box.js";
5
+ import { Box as l } from "./Box.js";
6
6
  import { Button as u } from "./Button.js";
7
7
  import { ByondUi as c } from "./ByondUi.js";
8
8
  import { Chart as b } from "./Chart.js";
@@ -11,47 +11,45 @@ import { ColorBox as D } from "./ColorBox.js";
11
11
  import { Dialog as C } from "./Dialog.js";
12
12
  import { Dimmer as L } from "./Dimmer.js";
13
13
  import { Divider as y } from "./Divider.js";
14
- import { DmIcon as A } from "./DmIcon.js";
15
- import { DraggableControl as v } from "./DraggableControl.js";
16
- import { Dropdown as K } from "./Dropdown.js";
17
- import { FitText as R } from "./FitText.js";
14
+ import { DmIcon as N } from "./DmIcon.js";
15
+ import { DraggableControl as F } from "./DraggableControl.js";
16
+ import { Dropdown as M } from "./Dropdown.js";
17
+ import { FitText as h } from "./FitText.js";
18
18
  import { Flex as w } from "./Flex.js";
19
19
  import { Icon as O } from "./Icon.js";
20
20
  import { Image as U } from "./Image.js";
21
21
  import { ImageButton as j } from "./ImageButton.js";
22
22
  import { InfinitePlane as z } from "./InfinitePlane.js";
23
23
  import { Input as H } from "./Input.js";
24
- import { Interactive as W } from "./Interactive.js";
25
- import { KeyListener as Y } from "./KeyListener.js";
26
- import { Knob as _ } from "./Knob.js";
27
- import { LabeledControls as oo } from "./LabeledControls.js";
28
- import { LabeledList as eo } from "./LabeledList.js";
29
- import { MenuBar as mo } from "./MenuBar.js";
30
- import { Modal as xo } from "./Modal.js";
31
- import { NoticeBox as io } from "./NoticeBox.js";
32
- import { NumberInput as no } from "./NumberInput.js";
33
- import { Pointer as uo } from "./Pointer.js";
34
- import { Popper as co } from "./Popper.js";
35
- import { ProgressBar as Bo } from "./ProgressBar.js";
36
- import { RestrictedInput as go } from "./RestrictedInput.js";
37
- import { RoundGauge as To } from "./RoundGauge.js";
38
- import { Section as ko } from "./Section.js";
39
- import { Slider as So } from "./Slider.js";
40
- import { Stack as Po } from "./Stack.js";
41
- import { StyleableSection as No } from "./StyleableSection.js";
42
- import { Table as Fo } from "./Table.js";
43
- import { Tabs as Mo } from "./Tabs.js";
44
- import { TextArea as ho } from "./TextArea.js";
45
- import { TimeDisplay as Go } from "./TimeDisplay.js";
46
- import { Tooltip as Qo } from "./Tooltip.js";
47
- import { TrackOutsideClicks as Vo } from "./TrackOutsideClicks.js";
48
- import { VirtualList as qo } from "./VirtualList.js";
24
+ import { KeyListener as W } from "./KeyListener.js";
25
+ import { Knob as Y } from "./Knob.js";
26
+ import { LabeledControls as _ } from "./LabeledControls.js";
27
+ import { LabeledList as oo } from "./LabeledList.js";
28
+ import { MenuBar as eo } from "./MenuBar.js";
29
+ import { Modal as mo } from "./Modal.js";
30
+ import { NoticeBox as xo } from "./NoticeBox.js";
31
+ import { NumberInput as io } from "./NumberInput.js";
32
+ import { Popper as lo } from "./Popper.js";
33
+ import { ProgressBar as uo } from "./ProgressBar.js";
34
+ import { RestrictedInput as co } from "./RestrictedInput.js";
35
+ import { RoundGauge as Bo } from "./RoundGauge.js";
36
+ import { Section as go } from "./Section.js";
37
+ import { Slider as To } from "./Slider.js";
38
+ import { Stack as ko } from "./Stack.js";
39
+ import { StyleableSection as So } from "./StyleableSection.js";
40
+ import { Table as Ao } from "./Table.js";
41
+ import { Tabs as Po } from "./Tabs.js";
42
+ import { TextArea as Ko } from "./TextArea.js";
43
+ import { TimeDisplay as Ro } from "./TimeDisplay.js";
44
+ import { Tooltip as vo } from "./Tooltip.js";
45
+ import { TrackOutsideClicks as Go } from "./TrackOutsideClicks.js";
46
+ import { VirtualList as Qo } from "./VirtualList.js";
49
47
  export {
50
48
  e as AnimatedNumber,
51
49
  m as Autofocus,
52
50
  x as Blink,
53
51
  i as BlockQuote,
54
- n as Box,
52
+ l as Box,
55
53
  u as Button,
56
54
  c as ByondUi,
57
55
  b as Chart,
@@ -60,39 +58,37 @@ export {
60
58
  C as Dialog,
61
59
  L as Dimmer,
62
60
  y as Divider,
63
- A as DmIcon,
64
- v as DraggableControl,
65
- K as Dropdown,
66
- R as FitText,
61
+ N as DmIcon,
62
+ F as DraggableControl,
63
+ M as Dropdown,
64
+ h as FitText,
67
65
  w as Flex,
68
66
  O as Icon,
69
67
  U as Image,
70
68
  j as ImageButton,
71
69
  z as InfinitePlane,
72
70
  H as Input,
73
- W as Interactive,
74
- Y as KeyListener,
75
- _ as Knob,
76
- oo as LabeledControls,
77
- eo as LabeledList,
78
- mo as MenuBar,
79
- xo as Modal,
80
- io as NoticeBox,
81
- no as NumberInput,
82
- uo as Pointer,
83
- co as Popper,
84
- Bo as ProgressBar,
85
- go as RestrictedInput,
86
- To as RoundGauge,
87
- ko as Section,
88
- So as Slider,
89
- Po as Stack,
90
- No as StyleableSection,
91
- Fo as Table,
92
- Mo as Tabs,
93
- ho as TextArea,
94
- Go as TimeDisplay,
95
- Qo as Tooltip,
96
- Vo as TrackOutsideClicks,
97
- qo as VirtualList
71
+ W as KeyListener,
72
+ Y as Knob,
73
+ _ as LabeledControls,
74
+ oo as LabeledList,
75
+ eo as MenuBar,
76
+ mo as Modal,
77
+ xo as NoticeBox,
78
+ io as NumberInput,
79
+ lo as Popper,
80
+ uo as ProgressBar,
81
+ co as RestrictedInput,
82
+ Bo as RoundGauge,
83
+ go as Section,
84
+ To as Slider,
85
+ ko as Stack,
86
+ So as StyleableSection,
87
+ Ao as Table,
88
+ Po as Tabs,
89
+ Ko as TextArea,
90
+ Ro as TimeDisplay,
91
+ vo as Tooltip,
92
+ Go as TrackOutsideClicks,
93
+ Qo as VirtualList
98
94
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tgui-core",
3
- "version": "1.5.5",
3
+ "version": "1.5.7",
4
4
  "description": "TGUI core component library",
5
5
  "keywords": ["TGUI", "library", "typescript"],
6
6
  "files": ["dist"],
@@ -1,23 +0,0 @@
1
- import { default as React, Component, KeyboardEvent, MouseEvent, RefObject } from 'react';
2
- export interface Interaction {
3
- left: number;
4
- top: number;
5
- }
6
- export interface InteractiveProps {
7
- onMove: (interaction: Interaction) => void;
8
- onKey: (offset: Interaction) => void;
9
- children: React.ReactNode;
10
- style?: React.CSSProperties;
11
- }
12
- export declare class Interactive extends Component<InteractiveProps> {
13
- containerRef: RefObject<HTMLDivElement>;
14
- constructor(props: InteractiveProps);
15
- handleMoveStart: (event: MouseEvent) => void;
16
- handleMove: (event: MouseEvent) => void;
17
- handleMoveEnd: () => void;
18
- handleKeyDown: (event: KeyboardEvent) => void;
19
- toggleDocumentEvents: (state: boolean) => void;
20
- componentDidMount(): void;
21
- componentWillUnmount(): void;
22
- render(): import("react/jsx-runtime").JSX.Element;
23
- }
@@ -1,75 +0,0 @@
1
- var h = Object.defineProperty;
2
- var u = (t, n, e) => n in t ? h(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
- var s = (t, n, e) => u(t, typeof n != "symbol" ? n + "" : n, e);
4
- import { jsx as p } from "react/jsx-runtime";
5
- import { Component as f, createRef as g } from "react";
6
- import { clamp as l } from "../common/math.js";
7
- const i = (t) => {
8
- var n;
9
- return ((n = t == null ? void 0 : t.ownerDocument) == null ? void 0 : n.defaultView) || self;
10
- }, a = (t, n) => {
11
- const e = t.getBoundingClientRect();
12
- return {
13
- left: l(
14
- (n.pageX - (e.left + i(t).pageXOffset)) / e.width,
15
- 0,
16
- 1
17
- ),
18
- top: l(
19
- (n.pageY - (e.top + i(t).pageYOffset)) / e.height,
20
- 0,
21
- 1
22
- )
23
- };
24
- };
25
- class w extends f {
26
- constructor(e) {
27
- super(e);
28
- s(this, "containerRef");
29
- s(this, "handleMoveStart", (e) => {
30
- const o = this.containerRef.current;
31
- o && (e.preventDefault(), o.focus(), this.props.onMove(a(o, e)), this.toggleDocumentEvents(!0));
32
- });
33
- s(this, "handleMove", (e) => {
34
- e.preventDefault(), e.buttons > 0 && this.containerRef.current ? this.props.onMove(a(this.containerRef.current, e)) : this.toggleDocumentEvents(!1);
35
- });
36
- s(this, "handleMoveEnd", () => {
37
- this.toggleDocumentEvents(!1);
38
- });
39
- s(this, "handleKeyDown", (e) => {
40
- const o = e.which || e.keyCode;
41
- o < 37 || o > 40 || (e.preventDefault(), this.props.onKey({
42
- left: o === 39 ? 0.05 : o === 37 ? -0.05 : 0,
43
- top: o === 40 ? 0.05 : o === 38 ? -0.05 : 0
44
- }));
45
- });
46
- s(this, "toggleDocumentEvents", (e) => {
47
- const o = this.containerRef.current, r = i(o), c = e ? r.addEventListener.bind(r) : r.removeEventListener.bind(r);
48
- c("mousemove", this.handleMove), c("mouseup", this.handleMoveEnd);
49
- });
50
- this.containerRef = g();
51
- }
52
- componentDidMount() {
53
- this.toggleDocumentEvents(!0);
54
- }
55
- componentWillUnmount() {
56
- this.toggleDocumentEvents(!1);
57
- }
58
- render() {
59
- return /* @__PURE__ */ p(
60
- "div",
61
- {
62
- ...this.props,
63
- style: this.props.style,
64
- ref: this.containerRef,
65
- onMouseDown: this.handleMoveStart,
66
- className: "react-colorful__interactive",
67
- onKeyDown: this.handleKeyDown,
68
- children: this.props.children
69
- }
70
- );
71
- }
72
- }
73
- export {
74
- w as Interactive
75
- };
@@ -1,9 +0,0 @@
1
- import { ReactNode } from 'react';
2
- interface PointerProps {
3
- className?: string;
4
- top?: number;
5
- left: number;
6
- color: string;
7
- }
8
- export declare const Pointer: ({ className, color, left, top, }: PointerProps) => ReactNode;
9
- export {};
@@ -1,23 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { classes as a } from "../common/react.js";
3
- const m = ({
4
- className: r,
5
- color: e,
6
- left: t,
7
- top: l = 0.5
8
- }) => {
9
- const s = a(["react-colorful__pointer", r]), c = {
10
- top: `${l * 100}%`,
11
- left: `${t * 100}%`
12
- };
13
- return /* @__PURE__ */ o("div", { className: s, style: c, children: /* @__PURE__ */ o(
14
- "div",
15
- {
16
- className: "react-colorful__pointer-fill",
17
- style: { backgroundColor: e }
18
- }
19
- ) });
20
- };
21
- export {
22
- m as Pointer
23
- };