@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,141 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SnapshotRow = SnapshotRow;
7
+ var _reactNative = require("react-native");
8
+ var _primitives = require("../../ui/primitives");
9
+ var _SwipeActionsRow = require("../../ui/SwipeActionsRow");
10
+ var _tmTheme = require("../../ui/tmTheme");
11
+ var _format = require("../format");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ /**
14
+ * One restore point in the list: what it is, when it was taken, how big it
15
+ * is, where it was captured — and the single action worth having at arm's
16
+ * reach. Tapping the row opens the restore preview; the pill restores now.
17
+ *
18
+ * The route is shown as context — where this state was true. Whether a
19
+ * restore also navigates there is decided in the restore preview, beside the
20
+ * other changes it is about to make.
21
+ *
22
+ * Duplicate and delete live behind a swipe. A destructive target beside
23
+ * "Restore" is a mis-tap that costs a snapshot, and the two-step gesture is
24
+ * deliberate enough — recovery is the undo the list offers after, not a
25
+ * dialog before. Renaming is NOT here: it belongs with the restore point's
26
+ * other settings, on the preview screen.
27
+ */
28
+
29
+ /** "15h ago · 9.5 KB · 5 sources · skips 2" */function describe(meta) {
30
+ if (meta.baseline) return "Wipes to fresh install";
31
+ const parts = [(0, _format.timeAgo)(meta.createdAt), (0, _format.formatBytes)(meta.sizeBytes), `${Object.keys(meta.sources).length} sources`];
32
+ // A saved selection is worth stating on the row — this restore point no
33
+ // longer does the obvious thing, and one tap on RESTORE honors it.
34
+ if (meta.excludedKeys?.length) parts.push(`skips ${meta.excludedKeys.length}`);else if (meta.scope?.length) parts.push(`scoped (${meta.scope.length})`);
35
+ return parts.join(" · ");
36
+ }
37
+ function SnapshotRow({
38
+ meta,
39
+ busy,
40
+ onOpen,
41
+ onRestore,
42
+ onDelete,
43
+ onDuplicate
44
+ }) {
45
+ const testID = `time-machine-snap-${meta.id}`;
46
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SwipeActionsRow.SwipeActionsRow, {
47
+ testID: testID,
48
+ actions: [
49
+ // "Dup" over "Copy": on a row full of text, "Copy" reads as
50
+ // copy-to-clipboard.
51
+ {
52
+ label: "Dup",
53
+ onPress: onDuplicate
54
+ }, {
55
+ label: "Delete",
56
+ onPress: onDelete,
57
+ background: _tmTheme.tm.color.danger,
58
+ color: _tmTheme.tm.color.onDanger
59
+ }],
60
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
61
+ style: styles.row,
62
+ onPress: onOpen,
63
+ activeOpacity: 0.7,
64
+ accessibilityRole: "button",
65
+ accessibilityLabel: `${meta.name}. ${describe(meta)}. Open restore preview`,
66
+ testID: testID,
67
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
68
+ style: styles.text,
69
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
70
+ style: styles.name,
71
+ numberOfLines: 1,
72
+ children: meta.name
73
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
74
+ style: styles.meta,
75
+ numberOfLines: 1,
76
+ children: describe(meta)
77
+ }), meta.lastRestoredAt ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
78
+ style: styles.restored,
79
+ numberOfLines: 1,
80
+ children: ["Restored ", (0, _format.timeAgo)(meta.lastRestoredAt)]
81
+ }) : null, meta.route ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
82
+ style: styles.route,
83
+ numberOfLines: 1,
84
+ children: meta.route.href
85
+ }) : null]
86
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
87
+ onPress: onRestore,
88
+ disabled: busy,
89
+ style: busy ? styles.actionDisabled : null,
90
+ accessibilityRole: "button",
91
+ accessibilityLabel: meta.baseline ? "Wipe and reload" : "Restore",
92
+ testID: `${testID}-restore`,
93
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.PillLabel, {
94
+ label: meta.baseline ? "Wipe" : "Restore",
95
+ color: meta.baseline ? _tmTheme.tm.color.danger : _tmTheme.tm.color.accent,
96
+ background: meta.baseline ? _tmTheme.tm.color.dangerSoft : _tmTheme.tm.color.accentSoft
97
+ })
98
+ })]
99
+ })
100
+ });
101
+ }
102
+ const styles = _reactNative.StyleSheet.create({
103
+ row: {
104
+ flexDirection: "row",
105
+ alignItems: "center",
106
+ gap: 10,
107
+ paddingHorizontal: _tmTheme.tm.textInset,
108
+ paddingVertical: 11
109
+ },
110
+ text: {
111
+ flex: 1,
112
+ minWidth: 0
113
+ },
114
+ name: {
115
+ color: _tmTheme.tm.color.label,
116
+ fontSize: _tmTheme.tm.font.row,
117
+ fontWeight: "600",
118
+ letterSpacing: _tmTheme.tm.tracking.row
119
+ },
120
+ meta: {
121
+ color: _tmTheme.tm.color.labelSecondary,
122
+ fontSize: _tmTheme.tm.font.footnote,
123
+ marginTop: 2,
124
+ fontVariant: ["tabular-nums"]
125
+ },
126
+ restored: {
127
+ color: _tmTheme.tm.color.accent,
128
+ fontSize: _tmTheme.tm.font.footnote,
129
+ marginTop: 2
130
+ },
131
+ route: {
132
+ color: _tmTheme.tm.color.labelTertiary,
133
+ fontFamily: _tmTheme.TM_MONO,
134
+ fontSize: _tmTheme.tm.font.mono,
135
+ marginTop: 4
136
+ },
137
+ actionDisabled: {
138
+ opacity: 0.4
139
+ }
140
+ });
141
+ //# sourceMappingURL=SnapshotRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_primitives","_SwipeActionsRow","_tmTheme","_format","_jsxRuntime","describe","meta","baseline","parts","timeAgo","createdAt","formatBytes","sizeBytes","Object","keys","sources","length","excludedKeys","push","scope","join","SnapshotRow","busy","onOpen","onRestore","onDelete","onDuplicate","testID","id","jsx","SwipeActionsRow","actions","label","onPress","background","tm","color","danger","onDanger","children","jsxs","TouchableOpacity","style","styles","row","activeOpacity","accessibilityRole","accessibilityLabel","name","View","text","Text","numberOfLines","lastRestoredAt","restored","route","href","disabled","actionDisabled","PillLabel","accent","dangerSoft","accentSoft","StyleSheet","create","flexDirection","alignItems","gap","paddingHorizontal","textInset","paddingVertical","flex","minWidth","fontSize","font","fontWeight","letterSpacing","tracking","labelSecondary","footnote","marginTop","fontVariant","labelTertiary","fontFamily","TM_MONO","mono","opacity"],"sourceRoot":"../../../../src","sources":["components/list/SnapshotRow.tsx"],"mappings":";;;;;;AAeA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AAAiD,IAAAK,WAAA,GAAAL,OAAA;AApBjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,+CACA,SAASM,QAAQA,CAACC,IAAkB,EAAU;EAC5C,IAAIA,IAAI,CAACC,QAAQ,EAAE,OAAO,wBAAwB;EAClD,MAAMC,KAAK,GAAG,CACZ,IAAAC,eAAO,EAACH,IAAI,CAACI,SAAS,CAAC,EACvB,IAAAC,mBAAW,EAACL,IAAI,CAACM,SAAS,CAAC,EAC3B,GAAGC,MAAM,CAACC,IAAI,CAACR,IAAI,CAACS,OAAO,CAAC,CAACC,MAAM,UAAU,CAC9C;EACD;EACA;EACA,IAAIV,IAAI,CAACW,YAAY,EAAED,MAAM,EAAER,KAAK,CAACU,IAAI,CAAC,SAASZ,IAAI,CAACW,YAAY,CAACD,MAAM,EAAE,CAAC,CAAC,KAC1E,IAAIV,IAAI,CAACa,KAAK,EAAEH,MAAM,EAAER,KAAK,CAACU,IAAI,CAAC,WAAWZ,IAAI,CAACa,KAAK,CAACH,MAAM,GAAG,CAAC;EACxE,OAAOR,KAAK,CAACY,IAAI,CAAC,KAAK,CAAC;AAC1B;AAEO,SAASC,WAAWA,CAAC;EAC1Bf,IAAI;EACJgB,IAAI;EACJC,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC;AAU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.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SourcesStrip = SourcesStrip;
7
+ var _reactNative = require("react-native");
8
+ var _tmTheme = require("../../ui/tmTheme");
9
+ var _sources = require("../sources");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ /**
12
+ * Sources — one horizontally scrollable line of what a capture will pick up.
13
+ *
14
+ * Each source is its own tile (icon over name) rather than a count behind a
15
+ * disclosure: "is Redux wired?" is a glance question, and the answer should
16
+ * not cost a screen. A source that can't fully participate dims and carries a
17
+ * status dot, with the reason spelled out underneath the strip.
18
+ */
19
+
20
+ function statusDotColor(source) {
21
+ if (!source.canCapture) return _tmTheme.tm.color.labelTertiary; // not detected
22
+ if (!source.canRestore) return _tmTheme.tm.color.warning; // capture only
23
+ return null; // ready — nothing to flag
24
+ }
25
+ function SourceTile({
26
+ source
27
+ }) {
28
+ const Icon = (0, _sources.sourceIcon)(source.id);
29
+ const dot = statusDotColor(source);
30
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
31
+ style: styles.tile,
32
+ testID: `time-machine-source-${source.id}`,
33
+ accessibilityLabel: `${source.label}: ${source.canCapture ? source.canRestore ? "capture and restore" : "capture only" : "not detected"}`,
34
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
35
+ style: [styles.disc, !source.canCapture ? styles.discOff : null],
36
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
37
+ size: 26,
38
+ bgColor: _tmTheme.tm.color.fill
39
+ }), dot ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
40
+ style: [styles.dot, {
41
+ backgroundColor: dot
42
+ }]
43
+ }) : null]
44
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
45
+ style: [styles.label, !source.canCapture ? styles.labelOff : null],
46
+ numberOfLines: 1,
47
+ children: source.label
48
+ })]
49
+ });
50
+ }
51
+ function SourcesStrip({
52
+ sources
53
+ }) {
54
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
55
+ style: styles.card,
56
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
57
+ horizontal: true,
58
+ showsHorizontalScrollIndicator: false,
59
+ contentContainerStyle: styles.strip,
60
+ testID: "time-machine-sources",
61
+ children: [sources.map(source => /*#__PURE__*/(0, _jsxRuntime.jsx)(SourceTile, {
62
+ source: source
63
+ }, source.id)), sources.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
64
+ style: styles.empty,
65
+ children: "No state tools installed."
66
+ }) : null]
67
+ })
68
+ });
69
+ }
70
+ const styles = _reactNative.StyleSheet.create({
71
+ card: {
72
+ marginHorizontal: _tmTheme.tm.gutter,
73
+ backgroundColor: _tmTheme.tm.color.group,
74
+ borderRadius: _tmTheme.tm.radius.group,
75
+ paddingVertical: 12
76
+ },
77
+ strip: {
78
+ flexDirection: "row",
79
+ alignItems: "flex-start",
80
+ paddingHorizontal: _tmTheme.tm.textInset,
81
+ gap: 18
82
+ },
83
+ tile: {
84
+ alignItems: "center",
85
+ gap: 7,
86
+ // Fixed width so the row reads as a grid, and wide enough for the
87
+ // longest source name on ONE line: a second line would be blank for
88
+ // every other tile while still setting the card's height.
89
+ width: 78
90
+ },
91
+ disc: {
92
+ width: 50,
93
+ height: 50,
94
+ borderRadius: _tmTheme.tm.radius.pill,
95
+ backgroundColor: _tmTheme.tm.color.fill,
96
+ alignItems: "center",
97
+ justifyContent: "center"
98
+ },
99
+ discOff: {
100
+ opacity: 0.35
101
+ },
102
+ dot: {
103
+ position: "absolute",
104
+ top: 2,
105
+ right: 2,
106
+ width: 10,
107
+ height: 10,
108
+ borderRadius: 5,
109
+ // Ring it in the card color so it reads as a badge, not a smudge.
110
+ borderWidth: 2,
111
+ borderColor: _tmTheme.tm.color.group
112
+ },
113
+ label: {
114
+ color: _tmTheme.tm.color.labelSecondary,
115
+ fontSize: _tmTheme.tm.font.mono,
116
+ textAlign: "center"
117
+ },
118
+ labelOff: {
119
+ color: _tmTheme.tm.color.labelTertiary
120
+ },
121
+ empty: {
122
+ color: _tmTheme.tm.color.labelSecondary,
123
+ fontSize: _tmTheme.tm.font.footnote
124
+ }
125
+ });
126
+ //# sourceMappingURL=SourcesStrip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_tmTheme","_sources","_jsxRuntime","statusDotColor","source","canCapture","tm","color","labelTertiary","canRestore","warning","SourceTile","Icon","sourceIcon","id","dot","jsxs","View","style","styles","tile","testID","accessibilityLabel","label","children","disc","discOff","jsx","size","bgColor","fill","backgroundColor","Text","labelOff","numberOfLines","SourcesStrip","sources","card","ScrollView","horizontal","showsHorizontalScrollIndicator","contentContainerStyle","strip","map","length","empty","StyleSheet","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":";;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAA2D,IAAAG,WAAA,GAAAH,OAAA;AAV3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,SAASI,cAAcA,CAACC,MAAoB,EAAiB;EAC3D,IAAI,CAACA,MAAM,CAACC,UAAU,EAAE,OAAOC,WAAE,CAACC,KAAK,CAACC,aAAa,CAAC,CAAC;EACvD,IAAI,CAACJ,MAAM,CAACK,UAAU,EAAE,OAAOH,WAAE,CAACC,KAAK,CAACG,OAAO,CAAC,CAAC;EACjD,OAAO,IAAI,CAAC,CAAC;AACf;AAEA,SAASC,UAAUA,CAAC;EAAEP;AAAiC,CAAC,EAAE;EACxD,MAAMQ,IAAI,GAAG,IAAAC,mBAAU,EA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ACT,CAAC;EACDlC,IAAI,EAAE;IACJkC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVT,YAAY,EAAE7C,WAAE,CAAC8C,MAAM,CAACS,IAAI;IAC5B9B,eAAe,EAAEzB,WAAE,CAACC,KAAK,CAACuB,IAAI;IAC9ByB,UAAU,EAAE,QAAQ;IACpBO,cAAc,EAAE;EAClB,CAAC;EACDpC,OAAO,EAAE;IACPqC,OAAO,EAAE;EACX,CAAC;EACDhD,GAAG,EAAE;IACHiD,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRP,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVT,YAAY,EAAE,CAAC;IACf;IACAgB,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE9D,WAAE,CAACC,KAAK,CAAC2C;EACxB,CAAC;EACD3B,KAAK,EAAE;IACLhB,KAAK,EAAED,WAAE,CAACC,KAAK,CAAC8D,cAAc;IAC9BC,QAAQ,EAAEhE,WAAE,CAACiE,IAAI,CAACC,IAAI;IACtBC,SAAS,EAAE;EACb,CAAC;EACDxC,QAAQ,EAAE;IACR1B,KAAK,EAAED,WAAE,CAACC,KAAK,CAACC;EAClB,CAAC;EACDqC,KAAK,EAAE;IACLtC,KAAK,EAAED,WAAE,CAACC,KAAK,CAAC8D,cAAc;IAC9BC,QAAQ,EAAEhE,WAAE,CAACiE,IAAI,CAACG;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.UndoDeleteBar = UndoDeleteBar;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _tmTheme = require("../../ui/tmTheme");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ /**
12
+ * The way back from a swipe-delete.
13
+ *
14
+ * Swipe-then-tap is deliberate, which is why there's no confirmation dialog —
15
+ * but deliberate and recoverable are different properties, and a restore
16
+ * point can stand for state that took ten minutes and a cooperative backend
17
+ * to build. The record is held in memory until this bar expires.
18
+ */
19
+
20
+ /** Long enough to notice and react, short enough not to linger. */const WINDOW_MS = 8000;
21
+ function UndoDeleteBar({
22
+ name,
23
+ at,
24
+ onUndo,
25
+ onExpire
26
+ }) {
27
+ (0, _react.useEffect)(() => {
28
+ const timer = setTimeout(onExpire, WINDOW_MS);
29
+ return () => clearTimeout(timer);
30
+ // `at` keyed rather than `onExpire`: a new delete must restart the clock.
31
+ // eslint-disable-next-line react-hooks/exhaustive-deps
32
+ }, [at]);
33
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
34
+ style: styles.bar,
35
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
36
+ style: styles.text,
37
+ numberOfLines: 1,
38
+ children: ["Deleted \u201C", name, "\u201D"]
39
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
40
+ onPress: onUndo,
41
+ hitSlop: {
42
+ top: 10,
43
+ bottom: 10,
44
+ left: 10,
45
+ right: 10
46
+ },
47
+ accessibilityRole: "button",
48
+ testID: "time-machine-undo-delete",
49
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
50
+ style: styles.undo,
51
+ children: "Undo"
52
+ })
53
+ })]
54
+ });
55
+ }
56
+ const styles = _reactNative.StyleSheet.create({
57
+ bar: {
58
+ flexDirection: "row",
59
+ alignItems: "center",
60
+ gap: 12,
61
+ marginHorizontal: _tmTheme.tm.gutter,
62
+ marginTop: 12,
63
+ minHeight: 46,
64
+ paddingHorizontal: _tmTheme.tm.textInset,
65
+ backgroundColor: _tmTheme.tm.color.group,
66
+ borderRadius: _tmTheme.tm.radius.group
67
+ },
68
+ text: {
69
+ flex: 1,
70
+ color: _tmTheme.tm.color.labelSecondary,
71
+ fontSize: _tmTheme.tm.font.control,
72
+ letterSpacing: _tmTheme.tm.tracking.control
73
+ },
74
+ undo: {
75
+ color: _tmTheme.tm.color.accent,
76
+ fontSize: _tmTheme.tm.font.control,
77
+ fontWeight: "600",
78
+ letterSpacing: _tmTheme.tm.tracking.control
79
+ }
80
+ });
81
+ //# sourceMappingURL=UndoDeleteBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_tmTheme","_jsxRuntime","WINDOW_MS","UndoDeleteBar","name","at","onUndo","onExpire","useEffect","timer","setTimeout","clearTimeout","jsxs","View","style","styles","bar","children","Text","text","numberOfLines","jsx","TouchableOpacity","onPress","hitSlop","top","bottom","left","right","accessibilityRole","testID","undo","StyleSheet","create","flexDirection","alignItems","gap","marginHorizontal","tm","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":";;;;;;AAQA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAAsC,IAAAG,WAAA,GAAAH,OAAA;AAVtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,mEACA,MAAMI,SAAS,GAAG,IAAI;AAEf,SAASC,aAAaA,CAAC;EAC5BC,IAAI;EACJC,EAAE;EACFC,MAAM;EACNC;AAOF,CAAC,EAAE;EACD,IAAAC,gBAAS,EAAC,MAAM;IACd,MAAMC,KAAK,GAAGC,UAAU,CAACH,QAAQ,EAAEL,SAAS,CAAC;IAC7C,OAAO,MAAMS,YAAY,CAACF,KAAK,CAAC;IAChC;IACA;EACF,CAAC,EAAE,CAACJ,EAAE,CAAC,CAAC;EAER,oBACE,IAAAJ,WAAA,CAAAW,IAAA,EAACb,YAAA,CAAAc,IAAI;IAACC,KAAK,EAAEC,MAAM,CAACC,GAAI;IAAAC,QAAA,gBACtB,IAA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F;EAC7B,CAAC;EACDtB,IAAI,EAAE;IACJc,KAAK,EAAEP,WAAE,CAACO,KAAK,CAACW,MAAM;IACtBL,QAAQ,EAAEb,WAAE,CAACc,IAAI,CAACC,OAAO;IACzBI,UAAU,EAAE,KAAK;IACjBH,aAAa,EAAEhB,WAAE,CAACiB,QAAQ,CAACF;EAC7B;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WipeAllRow = WipeAllRow;
7
+ var _reactNative = require("react-native");
8
+ var _tmTheme = require("../../ui/tmTheme");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ /**
11
+ * "Wipe All App State…" — the destructive utility, deliberately last, alone
12
+ * in its own card and with no icon competing for attention.
13
+ */
14
+
15
+ function WipeAllRow({
16
+ disabled,
17
+ onWipe
18
+ }) {
19
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
20
+ style: [styles.row, disabled ? styles.disabled : null],
21
+ onPress: onWipe,
22
+ disabled: disabled,
23
+ accessibilityRole: "button",
24
+ testID: "time-machine-wipe-all",
25
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
26
+ style: styles.label,
27
+ children: "Wipe All App State\u2026"
28
+ })
29
+ });
30
+ }
31
+ const styles = _reactNative.StyleSheet.create({
32
+ row: {
33
+ minHeight: _tmTheme.tm.rowMinHeight,
34
+ alignItems: "center",
35
+ justifyContent: "center"
36
+ },
37
+ disabled: {
38
+ opacity: 0.4
39
+ },
40
+ label: {
41
+ color: _tmTheme.tm.color.danger,
42
+ fontSize: _tmTheme.tm.font.row,
43
+ letterSpacing: _tmTheme.tm.tracking.row
44
+ }
45
+ });
46
+ //# sourceMappingURL=WipeAllRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_tmTheme","_jsxRuntime","WipeAllRow","disabled","onWipe","jsx","TouchableOpacity","style","styles","row","onPress","accessibilityRole","testID","children","Text","label","StyleSheet","create","minHeight","tm","rowMinHeight","alignItems","justifyContent","opacity","color","danger","fontSize","font","letterSpacing","tracking"],"sourceRoot":"../../../../src","sources":["components/list/WipeAllRow.tsx"],"mappings":";;;;;;AAIA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAsC,IAAAE,WAAA,GAAAF,OAAA;AALtC;AACA;AACA;AACA;;AAIO,SAASG,UAAUA,CAAC;EACzBC,QAAQ;EACRC;AAIF,CAAC,EAAE;EACD,oBACE,IAAAH,WAAA,CAAAI,GAAA,EAACP,YAAA,CAAAQ,gBAAgB;IACfC,KAAK,EAAE,CAACC,MAAM,CAACC,GAAG,EAAEN,QAAQ,GAAGK,MAAM,CAACL,QAAQ,GAAG,IAAI,CAAE;IACvDO,OAAO,EAAEN,MAAO;IAChBD,QAAQ,EAAEA,QAAS;IACnBQ,iBAAiB,EAAC,QAAQ;IAC1BC,MAAM,EAAC,uBAAuB;IAAAC,QAAA,eAE9B,IAAAZ,WAAA,CAAAI,GAAA,EAACP,YAAA,CAAAgB,IAAI;MAACP,KAAK,EAAEC,MAAM,CAACO,KAAM;MAAAF,QAAA,EAAC;IAAmB,CAAM;EAAC,CACrC,CAAC;AAEvB;AAEA,MAAML,MAAM,GAAGQ,uBAAU,CAACC,MAAM,CAAC;EAC/BR,GAAG,EAAE;IACHS,SAAS,EAAEC,WAAE,CAACC,YAAY;IAC1BC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDnB,QAAQ,EAAE;IACRoB,OAAO,EAAE;EACX,CAAC;EACDR,KAAK,EAAE;IACLS,KAAK,EAAEL,WAAE,CAACK,KAAK,CAACC,MAAM;IACtBC,QAAQ,EAAEP,WAAE,CAACQ,IAAI,CAAClB,GAAG;IACrBmB,aAAa,EAAET,WAAE,CAACU,QAAQ,CAACpB;EAC7B;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ItemDiffPanel = ItemDiffPanel;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _dataViewer = require("@buoy-gg/shared-ui/dataViewer");
10
+ var _tmTheme = require("../../ui/tmTheme");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ /**
13
+ * One preview item's before/after, rendered INLINE under its row rather than
14
+ * on a screen of its own — "what changed in this key" is a glance question,
15
+ * and losing the list to answer it costs you the place you were reading.
16
+ *
17
+ * Split view only, with no view switcher. Side-by-side is the shape that
18
+ * answers the question here ("what is it now, what will it become"), and
19
+ * inside a list row the segmented control cost more vertical space than the
20
+ * diff it was switching.
21
+ *
22
+ * The render-layer viewer only handles plain JSON faithfully, so both sides
23
+ * pass through toDiffable (Dates→ISO, Maps→objects, BigInt→"1n", cycles→
24
+ * "[Circular]") and the pair is memoized ONCE per item — the storage tool's
25
+ * fix for the fresh-identity-every-render trap that redux/zustand still have.
26
+ *
27
+ * No scroller of its own: this sits inside the preview's FlatList, so the
28
+ * viewer renders at natural height with `scrollEnabled={false}` (the storage
29
+ * matched-pair contract).
30
+ */
31
+
32
+ const EMPTY = [];
33
+ function ItemDiffPanel({
34
+ item
35
+ }) {
36
+ // ABSENT_VALUE keeps added/removed reading as pure additions/removals
37
+ // instead of diffs against the literal "null".
38
+ const {
39
+ oldValue,
40
+ newValue
41
+ } = (0, _react.useMemo)(() => ({
42
+ oldValue: item.verdict === "added" ? _dataViewer.ABSENT_VALUE : (0, _dataViewer.toDiffable)(item.oldValue),
43
+ newValue: item.verdict === "removed" ? _dataViewer.ABSENT_VALUE : (0, _dataViewer.toDiffable)(item.newValue)
44
+ }), [item]);
45
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
46
+ style: styles.panel,
47
+ children: [item.reason ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
48
+ style: styles.reason,
49
+ children: ["\u26A0 ", item.reason]
50
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataViewer.ThemedSplitView, {
51
+ oldValue: oldValue,
52
+ newValue: newValue,
53
+ differences: EMPTY,
54
+ theme: _dataViewer.devToolsDefaultTheme,
55
+ scrollEnabled: false
56
+ })]
57
+ });
58
+ }
59
+ const styles = _reactNative.StyleSheet.create({
60
+ // Same fill as the rows above it: this is part of the card, not a thing
61
+ // floating under it.
62
+ panel: {
63
+ // Only a token indent: the viewer lays values out at their natural width
64
+ // and a 51pt inset (matching the checkbox column) clipped long numbers.
65
+ paddingLeft: 16,
66
+ paddingRight: 12,
67
+ paddingTop: 10,
68
+ paddingBottom: 14,
69
+ gap: 10,
70
+ backgroundColor: _tmTheme.tm.color.group
71
+ },
72
+ reason: {
73
+ color: _tmTheme.tm.color.warning,
74
+ fontSize: _tmTheme.tm.font.footnote
75
+ }
76
+ });
77
+ //# sourceMappingURL=ItemDiffPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_dataViewer","_tmTheme","_jsxRuntime","EMPTY","ItemDiffPanel","item","oldValue","newValue","useMemo","verdict","ABSENT_VALUE","toDiffable","jsxs","View","style","styles","panel","children","reason","Text","jsx","ThemedSplitView","differences","theme","devToolsDefaultTheme","scrollEnabled","StyleSheet","create","paddingLeft","paddingRight","paddingTop","paddingBottom","gap","backgroundColor","tm","color","group","warning","fontSize","font","footnote"],"sourceRoot":"../../../../src","sources":["components/preview/ItemDiffPanel.tsx"],"mappings":";;;;;;AAmBA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAMA,IAAAG,QAAA,GAAAH,OAAA;AAAsC,IAAAI,WAAA,GAAAJ,OAAA;AA5BtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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,eAAe,EAAEC,WAAE,CAACC,KAAK,CAACC;EAC5B,CAAC;EACDlB,MAAM,EAAE;IACNiB,KAAK,EAAED,WAAE,CAACC,KAAK,CAACE,OAAO;IACvBC,QAAQ,EAAEJ,WAAE,CAACK,IAAI,CAACC;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PreviewScreen = PreviewScreen;
7
+ var _timeMachineStore = require("../../store/timeMachineStore");
8
+ var _confirm = require("../confirm");
9
+ var _RestorePreviewScreen = require("./RestorePreviewScreen");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ /**
12
+ * The preview screen, wired to the store — the restore leg (baseline
13
+ * confirmation, the route prompt, landing back on the list) lives here so
14
+ * RestorePreviewScreen stays presentation.
15
+ *
16
+ * Kept apart from the restore-point list so each screen mounts and unmounts
17
+ * as a whole tree — the router in ../TimeMachineBody picks one, never swaps
18
+ * branches inside a live tree. (Item diffs are NOT a screen: they expand
19
+ * inline inside the preview's list.)
20
+ */
21
+
22
+ function snapshotFor(ref, snapshots) {
23
+ return ref === "current" ? undefined : snapshots.find(s => s.id === ref.snapshotId);
24
+ }
25
+ function PreviewScreen({
26
+ preview,
27
+ snapshots,
28
+ busy,
29
+ onClose
30
+ }) {
31
+ const rightMeta = snapshotFor(preview.right, snapshots);
32
+ const restore = (mode, excludeKeys) => {
33
+ if (!rightMeta || busy) return;
34
+ if (rightMeta.baseline) {
35
+ (0, _confirm.confirmDestructive)("Restore fresh install?", "This wipes all app storage and reloads the app.", "Wipe & reload", () => void _timeMachineStore.timeMachineStore.restore(rightMeta.id, "reload"));
36
+ return;
37
+ }
38
+ // Land back on the list, where the outcome card reports the results —
39
+ // the preview's diff is stale the moment restore runs. Whether the route
40
+ // comes back is the restore point's own setting, toggled on its row.
41
+ void _timeMachineStore.timeMachineStore.restore(rightMeta.id, mode, excludeKeys).then(onClose);
42
+ };
43
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RestorePreviewScreen.RestorePreviewScreen, {
44
+ preview: preview,
45
+ snapshots: snapshots,
46
+ busy: busy,
47
+ onBack: onClose,
48
+ onRestore: restore
49
+ });
50
+ }
51
+ //# sourceMappingURL=PreviewFlow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_timeMachineStore","require","_confirm","_RestorePreviewScreen","_jsxRuntime","snapshotFor","ref","snapshots","undefined","find","s","id","snapshotId","PreviewScreen","preview","busy","onClose","rightMeta","right","restore","mode","excludeKeys","baseline","confirmDestructive","timeMachineStore","then","jsx","RestorePreviewScreen","onBack","onRestore"],"sourceRoot":"../../../../src","sources":["components/preview/PreviewFlow.tsx"],"mappings":";;;;;;AAUA,IAAAA,iBAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAA8D,IAAAG,WAAA,GAAAH,OAAA;AAjB9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SAASI,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;AAEO,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;MACtB,IAAAC,2BAAkB,EAChB,wBAAwB,EACxB,iDAAiD,EACjD,eAAe,EACf,MAAM,KAAKC,kCAAgB,CAACL,OAAO,CAACF,SAAS,CAACN,EAAE,EAAE,QAAQ,CAC5D,CAAC;MACD;IACF;IACA;IACA;IACA;IACA,KAAKa,kCAAgB,CAClBL,OAAO,CAACF,SAAS,CAACN,EAAE,EAAES,IAAI,EAAEC,WAAW,CAAC,CACxCI,IAAI,CAACT,OAAO,CAAC;EAClB,CAAC;EAED,oBACE,IAAAZ,WAAA,CAAAsB,GAAA,EAACvB,qBAAA,CAAAwB,oBAAoB;IACnBb,OAAO,EAAEA,OAAQ;IACjBP,SAAS,EAAEA,SAAU;IACrBQ,IAAI,EAAEA,IAAK;IACXa,MAAM,EAAEZ,OAAQ;IAChBa,SAAS,EAAEV;EAAQ,CACpB,CAAC;AAEN","ignoreList":[]}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RestorePointNameRow = RestorePointNameRow;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _tmTheme = require("../../ui/tmTheme");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ /**
12
+ * The restore point's name, editable in place.
13
+ *
14
+ * Renaming lives on the preview rather than behind a swipe on the list: the
15
+ * list is for picking one, and you rarely know a name is wrong until you're
16
+ * looking at what the point actually contains.
17
+ *
18
+ * Commits on blur as well as on return — tapping away from a field you have
19
+ * just typed into should keep the typing. Finder and iOS both treat leaving
20
+ * as accepting, and silently discarding an edit is the one outcome nobody
21
+ * wants.
22
+ */
23
+
24
+ function RestorePointNameRow({
25
+ name,
26
+ onRename
27
+ }) {
28
+ const [draft, setDraft] = (0, _react.useState)(name);
29
+
30
+ // A rename from anywhere else (MCP, the desktop) should show up here.
31
+ (0, _react.useEffect)(() => setDraft(name), [name]);
32
+ const commit = () => {
33
+ const trimmed = draft.trim();
34
+ if (!trimmed) {
35
+ setDraft(name); // an empty name would make the row unidentifiable
36
+ return;
37
+ }
38
+ if (trimmed !== name) onRename(trimmed);
39
+ };
40
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
41
+ style: styles.row,
42
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
43
+ style: styles.label,
44
+ children: "Name"
45
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
46
+ style: styles.input,
47
+ value: draft,
48
+ onChangeText: setDraft,
49
+ onSubmitEditing: commit,
50
+ onBlur: commit,
51
+ returnKeyType: "done",
52
+ selectTextOnFocus: true,
53
+ accessibilityLabel: "Restore point name",
54
+ testID: "tm-preview-name"
55
+ })]
56
+ });
57
+ }
58
+ const styles = _reactNative.StyleSheet.create({
59
+ row: {
60
+ flexDirection: "row",
61
+ alignItems: "center",
62
+ gap: 14,
63
+ minHeight: _tmTheme.tm.rowMinHeight,
64
+ paddingHorizontal: _tmTheme.tm.textInset
65
+ },
66
+ label: {
67
+ color: _tmTheme.tm.color.labelSecondary,
68
+ fontSize: _tmTheme.tm.font.row,
69
+ letterSpacing: _tmTheme.tm.tracking.row
70
+ },
71
+ input: {
72
+ flex: 1,
73
+ minWidth: 0,
74
+ color: _tmTheme.tm.color.label,
75
+ fontSize: _tmTheme.tm.font.row,
76
+ fontWeight: "600",
77
+ letterSpacing: _tmTheme.tm.tracking.row,
78
+ textAlign: "right",
79
+ padding: 0,
80
+ backgroundColor: "transparent"
81
+ }
82
+ });
83
+ //# sourceMappingURL=RestorePointNameRow.js.map