@buoy-gg/time-machine 7.0.41 → 7.0.42
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/components/HeaderActions.js +1 -91
- package/lib/commonjs/components/HeaderReloadButton.js +1 -58
- package/lib/commonjs/components/TimeMachineBody.js +1 -282
- package/lib/commonjs/components/TimeMachineModal.js +1 -74
- package/lib/commonjs/components/confirm.js +2 -38
- package/lib/commonjs/components/floating/NamePromptModal.js +1 -193
- package/lib/commonjs/components/floating/TimeMachineFloatingTool.js +1 -715
- package/lib/commonjs/components/floating/armedPoint.js +1 -92
- package/lib/commonjs/components/floating/barSettings.js +1 -66
- package/lib/commonjs/components/format.js +1 -24
- package/lib/commonjs/components/list/CaptureBar.js +1 -97
- package/lib/commonjs/components/list/RestoreOutcomeCard.js +1 -175
- package/lib/commonjs/components/list/SnapshotRow.js +1 -170
- package/lib/commonjs/components/list/SourcesStrip.js +1 -172
- package/lib/commonjs/components/list/UndoDeleteBar.js +1 -85
- package/lib/commonjs/components/list/WipeAllRow.js +1 -46
- package/lib/commonjs/components/preview/ItemDiffPanel.js +1 -79
- package/lib/commonjs/components/preview/PreviewFlow.js +1 -51
- package/lib/commonjs/components/preview/RestorePointNameRow.js +1 -83
- package/lib/commonjs/components/preview/RestorePreviewScreen.js +1 -1010
- package/lib/commonjs/components/preview/verdictMeta.js +1 -58
- package/lib/commonjs/components/sources.js +1 -83
- package/lib/commonjs/hooks/useTimeMachine.js +1 -24
- package/lib/commonjs/index.js +1 -161
- package/lib/commonjs/preset.js +1 -56
- package/lib/commonjs/store/routeRestore.js +1 -188
- package/lib/commonjs/store/snapshotVault.js +1 -186
- package/lib/commonjs/store/sourceIds.js +1 -9
- package/lib/commonjs/store/sourceSettings.js +1 -79
- package/lib/commonjs/store/timeMachineStore.js +1 -848
- package/lib/commonjs/sync/timeMachineSyncAdapter.js +1 -258
- package/lib/commonjs/ui/SwipeActionsRow.js +1 -178
- package/lib/commonjs/ui/primitives.js +1 -172
- package/lib/commonjs/ui/tmTheme.js +1 -118
- package/lib/module/components/HeaderActions.js +1 -85
- package/lib/module/components/HeaderReloadButton.js +1 -53
- package/lib/module/components/TimeMachineBody.js +1 -277
- package/lib/module/components/TimeMachineModal.js +1 -68
- package/lib/module/components/confirm.js +2 -33
- package/lib/module/components/floating/NamePromptModal.js +1 -188
- package/lib/module/components/floating/TimeMachineFloatingTool.js +1 -708
- package/lib/module/components/floating/armedPoint.js +1 -82
- package/lib/module/components/floating/barSettings.js +1 -57
- package/lib/module/components/format.js +1 -19
- package/lib/module/components/list/CaptureBar.js +1 -92
- package/lib/module/components/list/RestoreOutcomeCard.js +1 -169
- package/lib/module/components/list/SnapshotRow.js +1 -167
- package/lib/module/components/list/SourcesStrip.js +1 -169
- package/lib/module/components/list/UndoDeleteBar.js +1 -82
- package/lib/module/components/list/WipeAllRow.js +1 -41
- package/lib/module/components/preview/ItemDiffPanel.js +1 -74
- package/lib/module/components/preview/PreviewFlow.js +1 -46
- package/lib/module/components/preview/RestorePointNameRow.js +1 -78
- package/lib/module/components/preview/RestorePreviewScreen.js +1 -1005
- package/lib/module/components/preview/verdictMeta.js +1 -54
- package/lib/module/components/sources.js +1 -73
- package/lib/module/hooks/useTimeMachine.js +1 -19
- package/lib/module/index.js +1 -46
- package/lib/module/preset.js +1 -51
- package/lib/module/store/routeRestore.js +1 -176
- package/lib/module/store/snapshotVault.js +1 -170
- package/lib/module/store/sourceIds.js +1 -5
- package/lib/module/store/sourceSettings.js +1 -69
- package/lib/module/store/timeMachineStore.js +1 -839
- package/lib/module/sync/timeMachineSyncAdapter.js +1 -253
- package/lib/module/ui/SwipeActionsRow.js +1 -173
- package/lib/module/ui/primitives.js +1 -164
- package/lib/module/ui/tmTheme.js +1 -114
- package/lib/web/index.mjs +2 -3
- package/package.json +7 -7
- package/lib/commonjs/components/HeaderActions.js.map +0 -1
- package/lib/commonjs/components/HeaderReloadButton.js.map +0 -1
- package/lib/commonjs/components/TimeMachineBody.js.map +0 -1
- package/lib/commonjs/components/TimeMachineModal.js.map +0 -1
- package/lib/commonjs/components/confirm.js.map +0 -1
- package/lib/commonjs/components/floating/NamePromptModal.js.map +0 -1
- package/lib/commonjs/components/floating/TimeMachineFloatingTool.js.map +0 -1
- package/lib/commonjs/components/floating/armedPoint.js.map +0 -1
- package/lib/commonjs/components/floating/barSettings.js.map +0 -1
- package/lib/commonjs/components/format.js.map +0 -1
- package/lib/commonjs/components/list/CaptureBar.js.map +0 -1
- package/lib/commonjs/components/list/RestoreOutcomeCard.js.map +0 -1
- package/lib/commonjs/components/list/SnapshotRow.js.map +0 -1
- package/lib/commonjs/components/list/SourcesStrip.js.map +0 -1
- package/lib/commonjs/components/list/UndoDeleteBar.js.map +0 -1
- package/lib/commonjs/components/list/WipeAllRow.js.map +0 -1
- package/lib/commonjs/components/preview/ItemDiffPanel.js.map +0 -1
- package/lib/commonjs/components/preview/PreviewFlow.js.map +0 -1
- package/lib/commonjs/components/preview/RestorePointNameRow.js.map +0 -1
- package/lib/commonjs/components/preview/RestorePreviewScreen.js.map +0 -1
- package/lib/commonjs/components/preview/verdictMeta.js.map +0 -1
- package/lib/commonjs/components/sources.js.map +0 -1
- package/lib/commonjs/hooks/useTimeMachine.js.map +0 -1
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/preset.js.map +0 -1
- package/lib/commonjs/store/routeRestore.js.map +0 -1
- package/lib/commonjs/store/snapshotVault.js.map +0 -1
- package/lib/commonjs/store/sourceIds.js.map +0 -1
- package/lib/commonjs/store/sourceSettings.js.map +0 -1
- package/lib/commonjs/store/timeMachineStore.js.map +0 -1
- package/lib/commonjs/sync/timeMachineSyncAdapter.js.map +0 -1
- package/lib/commonjs/ui/SwipeActionsRow.js.map +0 -1
- package/lib/commonjs/ui/primitives.js.map +0 -1
- package/lib/commonjs/ui/tmTheme.js.map +0 -1
- package/lib/module/components/HeaderActions.js.map +0 -1
- package/lib/module/components/HeaderReloadButton.js.map +0 -1
- package/lib/module/components/TimeMachineBody.js.map +0 -1
- package/lib/module/components/TimeMachineModal.js.map +0 -1
- package/lib/module/components/confirm.js.map +0 -1
- package/lib/module/components/floating/NamePromptModal.js.map +0 -1
- package/lib/module/components/floating/TimeMachineFloatingTool.js.map +0 -1
- package/lib/module/components/floating/armedPoint.js.map +0 -1
- package/lib/module/components/floating/barSettings.js.map +0 -1
- package/lib/module/components/format.js.map +0 -1
- package/lib/module/components/list/CaptureBar.js.map +0 -1
- package/lib/module/components/list/RestoreOutcomeCard.js.map +0 -1
- package/lib/module/components/list/SnapshotRow.js.map +0 -1
- package/lib/module/components/list/SourcesStrip.js.map +0 -1
- package/lib/module/components/list/UndoDeleteBar.js.map +0 -1
- package/lib/module/components/list/WipeAllRow.js.map +0 -1
- package/lib/module/components/preview/ItemDiffPanel.js.map +0 -1
- package/lib/module/components/preview/PreviewFlow.js.map +0 -1
- package/lib/module/components/preview/RestorePointNameRow.js.map +0 -1
- package/lib/module/components/preview/RestorePreviewScreen.js.map +0 -1
- package/lib/module/components/preview/verdictMeta.js.map +0 -1
- package/lib/module/components/sources.js.map +0 -1
- package/lib/module/hooks/useTimeMachine.js.map +0 -1
- package/lib/module/index.js.map +0 -1
- package/lib/module/preset.js.map +0 -1
- package/lib/module/store/routeRestore.js.map +0 -1
- package/lib/module/store/snapshotVault.js.map +0 -1
- package/lib/module/store/sourceIds.js.map +0 -1
- package/lib/module/store/sourceSettings.js.map +0 -1
- package/lib/module/store/timeMachineStore.js.map +0 -1
- package/lib/module/sync/timeMachineSyncAdapter.js.map +0 -1
- package/lib/module/ui/SwipeActionsRow.js.map +0 -1
- package/lib/module/ui/primitives.js.map +0 -1
- package/lib/module/ui/tmTheme.js.map +0 -1
- package/lib/typescript/components/HeaderActions.d.ts.map +0 -1
- package/lib/typescript/components/HeaderReloadButton.d.ts.map +0 -1
- package/lib/typescript/components/TimeMachineBody.d.ts.map +0 -1
- package/lib/typescript/components/TimeMachineModal.d.ts.map +0 -1
- package/lib/typescript/components/confirm.d.ts.map +0 -1
- package/lib/typescript/components/floating/NamePromptModal.d.ts.map +0 -1
- package/lib/typescript/components/floating/TimeMachineFloatingTool.d.ts.map +0 -1
- package/lib/typescript/components/floating/armedPoint.d.ts.map +0 -1
- package/lib/typescript/components/floating/barSettings.d.ts.map +0 -1
- package/lib/typescript/components/format.d.ts.map +0 -1
- package/lib/typescript/components/list/CaptureBar.d.ts.map +0 -1
- package/lib/typescript/components/list/RestoreOutcomeCard.d.ts.map +0 -1
- package/lib/typescript/components/list/SnapshotRow.d.ts.map +0 -1
- package/lib/typescript/components/list/SourcesStrip.d.ts.map +0 -1
- package/lib/typescript/components/list/UndoDeleteBar.d.ts.map +0 -1
- package/lib/typescript/components/list/WipeAllRow.d.ts.map +0 -1
- package/lib/typescript/components/preview/ItemDiffPanel.d.ts.map +0 -1
- package/lib/typescript/components/preview/PreviewFlow.d.ts.map +0 -1
- package/lib/typescript/components/preview/RestorePointNameRow.d.ts.map +0 -1
- package/lib/typescript/components/preview/RestorePreviewScreen.d.ts.map +0 -1
- package/lib/typescript/components/preview/verdictMeta.d.ts.map +0 -1
- package/lib/typescript/components/sources.d.ts.map +0 -1
- package/lib/typescript/hooks/useTimeMachine.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
- package/lib/typescript/store/routeRestore.d.ts.map +0 -1
- package/lib/typescript/store/snapshotVault.d.ts.map +0 -1
- package/lib/typescript/store/sourceIds.d.ts.map +0 -1
- package/lib/typescript/store/sourceSettings.d.ts.map +0 -1
- package/lib/typescript/store/timeMachineStore.d.ts.map +0 -1
- package/lib/typescript/sync/timeMachineSyncAdapter.d.ts.map +0 -1
- package/lib/typescript/ui/SwipeActionsRow.d.ts.map +0 -1
- package/lib/typescript/ui/primitives.d.ts.map +0 -1
- package/lib/typescript/ui/tmTheme.d.ts.map +0 -1
|
@@ -1,91 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.HeaderBarButton = HeaderBarButton;
|
|
7
|
-
exports.TimeMachineHeaderActions = TimeMachineHeaderActions;
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
10
|
-
var _core = require("@buoy-gg/core");
|
|
11
|
-
var _HeaderReloadButton = require("./HeaderReloadButton");
|
|
12
|
-
var _TimeMachineFloatingTool = require("./floating/TimeMachineFloatingTool");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
/**
|
|
15
|
-
* The tool's header actions, in Network's header language: labeled
|
|
16
|
-
* dark-glass chips. "Action bar" is named for the thing it opens, the
|
|
17
|
-
* floating action bar over the app, and takes the accent ink as the one
|
|
18
|
-
* action a newcomer has to find. Reload is the plain JS reload.
|
|
19
|
-
*
|
|
20
|
-
* Action bar puts a restore point on the floating bar and gets the modal out
|
|
21
|
-
* of the way. The preview screen passes the point it is showing as `armId`,
|
|
22
|
-
* so opening it from there arms that point; the list leaves it to the
|
|
23
|
-
* default rule.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
function HeaderBarButton({
|
|
27
|
-
armId
|
|
28
|
-
}) {
|
|
29
|
-
const host = (0, _core.useToolHost)();
|
|
30
|
-
const onPress = () => {
|
|
31
|
-
(0, _TimeMachineFloatingTool.openTimeMachineFloatingTool)(armId);
|
|
32
|
-
// Same move as Network: the bar is for using the app, so the modal
|
|
33
|
-
// minimizes to the dock instead of covering the screen the bar controls.
|
|
34
|
-
host.minimize();
|
|
35
|
-
};
|
|
36
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
37
|
-
style: styles.labeledChip,
|
|
38
|
-
onPress: onPress,
|
|
39
|
-
accessibilityLabel: "Open the floating action bar over the app",
|
|
40
|
-
accessibilityRole: "button",
|
|
41
|
-
testID: "time-machine-header-bar",
|
|
42
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
43
|
-
style: styles.glyph
|
|
44
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
45
|
-
style: styles.label,
|
|
46
|
-
children: "Action bar"
|
|
47
|
-
})]
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function TimeMachineHeaderActions({
|
|
51
|
-
armId
|
|
52
|
-
}) {
|
|
53
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
54
|
-
style: styles.row,
|
|
55
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(HeaderBarButton, {
|
|
56
|
-
armId: armId
|
|
57
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderReloadButton.HeaderReloadButton, {})]
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
const styles = _reactNative.StyleSheet.create({
|
|
61
|
-
row: {
|
|
62
|
-
flexDirection: "row",
|
|
63
|
-
alignItems: "center",
|
|
64
|
-
gap: 8
|
|
65
|
-
},
|
|
66
|
-
labeledChip: {
|
|
67
|
-
height: 32,
|
|
68
|
-
flexDirection: "row",
|
|
69
|
-
alignItems: "center",
|
|
70
|
-
gap: 6,
|
|
71
|
-
paddingHorizontal: 10,
|
|
72
|
-
borderRadius: 8,
|
|
73
|
-
borderWidth: 1,
|
|
74
|
-
borderColor: _sharedUi.night.color.border,
|
|
75
|
-
backgroundColor: _sharedUi.night.color.buttonSurface
|
|
76
|
-
},
|
|
77
|
-
// A small strip outline: the thing the button opens.
|
|
78
|
-
glyph: {
|
|
79
|
-
width: 14,
|
|
80
|
-
height: 8,
|
|
81
|
-
borderRadius: 3,
|
|
82
|
-
borderWidth: 1.5,
|
|
83
|
-
borderColor: _sharedUi.night.color.accent
|
|
84
|
-
},
|
|
85
|
-
label: {
|
|
86
|
-
fontSize: 11,
|
|
87
|
-
fontWeight: "700",
|
|
88
|
-
color: _sharedUi.night.color.accent
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
//# sourceMappingURL=HeaderActions.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.HeaderBarButton=HeaderBarButton;exports.TimeMachineHeaderActions=TimeMachineHeaderActions;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _core=require("@buoy-gg/core");var _HeaderReloadButton=require("./HeaderReloadButton");var _TimeMachineFloatingTool=require("./floating/TimeMachineFloatingTool");var _jsxRuntime=require("react/jsx-runtime");function HeaderBarButton({armId:e}){const r=(0,_core.useToolHost)();const t=()=>{(0,_TimeMachineFloatingTool.openTimeMachineFloatingTool)(e);r.minimize()};return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.labeledChip,onPress:t,accessibilityLabel:"Open the floating action bar over the app",accessibilityRole:"button",testID:"time-machine-header-bar",children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.glyph}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.label,children:"Action bar"})]})}function TimeMachineHeaderActions({armId:e}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(HeaderBarButton,{armId:e}),(0,_jsxRuntime.jsx)(_HeaderReloadButton.HeaderReloadButton,{})]})}const styles=_reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"center",gap:8},labeledChip:{height:32,flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:10,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,backgroundColor:_sharedUi.night.color.buttonSurface},glyph:{width:14,height:8,borderRadius:3,borderWidth:1.5,borderColor:_sharedUi.night.color.accent},label:{fontSize:11,fontWeight:"700",color:_sharedUi.night.color.accent}});
|
|
@@ -1,58 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.HeaderReloadButton = HeaderReloadButton;
|
|
7
|
-
var _reactNative = require("react-native");
|
|
8
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
/**
|
|
11
|
-
* The reload header action: a plain JS-bundle reload (no restore), so
|
|
12
|
-
* in-memory state rebuilds from whatever is persisted.
|
|
13
|
-
*
|
|
14
|
-
* A labeled dark-glass chip, the same shape as the Pin chip beside it and
|
|
15
|
-
* Network's "Override": the words are the whole explanation.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
function HeaderReloadButton() {
|
|
19
|
-
const onPress = () => {
|
|
20
|
-
try {
|
|
21
|
-
(0, _sharedUi.scheduleReloadApp)({
|
|
22
|
-
reason: "buoy time-machine reload app"
|
|
23
|
-
});
|
|
24
|
-
} catch {
|
|
25
|
-
// No reload mechanism available (bare production build) — nothing to do.
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
29
|
-
style: styles.chip,
|
|
30
|
-
onPress: onPress,
|
|
31
|
-
accessibilityLabel: "Reload app",
|
|
32
|
-
accessibilityHint: "Reloads the JavaScript bundle without restoring anything",
|
|
33
|
-
accessibilityRole: "button",
|
|
34
|
-
testID: "time-machine-reload-app",
|
|
35
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
36
|
-
style: styles.label,
|
|
37
|
-
children: "Reload app"
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
const styles = _reactNative.StyleSheet.create({
|
|
42
|
-
chip: {
|
|
43
|
-
height: 32,
|
|
44
|
-
paddingHorizontal: 10,
|
|
45
|
-
borderRadius: 8,
|
|
46
|
-
borderWidth: 1,
|
|
47
|
-
borderColor: _sharedUi.night.color.border,
|
|
48
|
-
backgroundColor: _sharedUi.night.color.buttonSurface,
|
|
49
|
-
alignItems: "center",
|
|
50
|
-
justifyContent: "center"
|
|
51
|
-
},
|
|
52
|
-
label: {
|
|
53
|
-
fontSize: 11,
|
|
54
|
-
fontWeight: "700",
|
|
55
|
-
color: _sharedUi.night.color.textSecondary
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
//# sourceMappingURL=HeaderReloadButton.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.HeaderReloadButton=HeaderReloadButton;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function HeaderReloadButton(){const e=()=>{try{(0,_sharedUi.scheduleReloadApp)({reason:"buoy time-machine reload app"})}catch{}};return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.chip,onPress:e,accessibilityLabel:"Reload app",accessibilityHint:"Reloads the JavaScript bundle without restoring anything",accessibilityRole:"button",testID:"time-machine-reload-app",children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.label,children:"Reload app"})})}const styles=_reactNative.StyleSheet.create({chip:{height:32,paddingHorizontal:10,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,backgroundColor:_sharedUi.night.color.buttonSurface,alignItems:"center",justifyContent:"center"},label:{fontSize:11,fontWeight:"700",color:_sharedUi.night.color.textSecondary}});
|
|
@@ -1,282 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TimeMachineBody = TimeMachineBody;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
10
|
-
var _core = require("@buoy-gg/core");
|
|
11
|
-
var _useTimeMachine = require("../hooks/useTimeMachine");
|
|
12
|
-
var _timeMachineStore = require("../store/timeMachineStore");
|
|
13
|
-
var _primitives = require("../ui/primitives");
|
|
14
|
-
var _tmTheme = require("../ui/tmTheme");
|
|
15
|
-
var _sources = require("./sources");
|
|
16
|
-
var _confirm = require("./confirm");
|
|
17
|
-
var _CaptureBar = require("./list/CaptureBar");
|
|
18
|
-
var _RestoreOutcomeCard = require("./list/RestoreOutcomeCard");
|
|
19
|
-
var _SnapshotRow = require("./list/SnapshotRow");
|
|
20
|
-
var _UndoDeleteBar = require("./list/UndoDeleteBar");
|
|
21
|
-
var _SourcesStrip = require("./list/SourcesStrip");
|
|
22
|
-
var _WipeAllRow = require("./list/WipeAllRow");
|
|
23
|
-
var _PreviewFlow = require("./preview/PreviewFlow");
|
|
24
|
-
var _TimeMachineFloatingTool = require("./floating/TimeMachineFloatingTool");
|
|
25
|
-
var _armedPoint = require("./floating/armedPoint");
|
|
26
|
-
var _sourceSettings = require("../store/sourceSettings");
|
|
27
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
|
-
/**
|
|
29
|
-
* Time Machine body — the screen router plus the restore-point list.
|
|
30
|
-
*
|
|
31
|
-
* Screens: list → preview. Each is its own component that mounts and
|
|
32
|
-
* unmounts whole (no branching inside a single tree), and each owns its own
|
|
33
|
-
* scrolling — the host must NOT wrap this in a scroll view, or the preview's
|
|
34
|
-
* virtualized FlatList is defeated. Item diffs expand inline in that list
|
|
35
|
-
* rather than being a third screen.
|
|
36
|
-
*
|
|
37
|
-
* The list follows the grouped-inset surface in ../ui: capture bar, the
|
|
38
|
-
* Sources strip, one card of restore points with swipe-to-delete, and the
|
|
39
|
-
* app-wide wipe kept last and understated.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
const isBarOpen = () => (0, _sharedUi.getFloatingTools)().some(tool => tool.id === _TimeMachineFloatingTool.TIME_MACHINE_FLOATING_TOOL_ID);
|
|
43
|
-
function TimeMachineBody() {
|
|
44
|
-
const [screen, setScreen] = (0, _react.useState)({
|
|
45
|
-
kind: "list"
|
|
46
|
-
});
|
|
47
|
-
const {
|
|
48
|
-
snapshots,
|
|
49
|
-
busy,
|
|
50
|
-
preview
|
|
51
|
-
} = (0, _useTimeMachine.useTimeMachineState)();
|
|
52
|
-
const sources = (0, _sources.useSourceStatuses)();
|
|
53
|
-
const backToList = () => {
|
|
54
|
-
_timeMachineStore.timeMachineStore.clearPreview();
|
|
55
|
-
setScreen({
|
|
56
|
-
kind: "list"
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
// The preview can't render without a built diff (clearPreview races a
|
|
61
|
-
// back-navigation) — fall through to the list rather than an empty shell.
|
|
62
|
-
if (screen.kind === "preview" && preview) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PreviewFlow.PreviewScreen, {
|
|
63
|
-
preview: preview,
|
|
64
|
-
snapshots: snapshots,
|
|
65
|
-
busy: busy !== null,
|
|
66
|
-
onClose: backToList
|
|
67
|
-
});
|
|
68
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RestorePointList, {
|
|
69
|
-
sources: sources,
|
|
70
|
-
onOpenPreview: meta => {
|
|
71
|
-
void _timeMachineStore.timeMachineStore.buildPreview({
|
|
72
|
-
snapshotId: meta.id
|
|
73
|
-
});
|
|
74
|
-
setScreen({
|
|
75
|
-
kind: "preview"
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function RestorePointList({
|
|
81
|
-
sources,
|
|
82
|
-
onOpenPreview
|
|
83
|
-
}) {
|
|
84
|
-
const {
|
|
85
|
-
snapshots,
|
|
86
|
-
hasLoaded,
|
|
87
|
-
busy,
|
|
88
|
-
lastOutcome,
|
|
89
|
-
recentlyDeleted,
|
|
90
|
-
remoteProviders
|
|
91
|
-
} = (0, _useTimeMachine.useTimeMachineState)();
|
|
92
|
-
const snapshotLimit = (0, _sharedUi.useLimit)("timeMachine.snapshots");
|
|
93
|
-
const host = (0, _core.useToolHost)();
|
|
94
|
-
const insets = (0, _sharedUi.useSafeAreaInsets)({
|
|
95
|
-
minBottom: 16
|
|
96
|
-
});
|
|
97
|
-
// Which point the floating restore bar has armed, while the bar is open.
|
|
98
|
-
const barOpen = (0, _react.useSyncExternalStore)(_sharedUi.subscribeFloatingTools, isBarOpen, isBarOpen);
|
|
99
|
-
const pickedId = (0, _react.useSyncExternalStore)(_armedPoint.subscribePickedPoint, _armedPoint.getPickedPointId, _armedPoint.getPickedPointId);
|
|
100
|
-
const armedId = barOpen ? (0, _armedPoint.resolveArmedPoint)(snapshots, pickedId)?.id : undefined;
|
|
101
|
-
// Restoring the same point from this list again and again is what the bar
|
|
102
|
-
// is for; say so once, at the moment it is true.
|
|
103
|
-
const listRestores = (0, _react.useRef)({});
|
|
104
|
-
const [barHintFor, setBarHintFor] = (0, _react.useState)(null);
|
|
105
|
-
const putOnBar = id => {
|
|
106
|
-
setBarHintFor(null);
|
|
107
|
-
(0, _TimeMachineFloatingTool.openTimeMachineFloatingTool)(id);
|
|
108
|
-
host.minimize();
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
// Header search (when hosted by the core shell) filters the list.
|
|
112
|
-
const query = host.search.trim().toLowerCase();
|
|
113
|
-
const visible = query ? snapshots.filter(s => s.name.toLowerCase().includes(query)) : snapshots;
|
|
114
|
-
|
|
115
|
-
// Infinity for Pro, so this is simply false for them. The bar's safety
|
|
116
|
-
// slot is not a point you chose to keep, so it does not count.
|
|
117
|
-
const atCaptureLimit = snapshots.filter(s => !s.safety).length >= snapshotLimit;
|
|
118
|
-
const captureDisabled = busy !== null || atCaptureLimit;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Restoring is the last thing anyone wants from this screen, so the tool
|
|
122
|
-
* gets out of the way the moment it worked — with no toast and no banner.
|
|
123
|
-
* The restored app IS the confirmation, and anything announcing it is one
|
|
124
|
-
* more thing to dismiss on a flow people run dozens of times an hour.
|
|
125
|
-
*
|
|
126
|
-
* It MINIMIZES rather than closes: the list, the search and the screen you
|
|
127
|
-
* were on all survive, and coming back is one tap on the dock. A partial
|
|
128
|
-
* restore stays open instead, because the outcome card is the only place
|
|
129
|
-
* the per-source failures are reported.
|
|
130
|
-
*/
|
|
131
|
-
const restore = meta => {
|
|
132
|
-
if (busy) return;
|
|
133
|
-
if (meta.baseline) {
|
|
134
|
-
(0, _confirm.confirmDestructive)("Restore fresh install?", "This wipes all app storage and reloads the app.", "Wipe & reload", () => void _timeMachineStore.timeMachineStore.restore(meta.id, "reload"));
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
const count = (listRestores.current[meta.id] ?? 0) + 1;
|
|
138
|
-
listRestores.current[meta.id] = count;
|
|
139
|
-
if (count >= 2 && !barOpen) setBarHintFor(meta.id);
|
|
140
|
-
void _timeMachineStore.timeMachineStore.restore(meta.id, "live").then(outcome => {
|
|
141
|
-
const clean = Object.values(outcome.results).every(r => r.ok);
|
|
142
|
-
if (!clean || outcome.willReload) return;
|
|
143
|
-
host.minimize();
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
const barHint = barHintFor && !barOpen ? snapshots.find(s => s.id === barHintFor) ?? null : null;
|
|
147
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
|
|
148
|
-
style: styles.fill,
|
|
149
|
-
contentContainerStyle: [styles.content, {
|
|
150
|
-
paddingBottom: insets.bottom
|
|
151
|
-
}],
|
|
152
|
-
testID: "time-machine-scroll"
|
|
153
|
-
// Without this, the first tap after typing a name only DISMISSES the
|
|
154
|
-
// keyboard — Capture never fires and the restore point is silently not
|
|
155
|
-
// taken. Every other Buoy screen with a field inside a scroller sets it;
|
|
156
|
-
// this one didn't, and only the XCTest lane could see it (Detox's
|
|
157
|
-
// replaceText never opens a keyboard, so the tap always landed).
|
|
158
|
-
,
|
|
159
|
-
keyboardShouldPersistTaps: "handled",
|
|
160
|
-
children: [lastOutcome && (0, _RestoreOutcomeCard.restoreNeedsAttention)(lastOutcome) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_RestoreOutcomeCard.RestoreOutcomeCard, {
|
|
161
|
-
outcome: lastOutcome
|
|
162
|
-
}) : null, recentlyDeleted ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_UndoDeleteBar.UndoDeleteBar, {
|
|
163
|
-
name: recentlyDeleted.stored.meta.name,
|
|
164
|
-
at: recentlyDeleted.at,
|
|
165
|
-
onUndo: () => void _timeMachineStore.timeMachineStore.undoDelete(),
|
|
166
|
-
onExpire: () => _timeMachineStore.timeMachineStore.clearRecentlyDeleted()
|
|
167
|
-
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
168
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CaptureBar.CaptureBar, {
|
|
169
|
-
disabled: captureDisabled,
|
|
170
|
-
busy: busy === "capture",
|
|
171
|
-
onCapture: name => void _timeMachineStore.timeMachineStore.capture(name)
|
|
172
|
-
})
|
|
173
|
-
}), atCaptureLimit ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Footnote, {
|
|
174
|
-
tone: "warning",
|
|
175
|
-
testID: "time-machine-limit",
|
|
176
|
-
children: ["Free plan keeps ", snapshotLimit, " restore point", snapshotLimit === 1 ? "" : "s", ". Upgrade to Pro for unlimited snapshots."]
|
|
177
|
-
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.SectionLabel, {
|
|
178
|
-
children: "Sources"
|
|
179
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_SourcesStrip.SourcesStrip, {
|
|
180
|
-
sources: sources,
|
|
181
|
-
onToggle: remoteProviders ? undefined : _sourceSettings.setSourceEnabled
|
|
182
|
-
}), remoteProviders ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Footnote, {
|
|
183
|
-
testID: "time-machine-sources-hint",
|
|
184
|
-
children: "Switch a source off to leave it out of every capture and restore."
|
|
185
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.SectionLabel, {
|
|
186
|
-
children: "Restore Points"
|
|
187
|
-
}), barHint ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
188
|
-
style: styles.barHint,
|
|
189
|
-
testID: "time-machine-bar-hint",
|
|
190
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Footnote, {
|
|
191
|
-
children: ["Restoring \"", barHint.name, "\" a lot? Put it on the floating action bar and restore it with one tap."]
|
|
192
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
193
|
-
onPress: () => putOnBar(barHint.id),
|
|
194
|
-
accessibilityRole: "button",
|
|
195
|
-
testID: "time-machine-bar-hint-pin",
|
|
196
|
-
hitSlop: {
|
|
197
|
-
top: 6,
|
|
198
|
-
bottom: 6,
|
|
199
|
-
left: 6,
|
|
200
|
-
right: 6
|
|
201
|
-
},
|
|
202
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
203
|
-
style: styles.barHintAction,
|
|
204
|
-
children: "Open the action bar"
|
|
205
|
-
})
|
|
206
|
-
})]
|
|
207
|
-
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Group, {
|
|
208
|
-
children: [visible.map(meta => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SnapshotRow.SnapshotRow, {
|
|
209
|
-
meta: meta,
|
|
210
|
-
busy: busy !== null,
|
|
211
|
-
armed: meta.id === armedId,
|
|
212
|
-
onOpen: () => onOpenPreview(meta),
|
|
213
|
-
onRestore: () => restore(meta),
|
|
214
|
-
onDelete: () => void _timeMachineStore.timeMachineStore.delete(meta.id),
|
|
215
|
-
onDuplicate: () => void _timeMachineStore.timeMachineStore.duplicate(meta.id),
|
|
216
|
-
onArm: () => putOnBar(meta.id)
|
|
217
|
-
}, meta.id)), visible.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolEmptyState, {
|
|
218
|
-
testID: "time-machine-empty",
|
|
219
|
-
...(!hasLoaded ? {
|
|
220
|
-
otto: "loading",
|
|
221
|
-
title: "Loading restore points…",
|
|
222
|
-
message: "Reading the vault off disk."
|
|
223
|
-
} : snapshots.length > 0 ? {
|
|
224
|
-
otto: "sad",
|
|
225
|
-
title: "No restore point matches that name.",
|
|
226
|
-
message: `Clear the search to see all ${snapshots.length}.`
|
|
227
|
-
} : {
|
|
228
|
-
// rewind = "Time Machine: stepping back through
|
|
229
|
-
// snapshots" — the one OTTO_USES sentence for this tool.
|
|
230
|
-
otto: "rewind",
|
|
231
|
-
title: "No restore points yet",
|
|
232
|
-
message: "Set up the state you want to come back to, then capture it."
|
|
233
|
-
})
|
|
234
|
-
}) : null]
|
|
235
|
-
}), visible.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Footnote, {
|
|
236
|
-
testID: "time-machine-swipe-hint",
|
|
237
|
-
children: "Swipe a restore point to copy or delete it."
|
|
238
|
-
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
239
|
-
style: styles.spacer
|
|
240
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Group, {
|
|
241
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_WipeAllRow.WipeAllRow, {
|
|
242
|
-
disabled: busy !== null,
|
|
243
|
-
onWipe: () => (0, _confirm.confirmDestructive)("Wipe all app state?", "This deletes all app storage and reloads the app — like a fresh install.", "Wipe & reload", () => void _timeMachineStore.timeMachineStore.wipeAll())
|
|
244
|
-
})
|
|
245
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Footnote, {
|
|
246
|
-
centered: true,
|
|
247
|
-
children: "Deletes all app storage and reloads \u2014 like a fresh install."
|
|
248
|
-
})]
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
const styles = _reactNative.StyleSheet.create({
|
|
252
|
-
barHint: {
|
|
253
|
-
marginHorizontal: _tmTheme.tm.gutter,
|
|
254
|
-
marginBottom: 8
|
|
255
|
-
},
|
|
256
|
-
barHintAction: {
|
|
257
|
-
color: _tmTheme.tm.color.accent,
|
|
258
|
-
fontSize: _tmTheme.tm.font.footnote,
|
|
259
|
-
fontWeight: "600",
|
|
260
|
-
paddingHorizontal: _tmTheme.tm.textInset,
|
|
261
|
-
paddingTop: 2
|
|
262
|
-
},
|
|
263
|
-
fill: {
|
|
264
|
-
flex: 1,
|
|
265
|
-
// Transparent so JsModal's ToolBackground shows through (the modal paints opaque base beneath it).
|
|
266
|
-
backgroundColor: "transparent"
|
|
267
|
-
},
|
|
268
|
-
content: {
|
|
269
|
-
paddingTop: 14
|
|
270
|
-
},
|
|
271
|
-
empty: {
|
|
272
|
-
color: _tmTheme.tm.color.labelSecondary,
|
|
273
|
-
fontSize: _tmTheme.tm.font.footnote,
|
|
274
|
-
lineHeight: _tmTheme.tm.font.footnote * 1.4,
|
|
275
|
-
paddingHorizontal: _tmTheme.tm.textInset,
|
|
276
|
-
paddingVertical: 16
|
|
277
|
-
},
|
|
278
|
-
spacer: {
|
|
279
|
-
height: 24
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
//# sourceMappingURL=TimeMachineBody.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.TimeMachineBody=TimeMachineBody;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _core=require("@buoy-gg/core");var _useTimeMachine=require("../hooks/useTimeMachine");var _timeMachineStore=require("../store/timeMachineStore");var _primitives=require("../ui/primitives");var _tmTheme=require("../ui/tmTheme");var _sources=require("./sources");var _confirm=require("./confirm");var _CaptureBar=require("./list/CaptureBar");var _RestoreOutcomeCard=require("./list/RestoreOutcomeCard");var _SnapshotRow=require("./list/SnapshotRow");var _UndoDeleteBar=require("./list/UndoDeleteBar");var _SourcesStrip=require("./list/SourcesStrip");var _WipeAllRow=require("./list/WipeAllRow");var _PreviewFlow=require("./preview/PreviewFlow");var _TimeMachineFloatingTool=require("./floating/TimeMachineFloatingTool");var _armedPoint=require("./floating/armedPoint");var _sourceSettings=require("../store/sourceSettings");var _jsxRuntime=require("react/jsx-runtime");const isBarOpen=()=>(0,_sharedUi.getFloatingTools)().some(o=>o.id===_TimeMachineFloatingTool.TIME_MACHINE_FLOATING_TOOL_ID);function TimeMachineBody(){const[o,s]=(0,_react.useState)({kind:"list"});const{snapshots:t,busy:l,preview:i}=(0,_useTimeMachine.useTimeMachineState)();const r=(0,_sources.useSourceStatuses)();const n=()=>{_timeMachineStore.timeMachineStore.clearPreview();s({kind:"list"})};if(o.kind==="preview"&&i)return(0,_jsxRuntime.jsx)(_PreviewFlow.PreviewScreen,{preview:i,snapshots:t,busy:l!==null,onClose:n});return(0,_jsxRuntime.jsx)(RestorePointList,{sources:r,onOpenPreview:a=>{void _timeMachineStore.timeMachineStore.buildPreview({snapshotId:a.id});s({kind:"preview"})}})}function RestorePointList({sources:o,onOpenPreview:s}){const{snapshots:t,hasLoaded:l,busy:i,lastOutcome:r,recentlyDeleted:n,remoteProviders:a}=(0,_useTimeMachine.useTimeMachineState)();const c=(0,_sharedUi.useLimit)("timeMachine.snapshots");const u=(0,_core.useToolHost)();const y=(0,_sharedUi.useSafeAreaInsets)({minBottom:16});const d=(0,_react.useSyncExternalStore)(_sharedUi.subscribeFloatingTools,isBarOpen,isBarOpen);const T=(0,_react.useSyncExternalStore)(_armedPoint.subscribePickedPoint,_armedPoint.getPickedPointId,_armedPoint.getPickedPointId);const j=d?(0,_armedPoint.resolveArmedPoint)(t,T)?.id:void 0;const m=(0,_react.useRef)({});const[v,S]=(0,_react.useState)(null);const g=e=>{S(null);(0,_TimeMachineFloatingTool.openTimeMachineFloatingTool)(e);u.minimize()};const f=u.search.trim().toLowerCase();const p=f?t.filter(e=>e.name.toLowerCase().includes(f)):t;const b=t.filter(e=>!e.safety).length>=c;const _=i!==null||b;const M=e=>{if(i)return;if(e.baseline){(0,_confirm.confirmDestructive)("Restore fresh install?","This wipes all app storage and reloads the app.","Wipe & reload",()=>void _timeMachineStore.timeMachineStore.restore(e.id,"reload"));return}const w=(m.current[e.id]??0)+1;m.current[e.id]=w;if(w>=2&&!d)S(e.id);void _timeMachineStore.timeMachineStore.restore(e.id,"live").then(x=>{const P=Object.values(x.results).every(q=>q.ok);if(!P||x.willReload)return;u.minimize()})};const h=v&&!d?t.find(e=>e.id===v)??null:null;return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{style:styles.fill,contentContainerStyle:[styles.content,{paddingBottom:y.bottom}],testID:"time-machine-scroll",keyboardShouldPersistTaps:"handled",children:[r&&(0,_RestoreOutcomeCard.restoreNeedsAttention)(r)?(0,_jsxRuntime.jsx)(_RestoreOutcomeCard.RestoreOutcomeCard,{outcome:r}):null,n?(0,_jsxRuntime.jsx)(_UndoDeleteBar.UndoDeleteBar,{name:n.stored.meta.name,at:n.at,onUndo:()=>void _timeMachineStore.timeMachineStore.undoDelete(),onExpire:()=>_timeMachineStore.timeMachineStore.clearRecentlyDeleted()}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{children:(0,_jsxRuntime.jsx)(_CaptureBar.CaptureBar,{disabled:_,busy:i==="capture",onCapture:e=>void _timeMachineStore.timeMachineStore.capture(e)})}),b?(0,_jsxRuntime.jsxs)(_primitives.Footnote,{tone:"warning",testID:"time-machine-limit",children:["Free plan keeps ",c," restore point",c===1?"":"s",". Upgrade to Pro for unlimited snapshots."]}):null,(0,_jsxRuntime.jsx)(_primitives.SectionLabel,{children:"Sources"}),(0,_jsxRuntime.jsx)(_SourcesStrip.SourcesStrip,{sources:o,onToggle:a?void 0:_sourceSettings.setSourceEnabled}),a?null:(0,_jsxRuntime.jsx)(_primitives.Footnote,{testID:"time-machine-sources-hint",children:"Switch a source off to leave it out of every capture and restore."}),(0,_jsxRuntime.jsx)(_primitives.SectionLabel,{children:"Restore Points"}),h?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.barHint,testID:"time-machine-bar-hint",children:[(0,_jsxRuntime.jsxs)(_primitives.Footnote,{children:['Restoring "',h.name,'" a lot? Put it on the floating action bar and restore it with one tap.']}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:()=>g(h.id),accessibilityRole:"button",testID:"time-machine-bar-hint-pin",hitSlop:{top:6,bottom:6,left:6,right:6},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.barHintAction,children:"Open the action bar"})})]}):null,(0,_jsxRuntime.jsxs)(_primitives.Group,{children:[p.map(e=>(0,_jsxRuntime.jsx)(_SnapshotRow.SnapshotRow,{meta:e,busy:i!==null,armed:e.id===j,onOpen:()=>s(e),onRestore:()=>M(e),onDelete:()=>void _timeMachineStore.timeMachineStore.delete(e.id),onDuplicate:()=>void _timeMachineStore.timeMachineStore.duplicate(e.id),onArm:()=>g(e.id)},e.id)),p.length===0?(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{testID:"time-machine-empty",...!l?{otto:"loading",title:"Loading restore points\u2026",message:"Reading the vault off disk."}:t.length>0?{otto:"sad",title:"No restore point matches that name.",message:`Clear the search to see all ${t.length}.`}:{otto:"rewind",title:"No restore points yet",message:"Set up the state you want to come back to, then capture it."}}):null]}),p.length>0?(0,_jsxRuntime.jsx)(_primitives.Footnote,{testID:"time-machine-swipe-hint",children:"Swipe a restore point to copy or delete it."}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.spacer}),(0,_jsxRuntime.jsx)(_primitives.Group,{children:(0,_jsxRuntime.jsx)(_WipeAllRow.WipeAllRow,{disabled:i!==null,onWipe:()=>(0,_confirm.confirmDestructive)("Wipe all app state?","This deletes all app storage and reloads the app \u2014 like a fresh install.","Wipe & reload",()=>void _timeMachineStore.timeMachineStore.wipeAll())})}),(0,_jsxRuntime.jsx)(_primitives.Footnote,{centered:true,children:"Deletes all app storage and reloads \u2014 like a fresh install."})]})}const styles=_reactNative.StyleSheet.create({barHint:{marginHorizontal:_tmTheme.tm.gutter,marginBottom:8},barHintAction:{color:_tmTheme.tm.color.accent,fontSize:_tmTheme.tm.font.footnote,fontWeight:"600",paddingHorizontal:_tmTheme.tm.textInset,paddingTop:2},fill:{flex:1,backgroundColor:"transparent"},content:{paddingTop:14},empty:{color:_tmTheme.tm.color.labelSecondary,fontSize:_tmTheme.tm.font.footnote,lineHeight:_tmTheme.tm.font.footnote*1.4,paddingHorizontal:_tmTheme.tm.textInset,paddingVertical:16},spacer:{height:24}});
|
|
@@ -1,74 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TimeMachineModal = TimeMachineModal;
|
|
7
|
-
exports.TimeMachineToolView = TimeMachineToolView;
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
10
|
-
var _tmTheme = require("../ui/tmTheme");
|
|
11
|
-
var _TimeMachineBody = require("./TimeMachineBody");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
/**
|
|
14
|
-
* TimeMachineModal — bottom-sheet wrapper rendered by FloatingDevTools when
|
|
15
|
-
* the Time Machine tool is opened. TimeMachineToolView is the inline variant
|
|
16
|
-
* for Buoy Desktop.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
function Header() {
|
|
20
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
21
|
-
style: styles.header,
|
|
22
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
23
|
-
style: styles.headerTitle,
|
|
24
|
-
children: "Time Machine"
|
|
25
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
26
|
-
style: styles.headerSubtitle,
|
|
27
|
-
children: "Snapshot & restore app state"
|
|
28
|
-
})]
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
function TimeMachineModal({
|
|
32
|
-
visible,
|
|
33
|
-
onClose,
|
|
34
|
-
onBack: _onBack,
|
|
35
|
-
onMinimize,
|
|
36
|
-
persistenceKey
|
|
37
|
-
}) {
|
|
38
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.JsModal, {
|
|
39
|
-
visible: visible,
|
|
40
|
-
onClose: onClose,
|
|
41
|
-
onMinimize: onMinimize,
|
|
42
|
-
persistenceKey: persistenceKey,
|
|
43
|
-
header: {
|
|
44
|
-
showToggleButton: true,
|
|
45
|
-
customContent: /*#__PURE__*/(0, _jsxRuntime.jsx)(Header, {})
|
|
46
|
-
},
|
|
47
|
-
enablePersistence: true,
|
|
48
|
-
initialMode: "bottomSheet",
|
|
49
|
-
disableScrollWrapper: true,
|
|
50
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TimeMachineBody.TimeMachineBody, {})
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/** Inline variant (no modal chrome) — used by Buoy Desktop. */
|
|
55
|
-
function TimeMachineToolView() {
|
|
56
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TimeMachineBody.TimeMachineBody, {});
|
|
57
|
-
}
|
|
58
|
-
const styles = _reactNative.StyleSheet.create({
|
|
59
|
-
header: {
|
|
60
|
-
paddingHorizontal: 4,
|
|
61
|
-
gap: 2
|
|
62
|
-
},
|
|
63
|
-
headerTitle: {
|
|
64
|
-
color: _tmTheme.tm.color.label,
|
|
65
|
-
fontSize: 22,
|
|
66
|
-
fontWeight: "700",
|
|
67
|
-
letterSpacing: 0.3
|
|
68
|
-
},
|
|
69
|
-
headerSubtitle: {
|
|
70
|
-
color: _tmTheme.tm.color.labelSecondary,
|
|
71
|
-
fontSize: _tmTheme.tm.font.footnote
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=TimeMachineModal.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.TimeMachineModal=TimeMachineModal;exports.TimeMachineToolView=TimeMachineToolView;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _tmTheme=require("../ui/tmTheme");var _TimeMachineBody=require("./TimeMachineBody");var _jsxRuntime=require("react/jsx-runtime");function Header(){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.header,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerTitle,children:"Time Machine"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerSubtitle,children:"Snapshot & restore app state"})]})}function TimeMachineModal({visible:e,onClose:t,onBack:o,onMinimize:r,persistenceKey:i}){return(0,_jsxRuntime.jsx)(_sharedUi.JsModal,{visible:e,onClose:t,onMinimize:r,persistenceKey:i,header:{showToggleButton:true,customContent:(0,_jsxRuntime.jsx)(Header,{})},enablePersistence:true,initialMode:"bottomSheet",disableScrollWrapper:true,children:(0,_jsxRuntime.jsx)(_TimeMachineBody.TimeMachineBody,{})})}function TimeMachineToolView(){return(0,_jsxRuntime.jsx)(_TimeMachineBody.TimeMachineBody,{})}const styles=_reactNative.StyleSheet.create({header:{paddingHorizontal:4,gap:2},headerTitle:{color:_tmTheme.tm.color.label,fontSize:22,fontWeight:"700",letterSpacing:.3},headerSubtitle:{color:_tmTheme.tm.color.labelSecondary,fontSize:_tmTheme.tm.font.footnote}});
|
|
@@ -1,39 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.confirmDestructive=confirmDestructive;var _reactNative=require("react-native");function webConfirm(t){const e=globalThis.confirm;return e?e(t):true}function confirmDestructive(t,e,n,r){if(_reactNative.Platform.OS==="web"){if(webConfirm(`${t}
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.confirmDestructive = confirmDestructive;
|
|
7
|
-
var _reactNative = require("react-native");
|
|
8
|
-
/**
|
|
9
|
-
* Confirmation dialogs for the destructive / branching Time Machine actions.
|
|
10
|
-
*
|
|
11
|
-
* RN-web's Alert renders no buttons at all, so the web path (Buoy Desktop,
|
|
12
|
-
* the web example) uses `window.confirm`.
|
|
13
|
-
*
|
|
14
|
-
* There is deliberately NO "restore the route too?" prompt: that question is
|
|
15
|
-
* answered once per restore point by the route toggle on its row, because
|
|
16
|
-
* asking it on every restore meant answering it thirty times a day.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
function webConfirm(message) {
|
|
20
|
-
const confirmFn = globalThis.confirm;
|
|
21
|
-
// No dialog available at all (headless web): don't silently swallow the
|
|
22
|
-
// user's intent — treat it as confirmed, same as the previous behavior.
|
|
23
|
-
return confirmFn ? confirmFn(message) : true;
|
|
24
|
-
}
|
|
25
|
-
function confirmDestructive(title, message, confirmLabel, onConfirm) {
|
|
26
|
-
if (_reactNative.Platform.OS === "web") {
|
|
27
|
-
if (webConfirm(`${title}\n\n${message}`)) onConfirm();
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
_reactNative.Alert.alert(title, message, [{
|
|
31
|
-
text: "Cancel",
|
|
32
|
-
style: "cancel"
|
|
33
|
-
}, {
|
|
34
|
-
text: confirmLabel,
|
|
35
|
-
style: "destructive",
|
|
36
|
-
onPress: onConfirm
|
|
37
|
-
}]);
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=confirm.js.map
|
|
3
|
+
${e}`))r();return}_reactNative.Alert.alert(t,e,[{text:"Cancel",style:"cancel"},{text:n,style:"destructive",onPress:r}])}
|