@buoy-gg/time-machine 7.0.21 → 7.0.23

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 (174) hide show
  1. package/lib/commonjs/components/TimeMachineBody.js +148 -583
  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/index.js +55 -0
  34. package/lib/commonjs/index.js.map +1 -1
  35. package/lib/commonjs/store/routeRestore.js +188 -0
  36. package/lib/commonjs/store/routeRestore.js.map +1 -0
  37. package/lib/commonjs/store/snapshotVault.js +93 -9
  38. package/lib/commonjs/store/snapshotVault.js.map +1 -1
  39. package/lib/commonjs/store/timeMachineStore.js +164 -7
  40. package/lib/commonjs/store/timeMachineStore.js.map +1 -1
  41. package/lib/commonjs/sync/timeMachineSyncAdapter.js +59 -4
  42. package/lib/commonjs/sync/timeMachineSyncAdapter.js.map +1 -1
  43. package/lib/commonjs/ui/SwipeActionsRow.js +167 -0
  44. package/lib/commonjs/ui/SwipeActionsRow.js.map +1 -0
  45. package/lib/commonjs/ui/primitives.js +164 -0
  46. package/lib/commonjs/ui/primitives.js.map +1 -0
  47. package/lib/commonjs/ui/tmTheme.js +103 -0
  48. package/lib/commonjs/ui/tmTheme.js.map +1 -0
  49. package/lib/module/components/TimeMachineBody.js +151 -586
  50. package/lib/module/components/TimeMachineBody.js.map +1 -1
  51. package/lib/module/components/TimeMachineModal.js +11 -12
  52. package/lib/module/components/TimeMachineModal.js.map +1 -1
  53. package/lib/module/components/confirm.js +34 -0
  54. package/lib/module/components/confirm.js.map +1 -0
  55. package/lib/module/components/format.js +19 -0
  56. package/lib/module/components/format.js.map +1 -0
  57. package/lib/module/components/list/CaptureBar.js +90 -0
  58. package/lib/module/components/list/CaptureBar.js.map +1 -0
  59. package/lib/module/components/list/RestoreOutcomeCard.js +156 -0
  60. package/lib/module/components/list/RestoreOutcomeCard.js.map +1 -0
  61. package/lib/module/components/list/SnapshotRow.js +138 -0
  62. package/lib/module/components/list/SnapshotRow.js.map +1 -0
  63. package/lib/module/components/list/SourcesStrip.js +121 -0
  64. package/lib/module/components/list/SourcesStrip.js.map +1 -0
  65. package/lib/module/components/list/UndoDeleteBar.js +78 -0
  66. package/lib/module/components/list/UndoDeleteBar.js.map +1 -0
  67. package/lib/module/components/list/WipeAllRow.js +41 -0
  68. package/lib/module/components/list/WipeAllRow.js.map +1 -0
  69. package/lib/module/components/preview/ItemDiffPanel.js +72 -0
  70. package/lib/module/components/preview/ItemDiffPanel.js.map +1 -0
  71. package/lib/module/components/preview/PreviewFlow.js +46 -0
  72. package/lib/module/components/preview/PreviewFlow.js.map +1 -0
  73. package/lib/module/components/preview/RestorePointNameRow.js +78 -0
  74. package/lib/module/components/preview/RestorePointNameRow.js.map +1 -0
  75. package/lib/module/components/preview/RestorePreviewScreen.js +552 -638
  76. package/lib/module/components/preview/RestorePreviewScreen.js.map +1 -1
  77. package/lib/module/components/preview/verdictMeta.js +9 -8
  78. package/lib/module/components/preview/verdictMeta.js.map +1 -1
  79. package/lib/module/components/sources.js +66 -0
  80. package/lib/module/components/sources.js.map +1 -0
  81. package/lib/module/index.js +11 -0
  82. package/lib/module/index.js.map +1 -1
  83. package/lib/module/store/routeRestore.js +176 -0
  84. package/lib/module/store/routeRestore.js.map +1 -0
  85. package/lib/module/store/snapshotVault.js +87 -9
  86. package/lib/module/store/snapshotVault.js.map +1 -1
  87. package/lib/module/store/timeMachineStore.js +164 -8
  88. package/lib/module/store/timeMachineStore.js.map +1 -1
  89. package/lib/module/sync/timeMachineSyncAdapter.js +59 -4
  90. package/lib/module/sync/timeMachineSyncAdapter.js.map +1 -1
  91. package/lib/module/ui/SwipeActionsRow.js +162 -0
  92. package/lib/module/ui/SwipeActionsRow.js.map +1 -0
  93. package/lib/module/ui/primitives.js +156 -0
  94. package/lib/module/ui/primitives.js.map +1 -0
  95. package/lib/module/ui/tmTheme.js +99 -0
  96. package/lib/module/ui/tmTheme.js.map +1 -0
  97. package/lib/typescript/components/TimeMachineBody.d.ts.map +1 -1
  98. package/lib/typescript/components/TimeMachineModal.d.ts.map +1 -1
  99. package/lib/typescript/components/confirm.d.ts +2 -0
  100. package/lib/typescript/components/confirm.d.ts.map +1 -0
  101. package/lib/typescript/components/format.d.ts +4 -0
  102. package/lib/typescript/components/format.d.ts.map +1 -0
  103. package/lib/typescript/components/list/CaptureBar.d.ts +6 -0
  104. package/lib/typescript/components/list/CaptureBar.d.ts.map +1 -0
  105. package/lib/typescript/components/list/RestoreOutcomeCard.d.ts +11 -0
  106. package/lib/typescript/components/list/RestoreOutcomeCard.d.ts.map +1 -0
  107. package/lib/typescript/components/list/SnapshotRow.d.ts +12 -0
  108. package/lib/typescript/components/list/SnapshotRow.d.ts.map +1 -0
  109. package/lib/typescript/components/list/SourcesStrip.d.ts +5 -0
  110. package/lib/typescript/components/list/SourcesStrip.d.ts.map +1 -0
  111. package/lib/typescript/components/list/UndoDeleteBar.d.ts +8 -0
  112. package/lib/typescript/components/list/UndoDeleteBar.d.ts.map +1 -0
  113. package/lib/typescript/components/list/WipeAllRow.d.ts +5 -0
  114. package/lib/typescript/components/list/WipeAllRow.d.ts.map +1 -0
  115. package/lib/typescript/components/preview/ItemDiffPanel.d.ts +5 -0
  116. package/lib/typescript/components/preview/ItemDiffPanel.d.ts.map +1 -0
  117. package/lib/typescript/components/preview/PreviewFlow.d.ts +9 -0
  118. package/lib/typescript/components/preview/PreviewFlow.d.ts.map +1 -0
  119. package/lib/typescript/components/preview/RestorePointNameRow.d.ts +5 -0
  120. package/lib/typescript/components/preview/RestorePointNameRow.d.ts.map +1 -0
  121. package/lib/typescript/components/preview/RestorePreviewScreen.d.ts +1 -5
  122. package/lib/typescript/components/preview/RestorePreviewScreen.d.ts.map +1 -1
  123. package/lib/typescript/components/preview/verdictMeta.d.ts +5 -0
  124. package/lib/typescript/components/preview/verdictMeta.d.ts.map +1 -1
  125. package/lib/typescript/components/sources.d.ts +36 -0
  126. package/lib/typescript/components/sources.d.ts.map +1 -0
  127. package/lib/typescript/index.d.ts +2 -1
  128. package/lib/typescript/index.d.ts.map +1 -1
  129. package/lib/typescript/store/routeRestore.d.ts +51 -0
  130. package/lib/typescript/store/routeRestore.d.ts.map +1 -0
  131. package/lib/typescript/store/snapshotVault.d.ts +55 -0
  132. package/lib/typescript/store/snapshotVault.d.ts.map +1 -1
  133. package/lib/typescript/store/timeMachineStore.d.ts +64 -2
  134. package/lib/typescript/store/timeMachineStore.d.ts.map +1 -1
  135. package/lib/typescript/sync/timeMachineSyncAdapter.d.ts +25 -0
  136. package/lib/typescript/sync/timeMachineSyncAdapter.d.ts.map +1 -1
  137. package/lib/typescript/ui/SwipeActionsRow.d.ts +32 -0
  138. package/lib/typescript/ui/SwipeActionsRow.d.ts.map +1 -0
  139. package/lib/typescript/ui/primitives.d.ts +57 -0
  140. package/lib/typescript/ui/primitives.d.ts.map +1 -0
  141. package/lib/typescript/ui/tmTheme.d.ts +67 -0
  142. package/lib/typescript/ui/tmTheme.d.ts.map +1 -0
  143. package/package.json +12 -8
  144. package/src/components/TimeMachineBody.tsx +184 -682
  145. package/src/components/TimeMachineModal.tsx +10 -11
  146. package/src/components/confirm.ts +35 -0
  147. package/src/components/format.ts +17 -0
  148. package/src/components/list/CaptureBar.tsx +100 -0
  149. package/src/components/list/RestoreOutcomeCard.tsx +159 -0
  150. package/src/components/list/SnapshotRow.tsx +155 -0
  151. package/src/components/list/SourcesStrip.tsx +124 -0
  152. package/src/components/list/UndoDeleteBar.tsx +76 -0
  153. package/src/components/list/WipeAllRow.tsx +42 -0
  154. package/src/components/preview/ItemDiffPanel.tsx +77 -0
  155. package/src/components/preview/PreviewFlow.tsx +70 -0
  156. package/src/components/preview/RestorePointNameRow.tsx +80 -0
  157. package/src/components/preview/RestorePreviewScreen.tsx +535 -535
  158. package/src/components/preview/verdictMeta.ts +8 -8
  159. package/src/components/sources.ts +92 -0
  160. package/src/index.tsx +22 -0
  161. package/src/store/routeRestore.ts +194 -0
  162. package/src/store/snapshotVault.ts +138 -9
  163. package/src/store/timeMachineStore.ts +195 -5
  164. package/src/sync/timeMachineSyncAdapter.ts +57 -4
  165. package/src/ui/SwipeActionsRow.tsx +199 -0
  166. package/src/ui/primitives.tsx +157 -0
  167. package/src/ui/tmTheme.ts +107 -0
  168. package/lib/commonjs/components/preview/ItemDetailScreen.js +0 -189
  169. package/lib/commonjs/components/preview/ItemDetailScreen.js.map +0 -1
  170. package/lib/module/components/preview/ItemDetailScreen.js +0 -184
  171. package/lib/module/components/preview/ItemDetailScreen.js.map +0 -1
  172. package/lib/typescript/components/preview/ItemDetailScreen.d.ts +0 -11
  173. package/lib/typescript/components/preview/ItemDetailScreen.d.ts.map +0 -1
  174. package/src/components/preview/ItemDetailScreen.tsx +0 -172
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Grouped-inset list primitives — the building blocks of the Time Machine
3
+ * surface (see ./tmTheme for the tokens and the promotion plan).
4
+ *
5
+ * The shape they compose to:
6
+ *
7
+ * SectionLabel SOURCES ← outside the card, uppercase
8
+ * Group ┌──────────────────┐
9
+ * <row> │ All sources … 6 ›│ ← rows are plain children;
10
+ * <row> ├──────────────────┤ Group draws the hairlines
11
+ * └──────────────────┘
12
+ * Footnote Route is captured with… ← explains the group above
13
+ *
14
+ * Rows are whatever a screen needs — Group only owns the card, the clipping
15
+ * and the separators, so a row never has to know its position in the list.
16
+ */
17
+ import { Children, type ReactNode } from "react";
18
+ import { StyleSheet, Text, View, type ViewStyle } from "react-native";
19
+ import { ChevronRight } from "@buoy-gg/shared-ui";
20
+ import { tm } from "./tmTheme";
21
+
22
+ /** Uppercase section label that sits above a Group. */
23
+ export function SectionLabel({ children }: { children: string }) {
24
+ return <Text style={styles.sectionLabel}>{children}</Text>;
25
+ }
26
+
27
+ /**
28
+ * Explanatory line under a Group ("Swipe a restore point to delete it").
29
+ * `centered` matches the iOS convention for a footnote under a lone button.
30
+ */
31
+ export function Footnote({
32
+ children,
33
+ centered,
34
+ tone = "secondary",
35
+ }: {
36
+ children: ReactNode;
37
+ centered?: boolean;
38
+ tone?: "secondary" | "warning";
39
+ }) {
40
+ return (
41
+ <Text
42
+ style={[
43
+ styles.footnote,
44
+ centered ? styles.footnoteCentered : null,
45
+ tone === "warning" ? styles.footnoteWarning : null,
46
+ ]}
47
+ >
48
+ {children}
49
+ </Text>
50
+ );
51
+ }
52
+
53
+ /**
54
+ * A rounded grouped card. Draws a hairline between consecutive children and
55
+ * clips them, so a row can paint edge-to-edge (swipe actions, press washes)
56
+ * without punching through the corners.
57
+ */
58
+ export function Group({
59
+ children,
60
+ style,
61
+ }: {
62
+ children: ReactNode;
63
+ style?: ViewStyle;
64
+ }) {
65
+ const rows = Children.toArray(children);
66
+ return (
67
+ <View style={[styles.group, style]}>
68
+ {rows.map((row, index) => (
69
+ // Children.toArray assigns stable synthetic keys ('.$id' for keyed
70
+ // children), so a row keeps its identity as the list changes.
71
+ <View key={(row as { key?: string }).key ?? index}>
72
+ {index > 0 ? <View style={styles.separator} /> : null}
73
+ {row}
74
+ </View>
75
+ ))}
76
+ </View>
77
+ );
78
+ }
79
+
80
+ /**
81
+ * Trailing disclosure chevron for a row that opens or expands.
82
+ *
83
+ * A real glyph, not two rotated hairlines: at this size the hand-built
84
+ * version's strokes never met at the vertex, so it read as a broken arrow.
85
+ */
86
+ export function DisclosureChevron() {
87
+ return <ChevronRight size={16} color={tm.color.labelTertiary} />;
88
+ }
89
+
90
+ /**
91
+ * Pill button. Parameterized by color rather than by variant flags so a
92
+ * screen can name its own (`CapturePill`, `RestorePill`) in one line.
93
+ */
94
+ export function PillLabel({
95
+ label,
96
+ color,
97
+ background,
98
+ }: {
99
+ label: string;
100
+ color: string;
101
+ background: string;
102
+ }) {
103
+ return (
104
+ <View style={[styles.pill, { backgroundColor: background }]}>
105
+ <Text style={[styles.pillText, { color }]}>{label}</Text>
106
+ </View>
107
+ );
108
+ }
109
+
110
+ const styles = StyleSheet.create({
111
+ sectionLabel: {
112
+ color: tm.color.labelSecondary,
113
+ fontSize: tm.font.footnote,
114
+ fontWeight: "500",
115
+ textTransform: "uppercase",
116
+ letterSpacing: 0.4,
117
+ paddingHorizontal: tm.gutter + tm.textInset,
118
+ paddingTop: 22,
119
+ paddingBottom: 7,
120
+ },
121
+ footnote: {
122
+ color: tm.color.labelSecondary,
123
+ fontSize: tm.font.footnote,
124
+ lineHeight: tm.font.footnote * 1.35,
125
+ paddingHorizontal: tm.gutter + tm.textInset,
126
+ paddingTop: 7,
127
+ },
128
+ footnoteCentered: {
129
+ textAlign: "center",
130
+ },
131
+ footnoteWarning: {
132
+ color: tm.color.warning,
133
+ },
134
+ group: {
135
+ marginHorizontal: tm.gutter,
136
+ backgroundColor: tm.color.group,
137
+ borderRadius: tm.radius.group,
138
+ overflow: "hidden",
139
+ },
140
+ separator: {
141
+ height: StyleSheet.hairlineWidth,
142
+ marginLeft: tm.separatorInset,
143
+ backgroundColor: tm.color.separator,
144
+ },
145
+ pill: {
146
+ height: 32,
147
+ paddingHorizontal: 15,
148
+ borderRadius: tm.radius.pill,
149
+ alignItems: "center",
150
+ justifyContent: "center",
151
+ },
152
+ pillText: {
153
+ fontSize: tm.font.control,
154
+ fontWeight: "600",
155
+ letterSpacing: tm.tracking.control,
156
+ },
157
+ });
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Time Machine design tokens — the "modern" surface language.
3
+ *
4
+ * A grouped-inset list system (iOS Settings shape): one dark sheet, rounded
5
+ * grouped cards holding hairline-separated rows, uppercase section labels
6
+ * outside the cards, and explanatory footnotes under them.
7
+ *
8
+ * COLOR COMES FROM `buoyColors` — the shared dev-tools palette — not from a
9
+ * private set. The mockup this layout came from used the Apple system colors;
10
+ * those are mapped onto Buoy's equivalents here (system green → Buoy teal,
11
+ * and so on) so the tool reads as part of the same product as every other
12
+ * one. Change a value in gameUIColors.ts and it lands here.
13
+ *
14
+ * Only shape, spacing and type live as literals below — those ARE the design
15
+ * language and have no palette equivalent.
16
+ *
17
+ * SCOPE: this is Time Machine's pilot of the new look. If it lands, promote
18
+ * this file (and ./primitives) into @buoy-gg/shared-ui and let the other
19
+ * tools import it — nothing in here is Time-Machine-specific.
20
+ *
21
+ * Note: like every StyleSheet in the repo, these values are read once at
22
+ * module load, so the desktop dashboard's in-place re-tint needs a reload to
23
+ * reach them.
24
+ */
25
+ import { buoyColors } from "@buoy-gg/shared-ui";
26
+
27
+ /** Hex opacity suffixes, so tinted fills stay tied to the palette color. */
28
+ const A18 = "2E";
29
+ const A30 = "4D";
30
+
31
+ export const tm = {
32
+ color: {
33
+ /** Sheet background behind the grouped cards. */
34
+ sheet: buoyColors.base,
35
+ /** A grouped card. */
36
+ group: buoyColors.card,
37
+ /** Row press / hover wash on top of a group. */
38
+ rowPressed: buoyColors.hover,
39
+ /** Hairline between rows, inset from the left like iOS. */
40
+ separator: buoyColors.border,
41
+ /** Neutral control fill (icon discs, chips, round buttons). */
42
+ fill: buoyColors.input,
43
+ fillStrong: buoyColors.borderStrong,
44
+
45
+ label: buoyColors.text,
46
+ labelSecondary: buoyColors.textSecondary,
47
+ labelTertiary: buoyColors.textMuted,
48
+
49
+ /** Primary action + "this is healthy" (Buoy teal). */
50
+ accent: buoyColors.primary,
51
+ accentSoft: `${buoyColors.primary}${A18}`,
52
+ accentSoftStrong: `${buoyColors.primary}${A30}`,
53
+ /** Text/icons ON an accent fill — the palette's teal wants dark ink. */
54
+ onAccent: "#0A0A0A",
55
+
56
+ warning: buoyColors.warning,
57
+ warningSoft: `${buoyColors.warning}${A18}`,
58
+
59
+ danger: buoyColors.error,
60
+ dangerSoft: `${buoyColors.error}${A18}`,
61
+ /** Text/icons ON a danger fill. */
62
+ onDanger: "#FFFFFF",
63
+
64
+ info: buoyColors.info,
65
+ },
66
+
67
+ radius: {
68
+ /** Grouped card + the capture field that visually matches one. */
69
+ group: 14,
70
+ /** Fully rounded pills and status circles. */
71
+ pill: 99,
72
+ },
73
+
74
+ /** Horizontal inset of the grouped cards from the sheet edge. */
75
+ gutter: 14,
76
+ /** Extra inset for labels/footnotes, measured from the card edge. */
77
+ textInset: 16,
78
+ /** Left inset of a row separator, measured from the card edge. */
79
+ separatorInset: 16,
80
+
81
+ font: {
82
+ /** Row titles and primary values. */
83
+ row: 17,
84
+ /** Buttons and pill labels. */
85
+ control: 15,
86
+ /** Section labels, row captions, footnotes. */
87
+ footnote: 13,
88
+ /** Route paths and other monospace detail. */
89
+ mono: 12,
90
+ },
91
+
92
+ /** iOS tracks display text slightly tighter than the default. */
93
+ tracking: {
94
+ row: -0.43,
95
+ control: -0.2,
96
+ },
97
+
98
+ /** Standard grouped-row height before content forces it taller. */
99
+ rowMinHeight: 52,
100
+ } as const;
101
+
102
+ /**
103
+ * Monospace family. RN native resolves a single family name only (no CSS
104
+ * stack), and "monospace" is the one token both platforms honor — it is what
105
+ * the rest of the design system uses.
106
+ */
107
+ export const TM_MONO = "monospace";
@@ -1,189 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ItemDetailScreen = ItemDetailScreen;
7
- var _react = require("react");
8
- var _reactNative = require("react-native");
9
- var _sharedUi = require("@buoy-gg/shared-ui");
10
- var _core = require("@buoy-gg/core");
11
- var _dataViewer = require("@buoy-gg/shared-ui/dataViewer");
12
- var _verdictMeta = require("./verdictMeta");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- /**
15
- * Item detail — one preview item's before/after, rendered with the two
16
- * familiar views (TREE / SPLIT, same as storage events).
17
- *
18
- * The render-layer viewers only handle plain JSON faithfully, so both sides
19
- * pass through toDiffable (Dates→ISO, Maps→objects, BigInt→"1n", cycles→
20
- * "[Circular]") and the pair is memoized ONCE per item — the storage tool's
21
- * fix for the fresh-identity-every-render trap that redux/zustand still have.
22
- */
23
-
24
- const DIFF_MODE_KEY = _sharedUi.devToolsStorageKeys.timeMachine.diffViewerMode();
25
- const TABS = [{
26
- key: "tree",
27
- label: "TREE VIEW"
28
- }, {
29
- key: "split",
30
- label: "SPLIT VIEW"
31
- }];
32
- function ItemDetailScreen({
33
- sourceLabel,
34
- item,
35
- leftLabel,
36
- rightLabel,
37
- onBack
38
- }) {
39
- // Persisted view preference — storage's load-guard/validate/optimistic
40
- // pattern, default TREE (structured state reads better as a tree).
41
- const [diffMode, setDiffMode] = (0, _react.useState)("tree");
42
- const hasLoadedMode = (0, _react.useRef)(false);
43
- (0, _react.useEffect)(() => {
44
- if (hasLoadedMode.current) return;
45
- hasLoadedMode.current = true;
46
- void _sharedUi.persistentStorage.getItem(DIFF_MODE_KEY).then(saved => {
47
- if (saved === "tree" || saved === "split") setDiffMode(saved);
48
- });
49
- }, []);
50
- const changeMode = mode => {
51
- setDiffMode(mode);
52
- void _sharedUi.persistentStorage.setItem(DIFF_MODE_KEY, mode).catch(() => {});
53
- };
54
- const meta = _verdictMeta.VERDICT_META[item.verdict];
55
- const host = (0, _core.useToolHost)();
56
- const hosted = host.instanceId !== undefined;
57
-
58
- // Hosted: the shared modal header shows this item's identity + back.
59
- (0, _core.useToolHeader)(hosted ? {
60
- title: item.label,
61
- subtitle: `${sourceLabel} · ${meta.label} · ${leftLabel} → ${rightLabel}`,
62
- onBack,
63
- searchable: false // nothing searchable on a single item's diff
64
- } : null,
65
- // eslint-disable-next-line react-hooks/exhaustive-deps
66
- [hosted, item.key, sourceLabel, leftLabel, rightLabel]);
67
-
68
- // Normalize ONCE per item; ABSENT_VALUE keeps added/removed reading as
69
- // pure additions/removals instead of diffs against the literal "null".
70
- const {
71
- oldValue,
72
- newValue
73
- } = (0, _react.useMemo)(() => ({
74
- oldValue: item.verdict === "added" ? _dataViewer.ABSENT_VALUE : (0, _dataViewer.toDiffable)(item.oldValue),
75
- newValue: item.verdict === "removed" ? _dataViewer.ABSENT_VALUE : (0, _dataViewer.toDiffable)(item.newValue)
76
- }), [item]);
77
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
78
- style: styles.container,
79
- children: [!hosted && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
80
- style: styles.screenHeader,
81
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
82
- onPress: onBack,
83
- hitSlop: HIT,
84
- testID: "tm-item-back",
85
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
86
- style: styles.backText,
87
- children: "\u2039 Preview"
88
- })
89
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
90
- style: styles.titleBlock,
91
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
92
- style: styles.title,
93
- numberOfLines: 1,
94
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
95
- style: {
96
- color: meta.color
97
- },
98
- children: [meta.glyph, " "]
99
- }), item.label]
100
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
101
- style: styles.subtitle,
102
- numberOfLines: 1,
103
- children: [sourceLabel, " \xB7 ", meta.label, " \xB7 ", leftLabel, " \u2192 ", rightLabel]
104
- })]
105
- })]
106
- }), item.reason && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
107
- style: styles.reason,
108
- children: ["\u26A0 ", item.reason]
109
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
110
- style: styles.tabs,
111
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.DiffModeTabs, {
112
- tabs: TABS,
113
- activeTab: diffMode,
114
- onTabChange: changeMode
115
- })
116
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
117
- style: styles.scroll,
118
- contentContainerStyle: styles.scrollContent,
119
- children: diffMode === "tree" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataViewer.TreeDiffViewer, {
120
- oldValue: oldValue,
121
- newValue: newValue,
122
- theme: "dark",
123
- showUnchanged: false,
124
- scrollEnabled: false
125
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataViewer.ThemedSplitView, {
126
- oldValue: oldValue,
127
- newValue: newValue,
128
- differences: EMPTY,
129
- theme: _dataViewer.devToolsDefaultTheme,
130
- scrollEnabled: false
131
- })
132
- })]
133
- });
134
- }
135
- const EMPTY = [];
136
- const HIT = {
137
- top: 10,
138
- bottom: 10,
139
- left: 10,
140
- right: 10
141
- };
142
- const styles = _reactNative.StyleSheet.create({
143
- container: {
144
- flex: 1
145
- },
146
- screenHeader: {
147
- flexDirection: "row",
148
- alignItems: "center",
149
- paddingHorizontal: 12,
150
- paddingVertical: 8,
151
- gap: 10
152
- },
153
- backText: {
154
- color: _sharedUi.buoyColors.primary,
155
- fontSize: 14
156
- },
157
- titleBlock: {
158
- flex: 1,
159
- minWidth: 0
160
- },
161
- title: {
162
- color: _sharedUi.buoyColors.text,
163
- fontSize: 13,
164
- fontWeight: "700"
165
- },
166
- subtitle: {
167
- color: _sharedUi.buoyColors.textMuted,
168
- fontSize: 10,
169
- marginTop: 2
170
- },
171
- reason: {
172
- color: _sharedUi.buoyColors.warning,
173
- fontSize: 11,
174
- paddingHorizontal: 12,
175
- paddingBottom: 6
176
- },
177
- tabs: {
178
- paddingHorizontal: 12,
179
- paddingBottom: 8
180
- },
181
- scroll: {
182
- flex: 1
183
- },
184
- scrollContent: {
185
- paddingHorizontal: 12,
186
- paddingBottom: 24
187
- }
188
- });
189
- //# sourceMappingURL=ItemDetailScreen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_reactNative","_sharedUi","_core","_dataViewer","_verdictMeta","_jsxRuntime","DIFF_MODE_KEY","devToolsStorageKeys","timeMachine","diffViewerMode","TABS","key","label","ItemDetailScreen","sourceLabel","item","leftLabel","rightLabel","onBack","diffMode","setDiffMode","useState","hasLoadedMode","useRef","useEffect","current","persistentStorage","getItem","then","saved","changeMode","mode","setItem","catch","meta","VERDICT_META","verdict","host","useToolHost","hosted","instanceId","undefined","useToolHeader","title","subtitle","searchable","oldValue","newValue","useMemo","ABSENT_VALUE","toDiffable","jsxs","View","style","styles","container","children","screenHeader","jsx","TouchableOpacity","onPress","hitSlop","HIT","testID","Text","backText","titleBlock","numberOfLines","color","glyph","reason","tabs","DiffModeTabs","activeTab","onTabChange","ScrollView","scroll","contentContainerStyle","scrollContent","TreeDiffViewer","theme","showUnchanged","scrollEnabled","ThemedSplitView","differences","EMPTY","devToolsDefaultTheme","top","bottom","left","right","StyleSheet","create","flex","flexDirection","alignItems","paddingHorizontal","paddingVertical","gap","buoyColors","primary","fontSize","minWidth","text","fontWeight","textMuted","marginTop","warning","paddingBottom"],"sourceRoot":"../../../../src","sources":["components/preview/ItemDetailScreen.tsx"],"mappings":";;;;;;AASA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAOA,IAAAK,YAAA,GAAAL,OAAA;AAA6C,IAAAM,WAAA,GAAAN,OAAA;AA1B7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA,MAAMO,aAAa,GAAGC,6BAAmB,CAACC,WAAW,CAACC,cAAc,CAAC,CAAC;AACtE,MAAMC,IAAI,GAAG,CACX;EAAEC,GAAG,EAAE,MAAM;EAAEC,KAAK,EAAE;AAAY,CAAC,EACnC;EAAED,GAAG,EAAE,OAAO;EAAEC,KAAK,EAAE;AAAa,CAAC,CACtC;AAWM,SAASC,gBAAgBA,CAAC;EAC/BC,WAAW;EACXC,IAAI;EACJC,SAAS;EACTC,UAAU;EACVC;AACqB,CAAC,EAAE;EACxB;EACA;EACA,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAG,IAAAC,eAAQ,EAAS,MAAM,CAAC;EACxD,MAAMC,aAAa,GAAG,IAAAC,aAAM,EAAC,KAAK,CAAC;EACnC,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIF,aAAa,CAACG,OAAO,EAAE;IAC3BH,aAAa,CAACG,OAAO,GAAG,IAAI;IAC5B,KAAKC,2BAAiB,CAAC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E;IAAEY,aAAa,EAAE;EAAG;AAC5D,CAAC,CAAC","ignoreList":[]}
@@ -1,184 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * Item detail — one preview item's before/after, rendered with the two
5
- * familiar views (TREE / SPLIT, same as storage events).
6
- *
7
- * The render-layer viewers only handle plain JSON faithfully, so both sides
8
- * pass through toDiffable (Dates→ISO, Maps→objects, BigInt→"1n", cycles→
9
- * "[Circular]") and the pair is memoized ONCE per item — the storage tool's
10
- * fix for the fresh-identity-every-render trap that redux/zustand still have.
11
- */
12
- import { useEffect, useMemo, useRef, useState } from "react";
13
- import { ScrollView, StyleSheet, Text, TouchableOpacity, View } from "react-native";
14
- import { DiffModeTabs, buoyColors, devToolsStorageKeys, persistentStorage } from "@buoy-gg/shared-ui";
15
- import { useToolHeader, useToolHost } from "@buoy-gg/core";
16
- import { ABSENT_VALUE, ThemedSplitView, TreeDiffViewer, devToolsDefaultTheme, toDiffable } from "@buoy-gg/shared-ui/dataViewer";
17
- import { VERDICT_META } from "./verdictMeta";
18
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
- const DIFF_MODE_KEY = devToolsStorageKeys.timeMachine.diffViewerMode();
20
- const TABS = [{
21
- key: "tree",
22
- label: "TREE VIEW"
23
- }, {
24
- key: "split",
25
- label: "SPLIT VIEW"
26
- }];
27
- export function ItemDetailScreen({
28
- sourceLabel,
29
- item,
30
- leftLabel,
31
- rightLabel,
32
- onBack
33
- }) {
34
- // Persisted view preference — storage's load-guard/validate/optimistic
35
- // pattern, default TREE (structured state reads better as a tree).
36
- const [diffMode, setDiffMode] = useState("tree");
37
- const hasLoadedMode = useRef(false);
38
- useEffect(() => {
39
- if (hasLoadedMode.current) return;
40
- hasLoadedMode.current = true;
41
- void persistentStorage.getItem(DIFF_MODE_KEY).then(saved => {
42
- if (saved === "tree" || saved === "split") setDiffMode(saved);
43
- });
44
- }, []);
45
- const changeMode = mode => {
46
- setDiffMode(mode);
47
- void persistentStorage.setItem(DIFF_MODE_KEY, mode).catch(() => {});
48
- };
49
- const meta = VERDICT_META[item.verdict];
50
- const host = useToolHost();
51
- const hosted = host.instanceId !== undefined;
52
-
53
- // Hosted: the shared modal header shows this item's identity + back.
54
- useToolHeader(hosted ? {
55
- title: item.label,
56
- subtitle: `${sourceLabel} · ${meta.label} · ${leftLabel} → ${rightLabel}`,
57
- onBack,
58
- searchable: false // nothing searchable on a single item's diff
59
- } : null,
60
- // eslint-disable-next-line react-hooks/exhaustive-deps
61
- [hosted, item.key, sourceLabel, leftLabel, rightLabel]);
62
-
63
- // Normalize ONCE per item; ABSENT_VALUE keeps added/removed reading as
64
- // pure additions/removals instead of diffs against the literal "null".
65
- const {
66
- oldValue,
67
- newValue
68
- } = useMemo(() => ({
69
- oldValue: item.verdict === "added" ? ABSENT_VALUE : toDiffable(item.oldValue),
70
- newValue: item.verdict === "removed" ? ABSENT_VALUE : toDiffable(item.newValue)
71
- }), [item]);
72
- return /*#__PURE__*/_jsxs(View, {
73
- style: styles.container,
74
- children: [!hosted && /*#__PURE__*/_jsxs(View, {
75
- style: styles.screenHeader,
76
- children: [/*#__PURE__*/_jsx(TouchableOpacity, {
77
- onPress: onBack,
78
- hitSlop: HIT,
79
- testID: "tm-item-back",
80
- children: /*#__PURE__*/_jsx(Text, {
81
- style: styles.backText,
82
- children: "\u2039 Preview"
83
- })
84
- }), /*#__PURE__*/_jsxs(View, {
85
- style: styles.titleBlock,
86
- children: [/*#__PURE__*/_jsxs(Text, {
87
- style: styles.title,
88
- numberOfLines: 1,
89
- children: [/*#__PURE__*/_jsxs(Text, {
90
- style: {
91
- color: meta.color
92
- },
93
- children: [meta.glyph, " "]
94
- }), item.label]
95
- }), /*#__PURE__*/_jsxs(Text, {
96
- style: styles.subtitle,
97
- numberOfLines: 1,
98
- children: [sourceLabel, " \xB7 ", meta.label, " \xB7 ", leftLabel, " \u2192 ", rightLabel]
99
- })]
100
- })]
101
- }), item.reason && /*#__PURE__*/_jsxs(Text, {
102
- style: styles.reason,
103
- children: ["\u26A0 ", item.reason]
104
- }), /*#__PURE__*/_jsx(View, {
105
- style: styles.tabs,
106
- children: /*#__PURE__*/_jsx(DiffModeTabs, {
107
- tabs: TABS,
108
- activeTab: diffMode,
109
- onTabChange: changeMode
110
- })
111
- }), /*#__PURE__*/_jsx(ScrollView, {
112
- style: styles.scroll,
113
- contentContainerStyle: styles.scrollContent,
114
- children: diffMode === "tree" ? /*#__PURE__*/_jsx(TreeDiffViewer, {
115
- oldValue: oldValue,
116
- newValue: newValue,
117
- theme: "dark",
118
- showUnchanged: false,
119
- scrollEnabled: false
120
- }) : /*#__PURE__*/_jsx(ThemedSplitView, {
121
- oldValue: oldValue,
122
- newValue: newValue,
123
- differences: EMPTY,
124
- theme: devToolsDefaultTheme,
125
- scrollEnabled: false
126
- })
127
- })]
128
- });
129
- }
130
- const EMPTY = [];
131
- const HIT = {
132
- top: 10,
133
- bottom: 10,
134
- left: 10,
135
- right: 10
136
- };
137
- const styles = StyleSheet.create({
138
- container: {
139
- flex: 1
140
- },
141
- screenHeader: {
142
- flexDirection: "row",
143
- alignItems: "center",
144
- paddingHorizontal: 12,
145
- paddingVertical: 8,
146
- gap: 10
147
- },
148
- backText: {
149
- color: buoyColors.primary,
150
- fontSize: 14
151
- },
152
- titleBlock: {
153
- flex: 1,
154
- minWidth: 0
155
- },
156
- title: {
157
- color: buoyColors.text,
158
- fontSize: 13,
159
- fontWeight: "700"
160
- },
161
- subtitle: {
162
- color: buoyColors.textMuted,
163
- fontSize: 10,
164
- marginTop: 2
165
- },
166
- reason: {
167
- color: buoyColors.warning,
168
- fontSize: 11,
169
- paddingHorizontal: 12,
170
- paddingBottom: 6
171
- },
172
- tabs: {
173
- paddingHorizontal: 12,
174
- paddingBottom: 8
175
- },
176
- scroll: {
177
- flex: 1
178
- },
179
- scrollContent: {
180
- paddingHorizontal: 12,
181
- paddingBottom: 24
182
- }
183
- });
184
- //# sourceMappingURL=ItemDetailScreen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useEffect","useMemo","useRef","useState","ScrollView","StyleSheet","Text","TouchableOpacity","View","DiffModeTabs","buoyColors","devToolsStorageKeys","persistentStorage","useToolHeader","useToolHost","ABSENT_VALUE","ThemedSplitView","TreeDiffViewer","devToolsDefaultTheme","toDiffable","VERDICT_META","jsx","_jsx","jsxs","_jsxs","DIFF_MODE_KEY","timeMachine","diffViewerMode","TABS","key","label","ItemDetailScreen","sourceLabel","item","leftLabel","rightLabel","onBack","diffMode","setDiffMode","hasLoadedMode","current","getItem","then","saved","changeMode","mode","setItem","catch","meta","verdict","host","hosted","instanceId","undefined","title","subtitle","searchable","oldValue","newValue","style","styles","container","children","screenHeader","onPress","hitSlop","HIT","testID","backText","titleBlock","numberOfLines","color","glyph","reason","tabs","activeTab","onTabChange","scroll","contentContainerStyle","scrollContent","theme","showUnchanged","scrollEnabled","differences","EMPTY","top","bottom","left","right","create","flex","flexDirection","alignItems","paddingHorizontal","paddingVertical","gap","primary","fontSize","minWidth","text","fontWeight","textMuted","marginTop","warning","paddingBottom"],"sourceRoot":"../../../../src","sources":["components/preview/ItemDetailScreen.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC5D,SAASC,UAAU,EAAEC,UAAU,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACnF,SACEC,YAAY,EACZC,UAAU,EACVC,mBAAmB,EACnBC,iBAAiB,QACZ,oBAAoB;AAC3B,SAASC,aAAa,EAAEC,WAAW,QAAQ,eAAe;AAE1D,SACEC,YAAY,EACZC,eAAe,EACfC,cAAc,EACdC,oBAAoB,EACpBC,UAAU,QACL,+BAA+B;AACtC,SAASC,YAAY,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE7C,MAAMC,aAAa,GA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EAAE;EAAE,CAAC;EACnBX,aAAa,EAAE;IAAEc,iBAAiB,EAAE,EAAE;IAAEW,aAAa,EAAE;EAAG;AAC5D,CAAC,CAAC","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- import type { StateSnapshotPreviewItem } from "@buoy-gg/shared-ui";
2
- export interface ItemDetailScreenProps {
3
- sourceLabel: string;
4
- item: StateSnapshotPreviewItem;
5
- /** "old → new" side labels, e.g. "CURRENT STATE" / snapshot name. */
6
- leftLabel: string;
7
- rightLabel: string;
8
- onBack: () => void;
9
- }
10
- export declare function ItemDetailScreen({ sourceLabel, item, leftLabel, rightLabel, onBack, }: ItemDetailScreenProps): import("react").JSX.Element;
11
- //# sourceMappingURL=ItemDetailScreen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ItemDetailScreen.d.ts","sourceRoot":"","sources":["../../../../src/components/preview/ItemDetailScreen.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAgBnE,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,wBAAwB,CAAC;IAC/B,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,IAAI,EACJ,SAAS,EACT,UAAU,EACV,MAAM,GACP,EAAE,qBAAqB,+BA+FvB"}