@o/helpers 0.0.0-bootstrap.0 → 0.16.14
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/README.md +7 -0
- package/dist/assert.d.ts +5 -0
- package/dist/assert.d.ts.map +1 -0
- package/dist/assert.js +26 -0
- package/dist/assert.js.map +1 -0
- package/dist/async/abortable.d.ts +9 -0
- package/dist/async/abortable.d.ts.map +1 -0
- package/dist/async/abortable.js +45 -0
- package/dist/async/abortable.js.map +1 -0
- package/dist/async/sleep.d.ts +2 -0
- package/dist/async/sleep.d.ts.map +1 -0
- package/dist/async/sleep.js +8 -0
- package/dist/async/sleep.js.map +1 -0
- package/dist/async/useAsyncEffect.d.ts +11 -0
- package/dist/async/useAsyncEffect.d.ts.map +1 -0
- package/dist/async/useAsyncEffect.js +99 -0
- package/dist/async/useAsyncEffect.js.map +1 -0
- package/dist/browser/isActiveElementFormField.d.ts +2 -0
- package/dist/browser/isActiveElementFormField.d.ts.map +1 -0
- package/dist/browser/isActiveElementFormField.js +9 -0
- package/dist/browser/isActiveElementFormField.js.map +1 -0
- package/dist/browser/openPopup.d.ts +2 -0
- package/dist/browser/openPopup.d.ts.map +1 -0
- package/dist/browser/openPopup.js +21 -0
- package/dist/browser/openPopup.js.map +1 -0
- package/dist/constants.d.ts +9 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +22 -0
- package/dist/constants.js.map +1 -0
- package/dist/emitter.d.ts +72 -0
- package/dist/emitter.d.ts.map +1 -0
- package/dist/emitter.js +273 -0
- package/dist/emitter.js.map +1 -0
- package/dist/error/errors.d.ts +23 -0
- package/dist/error/errors.d.ts.map +1 -0
- package/dist/error/errors.js +38 -0
- package/dist/error/errors.js.map +1 -0
- package/dist/global/globalValue.d.ts +23 -0
- package/dist/global/globalValue.d.ts.map +1 -0
- package/dist/global/globalValue.js +33 -0
- package/dist/global/globalValue.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/index.native.d.ts +3 -0
- package/dist/index.native.d.ts.map +1 -0
- package/dist/index.native.js +3 -0
- package/dist/index.native.js.map +1 -0
- package/dist/object/isEqualIdentity.d.ts +2 -0
- package/dist/object/isEqualIdentity.d.ts.map +1 -0
- package/dist/object/isEqualIdentity.js +2 -0
- package/dist/object/isEqualIdentity.js.map +1 -0
- package/dist/object/isEqualNever.d.ts +2 -0
- package/dist/object/isEqualNever.d.ts.map +1 -0
- package/dist/object/isEqualNever.js +2 -0
- package/dist/object/isEqualNever.js.map +1 -0
- package/dist/platform.d.ts +23 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/platform.js +60 -0
- package/dist/platform.js.map +1 -0
- package/dist/platform.native.d.ts +25 -0
- package/dist/platform.native.d.ts.map +1 -0
- package/dist/platform.native.js +52 -0
- package/dist/platform.native.js.map +1 -0
- package/dist/react/createGlobalContext.d.ts +3 -0
- package/dist/react/createGlobalContext.d.ts.map +1 -0
- package/dist/react/createGlobalContext.js +8 -0
- package/dist/react/createGlobalContext.js.map +1 -0
- package/dist/react/getCurrentComponentStack.d.ts +2 -0
- package/dist/react/getCurrentComponentStack.d.ts.map +1 -0
- package/dist/react/getCurrentComponentStack.js +46 -0
- package/dist/react/getCurrentComponentStack.js.map +1 -0
- package/dist/shared.d.ts +17 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +16 -0
- package/dist/shared.js.map +1 -0
- package/dist/storage/createStorage.d.ts +58 -0
- package/dist/storage/createStorage.d.ts.map +1 -0
- package/dist/storage/createStorage.js +110 -0
- package/dist/storage/createStorage.js.map +1 -0
- package/dist/storage/driver.d.ts +5 -0
- package/dist/storage/driver.d.ts.map +1 -0
- package/dist/storage/driver.js +21 -0
- package/dist/storage/driver.js.map +1 -0
- package/dist/storage/types.d.ts +7 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/dist/storage/types.js +2 -0
- package/dist/storage/types.js.map +1 -0
- package/dist/string/randomId.d.ts +2 -0
- package/dist/string/randomId.d.ts.map +1 -0
- package/dist/string/randomId.js +2 -0
- package/dist/string/randomId.js.map +1 -0
- package/dist/string/slugify.d.ts +2 -0
- package/dist/string/slugify.d.ts.map +1 -0
- package/dist/string/slugify.js +7 -0
- package/dist/string/slugify.js.map +1 -0
- package/dist/time/time.d.ts +28 -0
- package/dist/time/time.d.ts.map +1 -0
- package/dist/time/time.js +21 -0
- package/dist/time/time.js.map +1 -0
- package/package.json +39 -2
package/dist/emitter.js
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { dequal } from 'dequal';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { use, useLayoutEffect, useState } from 'react';
|
|
5
|
+
import { handleAbortError } from './async/abortable.js';
|
|
6
|
+
import { DEBUG_LEVEL, EMPTY_ARRAY } from './constants.js';
|
|
7
|
+
import { AbortError } from './error/errors.js';
|
|
8
|
+
import { globalValue } from './global/globalValue.js';
|
|
9
|
+
import { createGlobalContext } from './react/createGlobalContext.js';
|
|
10
|
+
// keeps a reference to the current value easily
|
|
11
|
+
function useGet(currentValue, initialValue, forwardToFunction) {
|
|
12
|
+
const curRef = React.useRef(initialValue ?? currentValue);
|
|
13
|
+
useLayoutEffect(() => {
|
|
14
|
+
curRef.current = currentValue;
|
|
15
|
+
});
|
|
16
|
+
// oxlint-disable-next-line exhaustive-deps
|
|
17
|
+
return React.useCallback(forwardToFunction
|
|
18
|
+
? (...args) => curRef.current?.apply(null, args)
|
|
19
|
+
: () => curRef.current, [curRef, forwardToFunction]);
|
|
20
|
+
}
|
|
21
|
+
export class Emitter {
|
|
22
|
+
disposables = new Set();
|
|
23
|
+
value;
|
|
24
|
+
options;
|
|
25
|
+
constructor(value, options) {
|
|
26
|
+
this.value = value;
|
|
27
|
+
this.options = options;
|
|
28
|
+
}
|
|
29
|
+
listen = (disposable) => {
|
|
30
|
+
this.disposables.add(disposable);
|
|
31
|
+
return () => {
|
|
32
|
+
this.disposables.delete(disposable);
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
emit = (next) => {
|
|
36
|
+
if (process.env.NODE_ENV === 'development') {
|
|
37
|
+
setCache(this, next);
|
|
38
|
+
}
|
|
39
|
+
const compare = this.options?.comparator;
|
|
40
|
+
if (compare) {
|
|
41
|
+
if (this.value && compare(this.value, next)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
if (this.value === next) {
|
|
47
|
+
if (process.env.NODE_ENV === 'development') {
|
|
48
|
+
console.warn(`[emitter] ${this.options?.name} no comparator option but received same value!
|
|
49
|
+
|
|
50
|
+
this will emit the same value again, which can be desirable, but we warn to ensure it's not unintended:
|
|
51
|
+
|
|
52
|
+
- if you want this behavior, add { comparator: isEqualNever }
|
|
53
|
+
- if you want only non-equal values: { comparator: isEqualIdentity }
|
|
54
|
+
- if you want only deeply non-equal values: { comparator: isEqualDeep }`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
this.value = next;
|
|
59
|
+
if (DEBUG_LEVEL > 1) {
|
|
60
|
+
if (!this.options?.silent) {
|
|
61
|
+
const name = this.options?.name;
|
|
62
|
+
console.groupCollapsed(`📣 ${name}`);
|
|
63
|
+
console.info(next);
|
|
64
|
+
console.trace(`trace >`);
|
|
65
|
+
console.groupEnd();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
this.disposables.forEach((cb) => cb(next));
|
|
69
|
+
};
|
|
70
|
+
nextValue = () => {
|
|
71
|
+
return new Promise((res) => {
|
|
72
|
+
const dispose = this.listen((val) => {
|
|
73
|
+
dispose();
|
|
74
|
+
res(val);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
// just createEmitter but ensures it doesn't mess up on HMR
|
|
80
|
+
export function createGlobalEmitter(name, defaultValue, options) {
|
|
81
|
+
return globalValue(name, () => createEmitter(name, defaultValue, options));
|
|
82
|
+
}
|
|
83
|
+
export function createEmitter(name, defaultValue, options) {
|
|
84
|
+
const existing = createOrUpdateCache(name, defaultValue);
|
|
85
|
+
return new Emitter(existing || defaultValue, { name, ...options });
|
|
86
|
+
}
|
|
87
|
+
export const useEmitter = (emitter, cb, args) => {
|
|
88
|
+
const getCallback = useGet(cb);
|
|
89
|
+
useLayoutEffect(() => {
|
|
90
|
+
return emitter.listen((val) => {
|
|
91
|
+
try {
|
|
92
|
+
getCallback()(val);
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
handleAbortError(err);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}, [emitter, getCallback]);
|
|
99
|
+
};
|
|
100
|
+
// i think this was useSyncExternalStore but removed for concurrent rendering improvements
|
|
101
|
+
// wondering if we could just always return a deferred value? or default to it?
|
|
102
|
+
export const useEmitterValue = (emitter, options) => {
|
|
103
|
+
const disabled = options?.disable;
|
|
104
|
+
// use a function initializer to get current emitter value
|
|
105
|
+
const [state, setState] = useState(() => emitter.value);
|
|
106
|
+
useLayoutEffect(() => {
|
|
107
|
+
if (disabled)
|
|
108
|
+
return;
|
|
109
|
+
// sync immediately in case emitter changed between render and effect
|
|
110
|
+
if (emitter.value !== state) {
|
|
111
|
+
setState(emitter.value);
|
|
112
|
+
}
|
|
113
|
+
return emitter.listen(setState);
|
|
114
|
+
// intentionally omit state from deps - we only want to re-subscribe when emitter changes.
|
|
115
|
+
// including state caused unsubscribe/resubscribe churn on every change, which under a
|
|
116
|
+
// rapidly-firing emitter (better-auth session refetches during ios oauth handoff)
|
|
117
|
+
// cascades into "Maximum update depth" via consumers that depend on the returned ref.
|
|
118
|
+
// oxlint-disable-next-line exhaustive-deps
|
|
119
|
+
}, [disabled, emitter]);
|
|
120
|
+
return state;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* By default selectors run every render, as well as when emitters update. This is a change
|
|
124
|
+
* from the previous behavior where they only ran when emitters changed value.
|
|
125
|
+
*
|
|
126
|
+
* The reason for this is because emitters capture the variables in scope of the component
|
|
127
|
+
* each render already by using "useGet" by default, which makes them easier to use - you
|
|
128
|
+
* don't need to pass an args[] array except for edge cases.
|
|
129
|
+
*
|
|
130
|
+
* Before explaining why we switched to the default, understand the different uses:
|
|
131
|
+
*
|
|
132
|
+
* - Default behavior - selector is updated every render, and ran every render, as well as
|
|
133
|
+
* when emitter value changes, so you basically are always up to date.
|
|
134
|
+
*
|
|
135
|
+
* - Set an args[] array as the fourth argument - this will stop the automatic capturing
|
|
136
|
+
* and instead update selector only when you change args[] yourself. This is good for when you
|
|
137
|
+
* want explicit control over re-selection and rendering.
|
|
138
|
+
*
|
|
139
|
+
* - With { lazy: true }, the selector only runs when the emitter value changes. If used with
|
|
140
|
+
* args[], you capture the context of the selector based on args[], if not, it's based on the
|
|
141
|
+
* current render.
|
|
142
|
+
*
|
|
143
|
+
* I made this change when we had 16 usages of useEmitterSelector and 100% of them are doing very
|
|
144
|
+
* cheap calculations, so this feels like the right pattern. For the rare case of a heavy selector,
|
|
145
|
+
* you have the option to control it.
|
|
146
|
+
*
|
|
147
|
+
*/
|
|
148
|
+
export const useEmitterSelector = (emitter, selector, options, args = EMPTY_ARRAY) => {
|
|
149
|
+
const [state, setState] = useState(() => selector(emitter.value));
|
|
150
|
+
const disabled = options?.disable;
|
|
151
|
+
const getSelector = useGet(selector);
|
|
152
|
+
if (options?.lazy !== true) {
|
|
153
|
+
const next = selector(emitter.value);
|
|
154
|
+
if (next !== state) {
|
|
155
|
+
setState(next);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
useLayoutEffect(() => {
|
|
159
|
+
if (disabled)
|
|
160
|
+
return;
|
|
161
|
+
return emitter.listen((val) => {
|
|
162
|
+
try {
|
|
163
|
+
const selectorFn = args !== EMPTY_ARRAY ? selector : getSelector();
|
|
164
|
+
const next = selectorFn(val);
|
|
165
|
+
setState(next);
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
if (error instanceof AbortError) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
throw error;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
// oxlint-disable-next-line exhaustive-deps
|
|
175
|
+
}, [disabled, emitter, getSelector, ...args]);
|
|
176
|
+
return state;
|
|
177
|
+
};
|
|
178
|
+
export const useEmittersSelector = (emitters, selector, options) => {
|
|
179
|
+
const getSelector = useGet(selector);
|
|
180
|
+
const disabled = options?.disable;
|
|
181
|
+
const [state, setState] = useState(() => {
|
|
182
|
+
const values = emitters.map((e) => e.value);
|
|
183
|
+
return getSelector()(values);
|
|
184
|
+
});
|
|
185
|
+
useLayoutEffect(() => {
|
|
186
|
+
if (disabled) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const handler = () => {
|
|
190
|
+
const values = emitters.map((e) => e.value);
|
|
191
|
+
try {
|
|
192
|
+
const next = getSelector()(values);
|
|
193
|
+
setState((prev) => {
|
|
194
|
+
if (options?.isEqual?.(prev, next)) {
|
|
195
|
+
return prev;
|
|
196
|
+
}
|
|
197
|
+
if (dequal(prev, next)) {
|
|
198
|
+
return prev;
|
|
199
|
+
}
|
|
200
|
+
return next;
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
if (error instanceof AbortError) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
throw error;
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
const disposals = emitters.map((emitter) => emitter.listen(handler));
|
|
211
|
+
return () => {
|
|
212
|
+
disposals.forEach((d) => d());
|
|
213
|
+
};
|
|
214
|
+
// oxlint-disable-next-line exhaustive-deps
|
|
215
|
+
}, [disabled, getSelector, ...emitters]);
|
|
216
|
+
return state;
|
|
217
|
+
};
|
|
218
|
+
export const createUseEmitter = (emitter) => {
|
|
219
|
+
return (cb, args) => useEmitter(emitter, cb, args);
|
|
220
|
+
};
|
|
221
|
+
export const createUseSelector = (emitter) => {
|
|
222
|
+
return (selector, options, args) => {
|
|
223
|
+
return useEmitterSelector(emitter, selector, options, args);
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
export function createContextualEmitter(name, defaultValue, defaultOptions) {
|
|
227
|
+
const id = Math.random().toString(36);
|
|
228
|
+
const EmitterContext = createGlobalContext(`contextual-emitter/${id}`, null);
|
|
229
|
+
const useContextEmitter = () => {
|
|
230
|
+
const emitter = use(EmitterContext);
|
|
231
|
+
if (!emitter) {
|
|
232
|
+
throw new Error('useContextEmitter must be used within an EmitterProvider');
|
|
233
|
+
}
|
|
234
|
+
return emitter;
|
|
235
|
+
};
|
|
236
|
+
const ProvideEmitter = (props) => {
|
|
237
|
+
const { children, value, silent } = props;
|
|
238
|
+
const [emitter] = useState(() => new Emitter(value ?? defaultValue, { name, silent, ...defaultOptions }));
|
|
239
|
+
useLayoutEffect(() => {
|
|
240
|
+
if (value !== undefined && value !== emitter.value) {
|
|
241
|
+
emitter.emit(value);
|
|
242
|
+
}
|
|
243
|
+
}, [value, emitter]);
|
|
244
|
+
return _jsx(EmitterContext.Provider, { value: emitter, children: children });
|
|
245
|
+
};
|
|
246
|
+
return [useContextEmitter, ProvideEmitter];
|
|
247
|
+
}
|
|
248
|
+
const HMRCache = process.env.NODE_ENV === 'development'
|
|
249
|
+
? new Map()
|
|
250
|
+
: null;
|
|
251
|
+
function setCache(emitter, value) {
|
|
252
|
+
const name = emitter.options?.name;
|
|
253
|
+
if (!name)
|
|
254
|
+
return;
|
|
255
|
+
const cache = HMRCache?.get(name);
|
|
256
|
+
if (!cache)
|
|
257
|
+
return;
|
|
258
|
+
cache.currentValue = value;
|
|
259
|
+
}
|
|
260
|
+
function createOrUpdateCache(name, defaultValueProp) {
|
|
261
|
+
const existing = HMRCache?.get(name);
|
|
262
|
+
const defaultValue = dequal(existing?.originalDefaultValue, defaultValueProp)
|
|
263
|
+
? existing?.currentValue
|
|
264
|
+
: defaultValueProp;
|
|
265
|
+
if (!existing) {
|
|
266
|
+
HMRCache?.set(name, {
|
|
267
|
+
originalDefaultValue: defaultValueProp,
|
|
268
|
+
currentValue: defaultValue,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
return defaultValue;
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=emitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emitter.js","sourceRoot":"","sources":["../src/emitter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AAIpE,gDAAgD;AAEhD,SAAS,MAAM,CACb,YAAe,EACf,YAAkB,EAClB,iBAA2B;IAE3B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAM,YAAY,IAAI,YAAY,CAAC,CAAA;IAE9D,eAAe,CAAC,GAAG,EAAE;QACnB,MAAM,CAAC,OAAO,GAAG,YAAY,CAAA;IAC/B,CAAC,CAAC,CAAA;IAEF,2CAA2C;IAC3C,OAAO,KAAK,CAAC,WAAW,CACtB,iBAAiB;QACf,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;QAChD,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM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,MAAM,QAAQ,GAAG,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IACpC,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,oBAAoB,EAAE,gBAAgB,CAAC;QAC3E,CAAC,CAAC,QAAQ,EAAE,YAAY;QACxB,CAAC,CAAC,gBAAgB,CAAA;IAEpB,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE;YAClB,oBAAoB,EAAE,gBAAgB;YACtC,YAAY,EAAE,YAAY;SAC3B,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,YAAY,CAAA;AACrB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare class AbortError extends Error {
|
|
2
|
+
constructor(message?: string);
|
|
3
|
+
}
|
|
4
|
+
export declare class EnsureError extends Error {
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
}
|
|
7
|
+
export type ErrorCode = 'CONTENT_POLICY_VIOLATION' | 'PROFANITY_DETECTED' | 'NOT_AUTHENTICATED' | 'NOT_AUTHORIZED' | 'VALIDATION_ERROR' | 'RATE_LIMITED' | 'NOT_FOUND' | 'INTERNAL_ERROR';
|
|
8
|
+
export declare class AppError extends Error {
|
|
9
|
+
code: ErrorCode;
|
|
10
|
+
details?: Record<string, unknown>;
|
|
11
|
+
constructor(code: ErrorCode, message: string, details?: Record<string, unknown>);
|
|
12
|
+
toJSON(): {
|
|
13
|
+
code: ErrorCode;
|
|
14
|
+
message: string;
|
|
15
|
+
details: Record<string, unknown> | undefined;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare function isAppError(error: unknown): error is AppError;
|
|
19
|
+
export declare function getErrorInfo(error: unknown): {
|
|
20
|
+
code: ErrorCode;
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/error/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,UAAW,SAAQ,KAAK;gBACvB,OAAO,SAAK;CAIzB;AAED,qBAAa,WAAY,SAAQ,KAAK;gBACxB,OAAO,EAAE,MAAM;CAI5B;AAED,MAAM,MAAM,SAAS,GACjB,0BAA0B,GAC1B,oBAAoB,GACpB,mBAAmB,GACnB,gBAAgB,GAChB,kBAAkB,GAClB,cAAc,GACd,WAAW,GACX,gBAAgB,CAAA;AAEpB,qBAAa,QAAS,SAAQ,KAAK;IACjC,IAAI,EAAE,SAAS,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;gBAErB,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAO/E,MAAM,IAAI;QACR,IAAI,EAAE,SAAS,CAAA;QACf,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;KAC7C;CAGF;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAE5D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAQjF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export class AbortError extends Error {
|
|
2
|
+
constructor(message = '') {
|
|
3
|
+
super(message);
|
|
4
|
+
this.name = 'AbortError';
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class EnsureError extends Error {
|
|
8
|
+
constructor(message) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = 'EnsureError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class AppError extends Error {
|
|
14
|
+
code;
|
|
15
|
+
details;
|
|
16
|
+
constructor(code, message, details) {
|
|
17
|
+
super(message);
|
|
18
|
+
this.name = 'AppError';
|
|
19
|
+
this.code = code;
|
|
20
|
+
this.details = details;
|
|
21
|
+
}
|
|
22
|
+
toJSON() {
|
|
23
|
+
return { code: this.code, message: this.message, details: this.details };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function isAppError(error) {
|
|
27
|
+
return error instanceof AppError;
|
|
28
|
+
}
|
|
29
|
+
export function getErrorInfo(error) {
|
|
30
|
+
if (isAppError(error)) {
|
|
31
|
+
return { code: error.code, message: error.message };
|
|
32
|
+
}
|
|
33
|
+
if (error instanceof Error) {
|
|
34
|
+
return { code: 'INTERNAL_ERROR', message: error.message };
|
|
35
|
+
}
|
|
36
|
+
return { code: 'INTERNAL_ERROR', message: String(error) };
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/error/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnC,YAAY,OAAO,GAAG,EAAE;QACtB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,YAAY,CAAA;IAC1B,CAAC;CACF;AAED,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,aAAa,CAAA;IAC3B,CAAC;CACF;AAYD,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,IAAI,CAAW;IACf,OAAO,CAA0B;IAEjC,YAAY,IAAe,EAAE,OAAe,EAAE,OAAiC;QAC7E,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,UAAU,CAAA;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,MAAM;QAKJ,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAA;IAC1E,CAAC;CACF;AAED,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,KAAK,YAAY,QAAQ,CAAA;AAClC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAA;IACrD,CAAC;IACD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAA;IAC3D,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAA;AAC3D,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper to store a value that's not duplicated within the global context Uses
|
|
3
|
+
* a symbol stored on `globalThis` to achieve it.
|
|
4
|
+
*
|
|
5
|
+
* There's two main uses for this (for us, so far):
|
|
6
|
+
*
|
|
7
|
+
* - in dev mode, HMR re-runs files, but you may want to preserve globals
|
|
8
|
+
*
|
|
9
|
+
* - in published node modules, sometimes Vite or other bundlers can cause
|
|
10
|
+
* duplicate dependencies either through bad setup or heuristics, they may
|
|
11
|
+
* compile a module but then another code path doesn't compile it, so you
|
|
12
|
+
* have duplicate modules. in this case it can be good to just use a
|
|
13
|
+
* globalValue and warn the end-user. because you can't account for ever
|
|
14
|
+
* possible weird configuration, and often fixing that config can be a
|
|
15
|
+
* massive pain in the ass, it's better to retain functionality while
|
|
16
|
+
* warning them so they can fix it at their own pace. this often happens
|
|
17
|
+
* with WeakMaps.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export declare function globalValue<T>(key: string, factory: () => T, opts?: {
|
|
21
|
+
warnMessage?: string;
|
|
22
|
+
}): T;
|
|
23
|
+
//# sourceMappingURL=globalValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalValue.d.ts","sourceRoot":"","sources":["../../src/global/globalValue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,CAAC,EAChB,IAAI,CAAC,EAAE;IACL,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,GACA,CAAC,CAaH"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper to store a value that's not duplicated within the global context Uses
|
|
3
|
+
* a symbol stored on `globalThis` to achieve it.
|
|
4
|
+
*
|
|
5
|
+
* There's two main uses for this (for us, so far):
|
|
6
|
+
*
|
|
7
|
+
* - in dev mode, HMR re-runs files, but you may want to preserve globals
|
|
8
|
+
*
|
|
9
|
+
* - in published node modules, sometimes Vite or other bundlers can cause
|
|
10
|
+
* duplicate dependencies either through bad setup or heuristics, they may
|
|
11
|
+
* compile a module but then another code path doesn't compile it, so you
|
|
12
|
+
* have duplicate modules. in this case it can be good to just use a
|
|
13
|
+
* globalValue and warn the end-user. because you can't account for ever
|
|
14
|
+
* possible weird configuration, and often fixing that config can be a
|
|
15
|
+
* massive pain in the ass, it's better to retain functionality while
|
|
16
|
+
* warning them so they can fix it at their own pace. this often happens
|
|
17
|
+
* with WeakMaps.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export function globalValue(key, factory, opts) {
|
|
21
|
+
const symbolKey = Symbol.for(key);
|
|
22
|
+
const g = globalThis;
|
|
23
|
+
if (!g[symbolKey]) {
|
|
24
|
+
g[symbolKey] = factory();
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
if (opts?.warnMessage) {
|
|
28
|
+
console.warn(`[globalValue] ${opts.warnMessage}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return g[symbolKey];
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=globalValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalValue.js","sourceRoot":"","sources":["../../src/global/globalValue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,UAAU,WAAW,CACzB,GAAW,EACX,OAAgB,EAChB,IAEC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACjC,MAAM,CAAC,GAAG,UAAqC,CAAA;IAE/C,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC;QAClB,CAAC,CAAC,SAAS,CAAC,GAAG,OAAO,EAAE,CAAA;IAC1B,CAAC;SAAM,CAAC;QACN,IAAI,IAAI,EAAE,WAAW,EAAE,CAAC;YACtB,OAAO,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;QACnD,CAAC;IACH,CAAC;IAED,OAAO,CAAC,CAAC,SAAS,CAAM,CAAA;AAC1B,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEqualIdentity.d.ts","sourceRoot":"","sources":["../../src/object/isEqualIdentity.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,GAAI,GAAG,GAAG,EAAE,GAAG,GAAG,KAAG,OAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEqualIdentity.js","sourceRoot":"","sources":["../../src/object/isEqualIdentity.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAM,EAAE,CAAM,EAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEqualNever.d.ts","sourceRoot":"","sources":["../../src/object/isEqualNever.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,GAAG,GAAG,EAAE,GAAG,GAAG,YAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEqualNever.js","sourceRoot":"","sources":["../../src/object/isEqualNever.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAM,EAAE,CAAM,EAAE,EAAE,CAAC,KAAK,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
export declare const IS_WEB: boolean;
|
|
3
|
+
export declare const IS_BROWSER: boolean;
|
|
4
|
+
export declare const IS_SERVER_RUNTIME: boolean;
|
|
5
|
+
export declare const IS_SERVER: boolean;
|
|
6
|
+
export declare const IS_CLIENT: boolean;
|
|
7
|
+
export declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
8
|
+
export declare const IS_CHROME: boolean;
|
|
9
|
+
export declare const IS_WEB_TOUCHABLE: boolean;
|
|
10
|
+
export declare const IS_NATIVE_DESKTOP: boolean;
|
|
11
|
+
export declare const IS_TOUCHABLE: boolean;
|
|
12
|
+
export declare const IS_ANDROID: boolean;
|
|
13
|
+
export declare const IS_IOS: boolean;
|
|
14
|
+
export declare const SUPPORTS_DYNAMIC_COLOR_IOS: boolean;
|
|
15
|
+
export declare const IS_TV: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Reflects Platform.OS. TV platforms are intentionally NOT separate values:
|
|
18
|
+
* - Android TV has Platform.OS === 'android' (react-native-tvos behavior)
|
|
19
|
+
* - tvOS has Platform.OS === 'ios' (react-native-tvos behavior)
|
|
20
|
+
* Use `IS_TV` combined with `IS_ANDROID`/`IS_IOS` to detect specific TV platforms.
|
|
21
|
+
*/
|
|
22
|
+
export declare const CURRENT_PLATFORM: 'web' | 'ios' | 'native' | 'android';
|
|
23
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAA;AAElD,eAAO,MAAM,MAAM,EAAE,OAAc,CAAA;AAInC,eAAO,MAAM,UAAU,EAAE,OAIW,CAAA;AAEpC,eAAO,MAAM,iBAAiB,EAAE,OAK+B,CAAA;AAC/D,eAAO,MAAM,SAAS,EAAE,OAE8C,CAAA;AACtE,eAAO,MAAM,SAAS,EAAE,OAA8B,CAAA;AAEtD,eAAO,MAAM,yBAAyB,EAAE,OAAO,SAE5B,CAAA;AAEnB,eAAO,MAAM,SAAS,EAAE,OAC4D,CAAA;AAQpF,eAAO,MAAM,gBAAgB,EAAE,OAG6B,CAAA;AAE5D,eAAO,MAAM,iBAAiB,EAAE,OAAe,CAAA;AAC/C,eAAO,MAAM,YAAY,EAAE,OAAqC,CAAA;AAKhE,eAAO,MAAM,UAAU,EAAE,OAEyB,CAAA;AAClD,eAAO,MAAM,MAAM,EAAE,OAEwB,CAAA;AAC7C,eAAO,MAAM,0BAA0B,EAAE,OACgB,CAAA;AACzD,eAAO,MAAM,KAAK,EAAE,OAEyB,CAAA;AAC7C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAiB,CAAA"}
|
package/dist/platform.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// platform booleans, web/default variant.
|
|
2
|
+
// Re-implemented locally (mirrors @tamagui/constants) so @o/helpers carries no @tamagui/* runtime dep.
|
|
3
|
+
// The native values live in platform.native.ts (resolved by metro / the react-native export condition).
|
|
4
|
+
import { useEffect, useLayoutEffect } from 'react';
|
|
5
|
+
export const IS_WEB = true;
|
|
6
|
+
// RN adds fake window and document so its not simple to get this right
|
|
7
|
+
// check both navigator and location
|
|
8
|
+
export const IS_BROWSER = process.env.VITE_ENVIRONMENT === 'client' ||
|
|
9
|
+
(process.env.VITE_ENVIRONMENT !== 'ssr' &&
|
|
10
|
+
typeof navigator !== 'undefined' &&
|
|
11
|
+
typeof location !== 'undefined');
|
|
12
|
+
export const IS_SERVER_RUNTIME = process.env.VITE_ENVIRONMENT === 'ssr' ||
|
|
13
|
+
(process.env.VITE_ENVIRONMENT !== 'client' &&
|
|
14
|
+
typeof process !== 'undefined' &&
|
|
15
|
+
!!process.versions &&
|
|
16
|
+
!!(process.versions.node || process.versions.bun));
|
|
17
|
+
export const IS_SERVER = process.env.VITE_ENVIRONMENT === 'ssr' ||
|
|
18
|
+
(process.env.VITE_ENVIRONMENT !== 'client' && IS_WEB && !IS_BROWSER);
|
|
19
|
+
export const IS_CLIENT = IS_WEB && !IS_SERVER;
|
|
20
|
+
export const useIsomorphicLayoutEffect = IS_SERVER
|
|
21
|
+
? useEffect
|
|
22
|
+
: useLayoutEffect;
|
|
23
|
+
export const IS_CHROME = typeof navigator !== 'undefined' && (navigator.userAgent || '').includes('Chrome');
|
|
24
|
+
// guard the `window` access: in a web worker `navigator`/`location` exist (so
|
|
25
|
+
// IS_CLIENT is true) but `window` does NOT — touching it throws "window is not
|
|
26
|
+
// defined" and kills the worker. browser hosts can bundle @o/helpers into a
|
|
27
|
+
// project-server web worker, so the unguarded form (which @tamagui/constants
|
|
28
|
+
// also ships, but never loads in a worker) hard-crashes preview bundling.
|
|
29
|
+
// keep this typeof guard even though it diverges from @tamagui/constants.
|
|
30
|
+
export const IS_WEB_TOUCHABLE = IS_CLIENT &&
|
|
31
|
+
typeof window !== 'undefined' &&
|
|
32
|
+
('ontouchstart' in window || navigator.maxTouchPoints > 0);
|
|
33
|
+
export const IS_NATIVE_DESKTOP = false;
|
|
34
|
+
export const IS_TOUCHABLE = !IS_WEB || IS_WEB_TOUCHABLE;
|
|
35
|
+
// set :boolean to avoid inferring type to false
|
|
36
|
+
// on web, IS_ANDROID/IS_IOS are always false in production.
|
|
37
|
+
// TEST_NATIVE_PLATFORM is only set by the test runner (vitest) to simulate native
|
|
38
|
+
// environments (e.g. androidtv, tvos) from a web/jsdom test context.
|
|
39
|
+
export const IS_ANDROID = process.env.TEST_NATIVE_PLATFORM === 'android' ||
|
|
40
|
+
process.env.TEST_NATIVE_PLATFORM === 'androidtv';
|
|
41
|
+
export const IS_IOS = process.env.TEST_NATIVE_PLATFORM === 'ios' ||
|
|
42
|
+
process.env.TEST_NATIVE_PLATFORM === 'tvos';
|
|
43
|
+
export const SUPPORTS_DYNAMIC_COLOR_IOS = IS_IOS || process.env.TAMAGUI_DYNAMIC_COLOR_IOS === '1';
|
|
44
|
+
export const IS_TV = process.env.TEST_NATIVE_PLATFORM === 'androidtv' ||
|
|
45
|
+
process.env.TEST_NATIVE_PLATFORM === 'tvos';
|
|
46
|
+
/**
|
|
47
|
+
* Reflects Platform.OS. TV platforms are intentionally NOT separate values:
|
|
48
|
+
* - Android TV has Platform.OS === 'android' (react-native-tvos behavior)
|
|
49
|
+
* - tvOS has Platform.OS === 'ios' (react-native-tvos behavior)
|
|
50
|
+
* Use `IS_TV` combined with `IS_ANDROID`/`IS_IOS` to detect specific TV platforms.
|
|
51
|
+
*/
|
|
52
|
+
export const CURRENT_PLATFORM = 'web';
|
|
53
|
+
// In web source mode (Vite/webpack without pre-built dist), TAMAGUI_TARGET may not be set.
|
|
54
|
+
// Set it here so all process.env.TAMAGUI_TARGET runtime checks work correctly.
|
|
55
|
+
// In pre-built dist, the build tool inlines TAMAGUI_TARGET as a literal string,
|
|
56
|
+
// making this block dead code (if (!'web') → never executes).
|
|
57
|
+
if (!process.env.TAMAGUI_TARGET) {
|
|
58
|
+
process.env.TAMAGUI_TARGET = 'web';
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,uGAAuG;AACvG,wGAAwG;AAExG,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;AAElD,MAAM,CAAC,MAAM,MAAM,GAAY,IAAI,CAAA;AAEnC,uEAAuE;AACvE,oCAAoC;AACpC,MAAM,CAAC,MAAM,UAAU,GACrB,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,QAAQ;IACzC,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,KAAK;QACrC,OAAO,SAAS,KAAK,WAAW;QAChC,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAA;AAEpC,MAAM,CAAC,MA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MAAM,CAAC,MAAM,UAAU,GACrB,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,SAAS;IAC9C,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,WAAW,CAAA;AAClD,MAAM,CAAC,MAAM,MAAM,GACjB,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,KAAK;IAC1C,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM,CAAA;AAC7C,MAAM,CAAC,MAAM,0BAA0B,GACrC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,yBAAyB,KAAK,GAAG,CAAA;AACzD,MAAM,CAAC,MAAM,KAAK,GAChB,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,WAAW;IAChD,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM,CAAA;AAC7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAyC,KAAK,CAAA;AAE3E,2FAA2F;AAC3F,+EAA+E;AAC/E,gFAAgF;AAChF,8DAA8D;AAC9D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,KAAK,CAAA;AACpC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type useEffect } from 'react';
|
|
2
|
+
export declare const IS_WEB: boolean;
|
|
3
|
+
export declare const IS_BROWSER: boolean;
|
|
4
|
+
export declare const IS_SERVER: boolean;
|
|
5
|
+
export declare const IS_SERVER_RUNTIME: boolean;
|
|
6
|
+
export declare const IS_CLIENT: boolean;
|
|
7
|
+
export declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
8
|
+
export declare const IS_CHROME: boolean;
|
|
9
|
+
export declare const IS_WEB_TOUCHABLE: boolean;
|
|
10
|
+
export declare const IS_NATIVE_DESKTOP: boolean;
|
|
11
|
+
export declare const IS_TOUCHABLE: boolean;
|
|
12
|
+
export declare const IS_ANDROID: boolean;
|
|
13
|
+
export declare const IS_IOS: boolean;
|
|
14
|
+
export declare const SUPPORTS_DYNAMIC_COLOR_IOS: boolean;
|
|
15
|
+
export declare const IS_TV: boolean;
|
|
16
|
+
type CurrentPlatform = 'web' | 'ios' | 'native' | 'android' | 'macos' | 'windows';
|
|
17
|
+
/**
|
|
18
|
+
* Reflects Platform.OS. TV platforms are intentionally NOT separate values:
|
|
19
|
+
* - Android TV has Platform.OS === 'android' (react-native-tvos behavior)
|
|
20
|
+
* - tvOS has Platform.OS === 'ios' (react-native-tvos behavior)
|
|
21
|
+
* Use `IS_TV` combined with `IS_ANDROID`/`IS_IOS` to detect specific TV platforms.
|
|
22
|
+
*/
|
|
23
|
+
export declare const CURRENT_PLATFORM: CurrentPlatform;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=platform.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.native.d.ts","sourceRoot":"","sources":["../src/platform.native.ts"],"names":[],"mappings":"AAKA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGvD,eAAO,MAAM,MAAM,EAAE,OAAe,CAAA;AACpC,eAAO,MAAM,UAAU,EAAE,OAAe,CAAA;AACxC,eAAO,MAAM,SAAS,EAAE,OAAe,CAAA;AACvC,eAAO,MAAM,iBAAiB,EAAE,OAAe,CAAA;AAC/C,eAAO,MAAM,SAAS,EAAE,OAAc,CAAA;AACtC,eAAO,MAAM,yBAAyB,EAAE,OAAO,SAA2B,CAAA;AAC1E,eAAO,MAAM,SAAS,EAAE,OAAe,CAAA;AACvC,eAAO,MAAM,gBAAgB,EAAE,OAAe,CAAA;AAC9C,eAAO,MAAM,iBAAiB,EAAE,OACwB,CAAA;AACxD,eAAO,MAAM,YAAY,EAAE,OAA4B,CAAA;AAGvD,eAAO,MAAM,UAAU,EAAE,OAGyB,CAAA;AAElD,eAAO,MAAM,MAAM,EAAE,OAGwB,CAAA;AAC7C,eAAO,MAAM,0BAA0B,EAAE,OACgB,CAAA;AACzD,eAAO,MAAM,KAAK,EAAE,OAGyB,CAAA;AAE7C,KAAK,eAAe,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;AAUjF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,eACkC,CAAA"}
|