@buoy-gg/time-machine 7.0.41 → 7.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/lib/commonjs/components/HeaderActions.js +1 -91
  2. package/lib/commonjs/components/HeaderReloadButton.js +1 -58
  3. package/lib/commonjs/components/TimeMachineBody.js +1 -282
  4. package/lib/commonjs/components/TimeMachineModal.js +1 -74
  5. package/lib/commonjs/components/confirm.js +2 -38
  6. package/lib/commonjs/components/floating/NamePromptModal.js +1 -193
  7. package/lib/commonjs/components/floating/TimeMachineFloatingTool.js +1 -715
  8. package/lib/commonjs/components/floating/armedPoint.js +1 -92
  9. package/lib/commonjs/components/floating/barSettings.js +1 -66
  10. package/lib/commonjs/components/format.js +1 -24
  11. package/lib/commonjs/components/list/CaptureBar.js +1 -97
  12. package/lib/commonjs/components/list/RestoreOutcomeCard.js +1 -175
  13. package/lib/commonjs/components/list/SnapshotRow.js +1 -170
  14. package/lib/commonjs/components/list/SourcesStrip.js +1 -172
  15. package/lib/commonjs/components/list/UndoDeleteBar.js +1 -85
  16. package/lib/commonjs/components/list/WipeAllRow.js +1 -46
  17. package/lib/commonjs/components/preview/ItemDiffPanel.js +1 -79
  18. package/lib/commonjs/components/preview/PreviewFlow.js +1 -51
  19. package/lib/commonjs/components/preview/RestorePointNameRow.js +1 -83
  20. package/lib/commonjs/components/preview/RestorePreviewScreen.js +1 -1010
  21. package/lib/commonjs/components/preview/verdictMeta.js +1 -58
  22. package/lib/commonjs/components/sources.js +1 -83
  23. package/lib/commonjs/hooks/useTimeMachine.js +1 -24
  24. package/lib/commonjs/index.js +1 -161
  25. package/lib/commonjs/preset.js +1 -56
  26. package/lib/commonjs/store/routeRestore.js +1 -188
  27. package/lib/commonjs/store/snapshotVault.js +1 -186
  28. package/lib/commonjs/store/sourceIds.js +1 -9
  29. package/lib/commonjs/store/sourceSettings.js +1 -79
  30. package/lib/commonjs/store/timeMachineStore.js +1 -848
  31. package/lib/commonjs/sync/timeMachineSyncAdapter.js +1 -258
  32. package/lib/commonjs/ui/SwipeActionsRow.js +1 -178
  33. package/lib/commonjs/ui/primitives.js +1 -172
  34. package/lib/commonjs/ui/tmTheme.js +1 -118
  35. package/lib/module/components/HeaderActions.js +1 -85
  36. package/lib/module/components/HeaderReloadButton.js +1 -53
  37. package/lib/module/components/TimeMachineBody.js +1 -277
  38. package/lib/module/components/TimeMachineModal.js +1 -68
  39. package/lib/module/components/confirm.js +2 -33
  40. package/lib/module/components/floating/NamePromptModal.js +1 -188
  41. package/lib/module/components/floating/TimeMachineFloatingTool.js +1 -708
  42. package/lib/module/components/floating/armedPoint.js +1 -82
  43. package/lib/module/components/floating/barSettings.js +1 -57
  44. package/lib/module/components/format.js +1 -19
  45. package/lib/module/components/list/CaptureBar.js +1 -92
  46. package/lib/module/components/list/RestoreOutcomeCard.js +1 -169
  47. package/lib/module/components/list/SnapshotRow.js +1 -167
  48. package/lib/module/components/list/SourcesStrip.js +1 -169
  49. package/lib/module/components/list/UndoDeleteBar.js +1 -82
  50. package/lib/module/components/list/WipeAllRow.js +1 -41
  51. package/lib/module/components/preview/ItemDiffPanel.js +1 -74
  52. package/lib/module/components/preview/PreviewFlow.js +1 -46
  53. package/lib/module/components/preview/RestorePointNameRow.js +1 -78
  54. package/lib/module/components/preview/RestorePreviewScreen.js +1 -1005
  55. package/lib/module/components/preview/verdictMeta.js +1 -54
  56. package/lib/module/components/sources.js +1 -73
  57. package/lib/module/hooks/useTimeMachine.js +1 -19
  58. package/lib/module/index.js +1 -46
  59. package/lib/module/preset.js +1 -51
  60. package/lib/module/store/routeRestore.js +1 -176
  61. package/lib/module/store/snapshotVault.js +1 -170
  62. package/lib/module/store/sourceIds.js +1 -5
  63. package/lib/module/store/sourceSettings.js +1 -69
  64. package/lib/module/store/timeMachineStore.js +1 -839
  65. package/lib/module/sync/timeMachineSyncAdapter.js +1 -253
  66. package/lib/module/ui/SwipeActionsRow.js +1 -173
  67. package/lib/module/ui/primitives.js +1 -164
  68. package/lib/module/ui/tmTheme.js +1 -114
  69. package/lib/web/index.mjs +2 -3
  70. package/package.json +7 -7
  71. package/lib/commonjs/components/HeaderActions.js.map +0 -1
  72. package/lib/commonjs/components/HeaderReloadButton.js.map +0 -1
  73. package/lib/commonjs/components/TimeMachineBody.js.map +0 -1
  74. package/lib/commonjs/components/TimeMachineModal.js.map +0 -1
  75. package/lib/commonjs/components/confirm.js.map +0 -1
  76. package/lib/commonjs/components/floating/NamePromptModal.js.map +0 -1
  77. package/lib/commonjs/components/floating/TimeMachineFloatingTool.js.map +0 -1
  78. package/lib/commonjs/components/floating/armedPoint.js.map +0 -1
  79. package/lib/commonjs/components/floating/barSettings.js.map +0 -1
  80. package/lib/commonjs/components/format.js.map +0 -1
  81. package/lib/commonjs/components/list/CaptureBar.js.map +0 -1
  82. package/lib/commonjs/components/list/RestoreOutcomeCard.js.map +0 -1
  83. package/lib/commonjs/components/list/SnapshotRow.js.map +0 -1
  84. package/lib/commonjs/components/list/SourcesStrip.js.map +0 -1
  85. package/lib/commonjs/components/list/UndoDeleteBar.js.map +0 -1
  86. package/lib/commonjs/components/list/WipeAllRow.js.map +0 -1
  87. package/lib/commonjs/components/preview/ItemDiffPanel.js.map +0 -1
  88. package/lib/commonjs/components/preview/PreviewFlow.js.map +0 -1
  89. package/lib/commonjs/components/preview/RestorePointNameRow.js.map +0 -1
  90. package/lib/commonjs/components/preview/RestorePreviewScreen.js.map +0 -1
  91. package/lib/commonjs/components/preview/verdictMeta.js.map +0 -1
  92. package/lib/commonjs/components/sources.js.map +0 -1
  93. package/lib/commonjs/hooks/useTimeMachine.js.map +0 -1
  94. package/lib/commonjs/index.js.map +0 -1
  95. package/lib/commonjs/preset.js.map +0 -1
  96. package/lib/commonjs/store/routeRestore.js.map +0 -1
  97. package/lib/commonjs/store/snapshotVault.js.map +0 -1
  98. package/lib/commonjs/store/sourceIds.js.map +0 -1
  99. package/lib/commonjs/store/sourceSettings.js.map +0 -1
  100. package/lib/commonjs/store/timeMachineStore.js.map +0 -1
  101. package/lib/commonjs/sync/timeMachineSyncAdapter.js.map +0 -1
  102. package/lib/commonjs/ui/SwipeActionsRow.js.map +0 -1
  103. package/lib/commonjs/ui/primitives.js.map +0 -1
  104. package/lib/commonjs/ui/tmTheme.js.map +0 -1
  105. package/lib/module/components/HeaderActions.js.map +0 -1
  106. package/lib/module/components/HeaderReloadButton.js.map +0 -1
  107. package/lib/module/components/TimeMachineBody.js.map +0 -1
  108. package/lib/module/components/TimeMachineModal.js.map +0 -1
  109. package/lib/module/components/confirm.js.map +0 -1
  110. package/lib/module/components/floating/NamePromptModal.js.map +0 -1
  111. package/lib/module/components/floating/TimeMachineFloatingTool.js.map +0 -1
  112. package/lib/module/components/floating/armedPoint.js.map +0 -1
  113. package/lib/module/components/floating/barSettings.js.map +0 -1
  114. package/lib/module/components/format.js.map +0 -1
  115. package/lib/module/components/list/CaptureBar.js.map +0 -1
  116. package/lib/module/components/list/RestoreOutcomeCard.js.map +0 -1
  117. package/lib/module/components/list/SnapshotRow.js.map +0 -1
  118. package/lib/module/components/list/SourcesStrip.js.map +0 -1
  119. package/lib/module/components/list/UndoDeleteBar.js.map +0 -1
  120. package/lib/module/components/list/WipeAllRow.js.map +0 -1
  121. package/lib/module/components/preview/ItemDiffPanel.js.map +0 -1
  122. package/lib/module/components/preview/PreviewFlow.js.map +0 -1
  123. package/lib/module/components/preview/RestorePointNameRow.js.map +0 -1
  124. package/lib/module/components/preview/RestorePreviewScreen.js.map +0 -1
  125. package/lib/module/components/preview/verdictMeta.js.map +0 -1
  126. package/lib/module/components/sources.js.map +0 -1
  127. package/lib/module/hooks/useTimeMachine.js.map +0 -1
  128. package/lib/module/index.js.map +0 -1
  129. package/lib/module/preset.js.map +0 -1
  130. package/lib/module/store/routeRestore.js.map +0 -1
  131. package/lib/module/store/snapshotVault.js.map +0 -1
  132. package/lib/module/store/sourceIds.js.map +0 -1
  133. package/lib/module/store/sourceSettings.js.map +0 -1
  134. package/lib/module/store/timeMachineStore.js.map +0 -1
  135. package/lib/module/sync/timeMachineSyncAdapter.js.map +0 -1
  136. package/lib/module/ui/SwipeActionsRow.js.map +0 -1
  137. package/lib/module/ui/primitives.js.map +0 -1
  138. package/lib/module/ui/tmTheme.js.map +0 -1
  139. package/lib/typescript/components/HeaderActions.d.ts.map +0 -1
  140. package/lib/typescript/components/HeaderReloadButton.d.ts.map +0 -1
  141. package/lib/typescript/components/TimeMachineBody.d.ts.map +0 -1
  142. package/lib/typescript/components/TimeMachineModal.d.ts.map +0 -1
  143. package/lib/typescript/components/confirm.d.ts.map +0 -1
  144. package/lib/typescript/components/floating/NamePromptModal.d.ts.map +0 -1
  145. package/lib/typescript/components/floating/TimeMachineFloatingTool.d.ts.map +0 -1
  146. package/lib/typescript/components/floating/armedPoint.d.ts.map +0 -1
  147. package/lib/typescript/components/floating/barSettings.d.ts.map +0 -1
  148. package/lib/typescript/components/format.d.ts.map +0 -1
  149. package/lib/typescript/components/list/CaptureBar.d.ts.map +0 -1
  150. package/lib/typescript/components/list/RestoreOutcomeCard.d.ts.map +0 -1
  151. package/lib/typescript/components/list/SnapshotRow.d.ts.map +0 -1
  152. package/lib/typescript/components/list/SourcesStrip.d.ts.map +0 -1
  153. package/lib/typescript/components/list/UndoDeleteBar.d.ts.map +0 -1
  154. package/lib/typescript/components/list/WipeAllRow.d.ts.map +0 -1
  155. package/lib/typescript/components/preview/ItemDiffPanel.d.ts.map +0 -1
  156. package/lib/typescript/components/preview/PreviewFlow.d.ts.map +0 -1
  157. package/lib/typescript/components/preview/RestorePointNameRow.d.ts.map +0 -1
  158. package/lib/typescript/components/preview/RestorePreviewScreen.d.ts.map +0 -1
  159. package/lib/typescript/components/preview/verdictMeta.d.ts.map +0 -1
  160. package/lib/typescript/components/sources.d.ts.map +0 -1
  161. package/lib/typescript/hooks/useTimeMachine.d.ts.map +0 -1
  162. package/lib/typescript/index.d.ts.map +0 -1
  163. package/lib/typescript/preset.d.ts.map +0 -1
  164. package/lib/typescript/store/routeRestore.d.ts.map +0 -1
  165. package/lib/typescript/store/snapshotVault.d.ts.map +0 -1
  166. package/lib/typescript/store/sourceIds.d.ts.map +0 -1
  167. package/lib/typescript/store/sourceSettings.d.ts.map +0 -1
  168. package/lib/typescript/store/timeMachineStore.d.ts.map +0 -1
  169. package/lib/typescript/sync/timeMachineSyncAdapter.d.ts.map +0 -1
  170. package/lib/typescript/ui/SwipeActionsRow.d.ts.map +0 -1
  171. package/lib/typescript/ui/primitives.d.ts.map +0 -1
  172. package/lib/typescript/ui/tmTheme.d.ts.map +0 -1
