@buoy-gg/time-machine 7.0.22 → 7.0.24

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.
Files changed (160) hide show
  1. package/lib/commonjs/components/TimeMachineBody.js +147 -677
  2. package/lib/commonjs/components/TimeMachineBody.js.map +1 -1
  3. package/lib/commonjs/components/TimeMachineModal.js +10 -11
  4. package/lib/commonjs/components/TimeMachineModal.js.map +1 -1
  5. package/lib/commonjs/components/confirm.js +39 -0
  6. package/lib/commonjs/components/confirm.js.map +1 -0
  7. package/lib/commonjs/components/format.js +24 -0
  8. package/lib/commonjs/components/format.js.map +1 -0
  9. package/lib/commonjs/components/list/CaptureBar.js +95 -0
  10. package/lib/commonjs/components/list/CaptureBar.js.map +1 -0
  11. package/lib/commonjs/components/list/RestoreOutcomeCard.js +162 -0
  12. package/lib/commonjs/components/list/RestoreOutcomeCard.js.map +1 -0
  13. package/lib/commonjs/components/list/SnapshotRow.js +141 -0
  14. package/lib/commonjs/components/list/SnapshotRow.js.map +1 -0
  15. package/lib/commonjs/components/list/SourcesStrip.js +126 -0
  16. package/lib/commonjs/components/list/SourcesStrip.js.map +1 -0
  17. package/lib/commonjs/components/list/UndoDeleteBar.js +81 -0
  18. package/lib/commonjs/components/list/UndoDeleteBar.js.map +1 -0
  19. package/lib/commonjs/components/list/WipeAllRow.js +46 -0
  20. package/lib/commonjs/components/list/WipeAllRow.js.map +1 -0
  21. package/lib/commonjs/components/preview/ItemDiffPanel.js +77 -0
  22. package/lib/commonjs/components/preview/ItemDiffPanel.js.map +1 -0
  23. package/lib/commonjs/components/preview/PreviewFlow.js +51 -0
  24. package/lib/commonjs/components/preview/PreviewFlow.js.map +1 -0
  25. package/lib/commonjs/components/preview/RestorePointNameRow.js +83 -0
  26. package/lib/commonjs/components/preview/RestorePointNameRow.js.map +1 -0
  27. package/lib/commonjs/components/preview/RestorePreviewScreen.js +549 -635
  28. package/lib/commonjs/components/preview/RestorePreviewScreen.js.map +1 -1
  29. package/lib/commonjs/components/preview/verdictMeta.js +8 -8
  30. package/lib/commonjs/components/preview/verdictMeta.js.map +1 -1
  31. package/lib/commonjs/components/sources.js +72 -0
  32. package/lib/commonjs/components/sources.js.map +1 -0
  33. package/lib/commonjs/store/snapshotVault.js +93 -9
  34. package/lib/commonjs/store/snapshotVault.js.map +1 -1
  35. package/lib/commonjs/store/timeMachineStore.js +125 -6
  36. package/lib/commonjs/store/timeMachineStore.js.map +1 -1
  37. package/lib/commonjs/sync/timeMachineSyncAdapter.js +41 -0
  38. package/lib/commonjs/sync/timeMachineSyncAdapter.js.map +1 -1
  39. package/lib/commonjs/ui/SwipeActionsRow.js +167 -0
  40. package/lib/commonjs/ui/SwipeActionsRow.js.map +1 -0
  41. package/lib/commonjs/ui/primitives.js +164 -0
  42. package/lib/commonjs/ui/primitives.js.map +1 -0
  43. package/lib/commonjs/ui/tmTheme.js +103 -0
  44. package/lib/commonjs/ui/tmTheme.js.map +1 -0
  45. package/lib/module/components/TimeMachineBody.js +150 -680
  46. package/lib/module/components/TimeMachineBody.js.map +1 -1
  47. package/lib/module/components/TimeMachineModal.js +11 -12
  48. package/lib/module/components/TimeMachineModal.js.map +1 -1
  49. package/lib/module/components/confirm.js +34 -0
  50. package/lib/module/components/confirm.js.map +1 -0
  51. package/lib/module/components/format.js +19 -0
  52. package/lib/module/components/format.js.map +1 -0
  53. package/lib/module/components/list/CaptureBar.js +90 -0
  54. package/lib/module/components/list/CaptureBar.js.map +1 -0
  55. package/lib/module/components/list/RestoreOutcomeCard.js +156 -0
  56. package/lib/module/components/list/RestoreOutcomeCard.js.map +1 -0
  57. package/lib/module/components/list/SnapshotRow.js +138 -0
  58. package/lib/module/components/list/SnapshotRow.js.map +1 -0
  59. package/lib/module/components/list/SourcesStrip.js +121 -0
  60. package/lib/module/components/list/SourcesStrip.js.map +1 -0
  61. package/lib/module/components/list/UndoDeleteBar.js +78 -0
  62. package/lib/module/components/list/UndoDeleteBar.js.map +1 -0
  63. package/lib/module/components/list/WipeAllRow.js +41 -0
  64. package/lib/module/components/list/WipeAllRow.js.map +1 -0
  65. package/lib/module/components/preview/ItemDiffPanel.js +72 -0
  66. package/lib/module/components/preview/ItemDiffPanel.js.map +1 -0
  67. package/lib/module/components/preview/PreviewFlow.js +46 -0
  68. package/lib/module/components/preview/PreviewFlow.js.map +1 -0
  69. package/lib/module/components/preview/RestorePointNameRow.js +78 -0
  70. package/lib/module/components/preview/RestorePointNameRow.js.map +1 -0
  71. package/lib/module/components/preview/RestorePreviewScreen.js +552 -638
  72. package/lib/module/components/preview/RestorePreviewScreen.js.map +1 -1
  73. package/lib/module/components/preview/verdictMeta.js +9 -8
  74. package/lib/module/components/preview/verdictMeta.js.map +1 -1
  75. package/lib/module/components/sources.js +66 -0
  76. package/lib/module/components/sources.js.map +1 -0
  77. package/lib/module/store/snapshotVault.js +87 -9
  78. package/lib/module/store/snapshotVault.js.map +1 -1
  79. package/lib/module/store/timeMachineStore.js +125 -7
  80. package/lib/module/store/timeMachineStore.js.map +1 -1
  81. package/lib/module/sync/timeMachineSyncAdapter.js +41 -0
  82. package/lib/module/sync/timeMachineSyncAdapter.js.map +1 -1
  83. package/lib/module/ui/SwipeActionsRow.js +162 -0
  84. package/lib/module/ui/SwipeActionsRow.js.map +1 -0
  85. package/lib/module/ui/primitives.js +156 -0
  86. package/lib/module/ui/primitives.js.map +1 -0
  87. package/lib/module/ui/tmTheme.js +99 -0
  88. package/lib/module/ui/tmTheme.js.map +1 -0
  89. package/lib/typescript/components/TimeMachineBody.d.ts.map +1 -1
  90. package/lib/typescript/components/TimeMachineModal.d.ts.map +1 -1
  91. package/lib/typescript/components/confirm.d.ts +2 -0
  92. package/lib/typescript/components/confirm.d.ts.map +1 -0
  93. package/lib/typescript/components/format.d.ts +4 -0
  94. package/lib/typescript/components/format.d.ts.map +1 -0
  95. package/lib/typescript/components/list/CaptureBar.d.ts +6 -0
  96. package/lib/typescript/components/list/CaptureBar.d.ts.map +1 -0
  97. package/lib/typescript/components/list/RestoreOutcomeCard.d.ts +11 -0
  98. package/lib/typescript/components/list/RestoreOutcomeCard.d.ts.map +1 -0
  99. package/lib/typescript/components/list/SnapshotRow.d.ts +12 -0
  100. package/lib/typescript/components/list/SnapshotRow.d.ts.map +1 -0
  101. package/lib/typescript/components/list/SourcesStrip.d.ts +5 -0
  102. package/lib/typescript/components/list/SourcesStrip.d.ts.map +1 -0
  103. package/lib/typescript/components/list/UndoDeleteBar.d.ts +8 -0
  104. package/lib/typescript/components/list/UndoDeleteBar.d.ts.map +1 -0
  105. package/lib/typescript/components/list/WipeAllRow.d.ts +5 -0
  106. package/lib/typescript/components/list/WipeAllRow.d.ts.map +1 -0
  107. package/lib/typescript/components/preview/ItemDiffPanel.d.ts +5 -0
  108. package/lib/typescript/components/preview/ItemDiffPanel.d.ts.map +1 -0
  109. package/lib/typescript/components/preview/PreviewFlow.d.ts +9 -0
  110. package/lib/typescript/components/preview/PreviewFlow.d.ts.map +1 -0
  111. package/lib/typescript/components/preview/RestorePointNameRow.d.ts +5 -0
  112. package/lib/typescript/components/preview/RestorePointNameRow.d.ts.map +1 -0
  113. package/lib/typescript/components/preview/RestorePreviewScreen.d.ts +1 -5
  114. package/lib/typescript/components/preview/RestorePreviewScreen.d.ts.map +1 -1
  115. package/lib/typescript/components/preview/verdictMeta.d.ts +5 -0
  116. package/lib/typescript/components/preview/verdictMeta.d.ts.map +1 -1
  117. package/lib/typescript/components/sources.d.ts +36 -0
  118. package/lib/typescript/components/sources.d.ts.map +1 -0
  119. package/lib/typescript/store/snapshotVault.d.ts +48 -0
  120. package/lib/typescript/store/snapshotVault.d.ts.map +1 -1
  121. package/lib/typescript/store/timeMachineStore.d.ts +35 -1
  122. package/lib/typescript/store/timeMachineStore.d.ts.map +1 -1
  123. package/lib/typescript/sync/timeMachineSyncAdapter.d.ts +17 -0
  124. package/lib/typescript/sync/timeMachineSyncAdapter.d.ts.map +1 -1
  125. package/lib/typescript/ui/SwipeActionsRow.d.ts +32 -0
  126. package/lib/typescript/ui/SwipeActionsRow.d.ts.map +1 -0
  127. package/lib/typescript/ui/primitives.d.ts +57 -0
  128. package/lib/typescript/ui/primitives.d.ts.map +1 -0
  129. package/lib/typescript/ui/tmTheme.d.ts +67 -0
  130. package/lib/typescript/ui/tmTheme.d.ts.map +1 -0
  131. package/package.json +7 -7
  132. package/src/components/TimeMachineBody.tsx +183 -817
  133. package/src/components/TimeMachineModal.tsx +10 -11
  134. package/src/components/confirm.ts +35 -0
  135. package/src/components/format.ts +17 -0
  136. package/src/components/list/CaptureBar.tsx +100 -0
  137. package/src/components/list/RestoreOutcomeCard.tsx +159 -0
  138. package/src/components/list/SnapshotRow.tsx +155 -0
  139. package/src/components/list/SourcesStrip.tsx +124 -0
  140. package/src/components/list/UndoDeleteBar.tsx +76 -0
  141. package/src/components/list/WipeAllRow.tsx +42 -0
  142. package/src/components/preview/ItemDiffPanel.tsx +77 -0
  143. package/src/components/preview/PreviewFlow.tsx +70 -0
  144. package/src/components/preview/RestorePointNameRow.tsx +80 -0
  145. package/src/components/preview/RestorePreviewScreen.tsx +535 -535
  146. package/src/components/preview/verdictMeta.ts +8 -8
  147. package/src/components/sources.ts +92 -0
  148. package/src/store/snapshotVault.ts +131 -9
  149. package/src/store/timeMachineStore.ts +136 -5
  150. package/src/sync/timeMachineSyncAdapter.ts +30 -0
  151. package/src/ui/SwipeActionsRow.tsx +199 -0
  152. package/src/ui/primitives.tsx +157 -0
  153. package/src/ui/tmTheme.ts +107 -0
  154. package/lib/commonjs/components/preview/ItemDetailScreen.js +0 -189
  155. package/lib/commonjs/components/preview/ItemDetailScreen.js.map +0 -1
  156. package/lib/module/components/preview/ItemDetailScreen.js +0 -184
  157. package/lib/module/components/preview/ItemDetailScreen.js.map +0 -1
  158. package/lib/typescript/components/preview/ItemDetailScreen.d.ts +0 -11
  159. package/lib/typescript/components/preview/ItemDetailScreen.d.ts.map +0 -1
  160. package/src/components/preview/ItemDetailScreen.tsx +0 -172
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Sources — one horizontally scrollable line of what a capture will pick up.
5
+ *
6
+ * Each source is its own tile (icon over name) rather than a count behind a
7
+ * disclosure: "is Redux wired?" is a glance question, and the answer should
8
+ * not cost a screen. A source that can't fully participate dims and carries a
9
+ * status dot, with the reason spelled out underneath the strip.
10
+ */
11
+ import { ScrollView, StyleSheet, Text, View } from "react-native";
12
+ import { tm } from "../../ui/tmTheme";
13
+ import { sourceIcon } from "../sources";
14
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
+ function statusDotColor(source) {
16
+ if (!source.canCapture) return tm.color.labelTertiary; // not detected
17
+ if (!source.canRestore) return tm.color.warning; // capture only
18
+ return null; // ready — nothing to flag
19
+ }
20
+ function SourceTile({
21
+ source
22
+ }) {
23
+ const Icon = sourceIcon(source.id);
24
+ const dot = statusDotColor(source);
25
+ return /*#__PURE__*/_jsxs(View, {
26
+ style: styles.tile,
27
+ testID: `time-machine-source-${source.id}`,
28
+ accessibilityLabel: `${source.label}: ${source.canCapture ? source.canRestore ? "capture and restore" : "capture only" : "not detected"}`,
29
+ children: [/*#__PURE__*/_jsxs(View, {
30
+ style: [styles.disc, !source.canCapture ? styles.discOff : null],
31
+ children: [/*#__PURE__*/_jsx(Icon, {
32
+ size: 26,
33
+ bgColor: tm.color.fill
34
+ }), dot ? /*#__PURE__*/_jsx(View, {
35
+ style: [styles.dot, {
36
+ backgroundColor: dot
37
+ }]
38
+ }) : null]
39
+ }), /*#__PURE__*/_jsx(Text, {
40
+ style: [styles.label, !source.canCapture ? styles.labelOff : null],
41
+ numberOfLines: 1,
42
+ children: source.label
43
+ })]
44
+ });
45
+ }
46
+ export function SourcesStrip({
47
+ sources
48
+ }) {
49
+ return /*#__PURE__*/_jsx(View, {
50
+ style: styles.card,
51
+ children: /*#__PURE__*/_jsxs(ScrollView, {
52
+ horizontal: true,
53
+ showsHorizontalScrollIndicator: false,
54
+ contentContainerStyle: styles.strip,
55
+ testID: "time-machine-sources",
56
+ children: [sources.map(source => /*#__PURE__*/_jsx(SourceTile, {
57
+ source: source
58
+ }, source.id)), sources.length === 0 ? /*#__PURE__*/_jsx(Text, {
59
+ style: styles.empty,
60
+ children: "No state tools installed."
61
+ }) : null]
62
+ })
63
+ });
64
+ }
65
+ const styles = StyleSheet.create({
66
+ card: {
67
+ marginHorizontal: tm.gutter,
68
+ backgroundColor: tm.color.group,
69
+ borderRadius: tm.radius.group,
70
+ paddingVertical: 12
71
+ },
72
+ strip: {
73
+ flexDirection: "row",
74
+ alignItems: "flex-start",
75
+ paddingHorizontal: tm.textInset,
76
+ gap: 18
77
+ },
78
+ tile: {
79
+ alignItems: "center",
80
+ gap: 7,
81
+ // Fixed width so the row reads as a grid, and wide enough for the
82
+ // longest source name on ONE line: a second line would be blank for
83
+ // every other tile while still setting the card's height.
84
+ width: 78
85
+ },
86
+ disc: {
87
+ width: 50,
88
+ height: 50,
89
+ borderRadius: tm.radius.pill,
90
+ backgroundColor: tm.color.fill,
91
+ alignItems: "center",
92
+ justifyContent: "center"
93
+ },
94
+ discOff: {
95
+ opacity: 0.35
96
+ },
97
+ dot: {
98
+ position: "absolute",
99
+ top: 2,
100
+ right: 2,
101
+ width: 10,
102
+ height: 10,
103
+ borderRadius: 5,
104
+ // Ring it in the card color so it reads as a badge, not a smudge.
105
+ borderWidth: 2,
106
+ borderColor: tm.color.group
107
+ },
108
+ label: {
109
+ color: tm.color.labelSecondary,
110
+ fontSize: tm.font.mono,
111
+ textAlign: "center"
112
+ },
113
+ labelOff: {
114
+ color: tm.color.labelTertiary
115
+ },
116
+ empty: {
117
+ color: tm.color.labelSecondary,
118
+ fontSize: tm.font.footnote
119
+ }
120
+ });
121
+ //# sourceMappingURL=SourcesStrip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ScrollView","StyleSheet","Text","View","tm","sourceIcon","jsx","_jsx","jsxs","_jsxs","statusDotColor","source","canCapture","color","labelTertiary","canRestore","warning","SourceTile","Icon","id","dot","style","styles","tile","testID","accessibilityLabel","label","children","disc","discOff","size","bgColor","fill","backgroundColor","labelOff","numberOfLines","SourcesStrip","sources","card","horizontal","showsHorizontalScrollIndicator","contentContainerStyle","strip","map","length","empty","create","marginHorizontal","gutter","group","borderRadius","radius","paddingVertical","flexDirection","alignItems","paddingHorizontal","textInset","gap","width","height","pill","justifyContent","opacity","position","top","right","borderWidth","borderColor","labelSecondary","fontSize","font","mono","textAlign","footnote"],"sourceRoot":"../../../../src","sources":["components/list/SourcesStrip.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACjE,SAASC,EAAE,QAAQ,kBAAkB;AACrC,SAASC,UAAU,QAA2B,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3D,SAASC,cAAcA,CAACC,MAAoB,EAAiB;EAC3D,IAAI,CAACA,MAAM,CAACC,UAAU,EAAE,OAAOR,EAAE,CAACS,KAAK,CAACC,aAAa,CAAC,CAAC;EACvD,IAAI,CAACH,MAAM,CAACI,UAAU,EAAE,OAAOX,EAAE,CAACS,KAAK,CAACG,OAAO,CAAC,CAAC;EACjD,OAAO,IAAI,CAAC,CAAC;AACf;AAEA,SAASC,UAAUA,CAAC;EAAEN;AAAiC,CAAC,EAAE;EACxD,MAAMO,IAAI,GAAGb,UAAU,CAACM,MAAM,CAACQ,EAAE,CAAC;EAClC,MAAMC,GAAG,GAAGV,cAAc,CAACC,MAAM,CAAC;EAClC,oBACEF,KAAA,CAACN,IAAI;IACHkB,KAAK,EAAEC,MAAM,CAACC,IAAK;IACnBC,MAAM,EAAE,uBAAuBb,MAAM,CAACQ,EAAE,EAAG;IAC3CM,kBAAkB,EAAE,GAAGd,MAAM,CAACe,KAAK,KACjCf,MAAM,CAACC,UAAU,GACbD,MAAM,CAACI,UAAU,GACf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AE,CAACS,KAAK,CAACuD,cAAc;IAC9BC,QAAQ,EAAEjE,EAAE,CAACkE,IAAI,CAACC,IAAI;IACtBC,SAAS,EAAE;EACb,CAAC;EACDtC,QAAQ,EAAE;IACRrB,KAAK,EAAET,EAAE,CAACS,KAAK,CAACC;EAClB,CAAC;EACD+B,KAAK,EAAE;IACLhC,KAAK,EAAET,EAAE,CAACS,KAAK,CAACuD,cAAc;IAC9BC,QAAQ,EAAEjE,EAAE,CAACkE,IAAI,CAACG;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * The way back from a swipe-delete.
5
+ *
6
+ * Swipe-then-tap is deliberate, which is why there's no confirmation dialog —
7
+ * but deliberate and recoverable are different properties, and a restore
8
+ * point can stand for state that took ten minutes and a cooperative backend
9
+ * to build. The record is held in memory until this bar expires.
10
+ */
11
+ import { useEffect } from "react";
12
+ import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
13
+ import { tm } from "../../ui/tmTheme";
14
+
15
+ /** Long enough to notice and react, short enough not to linger. */
16
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
17
+ const WINDOW_MS = 8000;
18
+ export function UndoDeleteBar({
19
+ name,
20
+ at,
21
+ onUndo,
22
+ onExpire
23
+ }) {
24
+ useEffect(() => {
25
+ const timer = setTimeout(onExpire, WINDOW_MS);
26
+ return () => clearTimeout(timer);
27
+ // `at` keyed rather than `onExpire`: a new delete must restart the clock.
28
+ // eslint-disable-next-line react-hooks/exhaustive-deps
29
+ }, [at]);
30
+ return /*#__PURE__*/_jsxs(View, {
31
+ style: styles.bar,
32
+ children: [/*#__PURE__*/_jsxs(Text, {
33
+ style: styles.text,
34
+ numberOfLines: 1,
35
+ children: ["Deleted \u201C", name, "\u201D"]
36
+ }), /*#__PURE__*/_jsx(TouchableOpacity, {
37
+ onPress: onUndo,
38
+ hitSlop: {
39
+ top: 10,
40
+ bottom: 10,
41
+ left: 10,
42
+ right: 10
43
+ },
44
+ accessibilityRole: "button",
45
+ testID: "time-machine-undo-delete",
46
+ children: /*#__PURE__*/_jsx(Text, {
47
+ style: styles.undo,
48
+ children: "Undo"
49
+ })
50
+ })]
51
+ });
52
+ }
53
+ const styles = StyleSheet.create({
54
+ bar: {
55
+ flexDirection: "row",
56
+ alignItems: "center",
57
+ gap: 12,
58
+ marginHorizontal: tm.gutter,
59
+ marginTop: 12,
60
+ minHeight: 46,
61
+ paddingHorizontal: tm.textInset,
62
+ backgroundColor: tm.color.group,
63
+ borderRadius: tm.radius.group
64
+ },
65
+ text: {
66
+ flex: 1,
67
+ color: tm.color.labelSecondary,
68
+ fontSize: tm.font.control,
69
+ letterSpacing: tm.tracking.control
70
+ },
71
+ undo: {
72
+ color: tm.color.accent,
73
+ fontSize: tm.font.control,
74
+ fontWeight: "600",
75
+ letterSpacing: tm.tracking.control
76
+ }
77
+ });
78
+ //# sourceMappingURL=UndoDeleteBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","StyleSheet","Text","TouchableOpacity","View","tm","jsxs","_jsxs","jsx","_jsx","WINDOW_MS","UndoDeleteBar","name","at","onUndo","onExpire","timer","setTimeout","clearTimeout","style","styles","bar","children","text","numberOfLines","onPress","hitSlop","top","bottom","left","right","accessibilityRole","testID","undo","create","flexDirection","alignItems","gap","marginHorizontal","gutter","marginTop","minHeight","paddingHorizontal","textInset","backgroundColor","color","group","borderRadius","radius","flex","labelSecondary","fontSize","font","control","letterSpacing","tracking","accent","fontWeight"],"sourceRoot":"../../../../src","sources":["components/list/UndoDeleteBar.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,UAAU,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACvE,SAASC,EAAE,QAAQ,kBAAkB;;AAErC;AAAA,SAAAC,IAAA,IAAAC,KAAA,EAAAC,GA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SAAS;IAC/BC,eAAe,EAAEvC,EAAE,CAACwC,KAAK,CAACC,KAAK;IAC/BC,YAAY,EAAE1C,EAAE,CAAC2C,MAAM,CAACF;EAC1B,CAAC;EACDvB,IAAI,EAAE;IACJ0B,IAAI,EAAE,CAAC;IACPJ,KAAK,EAAExC,EAAE,CAACwC,KAAK,CAACK,cAAc;IAC9BC,QAAQ,EAAE9C,EAAE,CAAC+C,IAAI,CAACC,OAAO;IACzBC,aAAa,EAAEjD,EAAE,CAACkD,QAAQ,CAACF;EAC7B,CAAC;EACDpB,IAAI,EAAE;IACJY,KAAK,EAAExC,EAAE,CAACwC,KAAK,CAACW,MAAM;IACtBL,QAAQ,EAAE9C,EAAE,CAAC+C,IAAI,CAACC,OAAO;IACzBI,UAAU,EAAE,KAAK;IACjBH,aAAa,EAAEjD,EAAE,CAACkD,QAAQ,CAACF;EAC7B;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * "Wipe All App State…" — the destructive utility, deliberately last, alone
5
+ * in its own card and with no icon competing for attention.
6
+ */
7
+ import { StyleSheet, Text, TouchableOpacity } from "react-native";
8
+ import { tm } from "../../ui/tmTheme";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ export function WipeAllRow({
11
+ disabled,
12
+ onWipe
13
+ }) {
14
+ return /*#__PURE__*/_jsx(TouchableOpacity, {
15
+ style: [styles.row, disabled ? styles.disabled : null],
16
+ onPress: onWipe,
17
+ disabled: disabled,
18
+ accessibilityRole: "button",
19
+ testID: "time-machine-wipe-all",
20
+ children: /*#__PURE__*/_jsx(Text, {
21
+ style: styles.label,
22
+ children: "Wipe All App State\u2026"
23
+ })
24
+ });
25
+ }
26
+ const styles = StyleSheet.create({
27
+ row: {
28
+ minHeight: tm.rowMinHeight,
29
+ alignItems: "center",
30
+ justifyContent: "center"
31
+ },
32
+ disabled: {
33
+ opacity: 0.4
34
+ },
35
+ label: {
36
+ color: tm.color.danger,
37
+ fontSize: tm.font.row,
38
+ letterSpacing: tm.tracking.row
39
+ }
40
+ });
41
+ //# sourceMappingURL=WipeAllRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StyleSheet","Text","TouchableOpacity","tm","jsx","_jsx","WipeAllRow","disabled","onWipe","style","styles","row","onPress","accessibilityRole","testID","children","label","create","minHeight","rowMinHeight","alignItems","justifyContent","opacity","color","danger","fontSize","font","letterSpacing","tracking"],"sourceRoot":"../../../../src","sources":["components/list/WipeAllRow.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AACjE,SAASC,EAAE,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEtC,OAAO,SAASC,UAAUA,CAAC;EACzBC,QAAQ;EACRC;AAIF,CAAC,EAAE;EACD,oBACEH,IAAA,CAACH,gBAAgB;IACfO,KAAK,EAAE,CAACC,MAAM,CAACC,GAAG,EAAEJ,QAAQ,GAAGG,MAAM,CAACH,QAAQ,GAAG,IAAI,CAAE;IACvDK,OAAO,EAAEJ,MAAO;IAChBD,QAAQ,EAAEA,QAAS;IACnBM,iBAAiB,EAAC,QAAQ;IAC1BC,MAAM,EAAC,uBAAuB;IAAAC,QAAA,eAE9BV,IAAA,CAACJ,IAAI;MAACQ,KAAK,EAAEC,MAAM,CAACM,KAAM;MAAAD,QAAA,EAAC;IAAmB,CAAM;EAAC,CACrC,CAAC;AAEvB;AAEA,MAAML,MAAM,GAAGV,UAAU,CAACiB,MAAM,CAAC;EAC/BN,GAAG,EAAE;IACHO,SAAS,EAAEf,EAAE,CAACgB,YAAY;IAC1BC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDd,QAAQ,EAAE;IACRe,OAAO,EAAE;EACX,CAAC;EACDN,KAAK,EAAE;IACLO,KAAK,EAAEpB,EAAE,CAACoB,KAAK,CAACC,MAAM;IACtBC,QAAQ,EAAEtB,EAAE,CAACuB,IAAI,CAACf,GAAG;IACrBgB,aAAa,EAAExB,EAAE,CAACyB,QAAQ,CAACjB;EAC7B;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * One preview item's before/after, rendered INLINE under its row rather than
5
+ * on a screen of its own — "what changed in this key" is a glance question,
6
+ * and losing the list to answer it costs you the place you were reading.
7
+ *
8
+ * Split view only, with no view switcher. Side-by-side is the shape that
9
+ * answers the question here ("what is it now, what will it become"), and
10
+ * inside a list row the segmented control cost more vertical space than the
11
+ * diff it was switching.
12
+ *
13
+ * The render-layer viewer only handles plain JSON faithfully, so both sides
14
+ * pass through toDiffable (Dates→ISO, Maps→objects, BigInt→"1n", cycles→
15
+ * "[Circular]") and the pair is memoized ONCE per item — the storage tool's
16
+ * fix for the fresh-identity-every-render trap that redux/zustand still have.
17
+ *
18
+ * No scroller of its own: this sits inside the preview's FlatList, so the
19
+ * viewer renders at natural height with `scrollEnabled={false}` (the storage
20
+ * matched-pair contract).
21
+ */
22
+ import { useMemo } from "react";
23
+ import { StyleSheet, Text, View } from "react-native";
24
+ import { ABSENT_VALUE, ThemedSplitView, devToolsDefaultTheme, toDiffable } from "@buoy-gg/shared-ui/dataViewer";
25
+ import { tm } from "../../ui/tmTheme";
26
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
27
+ const EMPTY = [];
28
+ export function ItemDiffPanel({
29
+ item
30
+ }) {
31
+ // ABSENT_VALUE keeps added/removed reading as pure additions/removals
32
+ // instead of diffs against the literal "null".
33
+ const {
34
+ oldValue,
35
+ newValue
36
+ } = useMemo(() => ({
37
+ oldValue: item.verdict === "added" ? ABSENT_VALUE : toDiffable(item.oldValue),
38
+ newValue: item.verdict === "removed" ? ABSENT_VALUE : toDiffable(item.newValue)
39
+ }), [item]);
40
+ return /*#__PURE__*/_jsxs(View, {
41
+ style: styles.panel,
42
+ children: [item.reason ? /*#__PURE__*/_jsxs(Text, {
43
+ style: styles.reason,
44
+ children: ["\u26A0 ", item.reason]
45
+ }) : null, /*#__PURE__*/_jsx(ThemedSplitView, {
46
+ oldValue: oldValue,
47
+ newValue: newValue,
48
+ differences: EMPTY,
49
+ theme: devToolsDefaultTheme,
50
+ scrollEnabled: false
51
+ })]
52
+ });
53
+ }
54
+ const styles = StyleSheet.create({
55
+ // Same fill as the rows above it: this is part of the card, not a thing
56
+ // floating under it.
57
+ panel: {
58
+ // Only a token indent: the viewer lays values out at their natural width
59
+ // and a 51pt inset (matching the checkbox column) clipped long numbers.
60
+ paddingLeft: 16,
61
+ paddingRight: 12,
62
+ paddingTop: 10,
63
+ paddingBottom: 14,
64
+ gap: 10,
65
+ backgroundColor: tm.color.group
66
+ },
67
+ reason: {
68
+ color: tm.color.warning,
69
+ fontSize: tm.font.footnote
70
+ }
71
+ });
72
+ //# sourceMappingURL=ItemDiffPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useMemo","StyleSheet","Text","View","ABSENT_VALUE","ThemedSplitView","devToolsDefaultTheme","toDiffable","tm","jsxs","_jsxs","jsx","_jsx","EMPTY","ItemDiffPanel","item","oldValue","newValue","verdict","style","styles","panel","children","reason","differences","theme","scrollEnabled","create","paddingLeft","paddingRight","paddingTop","paddingBottom","gap","backgroundColor","color","group","warning","fontSize","font","footnote"],"sourceRoot":"../../../../src","sources":["components/preview/ItemDiffPanel.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAErD,SACEC,YAAY,EACZC,eAAe,EACfC,oBAAoB,EACpBC,UAAU,QACL,+BAA+B;AACtC,SAASC,EAAE,QAAQ,kBAAkB;AAAC,SAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAA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AACE,OAAO;IACvBC,QAAQ,EAAE7B,EAAE,CAAC8B,IAAI,CAACC;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * The preview screen, wired to the store — the restore leg (baseline
5
+ * confirmation, the route prompt, landing back on the list) lives here so
6
+ * RestorePreviewScreen stays presentation.
7
+ *
8
+ * Kept apart from the restore-point list so each screen mounts and unmounts
9
+ * as a whole tree — the router in ../TimeMachineBody picks one, never swaps
10
+ * branches inside a live tree. (Item diffs are NOT a screen: they expand
11
+ * inline inside the preview's list.)
12
+ */
13
+ import { timeMachineStore } from "../../store/timeMachineStore";
14
+ import { confirmDestructive } from "../confirm";
15
+ import { RestorePreviewScreen } from "./RestorePreviewScreen";
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ function snapshotFor(ref, snapshots) {
18
+ return ref === "current" ? undefined : snapshots.find(s => s.id === ref.snapshotId);
19
+ }
20
+ export function PreviewScreen({
21
+ preview,
22
+ snapshots,
23
+ busy,
24
+ onClose
25
+ }) {
26
+ const rightMeta = snapshotFor(preview.right, snapshots);
27
+ const restore = (mode, excludeKeys) => {
28
+ if (!rightMeta || busy) return;
29
+ if (rightMeta.baseline) {
30
+ confirmDestructive("Restore fresh install?", "This wipes all app storage and reloads the app.", "Wipe & reload", () => void timeMachineStore.restore(rightMeta.id, "reload"));
31
+ return;
32
+ }
33
+ // Land back on the list, where the outcome card reports the results —
34
+ // the preview's diff is stale the moment restore runs. Whether the route
35
+ // comes back is the restore point's own setting, toggled on its row.
36
+ void timeMachineStore.restore(rightMeta.id, mode, excludeKeys).then(onClose);
37
+ };
38
+ return /*#__PURE__*/_jsx(RestorePreviewScreen, {
39
+ preview: preview,
40
+ snapshots: snapshots,
41
+ busy: busy,
42
+ onBack: onClose,
43
+ onRestore: restore
44
+ });
45
+ }
46
+ //# sourceMappingURL=PreviewFlow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["timeMachineStore","confirmDestructive","RestorePreviewScreen","jsx","_jsx","snapshotFor","ref","snapshots","undefined","find","s","id","snapshotId","PreviewScreen","preview","busy","onClose","rightMeta","right","restore","mode","excludeKeys","baseline","then","onBack","onRestore"],"sourceRoot":"../../../../src","sources":["components/preview/PreviewFlow.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,8BAA8B;AAM/D,SAASC,kBAAkB,QAAQ,YAAY;AAC/C,SAASC,oBAAoB,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE9D,SAASC,WAAWA,CAClBC,GAAmB,EACnBC,SAAyB,EACC;EAC1B,OAAOD,GAAG,KAAK,SAAS,GACpBE,SAAS,GACTD,SAAS,CAACE,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,EAAE,KAAKL,GAAG,CAACM,UAAU,CAAC;AACpD;AAEA,OAAO,SAASC,aAAaA,CAAC;EAC5BC,OAAO;EACPP,SAAS;EACTQ,IAAI;EACJC;AAMF,CAAC,EAAE;EACD,MAAMC,SAAS,GAAGZ,WAAW,CAACS,OAAO,CAACI,KAAK,EAAEX,SAAS,CAAC;EAEvD,MAAMY,OAAO,GAAGA,CAACC,IAAuB,EAAEC,WAAsB,KAAK;IACnE,IAAI,CAACJ,SAAS,IAAIF,IAAI,EAAE;IACxB,IAAIE,SAAS,CAACK,QAAQ,EAAE;MACtBrB,kBAAkB,CAChB,wBAAwB,EACxB,iDAAiD,EACjD,eAAe,EACf,MAAM,KAAKD,gBAAgB,CAACmB,OAAO,CAACF,SAAS,CAACN,EAAE,EAAE,QAAQ,CAC5D,CAAC;MACD;IACF;IACA;IACA;IACA;IACA,KAAKX,gBAAgB,CAClBmB,OAAO,CAACF,SAAS,CAACN,EAAE,EAAES,IAAI,EAAEC,WAAW,CAAC,CACxCE,IAAI,CAACP,OAAO,CAAC;EAClB,CAAC;EAED,oBACEZ,IAAA,CAACF,oBAAoB;IACnBY,OAAO,EAAEA,OAAQ;IACjBP,SAAS,EAAEA,SAAU;IACrBQ,IAAI,EAAEA,IAAK;IACXS,MAAM,EAAER,OAAQ;IAChBS,SAAS,EAAEN;EAAQ,CACpB,CAAC;AAEN","ignoreList":[]}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * The restore point's name, editable in place.
5
+ *
6
+ * Renaming lives on the preview rather than behind a swipe on the list: the
7
+ * list is for picking one, and you rarely know a name is wrong until you're
8
+ * looking at what the point actually contains.
9
+ *
10
+ * Commits on blur as well as on return — tapping away from a field you have
11
+ * just typed into should keep the typing. Finder and iOS both treat leaving
12
+ * as accepting, and silently discarding an edit is the one outcome nobody
13
+ * wants.
14
+ */
15
+ import { useEffect, useState } from "react";
16
+ import { StyleSheet, Text, TextInput, View } from "react-native";
17
+ import { tm } from "../../ui/tmTheme";
18
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
+ export function RestorePointNameRow({
20
+ name,
21
+ onRename
22
+ }) {
23
+ const [draft, setDraft] = useState(name);
24
+
25
+ // A rename from anywhere else (MCP, the desktop) should show up here.
26
+ useEffect(() => setDraft(name), [name]);
27
+ const commit = () => {
28
+ const trimmed = draft.trim();
29
+ if (!trimmed) {
30
+ setDraft(name); // an empty name would make the row unidentifiable
31
+ return;
32
+ }
33
+ if (trimmed !== name) onRename(trimmed);
34
+ };
35
+ return /*#__PURE__*/_jsxs(View, {
36
+ style: styles.row,
37
+ children: [/*#__PURE__*/_jsx(Text, {
38
+ style: styles.label,
39
+ children: "Name"
40
+ }), /*#__PURE__*/_jsx(TextInput, {
41
+ style: styles.input,
42
+ value: draft,
43
+ onChangeText: setDraft,
44
+ onSubmitEditing: commit,
45
+ onBlur: commit,
46
+ returnKeyType: "done",
47
+ selectTextOnFocus: true,
48
+ accessibilityLabel: "Restore point name",
49
+ testID: "tm-preview-name"
50
+ })]
51
+ });
52
+ }
53
+ const styles = StyleSheet.create({
54
+ row: {
55
+ flexDirection: "row",
56
+ alignItems: "center",
57
+ gap: 14,
58
+ minHeight: tm.rowMinHeight,
59
+ paddingHorizontal: tm.textInset
60
+ },
61
+ label: {
62
+ color: tm.color.labelSecondary,
63
+ fontSize: tm.font.row,
64
+ letterSpacing: tm.tracking.row
65
+ },
66
+ input: {
67
+ flex: 1,
68
+ minWidth: 0,
69
+ color: tm.color.label,
70
+ fontSize: tm.font.row,
71
+ fontWeight: "600",
72
+ letterSpacing: tm.tracking.row,
73
+ textAlign: "right",
74
+ padding: 0,
75
+ backgroundColor: "transparent"
76
+ }
77
+ });
78
+ //# sourceMappingURL=RestorePointNameRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useState","StyleSheet","Text","TextInput","View","tm","jsx","_jsx","jsxs","_jsxs","RestorePointNameRow","name","onRename","draft","setDraft","commit","trimmed","trim","style","styles","row","children","label","input","value","onChangeText","onSubmitEditing","onBlur","returnKeyType","selectTextOnFocus","accessibilityLabel","testID","create","flexDirection","alignItems","gap","minHeight","rowMinHeight","paddingHorizontal","textInset","color","labelSecondary","fontSize","font","letterSpacing","tracking","flex","minWidth","fontWeight","textAlign","padding","backgroundColor"],"sourceRoot":"../../../../src","sources":["components/preview/RestorePointNameRow.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,UAAU,EAAEC,IAAI,EAAEC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAChE,SAASC,EAAE,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtC,OAAO,SAASC,mBAAmBA,CAAC;EAClCC,IAAI;EACJC;AAIF,CAAC,EAAE;EACD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGd,QAAQ,CAACW,IAAI,CAAC;;EAExC;EACAZ,SAAS,CAAC,MAA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