@buoy-gg/shared-ui 7.0.15 → 7.0.16
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/JsModal.web.js +1588 -0
- package/lib/commonjs/env/EnvironmentIndicator.web.js +114 -0
- package/lib/commonjs/env/EnvironmentSelectorInline.web.js +178 -0
- package/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/icons/index.js +14 -0
- package/lib/commonjs/index.js +3 -3
- package/lib/commonjs/stores/ignoredPatternsCore.js +68 -0
- package/lib/commonjs/stores/ignoredPatternsStore.js +16 -52
- package/lib/commonjs/stores/ignoredPatternsStore.web.js +236 -0
- package/lib/commonjs/stores/index.js +1 -1
- package/lib/commonjs/ui/gameUI/constants/gameUIColors.js +5 -3
- package/lib/module/JsModal.web.js +1586 -0
- package/lib/module/env/EnvironmentIndicator.web.js +108 -0
- package/lib/module/env/EnvironmentSelectorInline.web.js +173 -0
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/icons/index.js +1 -0
- package/lib/module/index.js +3 -3
- package/lib/module/stores/ignoredPatternsCore.js +62 -0
- package/lib/module/stores/ignoredPatternsStore.js +5 -51
- package/lib/module/stores/ignoredPatternsStore.web.js +221 -0
- package/lib/module/stores/index.js +1 -1
- package/lib/module/ui/gameUI/constants/gameUIColors.js +4 -2
- package/lib/typescript/commonjs/JsModal.web.d.ts +138 -0
- package/lib/typescript/commonjs/JsModal.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/env/EnvironmentIndicator.web.d.ts +16 -0
- package/lib/typescript/commonjs/env/EnvironmentIndicator.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/env/EnvironmentSelectorInline.web.d.ts +8 -0
- package/lib/typescript/commonjs/env/EnvironmentSelectorInline.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/icons/index.d.ts +1 -0
- package/lib/typescript/commonjs/icons/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/stores/ignoredPatternsCore.d.ts +37 -0
- package/lib/typescript/commonjs/stores/ignoredPatternsCore.d.ts.map +1 -0
- package/lib/typescript/commonjs/stores/ignoredPatternsStore.d.ts +3 -27
- package/lib/typescript/commonjs/stores/ignoredPatternsStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/stores/ignoredPatternsStore.web.d.ts +72 -0
- package/lib/typescript/commonjs/stores/ignoredPatternsStore.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts +56 -0
- package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
- package/lib/typescript/module/JsModal.web.d.ts +138 -0
- package/lib/typescript/module/JsModal.web.d.ts.map +1 -0
- package/lib/typescript/module/env/EnvironmentIndicator.web.d.ts +16 -0
- package/lib/typescript/module/env/EnvironmentIndicator.web.d.ts.map +1 -0
- package/lib/typescript/module/env/EnvironmentSelectorInline.web.d.ts +8 -0
- package/lib/typescript/module/env/EnvironmentSelectorInline.web.d.ts.map +1 -0
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/icons/index.d.ts +1 -0
- package/lib/typescript/module/icons/index.d.ts.map +1 -1
- package/lib/typescript/module/stores/ignoredPatternsCore.d.ts +37 -0
- package/lib/typescript/module/stores/ignoredPatternsCore.d.ts.map +1 -0
- package/lib/typescript/module/stores/ignoredPatternsStore.d.ts +3 -27
- package/lib/typescript/module/stores/ignoredPatternsStore.d.ts.map +1 -1
- package/lib/typescript/module/stores/ignoredPatternsStore.web.d.ts +72 -0
- package/lib/typescript/module/stores/ignoredPatternsStore.web.d.ts.map +1 -0
- package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts +56 -0
- package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -15,7 +15,9 @@ import { macOSGameUIColors, refreshMacOSGameUIColors } from "./macOSDesignSystem
|
|
|
15
15
|
// THEME DEFINITIONS
|
|
16
16
|
// ============================================
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
// Kept (and exported) as the reference palette for theme swapping — see the
|
|
19
|
+
// header comment. Unused by the active theme selection.
|
|
20
|
+
export const _defaultTheme = {
|
|
19
21
|
// Base colors
|
|
20
22
|
border: "#00B8E666",
|
|
21
23
|
blackTint1: "rgba(8, 12, 21, 0.95)",
|
|
@@ -119,7 +121,7 @@ const macOSTheme = macOSGameUIColors;
|
|
|
119
121
|
// THEME SELECTION - Just change this one line!
|
|
120
122
|
// ============================================
|
|
121
123
|
|
|
122
|
-
// const activeTheme =
|
|
124
|
+
// const activeTheme = _defaultTheme; // DEFAULT - Mixed colors (original)
|
|
123
125
|
const activeTheme = macOSTheme; // macOS - Apple HIG design system
|
|
124
126
|
|
|
125
127
|
// ============================================
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JsModal.web — DOM port of JsModal.tsx (React Native).
|
|
3
|
+
*
|
|
4
|
+
* The dual-mode tool-panel container: draggable bottom sheet ⇄ floating
|
|
5
|
+
* window. Same exported names (`JsModal`, `ModalMode`, `ModalState`), same
|
|
6
|
+
* prop contract, same gesture spec and persistence key/JSON shape as the
|
|
7
|
+
* native file. Zero react-native imports — header chrome that lives in
|
|
8
|
+
* shared-ui RN components (`WindowControls`, `DraggableHeader`, `ModalHeader`,
|
|
9
|
+
* `ModalHintBanner`) is replicated as DOM with provenance comments, the same
|
|
10
|
+
* way DevToolsSettingsModal.web.tsx replicates the WindowControls close dot.
|
|
11
|
+
*
|
|
12
|
+
* Gesture spec (verbatim from native):
|
|
13
|
+
* - Sheet header drag: steal at |dy| > 3px, absolute finger anchoring
|
|
14
|
+
* (height = screenH − (pointerY − grab offset)), clamped to
|
|
15
|
+
* [minHeight, maxHeight ?? screenH − safeTop]. Fast downward swipe closes:
|
|
16
|
+
* (vy > 0.8 px/ms && dy > 50) || (dy > 150 && height <= minHeight).
|
|
17
|
+
* - Floating header drag (DraggableHeader.tsx): drag starts at
|
|
18
|
+
* |dx|+|dy| > 5, position unclamped during move, clamped on release to
|
|
19
|
+
* x ∈ [0, screenW − width], y ∈ [safeTop, screenH − height].
|
|
20
|
+
* - Corner resize (bottom corners only): moves < 0.5px ignored; rect clamped
|
|
21
|
+
* to safe-area bounds; min size = screenW*0.25 × 80.
|
|
22
|
+
* - Header taps (both modes): taps accumulate within a 500ms window and
|
|
23
|
+
* settle after 300ms — 2 taps toggles mode, ≥3 taps minimizes.
|
|
24
|
+
*
|
|
25
|
+
* Persistence (verbatim from native ModalStorage): the `persistenceKey` prop
|
|
26
|
+
* is the storage key, used verbatim (native callers pass fully-derived
|
|
27
|
+
* `@react_buoy…` keys or short keys — no extra derivation happens here
|
|
28
|
+
* either). JSON shape `{ mode, panelHeight, dimensions: {width, height, top,
|
|
29
|
+
* left}, isVisible }`, saved on a 500ms debounce after state loads, with the
|
|
30
|
+
* same in-memory cache in front of storage. Backed by a local
|
|
31
|
+
* localStorage adapter matching the `persistentStorage` API — importing
|
|
32
|
+
* `./utils/persistentStorage` is avoided on purpose: its lazy `require()`
|
|
33
|
+
* probing of expo-file-system/AsyncStorage doesn't survive Vite's ESM graph.
|
|
34
|
+
* The hint-acknowledged flag uses the real `devToolsStorageKeys` helper
|
|
35
|
+
* (zero-dep) so the key matches native exactly.
|
|
36
|
+
*
|
|
37
|
+
* Intentional deviations from the native file (all logged):
|
|
38
|
+
* - No native-driver springs: rAF drives all animations. The open/close
|
|
39
|
+
* spring (tension 180, friction 22, ~300ms settle) is approximated with a
|
|
40
|
+
* 300ms ease-out-cubic; native `Animated.timing` calls keep their exact
|
|
41
|
+
* durations (200ms fades, 300ms minimize) with ease-in-out.
|
|
42
|
+
* - No RN Modal/overlay layer: fixed-position divs with the `zIndex` prop
|
|
43
|
+
* (default 1000, same as the native styles).
|
|
44
|
+
* - `benchMotion` and `animatedHeight` (DEV-only benchmark seams) are
|
|
45
|
+
* accepted and no-op'd — the web build has no tool-bench harness.
|
|
46
|
+
* - `CyberpunkModalHeader` complete-replacement detection in ModalHeader is
|
|
47
|
+
* not ported (that component is RN-only); custom header content renders
|
|
48
|
+
* inside the standard header structure, with `onMinimize` injected via
|
|
49
|
+
* cloneElement like native's non-replacement path.
|
|
50
|
+
* - Native captures `Dimensions.get("window")` once at module load; the web
|
|
51
|
+
* twin reads `window.innerWidth/innerHeight` lazily so late layout (Tauri/
|
|
52
|
+
* WKWebView) doesn't bake in a 0×0 screen.
|
|
53
|
+
* - Safe-area insets come from a one-shot `env(safe-area-inset-*)` probe
|
|
54
|
+
* (same trick as floatingTools.web.tsx) instead of the RN hook.
|
|
55
|
+
* - On restore-from-minimize, the floating position re-syncs from the last
|
|
56
|
+
* committed dimensions when the panel becomes visible: the web AppHost
|
|
57
|
+
* doesn't pass `initialModalState` back, and without the re-sync the panel
|
|
58
|
+
* would reappear at the minimize target.
|
|
59
|
+
* - `JsModalProps` is additionally exported (native keeps it private) so web
|
|
60
|
+
* consumers can type wrappers without redeclaring the contract.
|
|
61
|
+
* - `visible={false}` renders children in a `display:none` div (state and
|
|
62
|
+
* listeners survive) instead of native's offscreen −9999 container.
|
|
63
|
+
* - The hidden/floating/bottomSheet root branches carry distinct React keys:
|
|
64
|
+
* the rAF animations write opacity/transform straight to the DOM, and DOM
|
|
65
|
+
* reuse across branches (e.g. an async persisted-mode flip mid-entrance)
|
|
66
|
+
* would leak those styles onto unrelated chrome (blank header bug).
|
|
67
|
+
*
|
|
68
|
+
* @platform React DOM Web (Vite, Tauri, Capacitor/Ionic, Electron)
|
|
69
|
+
*/
|
|
70
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
71
|
+
export type ModalMode = "bottomSheet" | "floating";
|
|
72
|
+
interface HeaderConfig {
|
|
73
|
+
title?: string;
|
|
74
|
+
subtitle?: string;
|
|
75
|
+
showToggleButton?: boolean;
|
|
76
|
+
customContent?: ReactNode;
|
|
77
|
+
hideCloseButton?: boolean;
|
|
78
|
+
hideMinimizeButton?: boolean;
|
|
79
|
+
}
|
|
80
|
+
interface CustomStyles {
|
|
81
|
+
container?: CSSProperties;
|
|
82
|
+
content?: CSSProperties;
|
|
83
|
+
}
|
|
84
|
+
/** Modal state that can be saved and restored when minimizing/restoring. */
|
|
85
|
+
export interface ModalState {
|
|
86
|
+
mode: ModalMode;
|
|
87
|
+
panelHeight?: number;
|
|
88
|
+
floatingPosition?: {
|
|
89
|
+
x: number;
|
|
90
|
+
y: number;
|
|
91
|
+
};
|
|
92
|
+
floatingDimensions?: {
|
|
93
|
+
width: number;
|
|
94
|
+
height: number;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export interface JsModalProps {
|
|
98
|
+
visible: boolean;
|
|
99
|
+
onClose: () => void;
|
|
100
|
+
children: ReactNode;
|
|
101
|
+
header?: HeaderConfig;
|
|
102
|
+
styles?: CustomStyles;
|
|
103
|
+
minHeight?: number;
|
|
104
|
+
maxHeight?: number;
|
|
105
|
+
initialHeight?: number;
|
|
106
|
+
/** DEV-only native seam (external Animated height) — accepted, no-op on web. */
|
|
107
|
+
animatedHeight?: unknown;
|
|
108
|
+
/** DEV-only native benchmark motion — accepted, no-op on web. */
|
|
109
|
+
benchMotion?: "resize" | "float-drag" | "float-resize" | "mode-cycle";
|
|
110
|
+
initialMode?: ModalMode;
|
|
111
|
+
onModeChange?: (mode: ModalMode) => void;
|
|
112
|
+
persistenceKey?: string;
|
|
113
|
+
enablePersistence?: boolean;
|
|
114
|
+
enableGlitchEffects?: boolean;
|
|
115
|
+
initialFloatingPosition?: {
|
|
116
|
+
x?: number;
|
|
117
|
+
y?: number;
|
|
118
|
+
};
|
|
119
|
+
footer?: ReactNode;
|
|
120
|
+
footerHeight?: number;
|
|
121
|
+
onBack?: () => void;
|
|
122
|
+
/** Callback when minimize is requested - receives current modal state for restoration */
|
|
123
|
+
onMinimize?: (modalState: ModalState) => void;
|
|
124
|
+
/** Target position for minimize animation (where the icon will appear) */
|
|
125
|
+
minimizeTargetPosition?: {
|
|
126
|
+
x: number;
|
|
127
|
+
y: number;
|
|
128
|
+
};
|
|
129
|
+
/** Initial modal state to restore from (when restoring from minimized) */
|
|
130
|
+
initialModalState?: ModalState;
|
|
131
|
+
/** z-index for stacking multiple modals (higher = on top) */
|
|
132
|
+
zIndex?: number;
|
|
133
|
+
/** If true, children render directly without the scroll wrapper */
|
|
134
|
+
disableScrollWrapper?: boolean;
|
|
135
|
+
}
|
|
136
|
+
export declare const JsModal: import("react").NamedExoticComponent<JsModalProps>;
|
|
137
|
+
export {};
|
|
138
|
+
//# sourceMappingURL=JsModal.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsModal.web.d.ts","sourceRoot":"","sources":["../../../src/JsModal.web.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AAEH,OAAO,EASL,KAAK,aAAa,EAGlB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAmHf,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;AAEnD,UAAU,YAAY;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,UAAU,YAAY;IAEpB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,4EAA4E;AAC5E,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM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C;IAClD,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AA88CD,eAAO,MAAM,OAAO,oDAAyB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Environment } from '../types/types';
|
|
2
|
+
export interface EnvironmentIndicatorProps {
|
|
3
|
+
environment: Environment | string;
|
|
4
|
+
/** When true, the badge becomes pressable and shows a dropdown indicator */
|
|
5
|
+
interactive?: boolean;
|
|
6
|
+
/** Called when the badge is pressed (only when interactive is true) */
|
|
7
|
+
onPress?: () => void;
|
|
8
|
+
}
|
|
9
|
+
interface EnvironmentConfig {
|
|
10
|
+
label: string;
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function getEnvironmentConfig(environment: Environment | string): EnvironmentConfig;
|
|
14
|
+
export declare function EnvironmentIndicator({ environment, interactive, onPress, }: EnvironmentIndicatorProps): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=EnvironmentIndicator.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnvironmentIndicator.web.d.ts","sourceRoot":"","sources":["../../../../src/env/EnvironmentIndicator.web.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,gBAAgB,CAAC;AAExE,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,WAAW,GAAG,MAAM,CAAC;IAClC,4EAA4E;IAC5E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,GAAG,MAAM,GAChC,iBAAiB,CAcnB;AAkBD,wBAAgB,oBAAoB,CAAC,EACnC,WAAW,EACX,WAAmB,EACnB,OAAO,GACR,EAAE,yBAAyB,+BA+C3B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Environment } from '../types/types';
|
|
2
|
+
export interface EnvironmentSelectorInlineProps {
|
|
3
|
+
currentEnvironment: Environment | string;
|
|
4
|
+
availableEnvironments: Array<Environment | string>;
|
|
5
|
+
onSelect: (env: Environment) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function EnvironmentSelectorInline({ currentEnvironment, availableEnvironments, onSelect, }: EnvironmentSelectorInlineProps): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=EnvironmentSelectorInline.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnvironmentSelectorInline.web.d.ts","sourceRoot":"","sources":["../../../../src/env/EnvironmentSelectorInline.web.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD,MAAM,WAAW,8BAA8B;IAC7C,kBAAkB,EAAE,WAAW,GAAG,MAAM,CAAC;IACzC,qBAAqB,EAAE,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,CAAC;IACnD,QAAQ,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAC;CACtC;AA0CD,wBAAgB,yBAAyB,CAAC,EACxC,kBAAkB,EAClB,qBAAqB,EACrB,QAAQ,GACT,EAAE,8BAA8B,+BA6HhC"}
|
|
@@ -3,6 +3,7 @@ export { NetworkIcon, NETWORK_ICON_COLOR } from "@buoy-gg/floating-tools-core";
|
|
|
3
3
|
export { EnvIcon, ENV_ICON_COLOR } from "@buoy-gg/floating-tools-core";
|
|
4
4
|
export { ConsoleIcon, CONSOLE_ICON_COLOR } from "@buoy-gg/floating-tools-core";
|
|
5
5
|
export { ImagesIcon, IMAGES_ICON_COLOR } from "@buoy-gg/floating-tools-core";
|
|
6
|
+
export { AssetsIcon, ASSETS_ICON_COLOR } from "@buoy-gg/floating-tools-core";
|
|
6
7
|
export { ImpersonateIcon, IMPERSONATE_ICON_COLOR } from "@buoy-gg/floating-tools-core";
|
|
7
8
|
export { ImageOverlayIcon, IMAGE_OVERLAY_ICON_COLOR } from "@buoy-gg/floating-tools-core";
|
|
8
9
|
export { ZustandIcon, ZUSTAND_ICON_COLOR } from "@buoy-gg/floating-tools-core";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/icons/index.tsx"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAG7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAKvE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAG3E,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,m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B,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EACL,cAAc,EACd,eAAe,EACf,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure, dependency-free part of the ignored-patterns feature — split from
|
|
3
|
+
* ignoredPatternsStore.ts so web consumers (which shim `@buoy-gg/shared-ui`
|
|
4
|
+
* and must not pull the store's relative `../utils/persistentStorage` import
|
|
5
|
+
* with its expo/async-storage requires into the bundle graph) can share the
|
|
6
|
+
* exact matching semantics. The store imports and re-exports everything here;
|
|
7
|
+
* the native barrel is unchanged.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* How a pattern matches a URL:
|
|
11
|
+
*
|
|
12
|
+
* - `contains`: case-insensitive substring match on the full URL (legacy behavior).
|
|
13
|
+
* - `exact`: smart equality — if pattern starts with `/`, matches URL.pathname;
|
|
14
|
+
* if it starts with `http://`/`https://`, matches origin+pathname; otherwise
|
|
15
|
+
* matches URL.host.
|
|
16
|
+
*/
|
|
17
|
+
export type IgnoredPatternMatchMode = "contains" | "exact";
|
|
18
|
+
/** A single exclude pattern with its match mode. */
|
|
19
|
+
export interface IgnoredPattern {
|
|
20
|
+
value: string;
|
|
21
|
+
mode: IgnoredPatternMatchMode;
|
|
22
|
+
}
|
|
23
|
+
/** Patterns hidden by default — Buoy's own license API traffic. */
|
|
24
|
+
export declare const DEFAULT_IGNORED_PATTERNS: ReadonlyArray<IgnoredPattern>;
|
|
25
|
+
/**
|
|
26
|
+
* Returns true when `url` matches the ignored `pattern` according to its mode.
|
|
27
|
+
*
|
|
28
|
+
* `contains` → case-insensitive substring on the full URL (legacy behavior).
|
|
29
|
+
* `exact` → smart equality: pattern starting with `/` compares URL.pathname,
|
|
30
|
+
* full URLs compare origin+pathname (ignoring query/hash), bare
|
|
31
|
+
* values compare URL.host. Falls back to literal equality if URL
|
|
32
|
+
* parsing fails (e.g. relative URLs).
|
|
33
|
+
*/
|
|
34
|
+
export declare function urlMatchesIgnoredPattern(url: string, pattern: IgnoredPattern): boolean;
|
|
35
|
+
/** Convenience: does `url` match ANY of the ignored `patterns`? */
|
|
36
|
+
export declare function isUrlIgnored(url: string, patterns: ReadonlyArray<IgnoredPattern>): boolean;
|
|
37
|
+
//# sourceMappingURL=ignoredPatternsCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignoredPatternsCore.d.ts","sourceRoot":"","sources":["../../../../src/stores/ignoredPatternsCore.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG,OAAO,CAAC;AAE3D,oDAAoD;AACpD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,uBAAuB,CAAC;CAC/B;AAED,mEAAmE;AACnE,eAAO,MAAM,wBAAwB,EAAE,aAAa,CAAC,cAAc,CAElE,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,cAAc,GACtB,OAAO,CAoBT;AAED,mEAAmE;AACnE,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,aAAa,CAAC,cAAc,CAAC,GACtC,OAAO,CAGT"}
|
|
@@ -10,32 +10,9 @@
|
|
|
10
10
|
* @buoy-gg/events) so the filter logic can be shared without @buoy-gg/events
|
|
11
11
|
* having to take a hard dependency on @buoy-gg/network (which is optional).
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* - `contains`: case-insensitive substring match on the full URL (legacy behavior).
|
|
17
|
-
* - `exact`: smart equality — if pattern starts with `/`, matches URL.pathname;
|
|
18
|
-
* if it starts with `http://`/`https://`, matches origin+pathname; otherwise
|
|
19
|
-
* matches URL.host.
|
|
20
|
-
*/
|
|
21
|
-
export type IgnoredPatternMatchMode = "contains" | "exact";
|
|
22
|
-
/** A single exclude pattern with its match mode. */
|
|
23
|
-
export interface IgnoredPattern {
|
|
24
|
-
value: string;
|
|
25
|
-
mode: IgnoredPatternMatchMode;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Returns true when `url` matches the ignored `pattern` according to its mode.
|
|
29
|
-
*
|
|
30
|
-
* `contains` → case-insensitive substring on the full URL (legacy behavior).
|
|
31
|
-
* `exact` → smart equality: pattern starting with `/` compares URL.pathname,
|
|
32
|
-
* full URLs compare origin+pathname (ignoring query/hash), bare
|
|
33
|
-
* values compare URL.host. Falls back to literal equality if URL
|
|
34
|
-
* parsing fails (e.g. relative URLs).
|
|
35
|
-
*/
|
|
36
|
-
export declare function urlMatchesIgnoredPattern(url: string, pattern: IgnoredPattern): boolean;
|
|
37
|
-
/** Convenience: does `url` match ANY of the ignored `patterns`? */
|
|
38
|
-
export declare function isUrlIgnored(url: string, patterns: ReadonlyArray<IgnoredPattern>): boolean;
|
|
13
|
+
import { type IgnoredPattern } from "./ignoredPatternsCore";
|
|
14
|
+
export type { IgnoredPatternMatchMode, IgnoredPattern, } from "./ignoredPatternsCore";
|
|
15
|
+
export { urlMatchesIgnoredPattern, isUrlIgnored, } from "./ignoredPatternsCore";
|
|
39
16
|
type Listener = () => void;
|
|
40
17
|
/**
|
|
41
18
|
* Singleton store. One instance per JS runtime, so every consumer (Network tool,
|
|
@@ -80,5 +57,4 @@ export interface UseIgnoredPatternsResult {
|
|
|
80
57
|
* see the same patterns and the same mutations.
|
|
81
58
|
*/
|
|
82
59
|
export declare function useIgnoredPatterns(): UseIgnoredPatternsResult;
|
|
83
|
-
export {};
|
|
84
60
|
//# sourceMappingURL=ignoredPatternsStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignoredPatternsStore.d.ts","sourceRoot":"","sources":["../../../../src/stores/ignoredPatternsStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"ignoredPatternsStore.d.ts","sourceRoot":"","sources":["../../../../src/stores/ignoredPatternsStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,uBAAuB,EACvB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,wBAAwB,EACxB,YAAY,GACb,MAAM,uBAAuB,CAAC;AAqC/B,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B;;;GAGG;AACH,cAAM,oBAAoB;IACxB,OAAO,CAAC,QAAQ,CAEd;IACF,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuB;IACjD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,WAAW,CAA8B;IACjD,2EAA2E;IAC3E,OAAO,CAAC,KAAK,CAAS;IAEtB,mEAAmE;IACnE,WAAW,IAAI,cAAc,EAAE;IAI/B,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI;IASzC,OAAO,CAAC,IAAI;IAIZ,OAAO,CAAC,YAAY;IAyBpB,OAAO,CAAC,OAAO;IAWf,OAAO,CAAC,MAAM;IAOd,yDAAyD;IACzD,GAAG,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAOlC,iCAAiC;IACjC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK3B,iFAAiF;IACjF,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAU3B,+DAA+D;IAC/D,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAUhC;AAED,eAAO,MAAM,oBAAoB,sBAA6B,CAAC;AAE/D,MAAM,WAAW,wBAAwB;IACvC,4CAA4C;IAC5C,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,yEAAyE;IACzE,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,GAAG,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IACvC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAkBD;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,wBAAwB,CAwB7D"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ignoredPatternsStore.web — web twin of ignoredPatternsStore.ts (the shared
|
|
3
|
+
* persisted "ignored patterns" singleton for network-style URL filtering).
|
|
4
|
+
*
|
|
5
|
+
* The native store imports shared's RN `persistentStorage` (whose module graph
|
|
6
|
+
* carries guarded expo-file-system / async-storage requires), which is why the
|
|
7
|
+
* web shims never re-exported it. This twin keeps the ENTIRE store class, hook
|
|
8
|
+
* and persistence contract identical — same class shape, same
|
|
9
|
+
* `devToolsStorageKeys.network.ignoredDomains()` storage key, same persisted
|
|
10
|
+
* JSON shape (`IgnoredPattern[]`, with the legacy `string[]` migration) — and
|
|
11
|
+
* swaps only the storage backing: a file-local localStorage adapter that
|
|
12
|
+
* matches the `persistentStorage` API (async getItem/setItem, best-effort,
|
|
13
|
+
* provenance: example-tauri/src/shims/shared-ui.web.ts's adapter — web Buoy
|
|
14
|
+
* chrome persistence lives in webview localStorage).
|
|
15
|
+
*
|
|
16
|
+
* Everything else — pure matching (`ignoredPatternsCore`), the migration +
|
|
17
|
+
* ensure-defaults logic, the dirty-flag load race guard, the module-scope
|
|
18
|
+
* stable mutation identities — is the native code, not a fork of its
|
|
19
|
+
* semantics. Web consumers get the same shared, persisted pattern list the
|
|
20
|
+
* phone has, keyed identically, so a DOM port and a react-native-web port of
|
|
21
|
+
* the same app read/write the same entry.
|
|
22
|
+
*
|
|
23
|
+
* @platform React DOM Web
|
|
24
|
+
*/
|
|
25
|
+
import { type IgnoredPattern } from "./ignoredPatternsCore";
|
|
26
|
+
export type { IgnoredPatternMatchMode, IgnoredPattern, } from "./ignoredPatternsCore";
|
|
27
|
+
export { urlMatchesIgnoredPattern, isUrlIgnored, } from "./ignoredPatternsCore";
|
|
28
|
+
type Listener = () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Singleton store. One instance per JS runtime, so every consumer (Network
|
|
31
|
+
* tool, Events tool, any web panel) shares the same patterns.
|
|
32
|
+
*/
|
|
33
|
+
declare class IgnoredPatternsStore {
|
|
34
|
+
private patterns;
|
|
35
|
+
private readonly listeners;
|
|
36
|
+
private loaded;
|
|
37
|
+
private loadPromise;
|
|
38
|
+
/** Set once a mutation happens so a slow initial load can't clobber it. */
|
|
39
|
+
private dirty;
|
|
40
|
+
/** Current patterns (stable reference until a mutation occurs). */
|
|
41
|
+
getPatterns(): IgnoredPattern[];
|
|
42
|
+
subscribe(listener: Listener): () => void;
|
|
43
|
+
private emit;
|
|
44
|
+
private ensureLoaded;
|
|
45
|
+
private persist;
|
|
46
|
+
private commit;
|
|
47
|
+
/** Add a pattern (no-op if its value already exists). */
|
|
48
|
+
add(pattern: IgnoredPattern): void;
|
|
49
|
+
/** Remove a pattern by value. */
|
|
50
|
+
remove(value: string): void;
|
|
51
|
+
/** Add as `contains` if absent, otherwise remove (used by detail-view chips). */
|
|
52
|
+
toggle(value: string): void;
|
|
53
|
+
/** Flip an existing pattern between `contains` and `exact`. */
|
|
54
|
+
toggleMode(value: string): void;
|
|
55
|
+
}
|
|
56
|
+
export declare const ignoredPatternsStore: IgnoredPatternsStore;
|
|
57
|
+
export interface UseIgnoredPatternsResult {
|
|
58
|
+
/** The ordered list of ignored patterns. */
|
|
59
|
+
patterns: IgnoredPattern[];
|
|
60
|
+
/** Just the pattern values, as a Set (for presence checks in the UI). */
|
|
61
|
+
values: Set<string>;
|
|
62
|
+
add: (pattern: IgnoredPattern) => void;
|
|
63
|
+
remove: (value: string) => void;
|
|
64
|
+
toggle: (value: string) => void;
|
|
65
|
+
toggleMode: (value: string) => void;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Subscribe to the shared ignored-patterns store. All consumers in a runtime
|
|
69
|
+
* see the same patterns and the same mutations.
|
|
70
|
+
*/
|
|
71
|
+
export declare function useIgnoredPatterns(): UseIgnoredPatternsResult;
|
|
72
|
+
//# sourceMappingURL=ignoredPatternsStore.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignoredPatternsStore.web.d.ts","sourceRoot":"","sources":["../../../../src/stores/ignoredPatternsStore.web.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAOH,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,uBAAuB,EACvB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,wBAAwB,EACxB,YAAY,GACb,MAAM,uBAAuB,CAAC;AA4D/B,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B;;;GAGG;AACH,cAAM,oBAAoB;IACxB,OAAO,CAAC,QAAQ,CAEd;IACF,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuB;IACjD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,WAAW,CAA8B;IACjD,2EAA2E;IAC3E,OAAO,CAAC,KAAK,CAAS;IAEtB,mEAAmE;IACnE,WAAW,IAAI,cAAc,EAAE;IAI/B,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI;IASzC,OAAO,CAAC,IAAI;IAIZ,OAAO,CAAC,YAAY;IAyBpB,OAAO,CAAC,OAAO;IAWf,OAAO,CAAC,MAAM;IAOd,yDAAyD;IACzD,GAAG,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAOlC,iCAAiC;IACjC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK3B,iFAAiF;IACjF,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAU3B,+DAA+D;IAC/D,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAUhC;AAED,eAAO,MAAM,oBAAoB,sBAA6B,CAAC;AAE/D,MAAM,WAAW,wBAAwB;IACvC,4CAA4C;IAC5C,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,yEAAyE;IACzE,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,GAAG,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IACvC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAgBD;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,wBAAwB,CAwB7D"}
|
|
@@ -6,6 +6,62 @@
|
|
|
6
6
|
* 2. Uncomment the theme you want
|
|
7
7
|
* 3. Save and refresh
|
|
8
8
|
*/
|
|
9
|
+
export declare const _defaultTheme: {
|
|
10
|
+
border: string;
|
|
11
|
+
blackTint1: string;
|
|
12
|
+
blackTint2: string;
|
|
13
|
+
blackTint3: string;
|
|
14
|
+
success: string;
|
|
15
|
+
warning: string;
|
|
16
|
+
error: string;
|
|
17
|
+
info: string;
|
|
18
|
+
critical: string;
|
|
19
|
+
optional: string;
|
|
20
|
+
env: string;
|
|
21
|
+
storage: string;
|
|
22
|
+
query: string;
|
|
23
|
+
debug: string;
|
|
24
|
+
network: string;
|
|
25
|
+
dataTypes: {
|
|
26
|
+
object: string;
|
|
27
|
+
array: string;
|
|
28
|
+
string: string;
|
|
29
|
+
number: string;
|
|
30
|
+
boolean: string;
|
|
31
|
+
function: string;
|
|
32
|
+
undefined: string;
|
|
33
|
+
null: string;
|
|
34
|
+
};
|
|
35
|
+
text: string;
|
|
36
|
+
secondary: string;
|
|
37
|
+
tertiary: string;
|
|
38
|
+
muted: string;
|
|
39
|
+
neonGlow: {
|
|
40
|
+
primary: string;
|
|
41
|
+
secondary: string;
|
|
42
|
+
tertiary: string;
|
|
43
|
+
};
|
|
44
|
+
diff: {
|
|
45
|
+
addedBackground: string;
|
|
46
|
+
removedBackground: string;
|
|
47
|
+
modifiedBackground: string;
|
|
48
|
+
unchangedBackground: string;
|
|
49
|
+
contextBackground: string;
|
|
50
|
+
addedText: string;
|
|
51
|
+
removedText: string;
|
|
52
|
+
modifiedText: string;
|
|
53
|
+
unchangedText: string;
|
|
54
|
+
addedWordHighlight: string;
|
|
55
|
+
removedWordHighlight: string;
|
|
56
|
+
lineNumberBackground: string;
|
|
57
|
+
lineNumberText: string;
|
|
58
|
+
lineNumberBorder: string;
|
|
59
|
+
markerAddedBackground: string;
|
|
60
|
+
markerRemovedBackground: string;
|
|
61
|
+
markerModifiedBackground: string;
|
|
62
|
+
markerText: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
9
65
|
export declare const gameUIColors: {
|
|
10
66
|
background: string;
|
|
11
67
|
panel: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gameUIColors.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/gameUI/constants/gameUIColors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"gameUIColors.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/gameUI/constants/gameUIColors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAaH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6EzB,CAAC;AAuCF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAmC,CAAC;AAE7D,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,YAAY,CAAC;AAEvD;;;;qEAIqE;AACrE,eAAO,MAAM,mBAAmB,YAG/B,CAAC;AAKF;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;CAsBb,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,UAAU,CAAC;AAGnD,eAAO,MAAM,UAAU;;;;;;;;CAQtB,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JsModal.web — DOM port of JsModal.tsx (React Native).
|
|
3
|
+
*
|
|
4
|
+
* The dual-mode tool-panel container: draggable bottom sheet ⇄ floating
|
|
5
|
+
* window. Same exported names (`JsModal`, `ModalMode`, `ModalState`), same
|
|
6
|
+
* prop contract, same gesture spec and persistence key/JSON shape as the
|
|
7
|
+
* native file. Zero react-native imports — header chrome that lives in
|
|
8
|
+
* shared-ui RN components (`WindowControls`, `DraggableHeader`, `ModalHeader`,
|
|
9
|
+
* `ModalHintBanner`) is replicated as DOM with provenance comments, the same
|
|
10
|
+
* way DevToolsSettingsModal.web.tsx replicates the WindowControls close dot.
|
|
11
|
+
*
|
|
12
|
+
* Gesture spec (verbatim from native):
|
|
13
|
+
* - Sheet header drag: steal at |dy| > 3px, absolute finger anchoring
|
|
14
|
+
* (height = screenH − (pointerY − grab offset)), clamped to
|
|
15
|
+
* [minHeight, maxHeight ?? screenH − safeTop]. Fast downward swipe closes:
|
|
16
|
+
* (vy > 0.8 px/ms && dy > 50) || (dy > 150 && height <= minHeight).
|
|
17
|
+
* - Floating header drag (DraggableHeader.tsx): drag starts at
|
|
18
|
+
* |dx|+|dy| > 5, position unclamped during move, clamped on release to
|
|
19
|
+
* x ∈ [0, screenW − width], y ∈ [safeTop, screenH − height].
|
|
20
|
+
* - Corner resize (bottom corners only): moves < 0.5px ignored; rect clamped
|
|
21
|
+
* to safe-area bounds; min size = screenW*0.25 × 80.
|
|
22
|
+
* - Header taps (both modes): taps accumulate within a 500ms window and
|
|
23
|
+
* settle after 300ms — 2 taps toggles mode, ≥3 taps minimizes.
|
|
24
|
+
*
|
|
25
|
+
* Persistence (verbatim from native ModalStorage): the `persistenceKey` prop
|
|
26
|
+
* is the storage key, used verbatim (native callers pass fully-derived
|
|
27
|
+
* `@react_buoy…` keys or short keys — no extra derivation happens here
|
|
28
|
+
* either). JSON shape `{ mode, panelHeight, dimensions: {width, height, top,
|
|
29
|
+
* left}, isVisible }`, saved on a 500ms debounce after state loads, with the
|
|
30
|
+
* same in-memory cache in front of storage. Backed by a local
|
|
31
|
+
* localStorage adapter matching the `persistentStorage` API — importing
|
|
32
|
+
* `./utils/persistentStorage` is avoided on purpose: its lazy `require()`
|
|
33
|
+
* probing of expo-file-system/AsyncStorage doesn't survive Vite's ESM graph.
|
|
34
|
+
* The hint-acknowledged flag uses the real `devToolsStorageKeys` helper
|
|
35
|
+
* (zero-dep) so the key matches native exactly.
|
|
36
|
+
*
|
|
37
|
+
* Intentional deviations from the native file (all logged):
|
|
38
|
+
* - No native-driver springs: rAF drives all animations. The open/close
|
|
39
|
+
* spring (tension 180, friction 22, ~300ms settle) is approximated with a
|
|
40
|
+
* 300ms ease-out-cubic; native `Animated.timing` calls keep their exact
|
|
41
|
+
* durations (200ms fades, 300ms minimize) with ease-in-out.
|
|
42
|
+
* - No RN Modal/overlay layer: fixed-position divs with the `zIndex` prop
|
|
43
|
+
* (default 1000, same as the native styles).
|
|
44
|
+
* - `benchMotion` and `animatedHeight` (DEV-only benchmark seams) are
|
|
45
|
+
* accepted and no-op'd — the web build has no tool-bench harness.
|
|
46
|
+
* - `CyberpunkModalHeader` complete-replacement detection in ModalHeader is
|
|
47
|
+
* not ported (that component is RN-only); custom header content renders
|
|
48
|
+
* inside the standard header structure, with `onMinimize` injected via
|
|
49
|
+
* cloneElement like native's non-replacement path.
|
|
50
|
+
* - Native captures `Dimensions.get("window")` once at module load; the web
|
|
51
|
+
* twin reads `window.innerWidth/innerHeight` lazily so late layout (Tauri/
|
|
52
|
+
* WKWebView) doesn't bake in a 0×0 screen.
|
|
53
|
+
* - Safe-area insets come from a one-shot `env(safe-area-inset-*)` probe
|
|
54
|
+
* (same trick as floatingTools.web.tsx) instead of the RN hook.
|
|
55
|
+
* - On restore-from-minimize, the floating position re-syncs from the last
|
|
56
|
+
* committed dimensions when the panel becomes visible: the web AppHost
|
|
57
|
+
* doesn't pass `initialModalState` back, and without the re-sync the panel
|
|
58
|
+
* would reappear at the minimize target.
|
|
59
|
+
* - `JsModalProps` is additionally exported (native keeps it private) so web
|
|
60
|
+
* consumers can type wrappers without redeclaring the contract.
|
|
61
|
+
* - `visible={false}` renders children in a `display:none` div (state and
|
|
62
|
+
* listeners survive) instead of native's offscreen −9999 container.
|
|
63
|
+
* - The hidden/floating/bottomSheet root branches carry distinct React keys:
|
|
64
|
+
* the rAF animations write opacity/transform straight to the DOM, and DOM
|
|
65
|
+
* reuse across branches (e.g. an async persisted-mode flip mid-entrance)
|
|
66
|
+
* would leak those styles onto unrelated chrome (blank header bug).
|
|
67
|
+
*
|
|
68
|
+
* @platform React DOM Web (Vite, Tauri, Capacitor/Ionic, Electron)
|
|
69
|
+
*/
|
|
70
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
71
|
+
export type ModalMode = "bottomSheet" | "floating";
|
|
72
|
+
interface HeaderConfig {
|
|
73
|
+
title?: string;
|
|
74
|
+
subtitle?: string;
|
|
75
|
+
showToggleButton?: boolean;
|
|
76
|
+
customContent?: ReactNode;
|
|
77
|
+
hideCloseButton?: boolean;
|
|
78
|
+
hideMinimizeButton?: boolean;
|
|
79
|
+
}
|
|
80
|
+
interface CustomStyles {
|
|
81
|
+
container?: CSSProperties;
|
|
82
|
+
content?: CSSProperties;
|
|
83
|
+
}
|
|
84
|
+
/** Modal state that can be saved and restored when minimizing/restoring. */
|
|
85
|
+
export interface ModalState {
|
|
86
|
+
mode: ModalMode;
|
|
87
|
+
panelHeight?: number;
|
|
88
|
+
floatingPosition?: {
|
|
89
|
+
x: number;
|
|
90
|
+
y: number;
|
|
91
|
+
};
|
|
92
|
+
floatingDimensions?: {
|
|
93
|
+
width: number;
|
|
94
|
+
height: number;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export interface JsModalProps {
|
|
98
|
+
visible: boolean;
|
|
99
|
+
onClose: () => void;
|
|
100
|
+
children: ReactNode;
|
|
101
|
+
header?: HeaderConfig;
|
|
102
|
+
styles?: CustomStyles;
|
|
103
|
+
minHeight?: number;
|
|
104
|
+
maxHeight?: number;
|
|
105
|
+
initialHeight?: number;
|
|
106
|
+
/** DEV-only native seam (external Animated height) — accepted, no-op on web. */
|
|
107
|
+
animatedHeight?: unknown;
|
|
108
|
+
/** DEV-only native benchmark motion — accepted, no-op on web. */
|
|
109
|
+
benchMotion?: "resize" | "float-drag" | "float-resize" | "mode-cycle";
|
|
110
|
+
initialMode?: ModalMode;
|
|
111
|
+
onModeChange?: (mode: ModalMode) => void;
|
|
112
|
+
persistenceKey?: string;
|
|
113
|
+
enablePersistence?: boolean;
|
|
114
|
+
enableGlitchEffects?: boolean;
|
|
115
|
+
initialFloatingPosition?: {
|
|
116
|
+
x?: number;
|
|
117
|
+
y?: number;
|
|
118
|
+
};
|
|
119
|
+
footer?: ReactNode;
|
|
120
|
+
footerHeight?: number;
|
|
121
|
+
onBack?: () => void;
|
|
122
|
+
/** Callback when minimize is requested - receives current modal state for restoration */
|
|
123
|
+
onMinimize?: (modalState: ModalState) => void;
|
|
124
|
+
/** Target position for minimize animation (where the icon will appear) */
|
|
125
|
+
minimizeTargetPosition?: {
|
|
126
|
+
x: number;
|
|
127
|
+
y: number;
|
|
128
|
+
};
|
|
129
|
+
/** Initial modal state to restore from (when restoring from minimized) */
|
|
130
|
+
initialModalState?: ModalState;
|
|
131
|
+
/** z-index for stacking multiple modals (higher = on top) */
|
|
132
|
+
zIndex?: number;
|
|
133
|
+
/** If true, children render directly without the scroll wrapper */
|
|
134
|
+
disableScrollWrapper?: boolean;
|
|
135
|
+
}
|
|
136
|
+
export declare const JsModal: import("react").NamedExoticComponent<JsModalProps>;
|
|
137
|
+
export {};
|
|
138
|
+
//# sourceMappingURL=JsModal.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsModal.web.d.ts","sourceRoot":"","sources":["../../../src/JsModal.web.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AAEH,OAAO,EASL,KAAK,aAAa,EAGlB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAmHf,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;AAEnD,UAAU,YAAY;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,UAAU,YAAY;IAEpB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,4EAA4E;AAC5E,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE;QAAE,CAAC,EA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AAE,CAAC;IAClD,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AA88CD,eAAO,MAAM,OAAO,oDAAyB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Environment } from '../types/types';
|
|
2
|
+
export interface EnvironmentIndicatorProps {
|
|
3
|
+
environment: Environment | string;
|
|
4
|
+
/** When true, the badge becomes pressable and shows a dropdown indicator */
|
|
5
|
+
interactive?: boolean;
|
|
6
|
+
/** Called when the badge is pressed (only when interactive is true) */
|
|
7
|
+
onPress?: () => void;
|
|
8
|
+
}
|
|
9
|
+
interface EnvironmentConfig {
|
|
10
|
+
label: string;
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function getEnvironmentConfig(environment: Environment | string): EnvironmentConfig;
|
|
14
|
+
export declare function EnvironmentIndicator({ environment, interactive, onPress, }: EnvironmentIndicatorProps): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=EnvironmentIndicator.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnvironmentIndicator.web.d.ts","sourceRoot":"","sources":["../../../../src/env/EnvironmentIndicator.web.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,gBAAgB,CAAC;AAExE,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,WAAW,GAAG,MAAM,CAAC;IAClC,4EAA4E;IAC5E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,GAAG,MAAM,GAChC,iBAAiB,CAcnB;AAkBD,wBAAgB,oBAAoB,CAAC,EACnC,WAAW,EACX,WAAmB,EACnB,OAAO,GACR,EAAE,yBAAyB,+BA+C3B"}
|