@telemetryos/sdk 1.7.4 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +734 -668
- package/dist/react/Settings.d.ts +20 -0
- package/dist/react/hooks/store.d.ts +14 -0
- package/dist/react/hooks/ui-scale.d.ts +6 -0
- package/dist/react/index.d.ts +2 -2
- package/dist/react.cjs +80 -12
- package/dist/react.js +377 -261
- package/package.json +3 -3
package/dist/react/Settings.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ interface SettingsBoxProps {
|
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
}
|
|
9
9
|
export declare function SettingsBox({ children }: SettingsBoxProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
interface SettingsHeadingProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function SettingsHeading({ children }: SettingsHeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
10
14
|
export declare function SettingsDivider(): import("react/jsx-runtime").JSX.Element;
|
|
11
15
|
interface SettingsFieldProps {
|
|
12
16
|
children: ReactNode;
|
|
@@ -16,6 +20,14 @@ interface SettingsLabelProps {
|
|
|
16
20
|
children: ReactNode;
|
|
17
21
|
}
|
|
18
22
|
export declare function SettingsLabel({ children }: SettingsLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
interface SettingsHintProps {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export declare function SettingsHint({ children }: SettingsHintProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
interface SettingsErrorProps {
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export declare function SettingsError({ children }: SettingsErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
19
31
|
interface SettingsInputFrameProps {
|
|
20
32
|
children: ReactNode;
|
|
21
33
|
}
|
|
@@ -32,6 +44,14 @@ interface SettingsSliderFrameProps {
|
|
|
32
44
|
children: ReactNode;
|
|
33
45
|
}
|
|
34
46
|
export declare function SettingsSliderFrame({ children }: SettingsSliderFrameProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
interface SettingsSliderRulerProps {
|
|
48
|
+
children: ReactNode;
|
|
49
|
+
}
|
|
50
|
+
export declare function SettingsSliderRuler({ children }: SettingsSliderRulerProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
interface SettingsColorFrameProps {
|
|
52
|
+
children: ReactNode;
|
|
53
|
+
}
|
|
54
|
+
export declare function SettingsColorFrame({ children }: SettingsColorFrameProps): import("react/jsx-runtime").JSX.Element;
|
|
35
55
|
interface SettingsSwitchFrameProps {
|
|
36
56
|
children: ReactNode;
|
|
37
57
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { StoreSlice } from '@telemetryos/root-sdk';
|
|
3
|
+
export declare function useStoreState<S>(storeSlice: StoreSlice, key: string, initialState: S | (() => S), debounceDelay?: number): [boolean, S, Dispatch<SetStateAction<S>>];
|
|
4
|
+
export declare function useStoreState<S = undefined>(storeSlice: StoreSlice, key: string, initialState?: undefined, debounceDelay?: number): [boolean, S | undefined, Dispatch<SetStateAction<S | undefined>>];
|
|
5
|
+
export declare function createUseStoreState<S>(key: string, initialState: S | (() => S)): (storeSlice: StoreSlice, debounceDelay?: number) => [boolean, S, Dispatch<SetStateAction<S>>];
|
|
6
|
+
export declare function createUseStoreState<S = undefined>(key: string, initialState?: undefined): (storeSlice: StoreSlice, debounceDelay?: number) => [boolean, S | undefined, Dispatch<SetStateAction<S | undefined>>];
|
|
7
|
+
export declare function createUseInstanceStoreState<S>(key: string, initialState: S | (() => S)): (debounceDelay?: number) => [boolean, S, Dispatch<SetStateAction<S>>];
|
|
8
|
+
export declare function createUseInstanceStoreState<S = undefined>(key: string, initialState?: undefined): (debounceDelay?: number) => [boolean, S | undefined, Dispatch<SetStateAction<S | undefined>>];
|
|
9
|
+
export declare function createUseApplicationStoreState<S>(key: string, initialState: S | (() => S)): (debounceDelay?: number) => [boolean, S, Dispatch<SetStateAction<S>>];
|
|
10
|
+
export declare function createUseApplicationStoreState<S = undefined>(key: string, initialState?: undefined): (debounceDelay?: number) => [boolean, S | undefined, Dispatch<SetStateAction<S | undefined>>];
|
|
11
|
+
export declare function createUseDeviceStoreState<S>(key: string, initialState: S | (() => S)): (debounceDelay?: number) => [boolean, S, Dispatch<SetStateAction<S>>];
|
|
12
|
+
export declare function createUseDeviceStoreState<S = undefined>(key: string, initialState?: undefined): (debounceDelay?: number) => [boolean, S | undefined, Dispatch<SetStateAction<S | undefined>>];
|
|
13
|
+
export declare function createUseSharedStoreState<S>(key: string, initialState: S | (() => S), namespace: string): (debounceDelay?: number) => [boolean, S, Dispatch<SetStateAction<S>>];
|
|
14
|
+
export declare function createUseSharedStoreState<S = undefined>(key: string, initialState: undefined, namespace: string): (debounceDelay?: number) => [boolean, S | undefined, Dispatch<SetStateAction<S | undefined>>];
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { SettingsBox, SettingsButtonFrame, SettingsCheckboxFrame, SettingsCheckboxLabel, SettingsContainer, SettingsDivider, SettingsField, SettingsInputFrame, SettingsLabel, SettingsRadioFrame, SettingsRadioLabel, SettingsSelectFrame, SettingsSliderFrame, SettingsSwitchFrame, SettingsSwitchLabel, SettingsTextAreaFrame, } from './Settings.js';
|
|
2
|
-
export { useStoreState, createUseStoreState } from './hooks/store.js';
|
|
1
|
+
export { SettingsBox, SettingsButtonFrame, SettingsCheckboxFrame, SettingsCheckboxLabel, SettingsColorFrame, SettingsContainer, SettingsDivider, SettingsError, SettingsField, SettingsHeading, SettingsHint, SettingsInputFrame, SettingsLabel, SettingsRadioFrame, SettingsRadioLabel, SettingsSelectFrame, SettingsSliderFrame, SettingsSliderRuler, SettingsSwitchFrame, SettingsSwitchLabel, SettingsTextAreaFrame, } from './Settings.js';
|
|
2
|
+
export { useStoreState, createUseStoreState, createUseInstanceStoreState, createUseApplicationStoreState, createUseDeviceStoreState, createUseSharedStoreState, } from './hooks/store.js';
|
|
3
3
|
export { useUiScaleToSetRem, useUiAspectRatio, useUiResponsiveFactors } from './hooks/ui-scale.js';
|
package/dist/react.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),_=require("./index.cjs");var T={exports:{}},E={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var $;function oe(){if($)return
|
|
9
|
+
*/var $;function oe(){if($)return E;$=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(o,c,f){var m=null;if(f!==void 0&&(m=""+f),c.key!==void 0&&(m=""+c.key),"key"in c){f={};for(var p in c)p!=="key"&&(f[p]=c[p])}else f=c;return c=f.ref,{$$typeof:n,type:o,key:m,ref:c!==void 0?c:null,props:f}}return E.Fragment=t,E.jsx=s,E.jsxs=s,E}var w={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var D;function
|
|
17
|
+
*/var D;function se(){return D||(D=1,process.env.NODE_ENV!=="production"&&(function(){function n(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case H:return"Profiler";case q:return"StrictMode";case Q:return"Suspense";case Z:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case V:return"Portal";case G:return e.displayName||"Context";case B:return(e._context.displayName||"Context")+".Consumer";case X:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return r=e.displayName||null,r!==null?r:n(e.type)||"Memo";case A:r=e._payload,e=e._init;try{return n(e(r))}catch{}}return null}function t(e){return""+e}function s(e){try{t(e);var r=!1}catch{r=!0}if(r){r=console;var a=r.error,u=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),t(e)}}function o(e){if(e===N)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===A)return"<...>";try{var r=n(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function c(){var e=O.A;return e===null?null:e.getOwner()}function f(){return Error("react-stack-top-frame")}function m(e){if(L.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function p(e,r){function a(){z||(z=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}function S(){var e=n(this.type);return U[e]||(U[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function j(e,r,a,u,R,P){var l=a.ref;return e={$$typeof:y,type:e,key:r,props:a,_owner:u},(l!==void 0?l:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:S}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:R}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function g(e,r,a,u,R,P){var l=r.children;if(l!==void 0)if(u)if(re(l)){for(u=0;u<l.length;u++)k(l[u]);Object.freeze&&Object.freeze(l)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else k(l);if(L.call(r,"key")){l=n(e);var x=Object.keys(r).filter(function(te){return te!=="key"});u=0<x.length?"{key: someKey, "+x.join(": ..., ")+": ...}":"{key: someKey}",M[l+u]||(x=0<x.length?"{"+x.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,
|
|
22
|
+
<%s key={someKey} {...props} />`,u,l,x,l),M[l+u]=!0)}if(l=null,a!==void 0&&(s(a),l=""+a),m(r)&&(s(r.key),l=""+r.key),"key"in r){a={};for(var F in r)F!=="key"&&(a[F]=r[F])}else a=r;return l&&p(a,typeof e=="function"?e.displayName||e.name||"Unknown":e),j(e,l,a,c(),R,P)}function k(e){b(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===A&&(e._payload.status==="fulfilled"?b(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function b(e){return typeof e=="object"&&e!==null&&e.$$typeof===y}var h=d,y=Symbol.for("react.transitional.element"),V=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),G=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),ne=Symbol.for("react.client.reference"),O=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.prototype.hasOwnProperty,re=Array.isArray,C=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(e){return e()}};var z,U={},I=h.react_stack_bottom_frame.bind(h,f)(),Y=C(o(f)),M={};w.Fragment=N,w.jsx=function(e,r,a){var u=1e4>O.recentlyCreatedOwnerStacks++;return g(e,r,a,!1,u?Error("react-stack-top-frame"):I,u?C(o(e)):Y)},w.jsxs=function(e,r,a){var u=1e4>O.recentlyCreatedOwnerStacks++;return g(e,r,a,!0,u?Error("react-stack-top-frame"):I,u?C(o(e)):Y)}})()),w}var W;function ae(){return W||(W=1,process.env.NODE_ENV==="production"?T.exports=oe():T.exports=se()),T.exports}var i=ae();const ie=`:root {
|
|
23
23
|
--background: 0 0% 100%;
|
|
24
24
|
--foreground: 222.2 84% 4.9%;
|
|
25
25
|
|
|
@@ -90,23 +90,33 @@ React keys must be passed directly to JSX without using spread:
|
|
|
90
90
|
font-family: 'Rubik', sans-serif;
|
|
91
91
|
font-feature-settings: "rlig" 1, "calt" 1;
|
|
92
92
|
flex-grow: 1;
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
gap: 16px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.settings__container>form {
|
|
99
|
+
display: contents;
|
|
93
100
|
}
|
|
94
101
|
|
|
95
102
|
.settings__box {
|
|
96
103
|
border: 1px solid hsl(var(--border));
|
|
97
104
|
border-radius: var(--radius);
|
|
98
105
|
padding: 16px;
|
|
99
|
-
|
|
106
|
+
display: flex;
|
|
107
|
+
flex-direction: column;
|
|
108
|
+
gap: 16px;
|
|
100
109
|
}
|
|
101
110
|
|
|
102
|
-
.
|
|
103
|
-
|
|
111
|
+
.settings__heading {
|
|
112
|
+
font-size: 16px;
|
|
113
|
+
font-weight: bold;
|
|
114
|
+
color: hsl(var(--foreground));
|
|
104
115
|
}
|
|
105
116
|
|
|
106
117
|
.settings__divider {
|
|
107
118
|
border: none;
|
|
108
119
|
border-top: 1px solid hsl(var(--border));
|
|
109
|
-
margin: 16px 0;
|
|
110
120
|
}
|
|
111
121
|
|
|
112
122
|
/* =============================================================================
|
|
@@ -114,16 +124,28 @@ React keys must be passed directly to JSX without using spread:
|
|
|
114
124
|
============================================================================= */
|
|
115
125
|
|
|
116
126
|
.settings__field {
|
|
117
|
-
|
|
127
|
+
display: inline-block;
|
|
118
128
|
}
|
|
119
129
|
|
|
120
130
|
.settings__label {
|
|
121
131
|
font-size: 14px;
|
|
122
132
|
margin-bottom: 6px;
|
|
123
|
-
font-weight: 500;
|
|
124
133
|
color: hsl(var(--foreground));
|
|
125
134
|
}
|
|
126
135
|
|
|
136
|
+
.settings__hint {
|
|
137
|
+
font-size: 12px;
|
|
138
|
+
opacity: 0.65;
|
|
139
|
+
margin-top: 4px;
|
|
140
|
+
color: hsl(var(--foreground));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.settings__error {
|
|
144
|
+
font-size: 12px;
|
|
145
|
+
margin-top: 4px;
|
|
146
|
+
color: #ff6b6b;
|
|
147
|
+
}
|
|
148
|
+
|
|
127
149
|
/* =============================================================================
|
|
128
150
|
Text Inputs
|
|
129
151
|
============================================================================= */
|
|
@@ -244,12 +266,54 @@ React keys must be passed directly to JSX without using spread:
|
|
|
244
266
|
}
|
|
245
267
|
|
|
246
268
|
.settings__slider-frame>span {
|
|
247
|
-
min-width:
|
|
269
|
+
min-width: 36px;
|
|
248
270
|
text-align: right;
|
|
249
271
|
font-size: 14px;
|
|
250
272
|
color: hsl(var(--muted-foreground));
|
|
251
273
|
}
|
|
252
274
|
|
|
275
|
+
.settings__slider-ruler {
|
|
276
|
+
display: flex;
|
|
277
|
+
justify-content: space-between;
|
|
278
|
+
font-size: 12px;
|
|
279
|
+
margin-top: 4px;
|
|
280
|
+
margin-left: -4px;
|
|
281
|
+
margin-right: 36px;
|
|
282
|
+
opacity: 0.65;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.settings__color-frame {
|
|
286
|
+
display: flex;
|
|
287
|
+
align-items: center;
|
|
288
|
+
gap: 8px;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.settings__color-frame>input[type="color"] {
|
|
292
|
+
appearance: none;
|
|
293
|
+
width: 40px;
|
|
294
|
+
height: 40px;
|
|
295
|
+
border: 1px solid hsl(var(--border));
|
|
296
|
+
border-radius: var(--radius);
|
|
297
|
+
padding: 0;
|
|
298
|
+
cursor: pointer;
|
|
299
|
+
flex-shrink: 0;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.settings__color-frame>input[type="color"]::-webkit-color-swatch-wrapper {
|
|
303
|
+
padding: 2px;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.settings__color-frame>input[type="color"]::-webkit-color-swatch {
|
|
307
|
+
border: none;
|
|
308
|
+
border-radius: calc(var(--radius) - 3px);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.settings__color-frame>span {
|
|
312
|
+
font-size: 14px;
|
|
313
|
+
color: hsl(var(--foreground));
|
|
314
|
+
font-family: monospace;
|
|
315
|
+
}
|
|
316
|
+
|
|
253
317
|
/* =============================================================================
|
|
254
318
|
Toggle Inputs
|
|
255
319
|
============================================================================= */
|
|
@@ -383,6 +447,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
383
447
|
Actions
|
|
384
448
|
============================================================================= */
|
|
385
449
|
|
|
450
|
+
.settings__button-frame {
|
|
451
|
+
display: contents;
|
|
452
|
+
}
|
|
453
|
+
|
|
386
454
|
.settings__button-frame>button {
|
|
387
455
|
padding: 8px 16px;
|
|
388
456
|
background: hsl(var(--background));
|
|
@@ -404,4 +472,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
404
472
|
border-color: hsl(var(--primary));
|
|
405
473
|
color: hsl(var(--primary-foreground));
|
|
406
474
|
}
|
|
407
|
-
`;let
|
|
475
|
+
`;let J=!1;function ce(){if(J||typeof document>"u")return;const n=document.createElement("style");n.setAttribute("data-telemetryos-sdk",""),n.textContent=ie,document.head.appendChild(n),J=!0}ce();function ue({children:n}){const t=()=>{const s=window.matchMedia("(prefers-color-scheme: dark)"),o=m=>{let p;m==="system"?p=s.matches:p=m!=="light",p?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},c=_.environment().subscribeColorScheme(o);c.catch(console.error);const f=()=>{_.environment().getColorScheme().then(o).catch(console.error)};return s.addEventListener("change",f),()=>{c.then(()=>_.environment().unsubscribeColorScheme(o)).catch(console.error),s.removeEventListener("change",f)}};return d.useEffect(t,[]),i.jsx("div",{className:"settings__container",children:n})}function le({children:n}){return i.jsx("div",{className:"settings__box",children:n})}function de({children:n}){return i.jsx("div",{className:"settings__heading",children:n})}function fe(){return i.jsx("hr",{className:"settings__divider"})}function pe({children:n}){return i.jsx("label",{className:"settings__field",children:n})}function ge({children:n}){return i.jsx("div",{className:"settings__label",children:n})}function me({children:n}){return i.jsx("div",{className:"settings__hint",children:n})}function be({children:n}){return i.jsx("div",{className:"settings__error",children:n})}function he({children:n}){return i.jsx("div",{className:"settings__input-frame",children:n})}function _e({children:n}){return i.jsx("div",{className:"settings__textarea-frame",children:n})}function xe({children:n}){return i.jsx("div",{className:"settings__select-frame",children:n})}function ve({children:n}){return i.jsx("div",{className:"settings__slider-frame",children:n})}function Se({children:n}){return i.jsx("div",{className:"settings__slider-ruler",children:n})}function ke({children:n}){return i.jsx("div",{className:"settings__color-frame",children:n})}function ye({children:n}){return i.jsx("label",{className:"settings__switch-frame",children:n})}function Ee({children:n}){return i.jsx("span",{className:"settings__switch-label",children:n})}function we({children:n}){return i.jsx("label",{className:"settings__checkbox-frame",children:n})}function Re({children:n}){return i.jsx("span",{className:"settings__checkbox-label",children:n})}function Te({children:n}){return i.jsx("label",{className:"settings__radio-frame",children:n})}function je({children:n}){return i.jsx("span",{className:"settings__radio-label",children:n})}function Ne({children:n}){return i.jsx("div",{className:"settings__button-frame",children:n})}function v(n,t,s,o=0){var c;const[f,m]=d.useState(!0),[p]=d.useState(s),[S,j]=d.useState(void 0),[g,k]=d.useState(void 0);return d.useEffect(()=>{const b=h=>{j(y=>JSON.stringify(y)===JSON.stringify(h)?y:h),m(!1)};return n.subscribe(t,b).catch(console.error),()=>{n.unsubscribe(t,b).catch(console.error)}},[n,t]),d.useEffect(()=>{if(typeof g<"u"){const b=setTimeout(()=>{n.set(t,g)},o);return()=>clearTimeout(b)}},[g,n,t,o]),d.useEffect(()=>{if(JSON.stringify(g)===JSON.stringify(S)){const b=setTimeout(()=>{k(void 0)},500);return()=>clearTimeout(b)}},[g,S]),[f,(c=g??S)!==null&&c!==void 0?c:p,k]}function Ae(n,t){return(s,o=0)=>v(s,n,t,o)}function Oe(n,t){return(s=0)=>{const o=d.useMemo(()=>_.store().instance,[]);return v(o,n,t,s)}}function Ce(n,t){return(s=0)=>{const o=d.useMemo(()=>_.store().application,[]);return v(o,n,t,s)}}function Pe(n,t){return(s=0)=>{const o=d.useMemo(()=>_.store().device,[]);return v(o,n,t,s)}}function Fe(n,t,s){return(o=0)=>{const c=d.useMemo(()=>_.store().shared(s),[]);return v(c,n,t,o)}}function Le(n){const t=()=>{document.documentElement.style.fontSize=`calc(1vmax * ${n})`};d.useEffect(t,[n])}function ze(){const[n,t]=d.useState(()=>window.innerWidth/window.innerHeight),s=()=>{const o=()=>{t(window.innerWidth/window.innerHeight)};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)};return d.useEffect(s,[]),n}function Ue(n,t){return{uiWidthFactor:Math.min(t,1)/n,uiHeightFactor:Math.max(t,1)/n}}exports.SettingsBox=le;exports.SettingsButtonFrame=Ne;exports.SettingsCheckboxFrame=we;exports.SettingsCheckboxLabel=Re;exports.SettingsColorFrame=ke;exports.SettingsContainer=ue;exports.SettingsDivider=fe;exports.SettingsError=be;exports.SettingsField=pe;exports.SettingsHeading=de;exports.SettingsHint=me;exports.SettingsInputFrame=he;exports.SettingsLabel=ge;exports.SettingsRadioFrame=Te;exports.SettingsRadioLabel=je;exports.SettingsSelectFrame=xe;exports.SettingsSliderFrame=ve;exports.SettingsSliderRuler=Se;exports.SettingsSwitchFrame=ye;exports.SettingsSwitchLabel=Ee;exports.SettingsTextAreaFrame=_e;exports.createUseApplicationStoreState=Ce;exports.createUseDeviceStoreState=Pe;exports.createUseInstanceStoreState=Oe;exports.createUseSharedStoreState=Fe;exports.createUseStoreState=Ae;exports.useStoreState=v;exports.useUiAspectRatio=ze;exports.useUiResponsiveFactors=Ue;exports.useUiScaleToSetRem=Le;
|