@buoy-gg/time-machine 7.0.41 → 7.0.43
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 -11
- 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,118 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.tm = exports.TM_MONO = void 0;
|
|
7
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
8
|
-
/**
|
|
9
|
-
* Time Machine design tokens — the "modern" surface language.
|
|
10
|
-
*
|
|
11
|
-
* A grouped-inset list system (iOS Settings shape): one dark sheet, rounded
|
|
12
|
-
* glass cards holding hairline-separated rows, uppercase section labels
|
|
13
|
-
* outside the cards, and explanatory footnotes under them.
|
|
14
|
-
*
|
|
15
|
-
* COLOR COMES FROM the shared `night` palette (ui/night/nightTheme.ts) — not
|
|
16
|
-
* from a private set — so the tool reads as part of the same product as every
|
|
17
|
-
* other one. Change a value in nightTheme.ts and it lands here.
|
|
18
|
-
*
|
|
19
|
-
* Only shape, spacing and type live as literals below — those ARE the design
|
|
20
|
-
* language and have no palette equivalent.
|
|
21
|
-
*
|
|
22
|
-
* SCOPE: this is Time Machine's pilot of the new look. If it lands, promote
|
|
23
|
-
* this file (and ./primitives) into @buoy-gg/shared-ui and let the other
|
|
24
|
-
* tools import it — nothing in here is Time-Machine-specific.
|
|
25
|
-
*
|
|
26
|
-
* Note: like every StyleSheet in the repo, these values are read once at
|
|
27
|
-
* module load, so the desktop dashboard's in-place re-tint needs a reload to
|
|
28
|
-
* reach them.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/** Hex opacity suffixes, so tinted fills stay tied to the palette color. */
|
|
32
|
-
const A18 = "2E";
|
|
33
|
-
const A30 = "4D";
|
|
34
|
-
const tm = exports.tm = {
|
|
35
|
-
color: {
|
|
36
|
-
/**
|
|
37
|
-
* Backing for the sticky footer (its only consumer) — night glass, same
|
|
38
|
-
* treatment as the shared stepper footer, so the star field hints through
|
|
39
|
-
* without the list reading through the CTA.
|
|
40
|
-
*/
|
|
41
|
-
sheet: "rgba(5, 5, 5, 0.92)",
|
|
42
|
-
/**
|
|
43
|
-
* A grouped card: night glass, so the star field behind the sheet shows
|
|
44
|
-
* through every card the way it does through the header chips. Cards
|
|
45
|
-
* take `groupBorder` as a hairline, or the glass reads as a smudge.
|
|
46
|
-
*/
|
|
47
|
-
group: _sharedUi.night.color.glass,
|
|
48
|
-
groupBorder: _sharedUi.night.color.glassBorder,
|
|
49
|
-
/** Row press / hover wash on top of a group. */
|
|
50
|
-
rowPressed: _sharedUi.night.color.glassElevated,
|
|
51
|
-
/** Hairline between rows, inset from the left like iOS. */
|
|
52
|
-
separator: _sharedUi.night.color.separator,
|
|
53
|
-
/** Neutral control fill (icon discs, chips, round buttons). */
|
|
54
|
-
fill: _sharedUi.night.color.glassElevated,
|
|
55
|
-
fillStrong: _sharedUi.night.color.fillTertiary,
|
|
56
|
-
/** Opaque ring around a badge on a glass card (the sheet's own color). */
|
|
57
|
-
ring: _sharedUi.night.color.bg,
|
|
58
|
-
/**
|
|
59
|
-
* Opaque disc behind a Buoy icon. The icons paint their knock-outs in
|
|
60
|
-
* the color they are handed, so a translucent fill turns a floppy disk
|
|
61
|
-
* into a yellow square. Stays solid on purpose.
|
|
62
|
-
*/
|
|
63
|
-
disc: _sharedUi.night.color.surfaceElevated,
|
|
64
|
-
label: _sharedUi.night.color.text,
|
|
65
|
-
labelSecondary: _sharedUi.night.color.textSecondary,
|
|
66
|
-
labelTertiary: _sharedUi.night.color.textTertiary,
|
|
67
|
-
/** Primary action + "this is healthy" (the night brand green). */
|
|
68
|
-
accent: _sharedUi.night.color.accent,
|
|
69
|
-
accentSoft: `${_sharedUi.night.color.accent}${A18}`,
|
|
70
|
-
accentSoftStrong: `${_sharedUi.night.color.accent}${A30}`,
|
|
71
|
-
/** Text/icons ON an accent fill — the brand green wants dark ink. */
|
|
72
|
-
onAccent: "#0A0A0A",
|
|
73
|
-
warning: _sharedUi.night.color.warning,
|
|
74
|
-
warningSoft: `${_sharedUi.night.color.warning}${A18}`,
|
|
75
|
-
danger: _sharedUi.night.color.danger,
|
|
76
|
-
dangerSoft: `${_sharedUi.night.color.danger}${A18}`,
|
|
77
|
-
/** Text/icons ON a danger fill. */
|
|
78
|
-
onDanger: "#FFFFFF",
|
|
79
|
-
info: _sharedUi.night.color.info
|
|
80
|
-
},
|
|
81
|
-
radius: {
|
|
82
|
-
/** Grouped card + the capture field that visually matches one. */
|
|
83
|
-
group: 14,
|
|
84
|
-
/** Fully rounded pills and status circles. */
|
|
85
|
-
pill: 99
|
|
86
|
-
},
|
|
87
|
-
/** Horizontal inset of the grouped cards from the sheet edge. */
|
|
88
|
-
gutter: 14,
|
|
89
|
-
/** Extra inset for labels/footnotes, measured from the card edge. */
|
|
90
|
-
textInset: 16,
|
|
91
|
-
/** Left inset of a row separator, measured from the card edge. */
|
|
92
|
-
separatorInset: 16,
|
|
93
|
-
font: {
|
|
94
|
-
/** Row titles and primary values. */
|
|
95
|
-
row: 17,
|
|
96
|
-
/** Buttons and pill labels. */
|
|
97
|
-
control: 15,
|
|
98
|
-
/** Section labels, row captions, footnotes. */
|
|
99
|
-
footnote: 13,
|
|
100
|
-
/** Route paths and other monospace detail. */
|
|
101
|
-
mono: 12
|
|
102
|
-
},
|
|
103
|
-
/** iOS tracks display text slightly tighter than the default. */
|
|
104
|
-
tracking: {
|
|
105
|
-
row: -0.43,
|
|
106
|
-
control: -0.2
|
|
107
|
-
},
|
|
108
|
-
/** Standard grouped-row height before content forces it taller. */
|
|
109
|
-
rowMinHeight: 52
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Monospace family. RN native resolves a single family name only (no CSS
|
|
114
|
-
* stack), and "monospace" is the one token both platforms honor — it is what
|
|
115
|
-
* the rest of the design system uses.
|
|
116
|
-
*/
|
|
117
|
-
const TM_MONO = exports.TM_MONO = _sharedUi.monoFont;
|
|
118
|
-
//# sourceMappingURL=tmTheme.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.tm=exports.TM_MONO=void 0;var _sharedUi=require("@buoy-gg/shared-ui");const A18="2E";const A30="4D";const tm=exports.tm={color:{sheet:"rgba(5, 5, 5, 0.92)",group:_sharedUi.night.color.glass,groupBorder:_sharedUi.night.color.glassBorder,rowPressed:_sharedUi.night.color.glassElevated,separator:_sharedUi.night.color.separator,fill:_sharedUi.night.color.glassElevated,fillStrong:_sharedUi.night.color.fillTertiary,ring:_sharedUi.night.color.bg,disc:_sharedUi.night.color.surfaceElevated,label:_sharedUi.night.color.text,labelSecondary:_sharedUi.night.color.textSecondary,labelTertiary:_sharedUi.night.color.textTertiary,accent:_sharedUi.night.color.accent,accentSoft:`${_sharedUi.night.color.accent}${A18}`,accentSoftStrong:`${_sharedUi.night.color.accent}${A30}`,onAccent:"#0A0A0A",warning:_sharedUi.night.color.warning,warningSoft:`${_sharedUi.night.color.warning}${A18}`,danger:_sharedUi.night.color.danger,dangerSoft:`${_sharedUi.night.color.danger}${A18}`,onDanger:"#FFFFFF",info:_sharedUi.night.color.info},radius:{group:14,pill:99},gutter:14,textInset:16,separatorInset:16,font:{row:17,control:15,footnote:13,mono:12},tracking:{row:-.43,control:-.2},rowMinHeight:52};const TM_MONO=exports.TM_MONO=_sharedUi.monoFont;
|
|
@@ -1,85 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The tool's header actions, in Network's header language: labeled
|
|
5
|
-
* dark-glass chips. "Action bar" is named for the thing it opens, the
|
|
6
|
-
* floating action bar over the app, and takes the accent ink as the one
|
|
7
|
-
* action a newcomer has to find. Reload is the plain JS reload.
|
|
8
|
-
*
|
|
9
|
-
* Action bar puts a restore point on the floating bar and gets the modal out
|
|
10
|
-
* of the way. The preview screen passes the point it is showing as `armId`,
|
|
11
|
-
* so opening it from there arms that point; the list leaves it to the
|
|
12
|
-
* default rule.
|
|
13
|
-
*/
|
|
14
|
-
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
15
|
-
import { night } from "@buoy-gg/shared-ui";
|
|
16
|
-
import { useToolHost } from "@buoy-gg/core";
|
|
17
|
-
import { HeaderReloadButton } from "./HeaderReloadButton";
|
|
18
|
-
import { openTimeMachineFloatingTool } from "./floating/TimeMachineFloatingTool";
|
|
19
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
export function HeaderBarButton({
|
|
21
|
-
armId
|
|
22
|
-
}) {
|
|
23
|
-
const host = useToolHost();
|
|
24
|
-
const onPress = () => {
|
|
25
|
-
openTimeMachineFloatingTool(armId);
|
|
26
|
-
// Same move as Network: the bar is for using the app, so the modal
|
|
27
|
-
// minimizes to the dock instead of covering the screen the bar controls.
|
|
28
|
-
host.minimize();
|
|
29
|
-
};
|
|
30
|
-
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
31
|
-
style: styles.labeledChip,
|
|
32
|
-
onPress: onPress,
|
|
33
|
-
accessibilityLabel: "Open the floating action bar over the app",
|
|
34
|
-
accessibilityRole: "button",
|
|
35
|
-
testID: "time-machine-header-bar",
|
|
36
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
37
|
-
style: styles.glyph
|
|
38
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
39
|
-
style: styles.label,
|
|
40
|
-
children: "Action bar"
|
|
41
|
-
})]
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
export function TimeMachineHeaderActions({
|
|
45
|
-
armId
|
|
46
|
-
}) {
|
|
47
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
48
|
-
style: styles.row,
|
|
49
|
-
children: [/*#__PURE__*/_jsx(HeaderBarButton, {
|
|
50
|
-
armId: armId
|
|
51
|
-
}), /*#__PURE__*/_jsx(HeaderReloadButton, {})]
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
const styles = StyleSheet.create({
|
|
55
|
-
row: {
|
|
56
|
-
flexDirection: "row",
|
|
57
|
-
alignItems: "center",
|
|
58
|
-
gap: 8
|
|
59
|
-
},
|
|
60
|
-
labeledChip: {
|
|
61
|
-
height: 32,
|
|
62
|
-
flexDirection: "row",
|
|
63
|
-
alignItems: "center",
|
|
64
|
-
gap: 6,
|
|
65
|
-
paddingHorizontal: 10,
|
|
66
|
-
borderRadius: 8,
|
|
67
|
-
borderWidth: 1,
|
|
68
|
-
borderColor: night.color.border,
|
|
69
|
-
backgroundColor: night.color.buttonSurface
|
|
70
|
-
},
|
|
71
|
-
// A small strip outline: the thing the button opens.
|
|
72
|
-
glyph: {
|
|
73
|
-
width: 14,
|
|
74
|
-
height: 8,
|
|
75
|
-
borderRadius: 3,
|
|
76
|
-
borderWidth: 1.5,
|
|
77
|
-
borderColor: night.color.accent
|
|
78
|
-
},
|
|
79
|
-
label: {
|
|
80
|
-
fontSize: 11,
|
|
81
|
-
fontWeight: "700",
|
|
82
|
-
color: night.color.accent
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
//# sourceMappingURL=HeaderActions.js.map
|
|
1
|
+
"use strict";import{StyleSheet as c,Text as s,TouchableOpacity as d,View as i}from"react-native";import{night as e}from"@buoy-gg/shared-ui";import{useToolHost as h}from"@buoy-gg/core";import{HeaderReloadButton as b}from"./HeaderReloadButton";import{openTimeMachineFloatingTool as m}from"./floating/TimeMachineFloatingTool";import{jsx as o,jsxs as n}from"react/jsx-runtime";export function HeaderBarButton({armId:t}){const l=h();const a=()=>{m(t);l.minimize()};return n(d,{style:r.labeledChip,onPress:a,accessibilityLabel:"Open the floating action bar over the app",accessibilityRole:"button",testID:"time-machine-header-bar",children:[o(i,{style:r.glyph}),o(s,{style:r.label,children:"Action bar"})]})}export function TimeMachineHeaderActions({armId:t}){return n(i,{style:r.row,children:[o(HeaderBarButton,{armId:t}),o(b,{})]})}const r=c.create({row:{flexDirection:"row",alignItems:"center",gap:8},labeledChip:{height:32,flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:10,borderRadius:8,borderWidth:1,borderColor:e.color.border,backgroundColor:e.color.buttonSurface},glyph:{width:14,height:8,borderRadius:3,borderWidth:1.5,borderColor:e.color.accent},label:{fontSize:11,fontWeight:"700",color:e.color.accent}});
|
|
@@ -1,53 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The reload header action: a plain JS-bundle reload (no restore), so
|
|
5
|
-
* in-memory state rebuilds from whatever is persisted.
|
|
6
|
-
*
|
|
7
|
-
* A labeled dark-glass chip, the same shape as the Pin chip beside it and
|
|
8
|
-
* Network's "Override": the words are the whole explanation.
|
|
9
|
-
*/
|
|
10
|
-
import { StyleSheet, Text, TouchableOpacity } from "react-native";
|
|
11
|
-
import { night, scheduleReloadApp } from "@buoy-gg/shared-ui";
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
export function HeaderReloadButton() {
|
|
14
|
-
const onPress = () => {
|
|
15
|
-
try {
|
|
16
|
-
scheduleReloadApp({
|
|
17
|
-
reason: "buoy time-machine reload app"
|
|
18
|
-
});
|
|
19
|
-
} catch {
|
|
20
|
-
// No reload mechanism available (bare production build) — nothing to do.
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
24
|
-
style: styles.chip,
|
|
25
|
-
onPress: onPress,
|
|
26
|
-
accessibilityLabel: "Reload app",
|
|
27
|
-
accessibilityHint: "Reloads the JavaScript bundle without restoring anything",
|
|
28
|
-
accessibilityRole: "button",
|
|
29
|
-
testID: "time-machine-reload-app",
|
|
30
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
31
|
-
style: styles.label,
|
|
32
|
-
children: "Reload app"
|
|
33
|
-
})
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
const styles = StyleSheet.create({
|
|
37
|
-
chip: {
|
|
38
|
-
height: 32,
|
|
39
|
-
paddingHorizontal: 10,
|
|
40
|
-
borderRadius: 8,
|
|
41
|
-
borderWidth: 1,
|
|
42
|
-
borderColor: night.color.border,
|
|
43
|
-
backgroundColor: night.color.buttonSurface,
|
|
44
|
-
alignItems: "center",
|
|
45
|
-
justifyContent: "center"
|
|
46
|
-
},
|
|
47
|
-
label: {
|
|
48
|
-
fontSize: 11,
|
|
49
|
-
fontWeight: "700",
|
|
50
|
-
color: night.color.textSecondary
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
//# sourceMappingURL=HeaderReloadButton.js.map
|
|
1
|
+
"use strict";import{StyleSheet as i,Text as a,TouchableOpacity as l}from"react-native";import{night as e,scheduleReloadApp as c}from"@buoy-gg/shared-ui";import{jsx as t}from"react/jsx-runtime";export function HeaderReloadButton(){const r=()=>{try{c({reason:"buoy time-machine reload app"})}catch{}};return t(l,{style:o.chip,onPress:r,accessibilityLabel:"Reload app",accessibilityHint:"Reloads the JavaScript bundle without restoring anything",accessibilityRole:"button",testID:"time-machine-reload-app",children:t(a,{style:o.label,children:"Reload app"})})}const o=i.create({chip:{height:32,paddingHorizontal:10,borderRadius:8,borderWidth:1,borderColor:e.color.border,backgroundColor:e.color.buttonSurface,alignItems:"center",justifyContent:"center"},label:{fontSize:11,fontWeight:"700",color:e.color.textSecondary}});
|
|
@@ -1,277 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Time Machine body — the screen router plus the restore-point list.
|
|
5
|
-
*
|
|
6
|
-
* Screens: list → preview. Each is its own component that mounts and
|
|
7
|
-
* unmounts whole (no branching inside a single tree), and each owns its own
|
|
8
|
-
* scrolling — the host must NOT wrap this in a scroll view, or the preview's
|
|
9
|
-
* virtualized FlatList is defeated. Item diffs expand inline in that list
|
|
10
|
-
* rather than being a third screen.
|
|
11
|
-
*
|
|
12
|
-
* The list follows the grouped-inset surface in ../ui: capture bar, the
|
|
13
|
-
* Sources strip, one card of restore points with swipe-to-delete, and the
|
|
14
|
-
* app-wide wipe kept last and understated.
|
|
15
|
-
*/
|
|
16
|
-
import { useRef, useState, useSyncExternalStore } from "react";
|
|
17
|
-
import { ScrollView, StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
18
|
-
import { useSafeAreaInsets, useLimit, ToolEmptyState, getFloatingTools, subscribeFloatingTools } from "@buoy-gg/shared-ui";
|
|
19
|
-
import { useToolHost } from "@buoy-gg/core";
|
|
20
|
-
import { useTimeMachineState } from "../hooks/useTimeMachine";
|
|
21
|
-
import { timeMachineStore } from "../store/timeMachineStore";
|
|
22
|
-
import { Footnote, Group, SectionLabel } from "../ui/primitives";
|
|
23
|
-
import { tm } from "../ui/tmTheme";
|
|
24
|
-
import { useSourceStatuses } from "./sources";
|
|
25
|
-
import { confirmDestructive } from "./confirm";
|
|
26
|
-
import { CaptureBar } from "./list/CaptureBar";
|
|
27
|
-
import { RestoreOutcomeCard, restoreNeedsAttention } from "./list/RestoreOutcomeCard";
|
|
28
|
-
import { SnapshotRow } from "./list/SnapshotRow";
|
|
29
|
-
import { UndoDeleteBar } from "./list/UndoDeleteBar";
|
|
30
|
-
import { SourcesStrip } from "./list/SourcesStrip";
|
|
31
|
-
import { WipeAllRow } from "./list/WipeAllRow";
|
|
32
|
-
import { PreviewScreen } from "./preview/PreviewFlow";
|
|
33
|
-
import { TIME_MACHINE_FLOATING_TOOL_ID, openTimeMachineFloatingTool } from "./floating/TimeMachineFloatingTool";
|
|
34
|
-
import { getPickedPointId, resolveArmedPoint, subscribePickedPoint } from "./floating/armedPoint";
|
|
35
|
-
import { setSourceEnabled } from "../store/sourceSettings";
|
|
36
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
37
|
-
const isBarOpen = () => getFloatingTools().some(tool => tool.id === TIME_MACHINE_FLOATING_TOOL_ID);
|
|
38
|
-
export function TimeMachineBody() {
|
|
39
|
-
const [screen, setScreen] = useState({
|
|
40
|
-
kind: "list"
|
|
41
|
-
});
|
|
42
|
-
const {
|
|
43
|
-
snapshots,
|
|
44
|
-
busy,
|
|
45
|
-
preview
|
|
46
|
-
} = useTimeMachineState();
|
|
47
|
-
const sources = useSourceStatuses();
|
|
48
|
-
const backToList = () => {
|
|
49
|
-
timeMachineStore.clearPreview();
|
|
50
|
-
setScreen({
|
|
51
|
-
kind: "list"
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// The preview can't render without a built diff (clearPreview races a
|
|
56
|
-
// back-navigation) — fall through to the list rather than an empty shell.
|
|
57
|
-
if (screen.kind === "preview" && preview) return /*#__PURE__*/_jsx(PreviewScreen, {
|
|
58
|
-
preview: preview,
|
|
59
|
-
snapshots: snapshots,
|
|
60
|
-
busy: busy !== null,
|
|
61
|
-
onClose: backToList
|
|
62
|
-
});
|
|
63
|
-
return /*#__PURE__*/_jsx(RestorePointList, {
|
|
64
|
-
sources: sources,
|
|
65
|
-
onOpenPreview: meta => {
|
|
66
|
-
void timeMachineStore.buildPreview({
|
|
67
|
-
snapshotId: meta.id
|
|
68
|
-
});
|
|
69
|
-
setScreen({
|
|
70
|
-
kind: "preview"
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function RestorePointList({
|
|
76
|
-
sources,
|
|
77
|
-
onOpenPreview
|
|
78
|
-
}) {
|
|
79
|
-
const {
|
|
80
|
-
snapshots,
|
|
81
|
-
hasLoaded,
|
|
82
|
-
busy,
|
|
83
|
-
lastOutcome,
|
|
84
|
-
recentlyDeleted,
|
|
85
|
-
remoteProviders
|
|
86
|
-
} = useTimeMachineState();
|
|
87
|
-
const snapshotLimit = useLimit("timeMachine.snapshots");
|
|
88
|
-
const host = useToolHost();
|
|
89
|
-
const insets = useSafeAreaInsets({
|
|
90
|
-
minBottom: 16
|
|
91
|
-
});
|
|
92
|
-
// Which point the floating restore bar has armed, while the bar is open.
|
|
93
|
-
const barOpen = useSyncExternalStore(subscribeFloatingTools, isBarOpen, isBarOpen);
|
|
94
|
-
const pickedId = useSyncExternalStore(subscribePickedPoint, getPickedPointId, getPickedPointId);
|
|
95
|
-
const armedId = barOpen ? resolveArmedPoint(snapshots, pickedId)?.id : undefined;
|
|
96
|
-
// Restoring the same point from this list again and again is what the bar
|
|
97
|
-
// is for; say so once, at the moment it is true.
|
|
98
|
-
const listRestores = useRef({});
|
|
99
|
-
const [barHintFor, setBarHintFor] = useState(null);
|
|
100
|
-
const putOnBar = id => {
|
|
101
|
-
setBarHintFor(null);
|
|
102
|
-
openTimeMachineFloatingTool(id);
|
|
103
|
-
host.minimize();
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
// Header search (when hosted by the core shell) filters the list.
|
|
107
|
-
const query = host.search.trim().toLowerCase();
|
|
108
|
-
const visible = query ? snapshots.filter(s => s.name.toLowerCase().includes(query)) : snapshots;
|
|
109
|
-
|
|
110
|
-
// Infinity for Pro, so this is simply false for them. The bar's safety
|
|
111
|
-
// slot is not a point you chose to keep, so it does not count.
|
|
112
|
-
const atCaptureLimit = snapshots.filter(s => !s.safety).length >= snapshotLimit;
|
|
113
|
-
const captureDisabled = busy !== null || atCaptureLimit;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Restoring is the last thing anyone wants from this screen, so the tool
|
|
117
|
-
* gets out of the way the moment it worked — with no toast and no banner.
|
|
118
|
-
* The restored app IS the confirmation, and anything announcing it is one
|
|
119
|
-
* more thing to dismiss on a flow people run dozens of times an hour.
|
|
120
|
-
*
|
|
121
|
-
* It MINIMIZES rather than closes: the list, the search and the screen you
|
|
122
|
-
* were on all survive, and coming back is one tap on the dock. A partial
|
|
123
|
-
* restore stays open instead, because the outcome card is the only place
|
|
124
|
-
* the per-source failures are reported.
|
|
125
|
-
*/
|
|
126
|
-
const restore = meta => {
|
|
127
|
-
if (busy) return;
|
|
128
|
-
if (meta.baseline) {
|
|
129
|
-
confirmDestructive("Restore fresh install?", "This wipes all app storage and reloads the app.", "Wipe & reload", () => void timeMachineStore.restore(meta.id, "reload"));
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
const count = (listRestores.current[meta.id] ?? 0) + 1;
|
|
133
|
-
listRestores.current[meta.id] = count;
|
|
134
|
-
if (count >= 2 && !barOpen) setBarHintFor(meta.id);
|
|
135
|
-
void timeMachineStore.restore(meta.id, "live").then(outcome => {
|
|
136
|
-
const clean = Object.values(outcome.results).every(r => r.ok);
|
|
137
|
-
if (!clean || outcome.willReload) return;
|
|
138
|
-
host.minimize();
|
|
139
|
-
});
|
|
140
|
-
};
|
|
141
|
-
const barHint = barHintFor && !barOpen ? snapshots.find(s => s.id === barHintFor) ?? null : null;
|
|
142
|
-
return /*#__PURE__*/_jsxs(ScrollView, {
|
|
143
|
-
style: styles.fill,
|
|
144
|
-
contentContainerStyle: [styles.content, {
|
|
145
|
-
paddingBottom: insets.bottom
|
|
146
|
-
}],
|
|
147
|
-
testID: "time-machine-scroll"
|
|
148
|
-
// Without this, the first tap after typing a name only DISMISSES the
|
|
149
|
-
// keyboard — Capture never fires and the restore point is silently not
|
|
150
|
-
// taken. Every other Buoy screen with a field inside a scroller sets it;
|
|
151
|
-
// this one didn't, and only the XCTest lane could see it (Detox's
|
|
152
|
-
// replaceText never opens a keyboard, so the tap always landed).
|
|
153
|
-
,
|
|
154
|
-
keyboardShouldPersistTaps: "handled",
|
|
155
|
-
children: [lastOutcome && restoreNeedsAttention(lastOutcome) ? /*#__PURE__*/_jsx(RestoreOutcomeCard, {
|
|
156
|
-
outcome: lastOutcome
|
|
157
|
-
}) : null, recentlyDeleted ? /*#__PURE__*/_jsx(UndoDeleteBar, {
|
|
158
|
-
name: recentlyDeleted.stored.meta.name,
|
|
159
|
-
at: recentlyDeleted.at,
|
|
160
|
-
onUndo: () => void timeMachineStore.undoDelete(),
|
|
161
|
-
onExpire: () => timeMachineStore.clearRecentlyDeleted()
|
|
162
|
-
}) : null, /*#__PURE__*/_jsx(View, {
|
|
163
|
-
children: /*#__PURE__*/_jsx(CaptureBar, {
|
|
164
|
-
disabled: captureDisabled,
|
|
165
|
-
busy: busy === "capture",
|
|
166
|
-
onCapture: name => void timeMachineStore.capture(name)
|
|
167
|
-
})
|
|
168
|
-
}), atCaptureLimit ? /*#__PURE__*/_jsxs(Footnote, {
|
|
169
|
-
tone: "warning",
|
|
170
|
-
testID: "time-machine-limit",
|
|
171
|
-
children: ["Free plan keeps ", snapshotLimit, " restore point", snapshotLimit === 1 ? "" : "s", ". Upgrade to Pro for unlimited snapshots."]
|
|
172
|
-
}) : null, /*#__PURE__*/_jsx(SectionLabel, {
|
|
173
|
-
children: "Sources"
|
|
174
|
-
}), /*#__PURE__*/_jsx(SourcesStrip, {
|
|
175
|
-
sources: sources,
|
|
176
|
-
onToggle: remoteProviders ? undefined : setSourceEnabled
|
|
177
|
-
}), remoteProviders ? null : /*#__PURE__*/_jsx(Footnote, {
|
|
178
|
-
testID: "time-machine-sources-hint",
|
|
179
|
-
children: "Switch a source off to leave it out of every capture and restore."
|
|
180
|
-
}), /*#__PURE__*/_jsx(SectionLabel, {
|
|
181
|
-
children: "Restore Points"
|
|
182
|
-
}), barHint ? /*#__PURE__*/_jsxs(View, {
|
|
183
|
-
style: styles.barHint,
|
|
184
|
-
testID: "time-machine-bar-hint",
|
|
185
|
-
children: [/*#__PURE__*/_jsxs(Footnote, {
|
|
186
|
-
children: ["Restoring \"", barHint.name, "\" a lot? Put it on the floating action bar and restore it with one tap."]
|
|
187
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
188
|
-
onPress: () => putOnBar(barHint.id),
|
|
189
|
-
accessibilityRole: "button",
|
|
190
|
-
testID: "time-machine-bar-hint-pin",
|
|
191
|
-
hitSlop: {
|
|
192
|
-
top: 6,
|
|
193
|
-
bottom: 6,
|
|
194
|
-
left: 6,
|
|
195
|
-
right: 6
|
|
196
|
-
},
|
|
197
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
198
|
-
style: styles.barHintAction,
|
|
199
|
-
children: "Open the action bar"
|
|
200
|
-
})
|
|
201
|
-
})]
|
|
202
|
-
}) : null, /*#__PURE__*/_jsxs(Group, {
|
|
203
|
-
children: [visible.map(meta => /*#__PURE__*/_jsx(SnapshotRow, {
|
|
204
|
-
meta: meta,
|
|
205
|
-
busy: busy !== null,
|
|
206
|
-
armed: meta.id === armedId,
|
|
207
|
-
onOpen: () => onOpenPreview(meta),
|
|
208
|
-
onRestore: () => restore(meta),
|
|
209
|
-
onDelete: () => void timeMachineStore.delete(meta.id),
|
|
210
|
-
onDuplicate: () => void timeMachineStore.duplicate(meta.id),
|
|
211
|
-
onArm: () => putOnBar(meta.id)
|
|
212
|
-
}, meta.id)), visible.length === 0 ? /*#__PURE__*/_jsx(ToolEmptyState, {
|
|
213
|
-
testID: "time-machine-empty",
|
|
214
|
-
...(!hasLoaded ? {
|
|
215
|
-
otto: "loading",
|
|
216
|
-
title: "Loading restore points…",
|
|
217
|
-
message: "Reading the vault off disk."
|
|
218
|
-
} : snapshots.length > 0 ? {
|
|
219
|
-
otto: "sad",
|
|
220
|
-
title: "No restore point matches that name.",
|
|
221
|
-
message: `Clear the search to see all ${snapshots.length}.`
|
|
222
|
-
} : {
|
|
223
|
-
// rewind = "Time Machine: stepping back through
|
|
224
|
-
// snapshots" — the one OTTO_USES sentence for this tool.
|
|
225
|
-
otto: "rewind",
|
|
226
|
-
title: "No restore points yet",
|
|
227
|
-
message: "Set up the state you want to come back to, then capture it."
|
|
228
|
-
})
|
|
229
|
-
}) : null]
|
|
230
|
-
}), visible.length > 0 ? /*#__PURE__*/_jsx(Footnote, {
|
|
231
|
-
testID: "time-machine-swipe-hint",
|
|
232
|
-
children: "Swipe a restore point to copy or delete it."
|
|
233
|
-
}) : null, /*#__PURE__*/_jsx(View, {
|
|
234
|
-
style: styles.spacer
|
|
235
|
-
}), /*#__PURE__*/_jsx(Group, {
|
|
236
|
-
children: /*#__PURE__*/_jsx(WipeAllRow, {
|
|
237
|
-
disabled: busy !== null,
|
|
238
|
-
onWipe: () => confirmDestructive("Wipe all app state?", "This deletes all app storage and reloads the app — like a fresh install.", "Wipe & reload", () => void timeMachineStore.wipeAll())
|
|
239
|
-
})
|
|
240
|
-
}), /*#__PURE__*/_jsx(Footnote, {
|
|
241
|
-
centered: true,
|
|
242
|
-
children: "Deletes all app storage and reloads \u2014 like a fresh install."
|
|
243
|
-
})]
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
const styles = StyleSheet.create({
|
|
247
|
-
barHint: {
|
|
248
|
-
marginHorizontal: tm.gutter,
|
|
249
|
-
marginBottom: 8
|
|
250
|
-
},
|
|
251
|
-
barHintAction: {
|
|
252
|
-
color: tm.color.accent,
|
|
253
|
-
fontSize: tm.font.footnote,
|
|
254
|
-
fontWeight: "600",
|
|
255
|
-
paddingHorizontal: tm.textInset,
|
|
256
|
-
paddingTop: 2
|
|
257
|
-
},
|
|
258
|
-
fill: {
|
|
259
|
-
flex: 1,
|
|
260
|
-
// Transparent so JsModal's ToolBackground shows through (the modal paints opaque base beneath it).
|
|
261
|
-
backgroundColor: "transparent"
|
|
262
|
-
},
|
|
263
|
-
content: {
|
|
264
|
-
paddingTop: 14
|
|
265
|
-
},
|
|
266
|
-
empty: {
|
|
267
|
-
color: tm.color.labelSecondary,
|
|
268
|
-
fontSize: tm.font.footnote,
|
|
269
|
-
lineHeight: tm.font.footnote * 1.4,
|
|
270
|
-
paddingHorizontal: tm.textInset,
|
|
271
|
-
paddingVertical: 16
|
|
272
|
-
},
|
|
273
|
-
spacer: {
|
|
274
|
-
height: 24
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
//# sourceMappingURL=TimeMachineBody.js.map
|
|
1
|
+
"use strict";import{useRef as V,useState as O,useSyncExternalStore as L}from"react";import{ScrollView as G,StyleSheet as q,Text as $,TouchableOpacity as J,View as v}from"react-native";import{useSafeAreaInsets as K,useLimit as Q,ToolEmptyState as X,getFloatingTools as Y,subscribeFloatingTools as Z}from"@buoy-gg/shared-ui";import{useToolHost as ee}from"@buoy-gg/core";import{useTimeMachineState as x}from"../hooks/useTimeMachine";import{timeMachineStore as o}from"../store/timeMachineStore";import{Footnote as c,Group as C,SectionLabel as A}from"../ui/primitives";import{tm as r}from"../ui/tmTheme";import{useSourceStatuses as te}from"./sources";import{confirmDestructive as B}from"./confirm";import{CaptureBar as oe}from"./list/CaptureBar";import{RestoreOutcomeCard as ie,restoreNeedsAttention as ne}from"./list/RestoreOutcomeCard";import{SnapshotRow as re}from"./list/SnapshotRow";import{UndoDeleteBar as se}from"./list/UndoDeleteBar";import{SourcesStrip as le}from"./list/SourcesStrip";import{WipeAllRow as ae}from"./list/WipeAllRow";import{PreviewScreen as ce}from"./preview/PreviewFlow";import{TIME_MACHINE_FLOATING_TOOL_ID as de,openTimeMachineFloatingTool as pe}from"./floating/TimeMachineFloatingTool";import{getPickedPointId as F,resolveArmedPoint as me,subscribePickedPoint as ue}from"./floating/armedPoint";import{setSourceEnabled as he}from"../store/sourceSettings";import{jsx as t,jsxs as d}from"react/jsx-runtime";const z=()=>Y().some(s=>s.id===de);export function TimeMachineBody(){const[s,m]=O({kind:"list"});const{snapshots:i,busy:h,preview:n}=x();const l=te();const a=()=>{o.clearPreview();m({kind:"list"})};if(s.kind==="preview"&&n)return t(ce,{preview:n,snapshots:i,busy:h!==null,onClose:a});return t(fe,{sources:l,onOpenPreview:u=>{void o.buildPreview({snapshotId:u.id});m({kind:"preview"})}})}function fe({sources:s,onOpenPreview:m}){const{snapshots:i,hasLoaded:h,busy:n,lastOutcome:l,recentlyDeleted:a,remoteProviders:u}=x();const f=Q("timeMachine.snapshots");const b=ee();const M=K({minBottom:16});const g=L(Z,z,z);const E=L(ue,F,F);const W=g?me(i,E)?.id:void 0;const w=V({});const[T,I]=O(null);const D=e=>{I(null);pe(e);b.minimize()};const k=b.search.trim().toLowerCase();const y=k?i.filter(e=>e.name.toLowerCase().includes(k)):i;const P=i.filter(e=>!e.safety).length>=f;const _=n!==null||P;const j=e=>{if(n)return;if(e.baseline){B("Restore fresh install?","This wipes all app storage and reloads the app.","Wipe & reload",()=>void o.restore(e.id,"reload"));return}const R=(w.current[e.id]??0)+1;w.current[e.id]=R;if(R>=2&&!g)I(e.id);void o.restore(e.id,"live").then(H=>{const N=Object.values(H.results).every(U=>U.ok);if(!N||H.willReload)return;b.minimize()})};const S=T&&!g?i.find(e=>e.id===T)??null:null;return d(G,{style:p.fill,contentContainerStyle:[p.content,{paddingBottom:M.bottom}],testID:"time-machine-scroll",keyboardShouldPersistTaps:"handled",children:[l&&ne(l)?t(ie,{outcome:l}):null,a?t(se,{name:a.stored.meta.name,at:a.at,onUndo:()=>void o.undoDelete(),onExpire:()=>o.clearRecentlyDeleted()}):null,t(v,{children:t(oe,{disabled:_,busy:n==="capture",onCapture:e=>void o.capture(e)})}),P?d(c,{tone:"warning",testID:"time-machine-limit",children:["Free plan keeps ",f," restore point",f===1?"":"s",". Upgrade to Pro for unlimited snapshots."]}):null,t(A,{children:"Sources"}),t(le,{sources:s,onToggle:u?void 0:he}),u?null:t(c,{testID:"time-machine-sources-hint",children:"Switch a source off to leave it out of every capture and restore."}),t(A,{children:"Restore Points"}),S?d(v,{style:p.barHint,testID:"time-machine-bar-hint",children:[d(c,{children:['Restoring "',S.name,'" a lot? Put it on the floating action bar and restore it with one tap.']}),t(J,{onPress:()=>D(S.id),accessibilityRole:"button",testID:"time-machine-bar-hint-pin",hitSlop:{top:6,bottom:6,left:6,right:6},children:t($,{style:p.barHintAction,children:"Open the action bar"})})]}):null,d(C,{children:[y.map(e=>t(re,{meta:e,busy:n!==null,armed:e.id===W,onOpen:()=>m(e),onRestore:()=>j(e),onDelete:()=>void o.delete(e.id),onDuplicate:()=>void o.duplicate(e.id),onArm:()=>D(e.id)},e.id)),y.length===0?t(X,{testID:"time-machine-empty",...!h?{otto:"loading",title:"Loading restore points\u2026",message:"Reading the vault off disk."}:i.length>0?{otto:"sad",title:"No restore point matches that name.",message:`Clear the search to see all ${i.length}.`}:{otto:"rewind",title:"No restore points yet",message:"Set up the state you want to come back to, then capture it."}}):null]}),y.length>0?t(c,{testID:"time-machine-swipe-hint",children:"Swipe a restore point to copy or delete it."}):null,t(v,{style:p.spacer}),t(C,{children:t(ae,{disabled:n!==null,onWipe:()=>B("Wipe all app state?","This deletes all app storage and reloads the app \u2014 like a fresh install.","Wipe & reload",()=>void o.wipeAll())})}),t(c,{centered:true,children:"Deletes all app storage and reloads \u2014 like a fresh install."})]})}const p=q.create({barHint:{marginHorizontal:r.gutter,marginBottom:8},barHintAction:{color:r.color.accent,fontSize:r.font.footnote,fontWeight:"600",paddingHorizontal:r.textInset,paddingTop:2},fill:{flex:1,backgroundColor:"transparent"},content:{paddingTop:14},empty:{color:r.color.labelSecondary,fontSize:r.font.footnote,lineHeight:r.font.footnote*1.4,paddingHorizontal:r.textInset,paddingVertical:16},spacer:{height:24}});
|
|
@@ -1,68 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* TimeMachineModal — bottom-sheet wrapper rendered by FloatingDevTools when
|
|
5
|
-
* the Time Machine tool is opened. TimeMachineToolView is the inline variant
|
|
6
|
-
* for Buoy Desktop.
|
|
7
|
-
*/
|
|
8
|
-
import { StyleSheet, Text, View } from "react-native";
|
|
9
|
-
import { JsModal } from "@buoy-gg/shared-ui";
|
|
10
|
-
import { tm } from "../ui/tmTheme";
|
|
11
|
-
import { TimeMachineBody } from "./TimeMachineBody";
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
function Header() {
|
|
14
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
15
|
-
style: styles.header,
|
|
16
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
17
|
-
style: styles.headerTitle,
|
|
18
|
-
children: "Time Machine"
|
|
19
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
20
|
-
style: styles.headerSubtitle,
|
|
21
|
-
children: "Snapshot & restore app state"
|
|
22
|
-
})]
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
export function TimeMachineModal({
|
|
26
|
-
visible,
|
|
27
|
-
onClose,
|
|
28
|
-
onBack: _onBack,
|
|
29
|
-
onMinimize,
|
|
30
|
-
persistenceKey
|
|
31
|
-
}) {
|
|
32
|
-
return /*#__PURE__*/_jsx(JsModal, {
|
|
33
|
-
visible: visible,
|
|
34
|
-
onClose: onClose,
|
|
35
|
-
onMinimize: onMinimize,
|
|
36
|
-
persistenceKey: persistenceKey,
|
|
37
|
-
header: {
|
|
38
|
-
showToggleButton: true,
|
|
39
|
-
customContent: /*#__PURE__*/_jsx(Header, {})
|
|
40
|
-
},
|
|
41
|
-
enablePersistence: true,
|
|
42
|
-
initialMode: "bottomSheet",
|
|
43
|
-
disableScrollWrapper: true,
|
|
44
|
-
children: /*#__PURE__*/_jsx(TimeMachineBody, {})
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/** Inline variant (no modal chrome) — used by Buoy Desktop. */
|
|
49
|
-
export function TimeMachineToolView() {
|
|
50
|
-
return /*#__PURE__*/_jsx(TimeMachineBody, {});
|
|
51
|
-
}
|
|
52
|
-
const styles = StyleSheet.create({
|
|
53
|
-
header: {
|
|
54
|
-
paddingHorizontal: 4,
|
|
55
|
-
gap: 2
|
|
56
|
-
},
|
|
57
|
-
headerTitle: {
|
|
58
|
-
color: tm.color.label,
|
|
59
|
-
fontSize: 22,
|
|
60
|
-
fontWeight: "700",
|
|
61
|
-
letterSpacing: 0.3
|
|
62
|
-
},
|
|
63
|
-
headerSubtitle: {
|
|
64
|
-
color: tm.color.labelSecondary,
|
|
65
|
-
fontSize: tm.font.footnote
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=TimeMachineModal.js.map
|
|
1
|
+
"use strict";import{StyleSheet as c,Text as r,View as d}from"react-native";import{JsModal as h}from"@buoy-gg/shared-ui";import{tm as t}from"../ui/tmTheme";import{TimeMachineBody as i}from"./TimeMachineBody";import{jsx as e,jsxs as m}from"react/jsx-runtime";function p(){return m(d,{style:o.header,children:[e(r,{style:o.headerTitle,children:"Time Machine"}),e(r,{style:o.headerSubtitle,children:"Snapshot & restore app state"})]})}export function TimeMachineModal({visible:n,onClose:l,onBack:u,onMinimize:a,persistenceKey:s}){return e(h,{visible:n,onClose:l,onMinimize:a,persistenceKey:s,header:{showToggleButton:true,customContent:e(p,{})},enablePersistence:true,initialMode:"bottomSheet",disableScrollWrapper:true,children:e(i,{})})}export function TimeMachineToolView(){return e(i,{})}const o=c.create({header:{paddingHorizontal:4,gap:2},headerTitle:{color:t.color.label,fontSize:22,fontWeight:"700",letterSpacing:.3},headerSubtitle:{color:t.color.labelSecondary,fontSize:t.font.footnote}});
|
|
@@ -1,34 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";import{Alert as c,Platform as i}from"react-native";function o(r){const t=globalThis.confirm;return t?t(r):true}export function confirmDestructive(r,t,n,e){if(i.OS==="web"){if(o(`${r}
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
* Confirmation dialogs for the destructive / branching Time Machine actions.
|
|
5
|
-
*
|
|
6
|
-
* RN-web's Alert renders no buttons at all, so the web path (Buoy Desktop,
|
|
7
|
-
* the web example) uses `window.confirm`.
|
|
8
|
-
*
|
|
9
|
-
* There is deliberately NO "restore the route too?" prompt: that question is
|
|
10
|
-
* answered once per restore point by the route toggle on its row, because
|
|
11
|
-
* asking it on every restore meant answering it thirty times a day.
|
|
12
|
-
*/
|
|
13
|
-
import { Alert, Platform } from "react-native";
|
|
14
|
-
function webConfirm(message) {
|
|
15
|
-
const confirmFn = globalThis.confirm;
|
|
16
|
-
// No dialog available at all (headless web): don't silently swallow the
|
|
17
|
-
// user's intent — treat it as confirmed, same as the previous behavior.
|
|
18
|
-
return confirmFn ? confirmFn(message) : true;
|
|
19
|
-
}
|
|
20
|
-
export function confirmDestructive(title, message, confirmLabel, onConfirm) {
|
|
21
|
-
if (Platform.OS === "web") {
|
|
22
|
-
if (webConfirm(`${title}\n\n${message}`)) onConfirm();
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
Alert.alert(title, message, [{
|
|
26
|
-
text: "Cancel",
|
|
27
|
-
style: "cancel"
|
|
28
|
-
}, {
|
|
29
|
-
text: confirmLabel,
|
|
30
|
-
style: "destructive",
|
|
31
|
-
onPress: onConfirm
|
|
32
|
-
}]);
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=confirm.js.map
|
|
3
|
+
${t}`))e();return}c.alert(r,t,[{text:"Cancel",style:"cancel"},{text:n,style:"destructive",onPress:e}])}
|