@buoy-gg/core 7.0.16 → 7.0.17
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/floatingMenu/AppHost.js +18 -0
- package/lib/commonjs/floatingMenu/FloatingMenu.js +2 -1
- package/lib/commonjs/floatingMenu/ToolHost.js +264 -0
- package/lib/commonjs/floatingMenu/allToolsRegistry.js +7 -0
- package/lib/commonjs/floatingMenu/autoDiscoverPresets.js +16 -0
- package/lib/commonjs/floatingMenu/autoExternalSync.js +9 -0
- package/lib/commonjs/floatingMenu/dial/DialDevTools.js +2 -1
- package/lib/commonjs/index.js +27 -0
- package/lib/commonjs/toolkit.js +427 -0
- package/lib/module/floatingMenu/AppHost.js +18 -0
- package/lib/module/floatingMenu/FloatingMenu.js +2 -1
- package/lib/module/floatingMenu/ToolHost.js +256 -0
- package/lib/module/floatingMenu/allToolsRegistry.js +8 -1
- package/lib/module/floatingMenu/autoDiscoverPresets.js +16 -0
- package/lib/module/floatingMenu/autoExternalSync.js +9 -0
- package/lib/module/floatingMenu/dial/DialDevTools.js +2 -1
- package/lib/module/index.js +6 -0
- package/lib/module/toolkit.js +45 -0
- package/lib/typescript/commonjs/floatingMenu/AppHost.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/AppHostLogic.d.ts +3 -0
- package/lib/typescript/commonjs/floatingMenu/AppHostLogic.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/FloatingMenu.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/ToolHost.d.ts +72 -0
- package/lib/typescript/commonjs/floatingMenu/ToolHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/allToolsRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/autoDiscoverPresets.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/autoExternalSync.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts +1 -1
- package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/types.d.ts +30 -1
- package/lib/typescript/commonjs/floatingMenu/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/toolkit.d.ts +22 -0
- package/lib/typescript/commonjs/toolkit.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/AppHost.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/AppHostLogic.d.ts +3 -0
- package/lib/typescript/module/floatingMenu/AppHostLogic.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/FloatingMenu.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/ToolHost.d.ts +72 -0
- package/lib/typescript/module/floatingMenu/ToolHost.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/allToolsRegistry.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/autoDiscoverPresets.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/autoExternalSync.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/defaultConfig.d.ts +1 -1
- package/lib/typescript/module/floatingMenu/defaultConfig.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/dial/DialDevTools.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/types.d.ts +30 -1
- package/lib/typescript/module/floatingMenu/types.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/toolkit.d.ts +22 -0
- package/lib/typescript/module/toolkit.d.ts.map +1 -0
- package/package.json +5 -5
|
@@ -9,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
10
|
var _AppHostLogic = require("./AppHostLogic.js");
|
|
11
11
|
var _MinimizedToolsContext = require("./MinimizedToolsContext.js");
|
|
12
|
+
var _ToolHost = require("./ToolHost.js");
|
|
12
13
|
var _DevToolsSettingsModal = require("./DevToolsSettingsModal");
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
@@ -81,6 +82,7 @@ const AppHostProvider = ({
|
|
|
81
82
|
singleton: appDef.singleton,
|
|
82
83
|
icon: resolvedIcon,
|
|
83
84
|
color: appDef.color,
|
|
85
|
+
modal: appDef.modal,
|
|
84
86
|
minimized: minimized // Preserve minimized state
|
|
85
87
|
});
|
|
86
88
|
}
|
|
@@ -257,6 +259,22 @@ const AppRenderer = ({
|
|
|
257
259
|
enableSharedModalDimensions: true
|
|
258
260
|
} : {})
|
|
259
261
|
};
|
|
262
|
+
|
|
263
|
+
// Declarative chrome: the component is a plain body — wrap it in the shared
|
|
264
|
+
// modal shell (JsModal + managed header + search + toasts).
|
|
265
|
+
if (app.modal && (app.launchMode === "self-modal" || !app.launchMode)) {
|
|
266
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ToolHost.ToolModalShell, {
|
|
267
|
+
app: app,
|
|
268
|
+
config: app.modal,
|
|
269
|
+
visible: isVisible,
|
|
270
|
+
zIndex: zIndex,
|
|
271
|
+
onClose: onClose,
|
|
272
|
+
onMinimize: onMinimize,
|
|
273
|
+
initialModalState: app.restoreState,
|
|
274
|
+
enableSharedModalDimensions: globalEnableSharedModalDimensions === true,
|
|
275
|
+
bodyProps: mergedProps
|
|
276
|
+
});
|
|
277
|
+
}
|
|
260
278
|
if (app.launchMode === "self-modal") {
|
|
261
279
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
262
280
|
...mergedProps,
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ToolModalShell = ToolModalShell;
|
|
7
|
+
exports.useToolHeader = useToolHeader;
|
|
8
|
+
exports.useToolHost = useToolHost;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
/**
|
|
15
|
+
* ToolHost — the declarative chrome layer for custom tools.
|
|
16
|
+
*
|
|
17
|
+
* When an `InstalledApp` declares `modal: {...}`, the AppHost renders its
|
|
18
|
+
* component inside `ToolModalShell` instead of raw: the shared JsModal
|
|
19
|
+
* (drag/resize, floating⇄bottom-sheet, minimize, dimension persistence) plus
|
|
20
|
+
* a managed header (title/subtitle, back navigation, search, actions) and a
|
|
21
|
+
* lightweight toast layer. The tool body talks back to the shell through
|
|
22
|
+
* `useToolHost()` / `useToolHeader()`.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/** Per-screen header overrides a tool body can apply (see `useToolHeader`). */
|
|
26
|
+
|
|
27
|
+
const noop = () => {};
|
|
28
|
+
const FALLBACK_CONTEXT = {
|
|
29
|
+
search: "",
|
|
30
|
+
isSearchActive: false,
|
|
31
|
+
clearSearch: noop,
|
|
32
|
+
close: noop,
|
|
33
|
+
showToast: noop,
|
|
34
|
+
setHeaderOverride: noop
|
|
35
|
+
};
|
|
36
|
+
const ToolHostContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Access the hosting shell from a custom tool body: search query, toasts,
|
|
40
|
+
* close. Safe to call outside the shell (returns inert no-ops) so tool
|
|
41
|
+
* components can also be mounted standalone.
|
|
42
|
+
*/
|
|
43
|
+
function useToolHost() {
|
|
44
|
+
return (0, _react.useContext)(ToolHostContext) ?? FALLBACK_CONTEXT;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Declare per-screen header state (title/subtitle/actions/back) from inside a
|
|
49
|
+
* tool body. Applies while the calling component is mounted and reverts to
|
|
50
|
+
* the preset's static config on unmount — so a detail screen simply mounts
|
|
51
|
+
* with its own header and the list header returns when it unmounts.
|
|
52
|
+
*
|
|
53
|
+
* ```tsx
|
|
54
|
+
* useToolHeader(
|
|
55
|
+
* { title: flag.key, onBack: () => setScreen("list"), actions: <CopyButton value={flag} /> },
|
|
56
|
+
* [flag.key]
|
|
57
|
+
* );
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
function useToolHeader(override, deps) {
|
|
61
|
+
const {
|
|
62
|
+
setHeaderOverride
|
|
63
|
+
} = useToolHost();
|
|
64
|
+
(0, _react.useEffect)(() => {
|
|
65
|
+
setHeaderOverride(override);
|
|
66
|
+
return () => setHeaderOverride(null);
|
|
67
|
+
// Caller-provided deps intentionally control when the override refreshes.
|
|
68
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
|
+
}, deps);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// ---------------------------------------------------------------------------
|
|
73
|
+
// Toast layer
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
|
|
76
|
+
const TOAST_DURATION_MS = 2200;
|
|
77
|
+
const TOAST_COLORS = {
|
|
78
|
+
success: _sharedUi.gameUIColors.success,
|
|
79
|
+
error: _sharedUi.gameUIColors.error,
|
|
80
|
+
info: _sharedUi.gameUIColors.info
|
|
81
|
+
};
|
|
82
|
+
function ToastView({
|
|
83
|
+
message,
|
|
84
|
+
type,
|
|
85
|
+
nonce
|
|
86
|
+
}) {
|
|
87
|
+
const opacity = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
88
|
+
(0, _react.useEffect)(() => {
|
|
89
|
+
opacity.setValue(0);
|
|
90
|
+
_reactNative.Animated.sequence([_reactNative.Animated.timing(opacity, {
|
|
91
|
+
toValue: 1,
|
|
92
|
+
duration: 150,
|
|
93
|
+
useNativeDriver: true
|
|
94
|
+
}), _reactNative.Animated.delay(TOAST_DURATION_MS - 450), _reactNative.Animated.timing(opacity, {
|
|
95
|
+
toValue: 0,
|
|
96
|
+
duration: 300,
|
|
97
|
+
useNativeDriver: true
|
|
98
|
+
})]).start();
|
|
99
|
+
}, [nonce, opacity]);
|
|
100
|
+
const color = TOAST_COLORS[type];
|
|
101
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
|
|
102
|
+
pointerEvents: "none",
|
|
103
|
+
style: [styles.toast, {
|
|
104
|
+
opacity,
|
|
105
|
+
borderColor: color + "60"
|
|
106
|
+
}],
|
|
107
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
108
|
+
style: [styles.toastDot, {
|
|
109
|
+
backgroundColor: color
|
|
110
|
+
}]
|
|
111
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
112
|
+
style: styles.toastText,
|
|
113
|
+
numberOfLines: 2,
|
|
114
|
+
children: message
|
|
115
|
+
})]
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ---------------------------------------------------------------------------
|
|
120
|
+
// Shell
|
|
121
|
+
// ---------------------------------------------------------------------------
|
|
122
|
+
|
|
123
|
+
function ToolModalShell({
|
|
124
|
+
app,
|
|
125
|
+
config,
|
|
126
|
+
visible,
|
|
127
|
+
zIndex,
|
|
128
|
+
onClose,
|
|
129
|
+
onMinimize,
|
|
130
|
+
initialModalState,
|
|
131
|
+
enableSharedModalDimensions,
|
|
132
|
+
bodyProps
|
|
133
|
+
}) {
|
|
134
|
+
const Body = app.component;
|
|
135
|
+
const [isSearchActive, setIsSearchActive] = (0, _react.useState)(false);
|
|
136
|
+
const [search, setSearch] = (0, _react.useState)("");
|
|
137
|
+
const [headerOverride, setHeaderOverride] = (0, _react.useState)(null);
|
|
138
|
+
const [toast, setToast] = (0, _react.useState)(null);
|
|
139
|
+
const toastTimeoutRef = (0, _react.useRef)(null);
|
|
140
|
+
const clearSearch = (0, _react.useCallback)(() => {
|
|
141
|
+
setIsSearchActive(false);
|
|
142
|
+
setSearch("");
|
|
143
|
+
}, []);
|
|
144
|
+
const showToast = (0, _react.useCallback)((message, type = "info") => {
|
|
145
|
+
if (toastTimeoutRef.current) clearTimeout(toastTimeoutRef.current);
|
|
146
|
+
setToast(prev => ({
|
|
147
|
+
message,
|
|
148
|
+
type,
|
|
149
|
+
nonce: (prev?.nonce ?? 0) + 1
|
|
150
|
+
}));
|
|
151
|
+
toastTimeoutRef.current = setTimeout(() => setToast(null), TOAST_DURATION_MS);
|
|
152
|
+
}, []);
|
|
153
|
+
(0, _react.useEffect)(() => {
|
|
154
|
+
return () => {
|
|
155
|
+
if (toastTimeoutRef.current) clearTimeout(toastTimeoutRef.current);
|
|
156
|
+
};
|
|
157
|
+
}, []);
|
|
158
|
+
const contextValue = (0, _react.useMemo)(() => ({
|
|
159
|
+
search: isSearchActive ? search : "",
|
|
160
|
+
isSearchActive,
|
|
161
|
+
clearSearch,
|
|
162
|
+
close: onClose,
|
|
163
|
+
showToast,
|
|
164
|
+
setHeaderOverride,
|
|
165
|
+
instanceId: app.instanceId
|
|
166
|
+
}), [search, isSearchActive, clearSearch, onClose, showToast, app.instanceId]);
|
|
167
|
+
const title = headerOverride?.title ?? config.title ?? app.title ?? app.id;
|
|
168
|
+
const subtitle = headerOverride?.subtitle ?? config.subtitle;
|
|
169
|
+
const onBack = headerOverride?.onBack;
|
|
170
|
+
const actions = headerOverride?.actions ?? config.headerActions;
|
|
171
|
+
|
|
172
|
+
// Tool-scoped persistence via the custom namespace unless the user has the
|
|
173
|
+
// shared-dimensions global setting on (all tools share one window size).
|
|
174
|
+
const persistenceKey = enableSharedModalDimensions ? _sharedUi.devToolsStorageKeys.modal.root() : _sharedUi.devToolsStorageKeys.custom(app.id).modal();
|
|
175
|
+
const header = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_sharedUi.ModalHeader, {
|
|
176
|
+
children: [onBack && !isSearchActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation, {
|
|
177
|
+
onBack: onBack
|
|
178
|
+
}), isSearchActive ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Search, {
|
|
179
|
+
value: search,
|
|
180
|
+
onChangeText: setSearch,
|
|
181
|
+
onCancel: clearSearch,
|
|
182
|
+
placeholder: config.searchPlaceholder
|
|
183
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Content, {
|
|
184
|
+
title: title,
|
|
185
|
+
subtitle: subtitle
|
|
186
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_sharedUi.ModalHeader.Actions, {
|
|
187
|
+
children: [!isSearchActive && actions, config.searchable && !isSearchActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.HeaderSearchButton, {
|
|
188
|
+
onPress: () => setIsSearchActive(true)
|
|
189
|
+
})]
|
|
190
|
+
})]
|
|
191
|
+
});
|
|
192
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolHostContext.Provider, {
|
|
193
|
+
value: contextValue,
|
|
194
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.JsModal, {
|
|
195
|
+
visible: visible,
|
|
196
|
+
onClose: onClose,
|
|
197
|
+
onBack: onBack,
|
|
198
|
+
onMinimize: onMinimize,
|
|
199
|
+
initialModalState: initialModalState,
|
|
200
|
+
zIndex: zIndex,
|
|
201
|
+
persistenceKey: persistenceKey,
|
|
202
|
+
enablePersistence: true,
|
|
203
|
+
initialMode: config.initialMode ?? "bottomSheet",
|
|
204
|
+
header: {
|
|
205
|
+
customContent: header,
|
|
206
|
+
showToggleButton: true
|
|
207
|
+
}
|
|
208
|
+
// Tool bodies own their scrolling (ScrollView/FlatList) — the shell
|
|
209
|
+
// must not add a competing wrapper.
|
|
210
|
+
,
|
|
211
|
+
disableScrollWrapper: true,
|
|
212
|
+
styles: {},
|
|
213
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
214
|
+
style: styles.bodyRoot,
|
|
215
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Body, {
|
|
216
|
+
...bodyProps
|
|
217
|
+
}), toast && /*#__PURE__*/(0, _jsxRuntime.jsx)(ToastView, {
|
|
218
|
+
message: toast.message,
|
|
219
|
+
type: toast.type,
|
|
220
|
+
nonce: toast.nonce
|
|
221
|
+
})]
|
|
222
|
+
})
|
|
223
|
+
})
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
const styles = _reactNative.StyleSheet.create({
|
|
227
|
+
bodyRoot: {
|
|
228
|
+
flex: 1,
|
|
229
|
+
minHeight: 0,
|
|
230
|
+
backgroundColor: _sharedUi.buoyColors.base
|
|
231
|
+
},
|
|
232
|
+
toast: {
|
|
233
|
+
position: "absolute",
|
|
234
|
+
bottom: 16,
|
|
235
|
+
alignSelf: "center",
|
|
236
|
+
flexDirection: "row",
|
|
237
|
+
alignItems: "center",
|
|
238
|
+
gap: 8,
|
|
239
|
+
maxWidth: "86%",
|
|
240
|
+
backgroundColor: _sharedUi.buoyColors.card,
|
|
241
|
+
borderWidth: 1,
|
|
242
|
+
borderRadius: 8,
|
|
243
|
+
paddingHorizontal: 12,
|
|
244
|
+
paddingVertical: 8,
|
|
245
|
+
shadowColor: "#000",
|
|
246
|
+
shadowOpacity: 0.4,
|
|
247
|
+
shadowRadius: 8,
|
|
248
|
+
shadowOffset: {
|
|
249
|
+
width: 0,
|
|
250
|
+
height: 2
|
|
251
|
+
},
|
|
252
|
+
elevation: 6
|
|
253
|
+
},
|
|
254
|
+
toastDot: {
|
|
255
|
+
width: 6,
|
|
256
|
+
height: 6,
|
|
257
|
+
borderRadius: 3
|
|
258
|
+
},
|
|
259
|
+
toastText: {
|
|
260
|
+
flex: 1,
|
|
261
|
+
fontSize: 12,
|
|
262
|
+
color: _sharedUi.buoyColors.text
|
|
263
|
+
}
|
|
264
|
+
});
|
|
@@ -113,6 +113,13 @@ const ALL_TOOLS_REGISTRY = exports.ALL_TOOLS_REGISTRY = [{
|
|
|
113
113
|
renderIcon: size => /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.EventsIcon, {
|
|
114
114
|
size: size
|
|
115
115
|
})
|
|
116
|
+
}, {
|
|
117
|
+
id: "time-machine",
|
|
118
|
+
name: "TIME MACHINE",
|
|
119
|
+
color: _floatingToolsCore.TIME_MACHINE_ICON_COLOR,
|
|
120
|
+
renderIcon: size => /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.TimeMachineIcon, {
|
|
121
|
+
size: size
|
|
122
|
+
})
|
|
116
123
|
}, {
|
|
117
124
|
id: "jotai",
|
|
118
125
|
name: "JOTAI",
|
|
@@ -189,6 +189,22 @@ function autoDiscoverPresets() {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
},
|
|
192
|
+
// Time Machine
|
|
193
|
+
{
|
|
194
|
+
name: "@buoy-gg/time-machine",
|
|
195
|
+
loader: () => {
|
|
196
|
+
try {
|
|
197
|
+
// @ts-ignore - Dynamic import that may not exist
|
|
198
|
+
const {
|
|
199
|
+
timeMachineToolPreset
|
|
200
|
+
} = require("@buoy-gg/time-machine");
|
|
201
|
+
return timeMachineToolPreset;
|
|
202
|
+
} catch (e) {
|
|
203
|
+
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/time-machine", e);
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
},
|
|
192
208
|
// Redux DevTools
|
|
193
209
|
{
|
|
194
210
|
name: "@buoy-gg/redux",
|
|
@@ -44,6 +44,7 @@ let zustandModule = null;
|
|
|
44
44
|
let jotaiModule = null;
|
|
45
45
|
let eventsModule = null;
|
|
46
46
|
let consoleModule = null;
|
|
47
|
+
let timeMachineModule = null;
|
|
47
48
|
let envModule = null;
|
|
48
49
|
let highlightUpdatesModule = null;
|
|
49
50
|
let debugBordersModule = null;
|
|
@@ -107,6 +108,11 @@ try {
|
|
|
107
108
|
} catch (e) {
|
|
108
109
|
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/console", e);
|
|
109
110
|
}
|
|
111
|
+
try {
|
|
112
|
+
timeMachineModule = require("@buoy-gg/time-machine");
|
|
113
|
+
} catch (e) {
|
|
114
|
+
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/time-machine", e);
|
|
115
|
+
}
|
|
110
116
|
try {
|
|
111
117
|
envModule = require("@buoy-gg/env");
|
|
112
118
|
} catch (e) {
|
|
@@ -260,6 +266,9 @@ function AutoExternalSync({
|
|
|
260
266
|
if (consoleModule?.consoleSyncAdapter) {
|
|
261
267
|
map.console = consoleModule.consoleSyncAdapter;
|
|
262
268
|
}
|
|
269
|
+
if (timeMachineModule?.timeMachineSyncAdapter) {
|
|
270
|
+
map["time-machine"] = timeMachineModule.timeMachineSyncAdapter;
|
|
271
|
+
}
|
|
263
272
|
if (envModule?.createEnvSyncAdapter) {
|
|
264
273
|
map.env = envModule.createEnvSyncAdapter(requiredEnvVars ?? []);
|
|
265
274
|
}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -21,6 +21,8 @@ var _exportNames = {
|
|
|
21
21
|
AppHostProvider: true,
|
|
22
22
|
AppOverlay: true,
|
|
23
23
|
useAppHost: true,
|
|
24
|
+
useToolHost: true,
|
|
25
|
+
useToolHeader: true,
|
|
24
26
|
DevToolsVisibilityProvider: true,
|
|
25
27
|
useDevToolsVisibility: true,
|
|
26
28
|
toggleStateManager: true,
|
|
@@ -230,6 +232,18 @@ Object.defineProperty(exports, "useMinimizedTools", {
|
|
|
230
232
|
return _MinimizedToolsContext.useMinimizedTools;
|
|
231
233
|
}
|
|
232
234
|
});
|
|
235
|
+
Object.defineProperty(exports, "useToolHeader", {
|
|
236
|
+
enumerable: true,
|
|
237
|
+
get: function () {
|
|
238
|
+
return _ToolHost.useToolHeader;
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
Object.defineProperty(exports, "useToolHost", {
|
|
242
|
+
enumerable: true,
|
|
243
|
+
get: function () {
|
|
244
|
+
return _ToolHost.useToolHost;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
233
247
|
Object.defineProperty(exports, "validateDialConfig", {
|
|
234
248
|
enumerable: true,
|
|
235
249
|
get: function () {
|
|
@@ -256,6 +270,19 @@ Object.keys(_types).forEach(function (key) {
|
|
|
256
270
|
});
|
|
257
271
|
var _DevToolsSettingsModal = require("./floatingMenu/DevToolsSettingsModal");
|
|
258
272
|
var _AppHost = require("./floatingMenu/AppHost");
|
|
273
|
+
var _ToolHost = require("./floatingMenu/ToolHost.js");
|
|
274
|
+
var _toolkit = require("./toolkit.js");
|
|
275
|
+
Object.keys(_toolkit).forEach(function (key) {
|
|
276
|
+
if (key === "default" || key === "__esModule") return;
|
|
277
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
278
|
+
if (key in exports && exports[key] === _toolkit[key]) return;
|
|
279
|
+
Object.defineProperty(exports, key, {
|
|
280
|
+
enumerable: true,
|
|
281
|
+
get: function () {
|
|
282
|
+
return _toolkit[key];
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
});
|
|
259
286
|
var _DevToolsVisibilityContext = require("./floatingMenu/DevToolsVisibilityContext.js");
|
|
260
287
|
var _ToggleStateManager = require("./floatingMenu/ToggleStateManager.js");
|
|
261
288
|
var _MinimizedToolsContext = require("./floatingMenu/MinimizedToolsContext.js");
|