@berenjena/react-dev-panel 1.0.1 → 1.0.4

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.
Files changed (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +305 -1
  3. package/dist/UIStore-CQdr4U-2.js +227 -0
  4. package/dist/assets/ButtonControl.css +1 -1
  5. package/dist/assets/ControlRenderer.css +1 -0
  6. package/dist/assets/DevPanel.css +1 -1
  7. package/dist/assets/EmptyContent.css +1 -1
  8. package/dist/assets/Input.css +1 -1
  9. package/dist/assets/RangeControl.css +1 -0
  10. package/dist/assets/Section.css +1 -1
  11. package/dist/assets/SeparatorControl.css +1 -0
  12. package/dist/assets/index.css +1 -1
  13. package/dist/assets/index2.css +1 -0
  14. package/dist/components/ControlRenderer/ControlRenderer.js +30 -6
  15. package/dist/components/ControlRenderer/controls/BooleanControl/BooleanControl.js +9 -10
  16. package/dist/components/ControlRenderer/controls/ButtonControl/ButtonControl.js +3 -3
  17. package/dist/components/ControlRenderer/controls/ColorControl/ColorControl.js +13 -9
  18. package/dist/components/ControlRenderer/controls/DateControl/DateControl.d.ts +29 -0
  19. package/dist/components/ControlRenderer/controls/DateControl/DateControl.js +31 -0
  20. package/dist/components/ControlRenderer/controls/DateControl/index.d.ts +1 -0
  21. package/dist/components/ControlRenderer/controls/DateControl/index.js +4 -0
  22. package/dist/components/ControlRenderer/controls/DateControl/types.d.ts +12 -0
  23. package/dist/components/ControlRenderer/controls/RangeControl/RangeControl.d.ts +30 -0
  24. package/dist/components/ControlRenderer/controls/RangeControl/RangeControl.js +40 -0
  25. package/dist/components/ControlRenderer/controls/RangeControl/index.d.ts +1 -0
  26. package/dist/components/ControlRenderer/controls/RangeControl/index.js +4 -0
  27. package/dist/components/ControlRenderer/controls/RangeControl/types.d.ts +13 -0
  28. package/dist/components/ControlRenderer/controls/SelectControl/SelectControl.js +6 -9
  29. package/dist/components/ControlRenderer/controls/SeparatorControl/SeparatorControl.d.ts +30 -0
  30. package/dist/components/ControlRenderer/controls/SeparatorControl/SeparatorControl.js +14 -0
  31. package/dist/components/ControlRenderer/controls/SeparatorControl/index.d.ts +1 -0
  32. package/dist/components/ControlRenderer/controls/SeparatorControl/index.js +4 -0
  33. package/dist/components/ControlRenderer/controls/SeparatorControl/types.d.ts +10 -0
  34. package/dist/components/ControlRenderer/controls/index.d.ts +3 -1
  35. package/dist/components/ControlRenderer/controls/index.js +13 -39
  36. package/dist/components/ControlRenderer/controls/types.d.ts +6 -0
  37. package/dist/components/ControlRenderer/index.js +1 -1
  38. package/dist/components/DevPanel/DevPanel.js +36 -35
  39. package/dist/components/DevPanel/types.d.ts +9 -4
  40. package/dist/components/EmptyContent/EmptyContent.js +2 -2
  41. package/dist/components/Input/Input.js +3 -3
  42. package/dist/components/Logger/index.d.ts +20 -0
  43. package/dist/components/Logger/index.js +85 -0
  44. package/dist/components/Section/Section.js +17 -16
  45. package/dist/components/index.d.ts +1 -0
  46. package/dist/components/index.js +6 -5
  47. package/dist/hooks/useDebounceCallback/index.d.ts +1 -0
  48. package/dist/hooks/useDebounceCallback/index.js +4 -0
  49. package/dist/hooks/useDebounceCallback/useDebounceCallback.d.ts +8 -0
  50. package/dist/hooks/useDebounceCallback/useDebounceCallback.js +17 -0
  51. package/dist/hooks/useDevPanel/useDevPanel.js +12 -12
  52. package/dist/hooks/useDragAndDrop/useDragAndDrop.d.ts +1 -1
  53. package/dist/hooks/useHotkeys/types.d.ts +14 -0
  54. package/dist/hooks/useHotkeys/useHotkey.d.ts +1 -2
  55. package/dist/hooks/useHotkeys/useHotkeys.d.ts +1 -2
  56. package/dist/index.d.ts +2 -0
  57. package/dist/index.js +9 -8
  58. package/dist/store/BaseStoreService.d.ts +90 -0
  59. package/dist/store/BaseStoreService.js +90 -0
  60. package/dist/store/SectionsStore.d.ts +40 -0
  61. package/dist/store/SectionsStore.js +7 -0
  62. package/dist/store/UIStore.d.ts +88 -0
  63. package/dist/store/UIStore.js +11 -0
  64. package/dist/store/index.d.ts +3 -0
  65. package/dist/store/index.js +13 -0
  66. package/dist/utils/createHotkey/createHotkey.d.ts +1 -1
  67. package/dist/utils/formatHotkey/formatHotkey.d.ts +1 -1
  68. package/dist/utils/getConstrainedPosition/getConstrainedPosition.d.ts +1 -1
  69. package/dist/utils/getCurrentElementPosition/getCurrentElementPosition.d.ts +1 -1
  70. package/dist/utils/getPositionAdjustment/getPositionAdjustment.d.ts +2 -2
  71. package/dist/utils/hasControlChanged/hasControlChanged.js +5 -5
  72. package/dist/utils/index.d.ts +0 -1
  73. package/dist/utils/index.js +16 -23
  74. package/package.json +27 -21
  75. package/dist/assets/SelectControl.css +0 -1
  76. package/dist/components/logger.d.ts +0 -5
  77. package/dist/components/logger.js +0 -7
  78. package/dist/types.d.ts +0 -18
  79. package/dist/utils/store/index.d.ts +0 -1
  80. package/dist/utils/store/index.js +0 -9
  81. package/dist/utils/store/store.d.ts +0 -40
  82. package/dist/utils/store/store.js +0 -103
  83. package/dist/vite-env.d.ts +0 -1
@@ -1,25 +1,24 @@
1
- import { jsxs as c, jsx as a } from "react/jsx-runtime";
2
- import { className as t } from "../../../../utils/className/className.js";
3
- import "../../../../utils/store/store.js";
4
- import '../../../../assets/BooleanControl.css';const l = "_slider_1i71a_25", e = {
1
+ import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
+ import { className as l } from "../../../../utils/className/className.js";
3
+ import '../../../../assets/BooleanControl.css';const t = "_slider_1i71a_25", e = {
5
4
  switch: "_switch_1i71a_1",
6
- slider: l
5
+ slider: t
7
6
  };
8
- function d({ control: s }) {
9
- return /* @__PURE__ */ c("label", { className: e.switch, children: [
7
+ function r({ control: s }) {
8
+ return /* @__PURE__ */ i("label", { className: e.switch, children: [
10
9
  /* @__PURE__ */ a(
11
10
  "input",
12
11
  {
13
12
  type: "checkbox",
14
13
  checked: s.value,
15
14
  disabled: s.disabled,
16
- onChange: (i) => s.onChange(i.target.checked),
15
+ onChange: (c) => s.onChange(c.target.checked),
17
16
  className: e.checkbox
18
17
  }
19
18
  ),
20
- /* @__PURE__ */ a("span", { ...t(e.slider, e.round) })
19
+ /* @__PURE__ */ a("span", { ...l(e.slider, e.round) })
21
20
  ] });
22
21
  }
23
22
  export {
24
- d as BooleanControl
23
+ r as BooleanControl
25
24
  };
@@ -1,10 +1,10 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import '../../../../assets/ButtonControl.css';const o = "_button_e2m3l_1", e = {
2
+ import '../../../../assets/ButtonControl.css';const o = "_button_1cetu_1", e = {
3
3
  button: o
4
4
  };
5
- function s({ control: t }) {
5
+ function u({ control: t }) {
6
6
  return /* @__PURE__ */ n("button", { onClick: t.onClick, disabled: t.disabled, className: e.button, children: t.label });
7
7
  }
8
8
  export {
9
- s as ButtonControl
9
+ u as ButtonControl
10
10
  };
@@ -1,13 +1,17 @@
1
- import { jsxs as t, jsx as n } from "react/jsx-runtime";
2
- import { Input as l } from "../../../Input/Input.js";
3
- import '../../../../assets/ColorControl.css';const o = "_container_ds1no_1", r = {
4
- container: o
1
+ import { jsxs as r, jsx as n } from "react/jsx-runtime";
2
+ import { Input as o } from "../../../Input/Input.js";
3
+ import { useDebouncedCallback as d } from "../../../../hooks/useDebounceCallback/useDebounceCallback.js";
4
+ import '../../../../assets/ColorControl.css';const s = "_container_ds1no_1", i = {
5
+ container: s
5
6
  };
6
- function d({ control: e }) {
7
- return /* @__PURE__ */ t("div", { className: r.container, children: [
8
- /* @__PURE__ */ n("label", { children: /* @__PURE__ */ n(l, { type: "color", value: e.value, disabled: e.disabled, onChange: (a) => e.onChange(a.target.value) }) }),
7
+ function C({ control: e }) {
8
+ const l = d(e.onChange, 100), t = (a) => {
9
+ l(a.target.value);
10
+ };
11
+ return /* @__PURE__ */ r("div", { className: i.container, children: [
12
+ /* @__PURE__ */ n("label", { children: /* @__PURE__ */ n(o, { type: "color", value: e.value, disabled: e.disabled, onChange: t }) }),
9
13
  /* @__PURE__ */ n(
10
- l,
14
+ o,
11
15
  {
12
16
  type: "text",
13
17
  value: e.value,
@@ -19,5 +23,5 @@ function d({ control: e }) {
19
23
  ] });
20
24
  }
21
25
  export {
22
- d as ColorControl
26
+ C as ColorControl
23
27
  };
@@ -0,0 +1,29 @@
1
+ import { DateControlProps } from './types';
2
+ /**
3
+ * Component that renders a date control with configurable event handling
4
+ * @param control - The control to render
5
+ * @param control.event - When to trigger onChange: "onChange" (real-time) or "onBlur" (on focus loss). Defaults to "onBlur"
6
+ * @returns The date control component
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * // Real-time updates
11
+ * <DateControl control={{
12
+ * type: 'date',
13
+ * value: '2025-07-26',
14
+ * min: '2025-01-01',
15
+ * max: '2025-12-31',
16
+ * event: 'onChange',
17
+ * onChange: (value) => setValue(value)
18
+ * }} />
19
+ *
20
+ * // Updates only when losing focus (default)
21
+ * <DateControl control={{
22
+ * type: 'date',
23
+ * value: '2025-07-26',
24
+ * event: 'onBlur',
25
+ * onChange: (value) => setValue(value)
26
+ * }} />
27
+ * ```
28
+ */
29
+ export declare function DateControl({ control }: DateControlProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,31 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { useState as o, useEffect as r } from "react";
3
+ import { Input as f } from "../../../Input/Input.js";
4
+ function h({ control: e }) {
5
+ const n = e.event || "onBlur", [l, t] = o(e.value);
6
+ r(() => {
7
+ t(e.value);
8
+ }, [e.value]);
9
+ const s = (u) => {
10
+ const a = u.target.value;
11
+ t(a), n === "onChange" && e.onChange(a);
12
+ }, i = (u) => {
13
+ const a = u.target.value;
14
+ n === "onBlur" && e.onChange(a);
15
+ };
16
+ return /* @__PURE__ */ m(
17
+ f,
18
+ {
19
+ type: "date",
20
+ value: l,
21
+ min: e.min,
22
+ max: e.max,
23
+ disabled: e.disabled,
24
+ onChange: s,
25
+ ...n === "onBlur" && { onBlur: i }
26
+ }
27
+ );
28
+ }
29
+ export {
30
+ h as DateControl
31
+ };
@@ -0,0 +1 @@
1
+ export * from './DateControl';
@@ -0,0 +1,4 @@
1
+ import { DateControl as t } from "./DateControl.js";
2
+ export {
3
+ t as DateControl
4
+ };
@@ -0,0 +1,12 @@
1
+ import { BaseInputControl } from '../types';
2
+ export interface DateControl extends BaseInputControl {
3
+ type: "date";
4
+ value: string; // ISO date string (YYYY-MM-DD)
5
+ min?: string; // ISO date string
6
+ max?: string; // ISO date string
7
+ onChange: (value: string) => void;
8
+ }
9
+
10
+ export interface DateControlProps {
11
+ control: DateControl;
12
+ }
@@ -0,0 +1,30 @@
1
+ import { RangeControlProps } from './types';
2
+ /**
3
+ * Component that renders a range/slider control with configurable event handling
4
+ * @param control - The control to render
5
+ * @param control.event - When to trigger onChange: "onChange" (real-time) or "onBlur" (on focus loss). Defaults to "onChange"
6
+ * @returns The range control component
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * // Real-time updates (default)
11
+ * <RangeControl control={{
12
+ * type: 'range',
13
+ * value: 50,
14
+ * min: 0,
15
+ * max: 100,
16
+ * step: 1,
17
+ * event: 'onChange',
18
+ * onChange: (value) => setValue(value)
19
+ * }} />
20
+ *
21
+ * // Updates only when losing focus
22
+ * <RangeControl control={{
23
+ * type: 'range',
24
+ * value: 50,
25
+ * event: 'onBlur',
26
+ * onChange: (value) => setValue(value)
27
+ * }} />
28
+ * ```
29
+ */
30
+ export declare function RangeControl({ control }: RangeControlProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,40 @@
1
+ import { jsxs as g, jsx as r } from "react/jsx-runtime";
2
+ import { useState as o, useEffect as m } from "react";
3
+ import '../../../../assets/RangeControl.css';const v = "_container_1ewrb_1", h = "_range_1ewrb_9", d = "_value_1ewrb_116", t = {
4
+ container: v,
5
+ range: h,
6
+ value: d
7
+ };
8
+ function b({ control: e }) {
9
+ const n = e.event || "onChange", [u, l] = o(e.value);
10
+ m(() => {
11
+ l(e.value);
12
+ }, [e.value]);
13
+ const i = (s) => {
14
+ const a = Number(s.target.value);
15
+ l(a), n === "onChange" && e.onChange(a);
16
+ }, c = (s) => {
17
+ const a = Number(s.target.value);
18
+ n === "onBlur" && e.onChange(a);
19
+ };
20
+ return /* @__PURE__ */ g("div", { className: t.container, children: [
21
+ /* @__PURE__ */ r(
22
+ "input",
23
+ {
24
+ type: "range",
25
+ value: u,
26
+ min: e.min,
27
+ max: e.max,
28
+ step: e.step,
29
+ disabled: e.disabled,
30
+ onChange: i,
31
+ ...n === "onBlur" && { onBlur: c },
32
+ className: t.range
33
+ }
34
+ ),
35
+ /* @__PURE__ */ r("span", { className: t.value, children: u })
36
+ ] });
37
+ }
38
+ export {
39
+ b as RangeControl
40
+ };
@@ -0,0 +1 @@
1
+ export * from './RangeControl';
@@ -0,0 +1,4 @@
1
+ import { RangeControl as e } from "./RangeControl.js";
2
+ export {
3
+ e as RangeControl
4
+ };
@@ -0,0 +1,13 @@
1
+ import { BaseInputControl } from '../types';
2
+ export interface RangeControl extends BaseInputControl {
3
+ type: "range";
4
+ value: number;
5
+ min?: number;
6
+ max?: number;
7
+ step?: number;
8
+ onChange: (value: number) => void;
9
+ }
10
+
11
+ export interface RangeControlProps {
12
+ control: RangeControl;
13
+ }
@@ -1,14 +1,11 @@
1
- import { jsx as s } from "react/jsx-runtime";
1
+ import { jsx as t } from "react/jsx-runtime";
2
2
  import { Select as n } from "../../../Select/Select.js";
3
- import '../../../../assets/SelectControl.css';const r = "_select_1w3k9_1", c = {
4
- select: r
5
- };
6
- function o({ control: t }) {
7
- return /* @__PURE__ */ s(n, { value: t.value, disabled: t.disabled, onChange: (e) => t.onChange(e.target.value), className: c.select, children: t.options.map((e) => {
8
- const l = typeof e == "string" ? e : e.value, a = typeof e == "string" ? e : e.label;
9
- return /* @__PURE__ */ s("option", { value: l, children: a }, l);
3
+ function s({ control: a }) {
4
+ return /* @__PURE__ */ t(n, { value: a.value, disabled: a.disabled, onChange: (e) => a.onChange(e.target.value), children: a.options.map((e) => {
5
+ const l = typeof e == "string" ? e : e.value, r = typeof e == "string" ? e : e.label;
6
+ return /* @__PURE__ */ t("option", { value: l, children: r }, l);
10
7
  }) });
11
8
  }
12
9
  export {
13
- o as SelectControl
10
+ s as SelectControl
14
11
  };
@@ -0,0 +1,30 @@
1
+ import { SeparatorControlProps } from './types';
2
+ /**
3
+ * Component that renders a visual separator to organize control groups
4
+ * @param control - The control to render
5
+ * @param control.style - The style of separator: "line" (default), "space", or "label"
6
+ * @param control.label - Optional label text (only shown when style is "label")
7
+ * @returns The separator control component
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * // Simple line separator
12
+ * <SeparatorControl control={{
13
+ * type: 'separator'
14
+ * }} />
15
+ *
16
+ * // Separator with label
17
+ * <SeparatorControl control={{
18
+ * type: 'separator',
19
+ * style: 'label',
20
+ * label: 'Advanced Settings'
21
+ * }} />
22
+ *
23
+ * // Space separator
24
+ * <SeparatorControl control={{
25
+ * type: 'separator',
26
+ * style: 'space'
27
+ * }} />
28
+ * ```
29
+ */
30
+ export declare function SeparatorControl({ control }: SeparatorControlProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import '../../../../assets/SeparatorControl.css';const s = "_line_12cvo_1", c = "_space_12cvo_9", t = "_labelContainer_12cvo_14", i = "_label_12cvo_14", l = {
3
+ line: s,
4
+ space: c,
5
+ labelContainer: t,
6
+ label: i
7
+ };
8
+ function r({ control: a }) {
9
+ const n = a.style || "line";
10
+ return n === "space" ? /* @__PURE__ */ e("div", { className: l.space }) : n === "label" && a.label ? /* @__PURE__ */ e("div", { className: l.labelContainer, children: /* @__PURE__ */ e("span", { className: l.label, children: a.label }) }) : /* @__PURE__ */ e("div", { className: l.line });
11
+ }
12
+ export {
13
+ r as SeparatorControl
14
+ };
@@ -0,0 +1 @@
1
+ export * from './SeparatorControl';
@@ -0,0 +1,4 @@
1
+ import { SeparatorControl as t } from "./SeparatorControl.js";
2
+ export {
3
+ t as SeparatorControl
4
+ };
@@ -0,0 +1,10 @@
1
+ import { BaseControl } from '../types';
2
+ export interface SeparatorControl extends BaseControl {
3
+ type: "separator";
4
+ style?: "line" | "space" | "label";
5
+ // Note: SeparatorControl doesn't need onChange or value as it's purely visual
6
+ }
7
+
8
+ export interface SeparatorControlProps {
9
+ control: SeparatorControl;
10
+ }
@@ -6,9 +6,11 @@ export declare const controls: Readonly<{
6
6
  boolean: import('react').LazyExoticComponent<typeof import('./BooleanControl').BooleanControl>;
7
7
  button: import('react').LazyExoticComponent<typeof import('./ButtonControl').ButtonControl>;
8
8
  color: import('react').LazyExoticComponent<typeof import('./ColorControl').ColorControl>;
9
+ date: import('react').LazyExoticComponent<typeof import('./DateControl').DateControl>;
9
10
  number: import('react').LazyExoticComponent<typeof import('./NumberControl').NumberControl>;
11
+ range: import('react').LazyExoticComponent<typeof import('./RangeControl').RangeControl>;
10
12
  select: import('react').LazyExoticComponent<typeof import('./SelectControl').SelectControl>;
13
+ separator: import('react').LazyExoticComponent<typeof import('./SeparatorControl').SeparatorControl>;
11
14
  text: import('react').LazyExoticComponent<typeof import('./TextControl').TextControl>;
12
15
  buttonGroup: import('react').LazyExoticComponent<typeof import('./ButtonGroupControl').ButtonGroupControl>;
13
16
  }>;
14
- export { ControlRenderer } from '..';
@@ -1,42 +1,16 @@
1
- import { Suspense as d, lazy as r } from "react";
2
- import { jsxs as i, jsx as o } from "react/jsx-runtime";
3
- import { className as s } from "../../../utils/className/className.js";
4
- import "../../../utils/store/store.js";
5
- import '../../../assets/index.css';const p = "_controlRendererContainer_eix3y_1", u = "_controlContainer_eix3y_5", m = "_fullWidth_eix3y_13", C = "_controlWrapper_eix3y_16", f = "_label_eix3y_20", _ = "_description_eix3y_28", h = "_loading_eix3y_29", t = {
6
- controlRendererContainer: p,
7
- controlContainer: u,
8
- fullWidth: m,
9
- controlWrapper: C,
10
- label: f,
11
- description: _,
12
- loading: h
13
- }, b = ["button", "buttonGroup"];
14
- function g({ name: e, control: n }) {
15
- const a = n?.label || e;
16
- function c() {
17
- if (!n || !n.type)
18
- return /* @__PURE__ */ o("div", { className: t.error, children: "Control type is not defined" });
19
- const l = y[n.type];
20
- return l ? /* @__PURE__ */ o(d, { fallback: /* @__PURE__ */ o("div", { className: t.loading, children: "Loading control..." }), children: /* @__PURE__ */ o(l, { control: n }) }) : /* @__PURE__ */ o("div", { children: "Unknown control type" });
21
- }
22
- return /* @__PURE__ */ i("div", { className: t.controlRendererContainer, children: [
23
- /* @__PURE__ */ i("div", { ...s(t.controlContainer, { [t.fullWidth]: b.includes(n.type) }), children: [
24
- n?.type !== "button" && /* @__PURE__ */ o("label", { className: t.label, children: a }),
25
- /* @__PURE__ */ o("div", { className: t.controlWrapper, children: c() })
26
- ] }),
27
- n?.description && /* @__PURE__ */ o("span", { className: t.description, children: n.description })
28
- ] });
29
- }
30
- const y = Object.freeze({
31
- boolean: r(() => import("./BooleanControl/index.js").then((e) => ({ default: e.BooleanControl }))),
32
- button: r(() => import("./ButtonControl/index.js").then((e) => ({ default: e.ButtonControl }))),
33
- color: r(() => import("./ColorControl/index.js").then((e) => ({ default: e.ColorControl }))),
34
- number: r(() => import("./NumberControl/index.js").then((e) => ({ default: e.NumberControl }))),
35
- select: r(() => import("./SelectControl/index.js").then((e) => ({ default: e.SelectControl }))),
36
- text: r(() => import("./TextControl/index.js").then((e) => ({ default: e.TextControl }))),
37
- buttonGroup: r(() => import("./ButtonGroupControl/index.js").then((e) => ({ default: e.ButtonGroupControl })))
1
+ import { lazy as o } from "react";
2
+ const r = Object.freeze({
3
+ boolean: o(() => import("./BooleanControl/index.js").then((t) => ({ default: t.BooleanControl }))),
4
+ button: o(() => import("./ButtonControl/index.js").then((t) => ({ default: t.ButtonControl }))),
5
+ color: o(() => import("./ColorControl/index.js").then((t) => ({ default: t.ColorControl }))),
6
+ date: o(() => import("./DateControl/index.js").then((t) => ({ default: t.DateControl }))),
7
+ number: o(() => import("./NumberControl/index.js").then((t) => ({ default: t.NumberControl }))),
8
+ range: o(() => import("./RangeControl/index.js").then((t) => ({ default: t.RangeControl }))),
9
+ select: o(() => import("./SelectControl/index.js").then((t) => ({ default: t.SelectControl }))),
10
+ separator: o(() => import("./SeparatorControl/index.js").then((t) => ({ default: t.SeparatorControl }))),
11
+ text: o(() => import("./TextControl/index.js").then((t) => ({ default: t.TextControl }))),
12
+ buttonGroup: o(() => import("./ButtonGroupControl/index.js").then((t) => ({ default: t.ButtonGroupControl })))
38
13
  });
39
14
  export {
40
- g as ControlRenderer,
41
- y as controls
15
+ r as controls
42
16
  };
@@ -2,8 +2,11 @@ import { BooleanControl } from './BooleanControl/types';
2
2
  import { ButtonControl } from './ButtonControl/types';
3
3
  import { ButtonGroupControl } from './ButtonGroupControl/types';
4
4
  import { ColorControl } from './ColorControl/types';
5
+ import { DateControl } from './DateControl/types';
5
6
  import { NumberControl } from './NumberControl/types';
7
+ import { RangeControl } from './RangeControl/types';
6
8
  import { SelectControl } from './SelectControl/types';
9
+ import { SeparatorControl } from './SeparatorControl/types';
7
10
  import { TextControl } from './TextControl/types';
8
11
  export interface BaseControl {
9
12
  label?: string;
@@ -23,6 +26,9 @@ export type Controls = {
23
26
  text: TextControl;
24
27
  button: ButtonControl;
25
28
  number: NumberControl;
29
+ range: RangeControl;
30
+ date: DateControl;
31
+ separator: SeparatorControl;
26
32
  buttonGroup: ButtonGroupControl;
27
33
  };
28
34
 
@@ -1,4 +1,4 @@
1
- import { ControlRenderer as o } from "./controls/index.js";
1
+ import { ControlRenderer as o } from "./ControlRenderer.js";
2
2
  export {
3
3
  o as ControlRenderer
4
4
  };
@@ -1,49 +1,50 @@
1
- import { jsxs as r, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
2
  import { useCallback as C } from "react";
3
- import { useDragAndDrop as _ } from "../../hooks/useDragAndDrop/useDragAndDrop.js";
4
- import { useHotkey as D } from "../../hooks/useHotkeys/useHotkey.js";
3
+ import { useDragAndDrop as w } from "../../hooks/useDragAndDrop/useDragAndDrop.js";
4
+ import { useHotkey as b } from "../../hooks/useHotkeys/useHotkey.js";
5
+ import { b as y, u as D } from "../../UIStore-CQdr4U-2.js";
5
6
  import { className as P } from "../../utils/className/className.js";
6
- import { useDevPanelVisible as g, useDevPanelCollapsed as b, useDevPanelPosition as y, useDevPanelSections as N, useDevPanelActions as K } from "../../utils/store/store.js";
7
- import { EmptyContent as k } from "../EmptyContent/EmptyContent.js";
8
- import { Section as w } from "../Section/Section.js";
9
- import '../../assets/DevPanel.css';const x = "_devPanelContainer_1rv6u_30", E = "_header_1rv6u_41", V = "_title_1rv6u_50", j = "_button_1rv6u_60", S = "_content_1rv6u_78", e = {
10
- devPanelContainer: x,
11
- header: E,
12
- title: V,
7
+ import { EmptyContent as x } from "../EmptyContent/EmptyContent.js";
8
+ import { Section as K } from "../Section/Section.js";
9
+ import '../../assets/DevPanel.css';const N = "_devPanelContainer_1vath_1", k = "_header_1vath_12", A = "_title_1vath_21", j = "_button_1vath_31", E = "_collapsed_1vath_53", H = "_content_1vath_60", t = {
10
+ devPanelContainer: N,
11
+ header: k,
12
+ title: A,
13
13
  button: j,
14
- content: S
15
- }, A = {
14
+ collapsed: E,
15
+ content: H
16
+ }, M = {
16
17
  ctrlKey: !0,
17
18
  shiftKey: !0,
18
19
  key: "a",
19
20
  altKey: !1,
20
21
  metaKey: !1
21
22
  };
22
- function F({ panelTitle: c = "Dev panel", ...u }) {
23
- const i = g(), n = b(), l = y(), d = N(), o = K(), m = C(
24
- (s) => {
25
- o.setPosition(s);
23
+ function U({ panelTitle: d = "Dev panel", ...h }) {
24
+ const { isVisible: s, isCollapsed: n, position: l, setVisible: a, setCollapsed: m, setPosition: i } = y(), p = D(), v = C(
25
+ (o) => {
26
+ i(o);
26
27
  },
27
- [o]
28
- ), { isDragging: v, elementRef: p, handleMouseDown: f } = _({
29
- onPositionChange: m
28
+ [i]
29
+ ), { isDragging: u, elementRef: f, handleMouseDown: g } = w({
30
+ onPositionChange: v
30
31
  });
31
- if (D({
32
+ if (b({
32
33
  description: "Show Dev Panel",
33
34
  preventDefault: !0,
34
- action: () => o.setVisible(!i),
35
- ...A,
36
- ...u.hotKeyConfig,
35
+ action: () => a(!s),
36
+ ...M,
37
+ ...h.hotKeyConfig,
37
38
  target: window
38
- }), process.env.NODE_ENV !== "development" || !i)
39
+ }), !s)
39
40
  return null;
40
- const a = Object.entries(d);
41
- return /* @__PURE__ */ r(
41
+ const r = Object.entries(p);
42
+ return /* @__PURE__ */ c(
42
43
  "div",
43
44
  {
44
- ref: p,
45
- ...P(e.devPanelContainer, {
46
- [e.dragging]: v
45
+ ref: f,
46
+ ...P(t.devPanelContainer, {
47
+ [t.dragging]: u
47
48
  }),
48
49
  style: {
49
50
  left: l.x,
@@ -51,16 +52,16 @@ function F({ panelTitle: c = "Dev panel", ...u }) {
51
52
  height: n ? "auto" : void 0
52
53
  },
53
54
  children: [
54
- /* @__PURE__ */ r("div", { className: e.header, onMouseDown: f, children: [
55
- /* @__PURE__ */ t("button", { className: e.button, onClick: () => o.setCollapsed(!n), title: n ? "Expand" : "Collapse", children: n ? "" : "" }),
56
- /* @__PURE__ */ t("div", { className: e.title, children: c }),
57
- /* @__PURE__ */ t("button", { className: e.button, onClick: () => o.setVisible(!1), title: "Close", children: "" })
55
+ /* @__PURE__ */ c("div", { className: t.header, onMouseDown: g, children: [
56
+ /* @__PURE__ */ e("button", { className: t.button, onClick: () => m(!n), title: n ? "Expand" : "Collapse", children: /* @__PURE__ */ e("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", className: n ? t.collapsed : void 0, children: /* @__PURE__ */ e("path", { d: "M16.843 10.211A.75.75 0 0 0 16.251 9H7.75a.75.75 0 0 0-.591 1.212l4.258 5.498a.746.746 0 0 0 1.183-.001l4.243-5.498z" }) }) }),
57
+ /* @__PURE__ */ e("div", { className: t.title, children: d }),
58
+ /* @__PURE__ */ e("button", { className: t.button, onClick: () => a(!1), title: "Close", children: /* @__PURE__ */ e("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { d: "m12 10.93 5.719-5.72a.749.749 0 1 1 1.062 1.062l-5.72 5.719 5.719 5.719a.75.75 0 1 1-1.061 1.062L12 13.053l-5.719 5.719A.75.75 0 0 1 5.22 17.71l5.719-5.719-5.72-5.719A.752.752 0 0 1 6.281 5.21z" }) }) })
58
59
  ] }),
59
- !n && /* @__PURE__ */ t("div", { className: e.content, children: a.length ? a.map(([s, h]) => /* @__PURE__ */ t(w, { sectionName: s, section: h }, `section-${s}`)) : /* @__PURE__ */ t(k, {}) })
60
+ !n && /* @__PURE__ */ e("div", { className: t.content, children: r.length ? r.map(([o, _]) => /* @__PURE__ */ e(K, { sectionName: o, section: _ }, `section-${o}`)) : /* @__PURE__ */ e(x, {}) })
60
61
  ]
61
62
  }
62
63
  );
63
64
  }
64
65
  export {
65
- F as DevPanel
66
+ U as DevPanel
66
67
  };
@@ -1,9 +1,7 @@
1
1
  import { ControlsGroup } from '../ControlRenderer/controls/types';
2
- import { HotkeyConfig, Position } from '../../types';
3
- export type DevPanelHoyKeyConfig = Pick<HotkeyConfig, "key" | "shiftKey" | "altKey" | "ctrlKey" | "metaKey">;
2
+ export type DevPanelHotkeyConfig = Pick<HotkeyConfig, "key" | "shiftKey" | "altKey" | "ctrlKey" | "metaKey">;
4
3
 
5
4
  export interface DevPanelProps {
6
- theme?: "light" | "dark";
7
5
  panelTitle?: string;
8
6
  /**
9
7
  * Hotkey configuration for toggling the DevPanel visibility.
@@ -18,7 +16,7 @@ export interface DevPanelProps {
18
16
  * }
19
17
  * ```
20
18
  */
21
- hotKeyConfig?: DevPanelHoyKeyConfig;
19
+ hotKeyConfig?: DevPanelHotkeyConfig;
22
20
  }
23
21
 
24
22
  export interface DevPanelSection {
@@ -34,6 +32,8 @@ export interface DevPanelState {
34
32
  position: Position;
35
33
  }
36
34
 
35
+ export type DevPanelUIState = Omit<DevPanelState, "sections">;
36
+
37
37
  export interface DevPanelActions {
38
38
  setVisible: (visible: boolean) => void;
39
39
  setCollapsed: (collapsed: boolean) => void;
@@ -45,3 +45,8 @@ export interface DevPanelActions {
45
45
  }
46
46
 
47
47
  export type DevPanelStore = DevPanelState & DevPanelActions;
48
+
49
+ export interface Position {
50
+ x: number;
51
+ y: number;
52
+ }
@@ -1,9 +1,9 @@
1
1
  import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import '../../assets/EmptyContent.css';const o = "_empty_1re8c_1", r = {
2
+ import '../../assets/EmptyContent.css';const o = "_empty_1xo8g_1", s = {
3
3
  empty: o
4
4
  };
5
5
  function n() {
6
- return /* @__PURE__ */ t("div", { className: r.empty, children: [
6
+ return /* @__PURE__ */ t("div", { className: s.empty, children: [
7
7
  "No controls registered yet.",
8
8
  /* @__PURE__ */ e("br", {}),
9
9
  " ",
@@ -1,9 +1,9 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import '../../assets/Input.css';const i = "_input_w2bi0_1", p = {
3
- input: i
2
+ import '../../assets/Input.css';const p = "_input_161wd_1", u = {
3
+ input: p
4
4
  };
5
5
  function s(t) {
6
- return /* @__PURE__ */ n("input", { ...t, className: p.input });
6
+ return /* @__PURE__ */ n("input", { ...t, className: u.input });
7
7
  }
8
8
  export {
9
9
  s as Input