@telemetryos/sdk 1.7.0 → 1.7.2
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 +16 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/react/Settings.d.ts +17 -4
- package/dist/react/index.d.ts +1 -1
- package/dist/react.cjs +135 -21
- package/dist/react.js +319 -189
- package/package.json +2 -2
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 m=require("react"),C=require("./index.cjs");var E={exports:{}},k={};/**
|
|
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 D;function oe(){if(D)return k;D=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function
|
|
9
|
+
*/var D;function oe(){if(D)return k;D=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function l(d,s,u){var f=null;if(u!==void 0&&(f=""+u),s.key!==void 0&&(f=""+s.key),"key"in s){u={};for(var b in s)b!=="key"&&(u[b]=s[b])}else u=s;return s=u.ref,{$$typeof:n,type:d,key:f,ref:s!==void 0?s:null,props:u}}return k.Fragment=i,k.jsx=l,k.jsxs=l,k}var S={};/**
|
|
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 M;function ae(){return M||(M=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
|
|
17
|
+
*/var M;function ae(){return M||(M=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 R:return"Fragment";case B:return"Profiler";case J: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 q:return"Portal";case X:return e.displayName||"Context";case G:return(e._context.displayName||"Context")+".Consumer";case H: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 T:r=e._payload,e=e._init;try{return n(e(r))}catch{}}return null}function i(e){return""+e}function l(e){try{i(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,o=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),i(e)}}function d(e){if(e===R)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===T)return"<...>";try{var r=n(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function s(){var e=j.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function f(e){if(F.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function b(e,r){function t(){L||(L=!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))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function x(){var e=n(this.type);return I[e]||(I[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 w(e,r,t,o,y,A){var a=t.ref;return e={$$typeof:P,type:e,key:r,props:t,_owner:o},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:x}):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:y}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function p(e,r,t,o,y,A){var a=r.children;if(a!==void 0)if(o)if(re(a)){for(o=0;o<a.length;o++)v(a[o]);Object.freeze&&Object.freeze(a)}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 v(a);if(F.call(r,"key")){a=n(e);var _=Object.keys(r).filter(function(te){return te!=="key"});o=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",$[a+o]||(_=0<_.length?"{"+_.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} />`,o,a,_,a)
|
|
22
|
+
<%s key={someKey} {...props} />`,o,a,_,a),$[a+o]=!0)}if(a=null,t!==void 0&&(l(t),a=""+t),f(r)&&(l(r.key),a=""+r.key),"key"in r){t={};for(var O in r)O!=="key"&&(t[O]=r[O])}else t=r;return a&&b(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),w(e,a,t,s(),y,A)}function v(e){g(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===T&&(e._payload.status==="fulfilled"?g(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function g(e){return typeof e=="object"&&e!==null&&e.$$typeof===P}var h=m,P=Symbol.for("react.transitional.element"),q=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),J=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),X=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),ne=Symbol.for("react.client.reference"),j=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,re=Array.isArray,N=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(e){return e()}};var L,I={},Y=h.react_stack_bottom_frame.bind(h,u)(),z=N(d(u)),$={};S.Fragment=R,S.jsx=function(e,r,t){var o=1e4>j.recentlyCreatedOwnerStacks++;return p(e,r,t,!1,o?Error("react-stack-top-frame"):Y,o?N(d(e)):z)},S.jsxs=function(e,r,t){var o=1e4>j.recentlyCreatedOwnerStacks++;return p(e,r,t,!0,o?Error("react-stack-top-frame"):Y,o?N(d(e)):z)}})()),S}var V;function se(){return V||(V=1,process.env.NODE_ENV==="production"?E.exports=oe():E.exports=ae()),E.exports}var c=se();const ie=`:root {
|
|
23
23
|
--background: 0 0% 100%;
|
|
24
24
|
--foreground: 222.2 84% 4.9%;
|
|
25
25
|
|
|
@@ -79,14 +79,40 @@ React keys must be passed directly to JSX without using spread:
|
|
|
79
79
|
--radius: 0.5rem;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
/* =============================================================================
|
|
83
|
+
Container & Layout
|
|
84
|
+
============================================================================= */
|
|
85
|
+
|
|
82
86
|
.settings__container {
|
|
83
87
|
padding: 16px;
|
|
84
88
|
background: hsl(var(--background));
|
|
85
89
|
color: hsl(var(--foreground));
|
|
86
90
|
font-family: 'Rubik', sans-serif;
|
|
87
91
|
font-feature-settings: "rlig" 1, "calt" 1;
|
|
92
|
+
flex-grow: 1;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.settings__box {
|
|
96
|
+
border: 1px solid hsl(var(--border));
|
|
97
|
+
border-radius: var(--radius);
|
|
98
|
+
padding: 16px;
|
|
99
|
+
margin-bottom: 16px;
|
|
88
100
|
}
|
|
89
101
|
|
|
102
|
+
.settings__box:last-child {
|
|
103
|
+
margin-bottom: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.settings__divider {
|
|
107
|
+
border: none;
|
|
108
|
+
border-top: 1px solid hsl(var(--border));
|
|
109
|
+
margin: 16px 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* =============================================================================
|
|
113
|
+
Field Structure
|
|
114
|
+
============================================================================= */
|
|
115
|
+
|
|
90
116
|
.settings__field {
|
|
91
117
|
margin-bottom: 24px;
|
|
92
118
|
}
|
|
@@ -98,6 +124,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
98
124
|
color: hsl(var(--foreground));
|
|
99
125
|
}
|
|
100
126
|
|
|
127
|
+
/* =============================================================================
|
|
128
|
+
Text Inputs
|
|
129
|
+
============================================================================= */
|
|
130
|
+
|
|
101
131
|
.settings__input-frame > * {
|
|
102
132
|
height: 40px;
|
|
103
133
|
width: 100%;
|
|
@@ -119,6 +149,34 @@ React keys must be passed directly to JSX without using spread:
|
|
|
119
149
|
opacity: 1;
|
|
120
150
|
}
|
|
121
151
|
|
|
152
|
+
.settings__textarea-frame > textarea {
|
|
153
|
+
width: 100%;
|
|
154
|
+
min-height: 80px;
|
|
155
|
+
font-family: inherit;
|
|
156
|
+
font-size: 14px;
|
|
157
|
+
line-height: 1.4em;
|
|
158
|
+
padding: 8px 12px;
|
|
159
|
+
border: 1px solid hsl(var(--border));
|
|
160
|
+
border-radius: var(--radius);
|
|
161
|
+
background: hsl(var(--background));
|
|
162
|
+
color: hsl(var(--foreground));
|
|
163
|
+
resize: vertical;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.settings__textarea-frame > textarea:focus {
|
|
167
|
+
outline: 1px solid hsl(var(--primary));
|
|
168
|
+
outline-offset: 0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.settings__textarea-frame > textarea::placeholder {
|
|
172
|
+
color: hsl(var(--muted-foreground));
|
|
173
|
+
opacity: 1;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* =============================================================================
|
|
177
|
+
Selection Inputs
|
|
178
|
+
============================================================================= */
|
|
179
|
+
|
|
122
180
|
.settings__select-frame > select {
|
|
123
181
|
appearance: none;
|
|
124
182
|
height: 40px;
|
|
@@ -144,30 +202,59 @@ React keys must be passed directly to JSX without using spread:
|
|
|
144
202
|
outline-offset: 0;
|
|
145
203
|
}
|
|
146
204
|
|
|
147
|
-
.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
205
|
+
.settings__slider-frame {
|
|
206
|
+
display: flex;
|
|
207
|
+
align-items: center;
|
|
208
|
+
gap: 8px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.settings__slider-frame > input[type="range"] {
|
|
212
|
+
flex: 1;
|
|
213
|
+
height: 8px;
|
|
214
|
+
background: hsl(var(--secondary));
|
|
215
|
+
border-radius: 9999px;
|
|
216
|
+
outline: none;
|
|
217
|
+
-webkit-appearance: none;
|
|
218
|
+
appearance: none;
|
|
219
|
+
transition: background 0.15s;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.settings__slider-frame > input[type="range"]:focus,
|
|
223
|
+
.settings__slider-frame > input[type="range"]:active {
|
|
224
|
+
background: hsl(var(--primary));
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.settings__slider-frame > input[type="range"]::-webkit-slider-thumb {
|
|
228
|
+
-webkit-appearance: none;
|
|
229
|
+
appearance: none;
|
|
230
|
+
width: 20px;
|
|
231
|
+
height: 20px;
|
|
156
232
|
background: hsl(var(--background));
|
|
157
|
-
|
|
158
|
-
|
|
233
|
+
border: 2px solid hsl(var(--primary));
|
|
234
|
+
border-radius: 50%;
|
|
235
|
+
cursor: pointer;
|
|
159
236
|
}
|
|
160
237
|
|
|
161
|
-
.
|
|
162
|
-
|
|
163
|
-
|
|
238
|
+
.settings__slider-frame > input[type="range"]::-moz-range-thumb {
|
|
239
|
+
width: 20px;
|
|
240
|
+
height: 20px;
|
|
241
|
+
background: hsl(var(--background));
|
|
242
|
+
border: 2px solid hsl(var(--primary));
|
|
243
|
+
border-radius: 50%;
|
|
244
|
+
cursor: pointer;
|
|
164
245
|
}
|
|
165
246
|
|
|
166
|
-
.
|
|
247
|
+
.settings__slider-frame > span {
|
|
248
|
+
min-width: 4ch;
|
|
249
|
+
text-align: right;
|
|
250
|
+
font-size: 14px;
|
|
167
251
|
color: hsl(var(--muted-foreground));
|
|
168
|
-
opacity: 1;
|
|
169
252
|
}
|
|
170
253
|
|
|
254
|
+
/* =============================================================================
|
|
255
|
+
Toggle Inputs
|
|
256
|
+
============================================================================= */
|
|
257
|
+
|
|
171
258
|
.settings__switch-frame {
|
|
172
259
|
display: flex;
|
|
173
260
|
align-items: center;
|
|
@@ -292,4 +379,31 @@ React keys must be passed directly to JSX without using spread:
|
|
|
292
379
|
flex: 1;
|
|
293
380
|
color: hsl(var(--foreground));
|
|
294
381
|
}
|
|
295
|
-
|
|
382
|
+
|
|
383
|
+
/* =============================================================================
|
|
384
|
+
Actions
|
|
385
|
+
============================================================================= */
|
|
386
|
+
|
|
387
|
+
.settings__button-frame > button {
|
|
388
|
+
padding: 8px 16px;
|
|
389
|
+
background: hsl(var(--background));
|
|
390
|
+
border: 1px solid hsl(var(--border));
|
|
391
|
+
border-radius: var(--radius);
|
|
392
|
+
color: hsl(var(--foreground));
|
|
393
|
+
font-size: 14px;
|
|
394
|
+
font-family: inherit;
|
|
395
|
+
cursor: pointer;
|
|
396
|
+
transition: background-color 0.15s, border-color 0.15s;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.settings__button-frame > button:hover {
|
|
400
|
+
background: hsl(var(--accent));
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.settings__button-frame > button.active,
|
|
404
|
+
.settings__button-frame > button[data-active="true"] {
|
|
405
|
+
background: hsl(var(--primary));
|
|
406
|
+
border-color: hsl(var(--primary));
|
|
407
|
+
color: hsl(var(--primary-foreground));
|
|
408
|
+
}
|
|
409
|
+
`;let U=!1;function ce(){if(U||typeof document>"u")return;const n=document.createElement("style");n.setAttribute("data-telemetryos-sdk",""),n.textContent=ie,document.head.appendChild(n),U=!0}ce();function ue({children:n}){return m.useEffect(()=>{const i=window.matchMedia("(prefers-color-scheme: dark)"),l=u=>{let f;u==="system"?f=i.matches:f=u!=="light",f?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},d=C.environment().subscribeColorScheme(l);d.catch(console.error);const s=()=>{C.environment().getColorScheme().then(l).catch(console.error)};return i.addEventListener("change",s),()=>{d.then(()=>C.environment().unsubscribeColorScheme(l)).catch(console.error),i.removeEventListener("change",s)}},[]),c.jsx("div",{className:"settings__container",children:n})}function le({children:n}){return c.jsx("div",{className:"settings__box",children:n})}function de(){return c.jsx("hr",{className:"settings__divider"})}function fe({children:n}){return c.jsx("div",{className:"settings__field",children:n})}function pe({children:n}){return c.jsx("div",{className:"settings__label",children:n})}function ge({children:n}){return c.jsx("div",{className:"settings__input-frame",children:n})}function me({children:n}){return c.jsx("div",{className:"settings__textarea-frame",children:n})}function be({children:n}){return c.jsx("div",{className:"settings__select-frame",children:n})}function he({children:n}){return c.jsx("div",{className:"settings__slider-frame",children:n})}function _e({children:n}){return c.jsx("label",{className:"settings__switch-frame",children:n})}function xe({children:n}){return c.jsx("span",{className:"settings__switch-label",children:n})}function ve({children:n}){return c.jsx("label",{className:"settings__checkbox-frame",children:n})}function ke({children:n}){return c.jsx("span",{className:"settings__checkbox-label",children:n})}function Se({children:n}){return c.jsx("label",{className:"settings__radio-frame",children:n})}function ye({children:n}){return c.jsx("span",{className:"settings__radio-label",children:n})}function Ee({children:n}){return c.jsx("div",{className:"settings__button-frame",children:n})}function W(n,i,l,d=0){var s;const[u,f]=m.useState(!0),[b]=m.useState(l),[x,w]=m.useState(void 0),[p,v]=m.useState(void 0);return m.useEffect(()=>{const g=h=>{w(h),f(!1)};return n.subscribe(i,g).catch(console.error),()=>{n.unsubscribe(i,g).catch(console.error)}},[n,i]),m.useEffect(()=>{if(typeof p<"u"){const g=setTimeout(()=>{n.set(i,p)},d);return()=>clearTimeout(g)}},[p,n,i,d]),m.useEffect(()=>{if(JSON.stringify(p)===JSON.stringify(x)){const g=setTimeout(()=>{v(void 0)},500);return()=>clearTimeout(g)}},[p,x]),[u,(s=p??x)!==null&&s!==void 0?s:b,v]}function we(n,i){return(l,d=0)=>W(l,n,i,d)}exports.SettingsBox=le;exports.SettingsButtonFrame=Ee;exports.SettingsCheckboxFrame=ve;exports.SettingsCheckboxLabel=ke;exports.SettingsContainer=ue;exports.SettingsDivider=de;exports.SettingsField=fe;exports.SettingsInputFrame=ge;exports.SettingsLabel=pe;exports.SettingsRadioFrame=Se;exports.SettingsRadioLabel=ye;exports.SettingsSelectFrame=be;exports.SettingsSliderFrame=he;exports.SettingsSwitchFrame=_e;exports.SettingsSwitchLabel=xe;exports.SettingsTextAreaFrame=me;exports.createUseStoreState=we;exports.useStoreState=W;
|