@@ -1,172 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SourcesStrip = SourcesStrip;
7
- var _reactNative = require("react-native");
8
- var _sharedUi = require("@buoy-gg/shared-ui");
9
- var _primitives = require("../../ui/primitives");
10
- var _tmTheme = require("../../ui/tmTheme");
11
- var _sources = require("../sources");
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- /**
14
- * Sources — one settings row per source, each with a switch.
15
- *
16
- * The iOS Settings shape the rest of the tool uses, because that is what a
17
- * list of things you can turn on and off looks like: icon, name, a line of
18
- * status, and a switch at the trailing edge. Off means every capture and
19
- * restore leaves that source alone, for the store whose full replace the
20
- * app cannot survive.
21
- *
22
- * Only sources the app has wired are listed; a library the app does not use
23
- * is not a choice to make. Icons keep full brightness in every state. Under
24
- * each name is what the source holds, in plain words; a short state line
25
- * appears only when something is off or capture-only.
26
- */
27
-
28
- /**
29
- * What each source holds, in words for someone who has never heard of the
30
- * library. The library name is the row title; this line is the meaning.
31
- */const DESCRIPTIONS = {
32
- storage: "Settings, sign-in and other things saved on the device",
33
- redux: "Data the whole app shares between screens",
34
- zustand: "Data the whole app shares between screens",
35
- jotai: "Small pieces of data screens share",
36
- query: "Data the app loaded from the server",
37
- route: "Which screen you were on"
38
- };
39
- function describe(source) {
40
- return DESCRIPTIONS[source.id] ?? "App data";
41
- }
42
-
43
- /**
44
- * The short state under the description, when there is one worth saying.
45
- * "Working" is the default and needs no line.
46
- */
47
- function stateLine(source) {
48
- if (!source.enabled) return {
49
- text: "Off · left as it is",
50
- tone: "off"
51
- };
52
- if (!source.canRestore) return {
53
- text: "Can be saved but not put back",
54
- tone: "warn"
55
- };
56
- return null;
57
- }
58
- function SourceRow({
59
- source,
60
- onToggle
61
- }) {
62
- const Icon = (0, _sources.sourceIcon)(source.id);
63
- const description = describe(source);
64
- const state = stateLine(source);
65
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
66
- style: styles.row,
67
- testID: `time-machine-source-${source.id}`,
68
- accessibilityLabel: `${source.label}: ${description}${state ? `. ${state.text}` : ""}`,
69
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
70
- style: styles.disc,
71
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
72
- size: 22,
73
- bgColor: _tmTheme.tm.color.disc
74
- })
75
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
76
- style: styles.text,
77
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
78
- style: styles.label,
79
- numberOfLines: 1,
80
- testID: `time-machine-source-${source.id}-label`,
81
- children: source.label
82
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
83
- style: styles.description,
84
- numberOfLines: 2,
85
- testID: `time-machine-source-${source.id}-description`,
86
- children: description
87
- }), state ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
88
- style: [styles.state, styles[`state_${state.tone}`]],
89
- numberOfLines: 1,
90
- testID: state.tone === "off" ? `time-machine-source-${source.id}-off` : `time-machine-source-${source.id}-detail`,
91
- children: state.text
92
- }) : null]
93
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
94
- testID: `time-machine-source-${source.id}-switch`,
95
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.NightSwitch, {
96
- value: source.enabled
97
- // The desktop mirror shows the device's setting and cannot flip it.
98
- ,
99
- disabled: !onToggle,
100
- onValueChange: next => onToggle?.(source.id, next)
101
- })
102
- })]
103
- });
104
- }
105
- function SourcesStrip({
106
- sources,
107
- onToggle
108
- }) {
109
- // A source the app has not wired (no Redux Provider, no Zustand stores)
110
- // is not listed: there is nothing to capture and nothing to switch off.
111
- const wired = sources.filter(source => source.canCapture);
112
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Group, {
113
- children: [wired.map(source => /*#__PURE__*/(0, _jsxRuntime.jsx)(SourceRow, {
114
- source: source,
115
- onToggle: onToggle
116
- }, source.id)), wired.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
117
- style: styles.row,
118
- testID: "time-machine-sources-empty",
119
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
120
- style: styles.description,
121
- children: "No state tools are set up in this app."
122
- })
123
- }) : null]
124
- });
125
- }
126
- const styles = _reactNative.StyleSheet.create({
127
- row: {
128
- flexDirection: "row",
129
- alignItems: "center",
130
- gap: 12,
131
- minHeight: _tmTheme.tm.rowMinHeight,
132
- paddingHorizontal: _tmTheme.tm.textInset,
133
- paddingVertical: 10
134
- },
135
- disc: {
136
- width: 36,
137
- height: 36,
138
- borderRadius: _tmTheme.tm.radius.pill,
139
- backgroundColor: _tmTheme.tm.color.disc,
140
- alignItems: "center",
141
- justifyContent: "center"
142
- },
143
- text: {
144
- flex: 1,
145
- minWidth: 0,
146
- gap: 2
147
- },
148
- label: {
149
- color: _tmTheme.tm.color.label,
150
- fontSize: _tmTheme.tm.font.row,
151
- fontWeight: "500",
152
- letterSpacing: _tmTheme.tm.tracking.row
153
- },
154
- description: {
155
- fontSize: _tmTheme.tm.font.footnote,
156
- lineHeight: _tmTheme.tm.font.footnote * 1.3,
157
- color: _tmTheme.tm.color.labelSecondary
158
- },
159
- state: {
160
- fontSize: _tmTheme.tm.font.mono,
161
- lineHeight: _tmTheme.tm.font.mono * 1.3,
162
- fontWeight: "600",
163
- marginTop: 1
164
- },
165
- state_off: {
166
- color: _tmTheme.tm.color.labelTertiary
167
- },
168
- state_warn: {
169
- color: _tmTheme.tm.color.warning
170
- }
171
- });
172
- //# sourceMappingURL=SourcesStrip.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SourcesStrip=SourcesStrip;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _primitives=require("../../ui/primitives");var _tmTheme=require("../../ui/tmTheme");var _sources=require("../sources");var _jsxRuntime=require("react/jsx-runtime");const DESCRIPTIONS={storage:"Settings, sign-in and other things saved on the device",redux:"Data the whole app shares between screens",zustand:"Data the whole app shares between screens",jotai:"Small pieces of data screens share",query:"Data the app loaded from the server",route:"Which screen you were on"};function describe(e){return DESCRIPTIONS[e.id]??"App data"}function stateLine(e){if(!e.enabled)return{text:"Off \xB7 left as it is",tone:"off"};if(!e.canRestore)return{text:"Can be saved but not put back",tone:"warn"};return null}function SourceRow({source:e,onToggle:n}){const r=(0,_sources.sourceIcon)(e.id);const t=describe(e);const i=stateLine(e);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,testID:`time-machine-source-${e.id}`,accessibilityLabel:`${e.label}: ${t}${i?`. ${i.text}`:""}`,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.disc,children:(0,_jsxRuntime.jsx)(r,{size:22,bgColor:_tmTheme.tm.color.disc})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.text,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.label,numberOfLines:1,testID:`time-machine-source-${e.id}-label`,children:e.label}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.description,numberOfLines:2,testID:`time-machine-source-${e.id}-description`,children:t}),i?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.state,styles[`state_${i.tone}`]],numberOfLines:1,testID:i.tone==="off"?`time-machine-source-${e.id}-off`:`time-machine-source-${e.id}-detail`,children:i.text}):null]}),(0,_jsxRuntime.jsx)(_reactNative.View,{testID:`time-machine-source-${e.id}-switch`,children:(0,_jsxRuntime.jsx)(_sharedUi.NightSwitch,{value:e.enabled,disabled:!n,onValueChange:s=>n?.(e.id,s)})})]})}function SourcesStrip({sources:e,onToggle:n}){const r=e.filter(t=>t.canCapture);return(0,_jsxRuntime.jsxs)(_primitives.Group,{children:[r.map(t=>(0,_jsxRuntime.jsx)(SourceRow,{source:t,onToggle:n},t.id)),r.length===0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.row,testID:"time-machine-sources-empty",children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.description,children:"No state tools are set up in this app."})}):null]})}const styles=_reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"center",gap:12,minHeight:_tmTheme.tm.rowMinHeight,paddingHorizontal:_tmTheme.tm.textInset,paddingVertical:10},disc:{width:36,height:36,borderRadius:_tmTheme.tm.radius.pill,backgroundColor:_tmTheme.tm.color.disc,alignItems:"center",justifyContent:"center"},text:{flex:1,minWidth:0,gap:2},label:{color:_tmTheme.tm.color.label,fontSize:_tmTheme.tm.font.row,fontWeight:"500",letterSpacing:_tmTheme.tm.tracking.row},description:{fontSize:_tmTheme.tm.font.footnote,lineHeight:_tmTheme.tm.font.footnote*1.3,color:_tmTheme.tm.color.labelSecondary},state:{fontSize:_tmTheme.tm.font.mono,lineHeight:_tmTheme.tm.font.mono*1.3,fontWeight:"600",marginTop:1},state_off:{color:_tmTheme.tm.color.labelTertiary},state_warn:{color:_tmTheme.tm.color.warning}});
@@ -1,85 +1 @@
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
- testID: "time-machine-undo-bar",
36
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
37
- style: styles.text,
38
- numberOfLines: 1,
39
- testID: "time-machine-undo-text",
40
- children: ["Deleted \u201C", name, "\u201D"]
41
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
42
- onPress: onUndo,
43
- hitSlop: {
44
- top: 10,
45
- bottom: 10,
46
- left: 10,
47
- right: 10
48
- },
49
- accessibilityRole: "button",
50
- testID: "time-machine-undo-delete",
51
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
52
- style: styles.undo,
53
- children: "Undo"
54
- })
55
- })]
56
- });
57
- }
58
- const styles = _reactNative.StyleSheet.create({
59
- bar: {
60
- flexDirection: "row",
61
- alignItems: "center",
62
- gap: 12,
63
- marginHorizontal: _tmTheme.tm.gutter,
64
- marginTop: 12,
65
- minHeight: 46,
66
- paddingHorizontal: _tmTheme.tm.textInset,
67
- backgroundColor: _tmTheme.tm.color.group,
68
- borderRadius: _tmTheme.tm.radius.group,
69
- borderWidth: 1,
70
- borderColor: _tmTheme.tm.color.groupBorder
71
- },
72
- text: {
73
- flex: 1,
74
- color: _tmTheme.tm.color.labelSecondary,
75
- fontSize: _tmTheme.tm.font.control,
76
- letterSpacing: _tmTheme.tm.tracking.control
77
- },
78
- undo: {
79
- color: _tmTheme.tm.color.accent,
80
- fontSize: _tmTheme.tm.font.control,
81
- fontWeight: "600",
82
- letterSpacing: _tmTheme.tm.tracking.control
83
- }
84
- });
85
- //# sourceMappingURL=UndoDeleteBar.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.UndoDeleteBar=UndoDeleteBar;var _react=require("react");var _reactNative=require("react-native");var _tmTheme=require("../../ui/tmTheme");var _jsxRuntime=require("react/jsx-runtime");const WINDOW_MS=8e3;function UndoDeleteBar({name:e,at:t,onUndo:r,onExpire:o}){(0,_react.useEffect)(()=>{const n=setTimeout(o,WINDOW_MS);return()=>clearTimeout(n)},[t]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.bar,testID:"time-machine-undo-bar",children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.text,numberOfLines:1,testID:"time-machine-undo-text",children:["Deleted \u201C",e,"\u201D"]}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:r,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",testID:"time-machine-undo-delete",children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.undo,children:"Undo"})})]})}const styles=_reactNative.StyleSheet.create({bar:{flexDirection:"row",alignItems:"center",gap:12,marginHorizontal:_tmTheme.tm.gutter,marginTop:12,minHeight:46,paddingHorizontal:_tmTheme.tm.textInset,backgroundColor:_tmTheme.tm.color.group,borderRadius:_tmTheme.tm.radius.group,borderWidth:1,borderColor:_tmTheme.tm.color.groupBorder},text:{flex:1,color:_tmTheme.tm.color.labelSecondary,fontSize:_tmTheme.tm.font.control,letterSpacing:_tmTheme.tm.tracking.control},undo:{color:_tmTheme.tm.color.accent,fontSize:_tmTheme.tm.font.control,fontWeight:"600",letterSpacing:_tmTheme.tm.tracking.control}});
@@ -1,46 +1 @@
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
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.WipeAllRow=WipeAllRow;var _reactNative=require("react-native");var _tmTheme=require("../../ui/tmTheme");var _jsxRuntime=require("react/jsx-runtime");function WipeAllRow({disabled:e,onWipe:t}){return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.row,e?styles.disabled:null],onPress:t,disabled:e,accessibilityRole:"button",testID:"time-machine-wipe-all",children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.label,children:"Wipe All App State\u2026"})})}const styles=_reactNative.StyleSheet.create({row:{minHeight:_tmTheme.tm.rowMinHeight,alignItems:"center",justifyContent:"center"},disabled:{opacity:.4},label:{color:_tmTheme.tm.color.danger,fontSize:_tmTheme.tm.font.row,letterSpacing:_tmTheme.tm.tracking.row}});
@@ -1,79 +1 @@
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
- testID
36
- }) {
37
- // ABSENT_VALUE keeps added/removed reading as pure additions/removals
38
- // instead of diffs against the literal "null".
39
- const {
40
- oldValue,
41
- newValue
42
- } = (0, _react.useMemo)(() => ({
43
- oldValue: item.verdict === "added" ? _dataViewer.ABSENT_VALUE : (0, _dataViewer.toDiffable)(item.oldValue),
44
- newValue: item.verdict === "removed" ? _dataViewer.ABSENT_VALUE : (0, _dataViewer.toDiffable)(item.newValue)
45
- }), [item]);
46
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
47
- style: styles.panel,
48
- testID: testID,
49
- children: [item.reason ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
50
- style: styles.reason,
51
- children: ["\u26A0 ", item.reason]
52
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataViewer.ThemedSplitView, {
53
- oldValue: oldValue,
54
- newValue: newValue,
55
- differences: EMPTY,
56
- theme: _dataViewer.devToolsDefaultTheme,
57
- scrollEnabled: false
58
- })]
59
- });
60
- }
61
- const styles = _reactNative.StyleSheet.create({
62
- // Same fill as the rows above it: this is part of the card, not a thing
63
- // floating under it.
64
- panel: {
65
- // Only a token indent: the viewer lays values out at their natural width
66
- // and a 51pt inset (matching the checkbox column) clipped long numbers.
67
- paddingLeft: 16,
68
- paddingRight: 12,
69
- paddingTop: 10,
70
- paddingBottom: 14,
71
- gap: 10,
72
- backgroundColor: _tmTheme.tm.color.group
73
- },
74
- reason: {
75
- color: _tmTheme.tm.color.warning,
76
- fontSize: _tmTheme.tm.font.footnote
77
- }
78
- });
79
- //# sourceMappingURL=ItemDiffPanel.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ItemDiffPanel=ItemDiffPanel;var _react=require("react");var _reactNative=require("react-native");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _tmTheme=require("../../ui/tmTheme");var _jsxRuntime=require("react/jsx-runtime");const EMPTY=[];function ItemDiffPanel({item:e,testID:r}){const{oldValue:a,newValue:t}=(0,_react.useMemo)(()=>({oldValue:e.verdict==="added"?_dataViewer.ABSENT_VALUE:(0,_dataViewer.toDiffable)(e.oldValue),newValue:e.verdict==="removed"?_dataViewer.ABSENT_VALUE:(0,_dataViewer.toDiffable)(e.newValue)}),[e]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.panel,testID:r,children:[e.reason?(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.reason,children:["\u26A0 ",e.reason]}):null,(0,_jsxRuntime.jsx)(_dataViewer.ThemedSplitView,{oldValue:a,newValue:t,differences:EMPTY,theme:_dataViewer.devToolsDefaultTheme,scrollEnabled:false})]})}const styles=_reactNative.StyleSheet.create({panel:{paddingLeft:16,paddingRight:12,paddingTop:10,paddingBottom:14,gap:10,backgroundColor:_tmTheme.tm.color.group},reason:{color:_tmTheme.tm.color.warning,fontSize:_tmTheme.tm.font.footnote}});
@@ -1,51 +1 @@
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
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.PreviewScreen=PreviewScreen;var _timeMachineStore=require("../../store/timeMachineStore");var _confirm=require("../confirm");var _RestorePreviewScreen=require("./RestorePreviewScreen");var _jsxRuntime=require("react/jsx-runtime");function snapshotFor(e,r){return e==="current"?void 0:r.find(t=>t.id===e.snapshotId)}function PreviewScreen({preview:e,snapshots:r,busy:t,onClose:n}){const i=snapshotFor(e.right,r);const o=(s,a)=>{if(!i||t)return;if(i.baseline){(0,_confirm.confirmDestructive)("Restore fresh install?","This wipes all app storage and reloads the app.","Wipe & reload",()=>void _timeMachineStore.timeMachineStore.restore(i.id,"reload"));return}void _timeMachineStore.timeMachineStore.restore(i.id,s,a).then(n)};return(0,_jsxRuntime.jsx)(_RestorePreviewScreen.RestorePreviewScreen,{preview:e,snapshots:r,busy:t,onBack:n,onRestore:o})}
@@ -1,83 +1 @@
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
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.RestorePointNameRow=RestorePointNameRow;var _react=require("react");var _reactNative=require("react-native");var _tmTheme=require("../../ui/tmTheme");var _jsxRuntime=require("react/jsx-runtime");function RestorePointNameRow({name:e,onRename:n}){const[i,t]=(0,_react.useState)(e);(0,_react.useEffect)(()=>t(e),[e]);const o=()=>{const r=i.trim();if(!r){t(e);return}if(r!==e)n(r)};return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.label,children:"Name"}),(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.input,value:i,onChangeText:t,onSubmitEditing:o,onBlur:o,returnKeyType:"done",selectTextOnFocus:true,accessibilityLabel:"Restore point name",testID:"tm-preview-name"})]})}const styles=_reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"center",gap:14,minHeight:_tmTheme.tm.rowMinHeight,paddingHorizontal:_tmTheme.tm.textInset},label:{color:_tmTheme.tm.color.labelSecondary,fontSize:_tmTheme.tm.font.row,letterSpacing:_tmTheme.tm.tracking.row},input:{flex:1,minWidth:0,color:_tmTheme.tm.color.label,fontSize:_tmTheme.tm.font.row,fontWeight:"600",letterSpacing:_tmTheme.tm.tracking.row,textAlign:"right",padding:0,backgroundColor:"transparent"}});