@buoy-gg/shared-ui 7.0.68 → 7.0.70
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/lib/commonjs/clipboard/clipboard-impl.web.js +1 -1
- package/lib/commonjs/ui/components/ToolFooter.js +1 -1
- package/lib/commonjs/utils/realAppState.js +1 -1
- package/lib/module/clipboard/clipboard-impl.web.js +1 -1
- package/lib/module/ui/components/ToolFooter.js +1 -1
- package/lib/module/utils/realAppState.js +1 -1
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/ToolFooter.d.ts +2 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/ui/components/ToolFooter.d.ts +2 -1
- package/lib/web/chunks/{chunk-HPZXETRA.mjs → chunk-7CBB7NEY.mjs} +1 -1
- package/lib/web/chunks/{chunk-GER55P4B.mjs → chunk-G27JNYZ3.mjs} +1 -1
- package/lib/web/chunks/chunk-RMLVR5LI.mjs +1 -0
- package/lib/web/chunks/chunk-UQRRKDKX.mjs +6 -0
- package/lib/web/dataViewer.mjs +1 -1
- package/lib/web/hooks.mjs +1 -1
- package/lib/web/index.mjs +1 -1
- package/lib/web/ui.mjs +1 -1
- package/lib/web/utils.mjs +1 -1
- package/package.json +5 -5
- package/lib/web/chunks/chunk-P32XO2YS.mjs +0 -1
- package/lib/web/chunks/chunk-ZTIJC3VV.mjs +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.isClipboardAvailable=exports.clipboardType=exports.clipboardFunction=void 0;const isClipboardAvailable=()=>typeof navigator!=="undefined"&&typeof navigator.clipboard?.writeText==="function";exports.isClipboardAvailable=isClipboardAvailable;const clipboardType=()=>isClipboardAvailable()?"web":null;exports.clipboardType=clipboardType;const clipboardFunction=async
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.isClipboardAvailable=exports.clipboardType=exports.clipboardFunction=void 0;function capacitorClipboard(){const i=globalThis.Capacitor;const t=i?.isNativePlatform?.()?i.Plugins?.Clipboard:void 0;return t&&typeof t.write==="function"?t:null}const isClipboardAvailable=()=>capacitorClipboard()!==null||typeof navigator!=="undefined"&&typeof navigator.clipboard?.writeText==="function";exports.isClipboardAvailable=isClipboardAvailable;const clipboardType=()=>isClipboardAvailable()?"web":null;exports.clipboardType=clipboardType;const clipboardFunction=async i=>{try{const t=capacitorClipboard();if(t){await t.write({string:i});return true}if(!isClipboardAvailable())return false;await navigator.clipboard.writeText(i);return true}catch{return false}};exports.clipboardFunction=clipboardFunction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FooterButton=FooterButton;exports.FooterCaption=FooterCaption;exports.FooterMessage=FooterMessage;exports.FooterRow=FooterRow;exports.ToolFooter=ToolFooter;var _reactNative=require("react-native");var _nightTheme=require("../night/nightTheme.js");var _useSafeAreaInsets=require("../../hooks/useSafeAreaInsets");var _fonts=require("../fonts.js");var _jsxRuntime=require("react/jsx-runtime");function ToolFooter({children:o,safeArea:t=true,paddingBottom:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FooterButton=FooterButton;exports.FooterCaption=FooterCaption;exports.FooterMessage=FooterMessage;exports.FooterRow=FooterRow;exports.ToolFooter=ToolFooter;var _reactNative=require("react-native");var _nightTheme=require("../night/nightTheme.js");var _useSafeAreaInsets=require("../../hooks/useSafeAreaInsets");var _fonts=require("../fonts.js");var _jsxRuntime=require("react/jsx-runtime");function ToolFooter({children:o,safeArea:t=true,paddingBottom:n=12,floating:e=false,absolute:r=false,gap:c=8,style:l,testID:i}){const s=(0,_useSafeAreaInsets.useSafeAreaInsets)();const a=typeof t==="number"?t+s.bottom:t?n+s.bottom:n;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.footer,e&&styles.footerFloating,r&&styles.footerAbsolute,{paddingBottom:a,gap:c},l],testID:i,children:o})}function FooterRow({children:o,style:t}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.row,t],children:o})}function FooterCaption({children:o,style:t}){return(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.caption,t],numberOfLines:1,children:o})}function FooterMessage({children:o,tone:t="info",style:n,testID:e}){return(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:e,style:[styles.message,t==="muted"&&styles.messageMuted,n],numberOfLines:1,children:o})}function FooterButton({label:o,onPress:t,accent:n=false,active:e=false,disabled:r=false,icon:c,flex:l=true,size:i="sm",testID:s,accessibilityLabel:a,style:u}){return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{onPress:t,disabled:r,activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:a??o,accessibilityState:{disabled:r,selected:e},testID:s,style:[styles.button,l?styles.buttonFlex:styles.buttonFixed,i==="md"&&styles.buttonMd,e&&styles.buttonActive,r&&styles.disabled,u],children:[c,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.buttonText,i==="md"&&styles.buttonTextMd,n&&!r&&styles.buttonTextAccent,e&&styles.buttonTextActive,r&&styles.buttonTextDisabled],children:o})]})}const styles=_reactNative.StyleSheet.create({footer:{paddingHorizontal:12,paddingTop:10,backgroundColor:"rgba(5, 5, 5, 0.92)",borderTopWidth:1,borderTopColor:_nightTheme.night.color.border},footerFloating:{borderBottomLeftRadius:14,borderBottomRightRadius:14},footerAbsolute:{position:"absolute",left:0,right:0,bottom:0},row:{flexDirection:"row",alignItems:"center",gap:6},caption:{color:_nightTheme.night.color.textTertiary,fontSize:9,fontWeight:"700",letterSpacing:.8},message:{color:_nightTheme.night.color.info,fontSize:10,fontFamily:_fonts.monoFont},messageMuted:{color:_nightTheme.night.color.textTertiary,fontFamily:void 0},button:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6,paddingVertical:8,paddingHorizontal:0,borderRadius:6,backgroundColor:_nightTheme.night.color.button,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_nightTheme.night.color.border},buttonFlex:{flex:1},buttonFixed:{paddingHorizontal:10},buttonMd:{paddingVertical:8},buttonActive:{backgroundColor:_nightTheme.night.color.accentSoft,borderColor:_nightTheme.night.color.accentBorderStrong},buttonText:{fontSize:10,fontWeight:"600",color:_nightTheme.night.color.textSecondary,fontFamily:_fonts.monoFont,textTransform:"uppercase"},buttonTextMd:{fontSize:11,color:_nightTheme.night.color.text},buttonTextAccent:{color:_nightTheme.night.color.warning},buttonTextActive:{color:_nightTheme.night.color.accent},buttonTextDisabled:{color:_nightTheme.night.color.textTertiary},disabled:{opacity:.4}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.BUOY_SYNTHETIC_MARK=void 0;exports.countBuoyListener=countBuoyListener;exports.getRealAppState=getRealAppState;exports.subscribeRealAppState=subscribeRealAppState;var _reactNative=require("react-native");const BUOY_SYNTHETIC_MARK=exports.BUOY_SYNTHETIC_MARK="__buoySynthetic";function countBuoyListener(t,e){const n=globalThis;const r=n.__buoyOwnDeviceListeners??={};r[t]=Math.max(0,(r[t]??0)+e)}const listeners=new Set;let current="unknown";let started=false;function webDocument(){const t=globalThis.document;return t&&typeof t.addEventListener==="function"?t:null}function realWebState(){try{const t=webDocument();const e=globalThis.Document?.prototype;const n=e&&Object.getOwnPropertyDescriptor(e,"visibilityState")?.get;if(!t||!n)return null;return n.call(t)==="visible"?"active":"background"}catch{return null}}function readInitial(){if(_reactNative.Platform.OS==="web"){const t=realWebState();if(t)return t}try{return _reactNative.AppState?.currentState??"unknown"}catch{return"unknown"}}function set(t){if(t===current)return;current=t;for(const e of Array.from(listeners)){try{e(t)}catch{}}}function start(){if(started)return;started=true;current=readInitial();try{if(_reactNative.Platform.OS==="web"){const t=webDocument();if(t&&realWebState()){t.addEventListener("visibilitychange",
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.BUOY_SYNTHETIC_MARK=void 0;exports.countBuoyListener=countBuoyListener;exports.getRealAppState=getRealAppState;exports.subscribeRealAppState=subscribeRealAppState;var _reactNative=require("react-native");const BUOY_SYNTHETIC_MARK=exports.BUOY_SYNTHETIC_MARK="__buoySynthetic";function countBuoyListener(t,e){const n=globalThis;const r=n.__buoyOwnDeviceListeners??={};r[t]=Math.max(0,(r[t]??0)+e)}const listeners=new Set;let current="unknown";let started=false;function webDocument(){const t=globalThis.document;return t&&typeof t.addEventListener==="function"?t:null}function realWebState(){try{const t=webDocument();const e=globalThis.Document?.prototype;const n=e&&Object.getOwnPropertyDescriptor(e,"visibilityState")?.get;if(!t||!n)return null;return n.call(t)==="visible"?"active":"background"}catch{return null}}function readInitial(){if(_reactNative.Platform.OS==="web"){const t=realWebState();if(t)return t}try{return _reactNative.AppState?.currentState??"unknown"}catch{return"unknown"}}function set(t){if(t===current)return;current=t;for(const e of Array.from(listeners)){try{e(t)}catch{}}}function start(){if(started)return;started=true;current=readInitial();try{if(_reactNative.Platform.OS==="web"){const t=webDocument();if(t&&realWebState()){t.addEventListener("visibilitychange",n=>{if(n?.[BUOY_SYNTHETIC_MARK])return;const r=realWebState();if(r)set(r)});const e=n=>r=>{if(r?.[BUOY_SYNTHETIC_MARK])return;set(n)};t.addEventListener("pause",e("background"));t.addEventListener("resume",e("active"));return}_reactNative.AppState.addEventListener("change",e=>set(e));return}countBuoyListener("appStateDidChange",1);_reactNative.DeviceEventEmitter.addListener("appStateDidChange",t=>{if(!t||t[BUOY_SYNTHETIC_MARK])return;if(t.app_state)set(t.app_state)})}catch{}}function getRealAppState(){start();if(current==="unknown")current=readInitial();return current}function subscribeRealAppState(t){start();listeners.add(t);return{remove:()=>listeners.delete(t)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export const isClipboardAvailable=()=>typeof navigator!=="undefined"&&typeof navigator.clipboard?.writeText==="function";export const clipboardType=()=>isClipboardAvailable()?"web":null;export const clipboardFunction=async
|
|
1
|
+
"use strict";function r(){const i=globalThis.Capacitor;const t=i?.isNativePlatform?.()?i.Plugins?.Clipboard:void 0;return t&&typeof t.write==="function"?t:null}export const isClipboardAvailable=()=>r()!==null||typeof navigator!=="undefined"&&typeof navigator.clipboard?.writeText==="function";export const clipboardType=()=>isClipboardAvailable()?"web":null;export const clipboardFunction=async i=>{try{const t=r();if(t){await t.write({string:i});return true}if(!isClipboardAvailable())return false;await navigator.clipboard.writeText(i);return true}catch{return false}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{StyleSheet as m,Text as f,TouchableOpacity as y,View as x}from"react-native";import{night as o}from"../night/nightTheme.js";import{useSafeAreaInsets as T}from"../../hooks/useSafeAreaInsets";import{monoFont as p}from"../fonts.js";import{jsx as l,jsxs as h}from"react/jsx-runtime";export function ToolFooter({children:r,safeArea:e=true,paddingBottom:
|
|
1
|
+
"use strict";import{StyleSheet as m,Text as f,TouchableOpacity as y,View as x}from"react-native";import{night as o}from"../night/nightTheme.js";import{useSafeAreaInsets as T}from"../../hooks/useSafeAreaInsets";import{monoFont as p}from"../fonts.js";import{jsx as l,jsxs as h}from"react/jsx-runtime";export function ToolFooter({children:r,safeArea:e=true,paddingBottom:c=12,floating:n=false,absolute:i=false,gap:u=8,style:d,testID:s}){const a=T();const b=typeof e==="number"?e+a.bottom:e?c+a.bottom:c;return l(x,{style:[t.footer,n&&t.footerFloating,i&&t.footerAbsolute,{paddingBottom:b,gap:u},d],testID:s,children:r})}export function FooterRow({children:r,style:e}){return l(x,{style:[t.row,e],children:r})}export function FooterCaption({children:r,style:e}){return l(f,{style:[t.caption,e],numberOfLines:1,children:r})}export function FooterMessage({children:r,tone:e="info",style:c,testID:n}){return l(f,{testID:n,style:[t.message,e==="muted"&&t.messageMuted,c],numberOfLines:1,children:r})}export function FooterButton({label:r,onPress:e,accent:c=false,active:n=false,disabled:i=false,icon:u,flex:d=true,size:s="sm",testID:a,accessibilityLabel:b,style:g}){return h(y,{onPress:e,disabled:i,activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:b??r,accessibilityState:{disabled:i,selected:n},testID:a,style:[t.button,d?t.buttonFlex:t.buttonFixed,s==="md"&&t.buttonMd,n&&t.buttonActive,i&&t.disabled,g],children:[u,l(f,{style:[t.buttonText,s==="md"&&t.buttonTextMd,c&&!i&&t.buttonTextAccent,n&&t.buttonTextActive,i&&t.buttonTextDisabled],children:r})]})}const t=m.create({footer:{paddingHorizontal:12,paddingTop:10,backgroundColor:"rgba(5, 5, 5, 0.92)",borderTopWidth:1,borderTopColor:o.color.border},footerFloating:{borderBottomLeftRadius:14,borderBottomRightRadius:14},footerAbsolute:{position:"absolute",left:0,right:0,bottom:0},row:{flexDirection:"row",alignItems:"center",gap:6},caption:{color:o.color.textTertiary,fontSize:9,fontWeight:"700",letterSpacing:.8},message:{color:o.color.info,fontSize:10,fontFamily:p},messageMuted:{color:o.color.textTertiary,fontFamily:void 0},button:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6,paddingVertical:8,paddingHorizontal:0,borderRadius:6,backgroundColor:o.color.button,borderWidth:m.hairlineWidth,borderColor:o.color.border},buttonFlex:{flex:1},buttonFixed:{paddingHorizontal:10},buttonMd:{paddingVertical:8},buttonActive:{backgroundColor:o.color.accentSoft,borderColor:o.color.accentBorderStrong},buttonText:{fontSize:10,fontWeight:"600",color:o.color.textSecondary,fontFamily:p,textTransform:"uppercase"},buttonTextMd:{fontSize:11,color:o.color.text},buttonTextAccent:{color:o.color.warning},buttonTextActive:{color:o.color.accent},buttonTextDisabled:{color:o.color.textTertiary},disabled:{opacity:.4}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{AppState as a,DeviceEventEmitter as
|
|
1
|
+
"use strict";import{AppState as a,DeviceEventEmitter as b,Platform as s}from"react-native";export const BUOY_SYNTHETIC_MARK="__buoySynthetic";export function countBuoyListener(t,e){const n=globalThis;const r=n.__buoyOwnDeviceListeners??={};r[t]=Math.max(0,(r[t]??0)+e)}const c=new Set;let i="unknown";let f=false;function l(){const t=globalThis.document;return t&&typeof t.addEventListener==="function"?t:null}function u(){try{const t=l();const e=globalThis.Document?.prototype;const n=e&&Object.getOwnPropertyDescriptor(e,"visibilityState")?.get;if(!t||!n)return null;return n.call(t)==="visible"?"active":"background"}catch{return null}}function p(){if(s.OS==="web"){const t=u();if(t)return t}try{return a?.currentState??"unknown"}catch{return"unknown"}}function o(t){if(t===i)return;i=t;for(const e of Array.from(c)){try{e(t)}catch{}}}function d(){if(f)return;f=true;i=p();try{if(s.OS==="web"){const t=l();if(t&&u()){t.addEventListener("visibilitychange",n=>{if(n?.[BUOY_SYNTHETIC_MARK])return;const r=u();if(r)o(r)});const e=n=>r=>{if(r?.[BUOY_SYNTHETIC_MARK])return;o(n)};t.addEventListener("pause",e("background"));t.addEventListener("resume",e("active"));return}a.addEventListener("change",e=>o(e));return}countBuoyListener("appStateDidChange",1);b.addListener("appStateDidChange",t=>{if(!t||t[BUOY_SYNTHETIC_MARK])return;if(t.app_state)o(t.app_state)})}catch{}}export function getRealAppState(){d();if(i==="unknown")i=p();return i}export function subscribeRealAppState(t){d();c.add(t);return{remove:()=>c.delete(t)}}
|
|
@@ -42,10 +42,11 @@ export declare function FooterCaption({ children, style }: {
|
|
|
42
42
|
style?: StyleProp<TextStyle>;
|
|
43
43
|
}): import("react").JSX.Element;
|
|
44
44
|
/** Mono feedback line ("Restored 3 images"). */
|
|
45
|
-
export declare function FooterMessage({ children, tone, style, }: {
|
|
45
|
+
export declare function FooterMessage({ children, tone, style, testID, }: {
|
|
46
46
|
children: ReactNode;
|
|
47
47
|
tone?: "info" | "muted";
|
|
48
48
|
style?: StyleProp<TextStyle>;
|
|
49
|
+
testID?: string;
|
|
49
50
|
}): import("react").JSX.Element;
|
|
50
51
|
export interface FooterButtonProps {
|
|
51
52
|
label: string;
|
|
@@ -42,10 +42,11 @@ export declare function FooterCaption({ children, style }: {
|
|
|
42
42
|
style?: StyleProp<TextStyle>;
|
|
43
43
|
}): import("react").JSX.Element;
|
|
44
44
|
/** Mono feedback line ("Restored 3 images"). */
|
|
45
|
-
export declare function FooterMessage({ children, tone, style, }: {
|
|
45
|
+
export declare function FooterMessage({ children, tone, style, testID, }: {
|
|
46
46
|
children: ReactNode;
|
|
47
47
|
tone?: "info" | "muted";
|
|
48
48
|
style?: StyleProp<TextStyle>;
|
|
49
|
+
testID?: string;
|
|
49
50
|
}): import("react").JSX.Element;
|
|
50
51
|
export interface FooterButtonProps {
|
|
51
52
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a as c}from"./chunk-
|
|
1
|
+
"use client";import{a as c}from"./chunk-RMLVR5LI.mjs";import{a as d}from"./chunk-T6T3FEMU.mjs";import{useState as u,useCallback as n}from"react";function w(a=new Set){let[r,s]=u(a),[i,l]=u(false),[p,m]=u(""),h=n(e=>{let o=e.trim();o&&(s(t=>new Set([...t,o])),m(""),l(false))},[]),v=n(e=>{s(o=>{let t=new Set(o);return t.delete(e),t})},[]),S=n(e=>{s(o=>{let t=new Set(o);return t.has(e)?t.delete(e):t.add(e),t})},[]),F=n(()=>{s(new Set),m(""),l(false)},[]),g=n(e=>r.has(e),[r]);return{filters:r,showAddInput:i,newFilter:p,setNewFilter:m,setShowAddInput:l,addFilter:h,removeFilter:v,toggleFilter:S,clearFilters:F,hasFilter:g}}d(w,"useFilterManager");import{useEffect as x,useState as b}from"react";function f(a={}){let[r,s]=b({top:0,bottom:0,left:0,right:0});return x(()=>{let i=d(()=>s(c()),"update");return i(),window.addEventListener("resize",i),window.visualViewport?.addEventListener("resize",i),()=>{window.removeEventListener("resize",i),window.visualViewport?.removeEventListener("resize",i)}},[]),{top:Math.max(r.top,a.minTop??0),bottom:Math.max(r.bottom,a.minBottom??0),left:Math.max(r.left,a.minLeft??0),right:Math.max(r.right,a.minRight??0)}}d(f,"useSafeAreaInsets");export{w as a,f as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";import{e as ge}from"./chunk-
|
|
1
|
+
"use client";import{e as ge}from"./chunk-RMLVR5LI.mjs";import{d as $}from"./chunk-2STKTXD3.mjs";import{A as j,G as z,H as r,W as fe,p as T,q as S,s as w,u as A,x as N,z as V}from"./chunk-5G6RSRP4.mjs";import{a as l}from"./chunk-T6T3FEMU.mjs";import{useCallback as he,useEffect as ye,useRef as U,useState as K}from"react";var B=new Map;function X(e){try{return JSON.parse(e)}catch{return}}l(X,"defaultParse");function _(e,t,n={}){let[s,o]=K(()=>B.has(e)?B.get(e):t),[v,h]=K(()=>B.has(e)),d=U(e);d.current=e;let u=U(n);u.current=n,ye(()=>{if(B.has(e)){o(B.get(e)),h(true);return}let c=false,m=u.current.storage??$,p=u.current.parse??X;return m.getItem(e).then(y=>{if(!c){if(y!=null){let g;try{g=p(y)}catch{}g!==void 0&&(B.set(e,g),o(g))}h(true)}}).catch(()=>{c||h(true)}),()=>{c=true}},[e]);let I=he(c=>{o(m=>{let p=typeof c=="function"?c(m):c;B.set(d.current,p);let y=u.current.storage??$,g=u.current.serialize??JSON.stringify;try{y.setItem(d.current,g(p)).catch(()=>{})}catch{}return p})},[]);return[s,I,v]}l(_,"usePersistedState");function Q(){B.clear()}l(Q,"resetPersistedStateCache");import{useCallback as F,useEffect as Z,useMemo as Se,useState as D}from"react";function ee(e,t={}){let[n,s]=D(()=>e.getAll()),[o,v]=D(()=>t.initialFilter??{}),[h,d]=D(()=>e.getEnabled());Z(()=>e.subscribe(s),[e]);let u=t.filterItems,I=Se(()=>u?u(n,o):n,[n,o,u]),c=F(()=>{e.clear()},[e]),m=F(()=>{let y=!h;e.setEnabled(y),d(y)},[e,h]),p=F(y=>e.getById(y),[e]);return{items:n,filteredItems:I,filter:o,setFilter:v,isEnabled:h,toggleCapture:m,clear:c,getById:p}}l(ee,"useChangeLog");function te(e,t){let[n,s]=D(e);return Z(()=>t(s),[t]),n}l(te,"useSubscribedValue");import{useCallback as me,useEffect as pe,useState as ne}from"react";function ie(e,t={}){let{enabled:n=true,maxEvents:s=500,select:o}=t,[v,h]=ne([]),[d,u]=ne(n);pe(()=>{if(!n){u(false);return}let c=null,m=null,p=e.subscribeToEvents(y=>{m=y,c==null&&(c=requestAnimationFrame(()=>{if(c=null,!m)return;let g=m;m=null,o&&(g=o(g)),g.length>s&&(g=g.slice(0,s)),h(g)}))});return u(true),()=>{p(),c!=null&&cancelAnimationFrame(c)}},[e,n,s,o]);let I=me(()=>{e.clearEvents()},[e]);return{events:v,clearEvents:I,isActive:d}}l(ie,"useEventStoreEvents");import{useState as b,useEffect as C,useCallback as be}from"react";async function J(){let[e,t,n]=await Promise.all([S.isScreenReaderEnabled(),S.isReduceMotionEnabled(),S.isReduceTransparencyEnabled()]),s={isScreenReaderEnabled:e,isReduceMotionEnabled:t,isReduceTransparencyEnabled:n};if(r.OS==="ios"){let[o,v,h,d,u]=await Promise.all([S.isBoldTextEnabled?.()??Promise.resolve(false),S.isGrayscaleEnabled?.()??Promise.resolve(false),S.isInvertColorsEnabled?.()??Promise.resolve(false),S.isDarkerSystemColorsEnabled?.()??Promise.resolve(false),S.prefersCrossFadeTransitions?.()??Promise.resolve(false)]);s.isBoldTextEnabled=o,s.isGrayscaleEnabled=v,s.isInvertColorsEnabled=h,s.isDarkerSystemColorsEnabled=d,s.prefersCrossFadeTransitions=u}if(r.OS==="android"){let o=await S.isHighTextContrastEnabled?.()??false;s.isHighTextContrastEnabled=o}return s}l(J,"getAccessibilitySettings");function O(){let e=r.constants,t={os:r.OS,version:r.Version,reactNativeVersion:e.reactNativeVersion,isTesting:r.isTesting??false,isDisableAnimations:e.isDisableAnimations??false};return r.OS==="ios"?{...t,osVersion:e.osVersion,systemName:e.systemName,interfaceIdiom:e.interfaceIdiom,isPad:r.isPad,isTV:r.isTV,isVision:r.isVision??false,isMacCatalyst:r.isMacCatalyst??false,forceTouchAvailable:e.forceTouchAvailable}:r.OS==="android"?{...t,apiLevel:e.Version,release:e.Release,brand:e.Brand,manufacturer:e.Manufacturer,model:e.Model,fingerprint:e.Fingerprint,serial:e.Serial,uiMode:e.uiMode}:t}l(O,"getPlatformInfo");function L(){let e=N.get("window"),t=N.get("screen"),n={window:{width:e.width,height:e.height,scale:e.scale,fontScale:e.fontScale},screen:{width:t.width,height:t.height,scale:t.scale,fontScale:t.fontScale},pixelRatio:z.get(),fontScale:z.getFontScale(),isLandscape:e.width>e.height,isPortrait:e.height>e.width};if(r.OS==="ios")try{let s=T.DeviceInfo?.getConstants?.();n.isIPhoneNotched=s?.isIPhoneX_deprecated??false}catch{n.isIPhoneNotched=false}if(r.OS==="android")try{let s=T.DeviceInfo?.getConstants?.();n.isEdgeToEdge=s?.isEdgeToEdge??false,n.densityDpi=Math.round(e.scale*160)}catch{}return n}l(L,"getDisplayInfo");async function x(){return new Promise(e=>{let t=false;r.OS==="ios"?T.StatusBarManager?.getHeight?.(n=>{t||(t=true,e(n?.height??null))})??e(null):r.OS==="android"?(t=true,e(fe.currentHeight??null)):(t=true,e(null)),setTimeout(()=>{t||(t=true,e(null))},100)})}l(x,"getStatusBarHeight");function P(){let e={isRTL:V.isRTL,doLeftAndRightSwapInRTL:V.doLeftAndRightSwapInRTL};return r.OS==="android"&&(e.localeIdentifier=V.localeIdentifier),e}l(P,"getLocaleInfo");function R(){if(r.OS==="ios")try{return{userDefaults:T.SettingsManager?.getConstants?.()?.settings??{}}}catch{return{}}return{}}l(R,"getSettingsInfo");function k(){let e={};if(r.OS==="android"){let t=r.constants;e.serial=t.Serial,e.fingerprint=t.Fingerprint;try{let n=T.PlatformConstants;n?.getAndroidID&&(e.androidId=n.getAndroidID())}catch{}}return e}l(k,"getUniqueIdentifiers");function ae(e){let t=[e.platform.os,e.platform.version,e.display.window.width,e.display.window.height,e.display.pixelRatio,e.platform.interfaceIdiom??"",e.platform.forceTouchAvailable??false,e.display.isIPhoneNotched??false,e.platform.model??"",e.platform.brand??"",e.platform.manufacturer??"",e.platform.uiMode??""].join("|"),n=0;for(let s=0;s<t.length;s++){let o=t.charCodeAt(s);n=(n<<5)-n+o,n=n&n}return Math.abs(n).toString(16).padStart(8,"0")}l(ae,"generateFingerprint");function se(){let[e,t]=b(true),[n,s]=b(O()),[o,v]=b(L()),[h,d]=b({isScreenReaderEnabled:false,isReduceMotionEnabled:false,isReduceTransparencyEnabled:false}),[u,I]=b(()=>{let f=w.getColorScheme()??null;return{colorScheme:f,prefersDarkMode:f==="dark"}}),[c,m]=b(P()),[p,y]=b({height:null,isVisible:true}),[g,H]=b({isVisible:false,height:0,animationDuration:0}),[G,le]=b({currentState:A.currentState,isActive:A.currentState==="active"}),[q,ce]=b(k()),[W,de]=b(R()),[Y,ue]=b(Date.now()),M=be(async()=>{t(true);let[f,i]=await Promise.all([J(),x()]);s(O()),v(L()),d(f);let a=w.getColorScheme()??null;I({colorScheme:a,prefersDarkMode:a==="dark"}),m(P()),y(E=>({...E,height:i})),ce(k()),de(R()),ue(Date.now()),t(false)},[]);return C(()=>{M()},[M]),C(()=>{let f=N.addEventListener("change",({window:i,screen:a})=>{v(E=>({...E,window:{width:i.width,height:i.height,scale:i.scale,fontScale:i.fontScale},screen:{width:a.width,height:a.height,scale:a.scale,fontScale:a.fontScale},isLandscape:i.width>i.height,isPortrait:i.height>i.width}))});return()=>f.remove()},[]),C(()=>{let f=w.addChangeListener(({colorScheme:i})=>{let a=i??null;I({colorScheme:a,prefersDarkMode:a==="dark"})});return()=>f.remove()},[]),C(()=>{let f=j.addListener(r.OS==="ios"?"keyboardWillShow":"keyboardDidShow",a=>{H({isVisible:true,height:a.endCoordinates.height,animationDuration:a.duration??0})}),i=j.addListener(r.OS==="ios"?"keyboardWillHide":"keyboardDidHide",a=>{H({isVisible:false,height:0,animationDuration:a.duration??0})});return()=>{f.remove(),i.remove()}},[]),C(()=>{let f=ge(i=>{le({currentState:i,isActive:i==="active"})});return()=>f.remove()},[]),C(()=>{let f=[S.addEventListener("screenReaderChanged",i=>{d(a=>({...a,isScreenReaderEnabled:i}))}),S.addEventListener("reduceMotionChanged",i=>{d(a=>({...a,isReduceMotionEnabled:i}))}),S.addEventListener("reduceTransparencyChanged",i=>{d(a=>({...a,isReduceTransparencyEnabled:i}))})];if(r.OS==="ios"){let i=l((a,E)=>S.addEventListener(a,E),"addIOSListener");f.push(i("boldTextChanged",a=>{d(E=>({...E,isBoldTextEnabled:a}))}),i("grayscaleChanged",a=>{d(E=>({...E,isGrayscaleEnabled:a}))}),i("invertColorsChanged",a=>{d(E=>({...E,isInvertColorsEnabled:a}))}))}return()=>{f.forEach(i=>i.remove())}},[]),{platform:n,display:o,accessibility:h,appearance:u,locale:c,statusBar:p,keyboard:g,appState:G,identifiers:q,settings:W,timestamp:Y,isLoading:e,refresh:M,generateFingerprint:l(()=>ae({platform:n,display:o,accessibility:h,appearance:u,locale:c,statusBar:p,keyboard:g,appState:G,identifiers:q,settings:W,timestamp:Y,isLoading:e}),"generateFingerprint")}}l(se,"useDeviceInfo");async function re(){let[e,t]=await Promise.all([J(),x()]),n=w.getColorScheme()??null;return{platform:O(),display:L(),accessibility:e,appearance:{colorScheme:n,prefersDarkMode:n==="dark"},locale:P(),statusBar:{height:t,isVisible:true},keyboard:{isVisible:false,height:0,animationDuration:0},appState:{currentState:A.currentState,isActive:A.currentState==="active"},identifiers:k(),settings:R(),timestamp:Date.now(),isLoading:false}}l(re,"getDeviceInfo");function oe(e){console.log("[Buoy]",`
|
|
2
2
|
========================================`),console.log("[Buoy]"," DEVICE INFO REPORT"),console.log("[Buoy]",`========================================
|
|
3
3
|
`),console.log("[Buoy]","--- PLATFORM ---"),console.log("[Buoy]",JSON.stringify(e.platform,null,2)),console.log("[Buoy]",`
|
|
4
4
|
--- DISPLAY ---`),console.log("[Buoy]",JSON.stringify(e.display,null,2)),console.log("[Buoy]",`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{H as m,aa as D,u as h}from"./chunk-5G6RSRP4.mjs";import{a}from"./chunk-T6T3FEMU.mjs";function y(){let e={top:0,bottom:0,left:0,right:0,hasNotch:false};if(typeof document>"u"||!document.body)return e;let t=document.createElement("div");t.style.cssText="position:fixed;visibility:hidden;pointer-events:none;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)",document.body.appendChild(t);try{let n=getComputedStyle(t),r=parseFloat(n.paddingTop)||0,g=parseFloat(n.paddingBottom)||0,b=parseFloat(n.paddingLeft)||0,v=parseFloat(n.paddingRight)||0;return{top:r,bottom:g,left:b,right:v,hasNotch:r>0||g>0||b>0||v>0}}finally{t.remove()}}a(y,"getSafeAreaInsets");var s="__buoySynthetic";function d(e,t){let n=globalThis,r=n.__buoyOwnDeviceListeners??(n.__buoyOwnDeviceListeners={});r[e]=Math.max(0,(r[e]??0)+t)}a(d,"countBuoyListener");var l=new Set,i="unknown",S=false;function c(){let e=globalThis.document;return e&&typeof e.addEventListener=="function"?e:null}a(c,"webDocument");function u(){try{let e=c(),t=globalThis.Document?.prototype,n=t&&Object.getOwnPropertyDescriptor(t,"visibilityState")?.get;return!e||!n?null:n.call(e)==="visible"?"active":"background"}catch{return null}}a(u,"realWebState");function p(){if(m.OS==="web"){let e=u();if(e)return e}try{return h?.currentState??"unknown"}catch{return"unknown"}}a(p,"readInitial");function o(e){if(e!==i){i=e;for(let t of Array.from(l))try{t(e)}catch{}}}a(o,"set");function f(){if(!S){S=true,i=p();try{if(m.OS==="web"){let e=c();if(e&&u()){e.addEventListener("visibilitychange",n=>{if(n?.[s])return;let r=u();r&&o(r)});let t=a(n=>r=>{r?.[s]||o(n)},"capacitorEvent");e.addEventListener("pause",t("background")),e.addEventListener("resume",t("active"));return}h.addEventListener("change",t=>o(t));return}d("appStateDidChange",1),D.addListener("appStateDidChange",e=>{!e||e[s]||e.app_state&&o(e.app_state)})}catch{}}}a(f,"start");function w(){return f(),i==="unknown"&&(i=p()),i}a(w,"getRealAppState");function L(e){return f(),l.add(e),{remove:a(()=>l.delete(e),"remove")}}a(L,"subscribeRealAppState");export{y as a,s as b,d as c,w as d,L as e};
|