@buoy-gg/storage 7.0.40 → 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 (215) hide show
  1. package/README.md +11 -86
  2. package/lib/commonjs/index.js +1 -346
  3. package/lib/commonjs/preset.js +1 -80
  4. package/lib/commonjs/storage/components/DiffViewer/TreeDiffViewer.js +1 -36
  5. package/lib/commonjs/storage/components/DiffViewer/modes/ThemedSplitView.js +1 -12
  6. package/lib/commonjs/storage/components/DiffViewer/themes/diffThemes.js +1 -24
  7. package/lib/commonjs/storage/components/GameUIStorageBrowser.js +3 -1258
  8. package/lib/commonjs/storage/components/MMKVInstanceInfoPanel.js +1 -257
  9. package/lib/commonjs/storage/components/MMKVInstanceSelector.js +1 -418
  10. package/lib/commonjs/storage/components/SelectionActionBar.js +1 -207
  11. package/lib/commonjs/storage/components/StorageActionButtons.js +1 -241
  12. package/lib/commonjs/storage/components/StorageBrowserMode.js +1 -61
  13. package/lib/commonjs/storage/components/StorageEventActionButton.js +1 -121
  14. package/lib/commonjs/storage/components/StorageEventCard.js +1 -117
  15. package/lib/commonjs/storage/components/StorageEventDetailContent.js +1 -494
  16. package/lib/commonjs/storage/components/StorageEventFilterView.js +1 -159
  17. package/lib/commonjs/storage/components/StorageEventsSection.js +1 -24
  18. package/lib/commonjs/storage/components/StorageFilterCards.js +1 -231
  19. package/lib/commonjs/storage/components/StorageKeyCard.js +1 -520
  20. package/lib/commonjs/storage/components/StorageKeyDetailScreen.js +1 -579
  21. package/lib/commonjs/storage/components/StorageKeyRow.js +1 -559
  22. package/lib/commonjs/storage/components/StorageKeySection.js +1 -160
  23. package/lib/commonjs/storage/components/StorageKeyStats.js +1 -344
  24. package/lib/commonjs/storage/components/StorageModalWithTabs.js +1 -954
  25. package/lib/commonjs/storage/components/StorageSaveNotice.js +1 -171
  26. package/lib/commonjs/storage/components/StorageSection.js +1 -43
  27. package/lib/commonjs/storage/components/StorageTypeFilterBar.js +1 -143
  28. package/lib/commonjs/storage/hooks/useAsyncStorageKeys.js +1 -141
  29. package/lib/commonjs/storage/hooks/useMMKVInstances.js +1 -210
  30. package/lib/commonjs/storage/hooks/useMMKVKeys.js +1 -376
  31. package/lib/commonjs/storage/hooks/useSecureStoreKeys.js +1 -159
  32. package/lib/commonjs/storage/hooks/useStorageEvents.js +1 -61
  33. package/lib/commonjs/storage/stores/storageEventStore.js +1 -312
  34. package/lib/commonjs/storage/sync/storageSyncAdapter.js +1 -478
  35. package/lib/commonjs/storage/types.js +1 -5
  36. package/lib/commonjs/storage/utils/AsyncStorageListener.js +1 -691
  37. package/lib/commonjs/storage/utils/AsyncStorageListener.web.js +1 -0
  38. package/lib/commonjs/storage/utils/MMKVInstanceRegistry.js +1 -203
  39. package/lib/commonjs/storage/utils/MMKVListener.js +1 -416
  40. package/lib/commonjs/storage/utils/SecureStoreRegistry.js +1 -200
  41. package/lib/commonjs/storage/utils/asyncStorageCompat.js +1 -89
  42. package/lib/commonjs/storage/utils/browserStorageLifecycle.js +1 -0
  43. package/lib/commonjs/storage/utils/browserStorageLifecycle.web.js +1 -0
  44. package/lib/commonjs/storage/utils/clearAllStorage.js +1 -48
  45. package/lib/commonjs/storage/utils/deleteStorageKeys.js +1 -82
  46. package/lib/commonjs/storage/utils/lineDiff.js +1 -30
  47. package/lib/commonjs/storage/utils/mmkvAvailability.js +1 -62
  48. package/lib/commonjs/storage/utils/mmkvAvailability.web.js +1 -0
  49. package/lib/commonjs/storage/utils/mmkvTypeDetection.js +1 -154
  50. package/lib/commonjs/storage/utils/requiredStorageKeyScope.js +1 -17
  51. package/lib/commonjs/storage/utils/setStorageValue.js +1 -218
  52. package/lib/commonjs/storage/utils/snapshotProvider.js +1 -382
  53. package/lib/commonjs/storage/utils/storageActionHelpers.js +1 -46
  54. package/lib/commonjs/storage/utils/storageBrowserRefresh.js +1 -49
  55. package/lib/commonjs/storage/utils/storageLabels.js +1 -0
  56. package/lib/commonjs/storage/utils/storageLabels.web.js +1 -0
  57. package/lib/commonjs/storage/utils/storageOps.js +1 -53
  58. package/lib/commonjs/storage/utils/storageQueryUtils.js +1 -35
  59. package/lib/commonjs/storage/utils/storageTimeTravelUtils.js +1 -288
  60. package/lib/commonjs/storage/utils/valueType.js +1 -83
  61. package/lib/module/index.js +1 -112
  62. package/lib/module/preset.js +1 -76
  63. package/lib/module/storage/components/DiffViewer/TreeDiffViewer.js +1 -32
  64. package/lib/module/storage/components/DiffViewer/modes/ThemedSplitView.js +1 -9
  65. package/lib/module/storage/components/DiffViewer/themes/diffThemes.js +1 -10
  66. package/lib/module/storage/components/GameUIStorageBrowser.js +3 -1256
  67. package/lib/module/storage/components/MMKVInstanceInfoPanel.js +1 -253
  68. package/lib/module/storage/components/MMKVInstanceSelector.js +1 -414
  69. package/lib/module/storage/components/SelectionActionBar.js +1 -204
  70. package/lib/module/storage/components/StorageActionButtons.js +1 -237
  71. package/lib/module/storage/components/StorageBrowserMode.js +1 -57
  72. package/lib/module/storage/components/StorageEventActionButton.js +1 -118
  73. package/lib/module/storage/components/StorageEventCard.js +1 -112
  74. package/lib/module/storage/components/StorageEventDetailContent.js +1 -490
  75. package/lib/module/storage/components/StorageEventFilterView.js +1 -155
  76. package/lib/module/storage/components/StorageEventsSection.js +1 -20
  77. package/lib/module/storage/components/StorageFilterCards.js +1 -227
  78. package/lib/module/storage/components/StorageKeyCard.js +1 -517
  79. package/lib/module/storage/components/StorageKeyDetailScreen.js +1 -577
  80. package/lib/module/storage/components/StorageKeyRow.js +1 -554
  81. package/lib/module/storage/components/StorageKeySection.js +1 -155
  82. package/lib/module/storage/components/StorageKeyStats.js +1 -341
  83. package/lib/module/storage/components/StorageModalWithTabs.js +1 -949
  84. package/lib/module/storage/components/StorageSaveNotice.js +1 -168
  85. package/lib/module/storage/components/StorageSection.js +1 -40
  86. package/lib/module/storage/components/StorageTypeFilterBar.js +1 -138
  87. package/lib/module/storage/hooks/useAsyncStorageKeys.js +1 -136
  88. package/lib/module/storage/hooks/useMMKVInstances.js +1 -204
  89. package/lib/module/storage/hooks/useMMKVKeys.js +1 -371
  90. package/lib/module/storage/hooks/useSecureStoreKeys.js +1 -156
  91. package/lib/module/storage/hooks/useStorageEvents.js +1 -58
  92. package/lib/module/storage/stores/storageEventStore.js +1 -301
  93. package/lib/module/storage/sync/storageSyncAdapter.js +1 -474
  94. package/lib/module/storage/types.js +1 -3
  95. package/lib/module/storage/utils/AsyncStorageListener.js +1 -679
  96. package/lib/module/storage/utils/AsyncStorageListener.web.js +1 -0
  97. package/lib/module/storage/utils/MMKVInstanceRegistry.js +1 -197
  98. package/lib/module/storage/utils/MMKVListener.js +1 -403
  99. package/lib/module/storage/utils/SecureStoreRegistry.js +1 -194
  100. package/lib/module/storage/utils/asyncStorageCompat.js +1 -81
  101. package/lib/module/storage/utils/browserStorageLifecycle.js +1 -0
  102. package/lib/module/storage/utils/browserStorageLifecycle.web.js +1 -0
  103. package/lib/module/storage/utils/clearAllStorage.js +1 -43
  104. package/lib/module/storage/utils/deleteStorageKeys.js +1 -78
  105. package/lib/module/storage/utils/lineDiff.js +1 -12
  106. package/lib/module/storage/utils/mmkvAvailability.js +1 -56
  107. package/lib/module/storage/utils/mmkvAvailability.web.js +1 -0
  108. package/lib/module/storage/utils/mmkvTypeDetection.js +1 -148
  109. package/lib/module/storage/utils/requiredStorageKeyScope.js +1 -13
  110. package/lib/module/storage/utils/setStorageValue.js +1 -209
  111. package/lib/module/storage/utils/snapshotProvider.js +1 -380
  112. package/lib/module/storage/utils/storageActionHelpers.js +1 -42
  113. package/lib/module/storage/utils/storageBrowserRefresh.js +1 -44
  114. package/lib/module/storage/utils/storageLabels.js +1 -0
  115. package/lib/module/storage/utils/storageLabels.web.js +1 -0
  116. package/lib/module/storage/utils/storageOps.js +1 -46
  117. package/lib/module/storage/utils/storageQueryUtils.js +1 -30
  118. package/lib/module/storage/utils/storageTimeTravelUtils.js +1 -281
  119. package/lib/module/storage/utils/valueType.js +1 -76
  120. package/lib/typescript/index.d.ts +1 -0
  121. package/lib/typescript/storage/components/MMKVInstanceSelector.d.ts +0 -8
  122. package/lib/typescript/storage/components/StorageEventCard.d.ts +0 -7
  123. package/lib/typescript/storage/components/StorageKeyRow.d.ts +2 -6
  124. package/lib/typescript/storage/components/StorageTypeFilterBar.d.ts +0 -15
  125. package/lib/typescript/storage/hooks/useSecureStoreKeys.d.ts +2 -2
  126. package/lib/typescript/storage/sync/storageSyncAdapter.d.ts +7 -13
  127. package/lib/typescript/storage/utils/AsyncStorageListener.web.d.ts +24 -0
  128. package/lib/typescript/storage/utils/browserStorageLifecycle.d.ts +3 -0
  129. package/lib/typescript/storage/utils/browserStorageLifecycle.web.d.ts +2 -0
  130. package/lib/typescript/storage/utils/mmkvAvailability.web.d.ts +4 -0
  131. package/lib/typescript/storage/utils/storageLabels.d.ts +8 -0
  132. package/lib/typescript/storage/utils/storageLabels.web.d.ts +8 -0
  133. package/lib/web/index.mjs +4 -0
  134. package/package.json +40 -14
  135. package/lib/commonjs/storage/components/DiffViewer/DiffOptionsPanel.js +0 -356
  136. package/lib/commonjs/storage/components/DiffViewer/components/DiffSummary.js +0 -122
  137. package/lib/commonjs/storage/components/StorageKeyEditorScreen.js +0 -414
  138. package/lib/commonjs/storage/components/StorageScalarKeyEditor.js +0 -61
  139. package/lib/commonjs/storage/components/StorageValueEditModal.js +0 -24
  140. package/lib/commonjs/storage/hooks/useKeyEditor.js +0 -31
  141. package/lib/commonjs/storage/hooks/useTreeDraft.js +0 -25
  142. package/lib/module/storage/components/DiffViewer/DiffOptionsPanel.js +0 -352
  143. package/lib/module/storage/components/DiffViewer/components/DiffSummary.js +0 -118
  144. package/lib/module/storage/components/StorageKeyEditorScreen.js +0 -410
  145. package/lib/module/storage/components/StorageScalarKeyEditor.js +0 -57
  146. package/lib/module/storage/components/StorageValueEditModal.js +0 -20
  147. package/lib/module/storage/hooks/useKeyEditor.js +0 -27
  148. package/lib/module/storage/hooks/useTreeDraft.js +0 -21
  149. package/lib/typescript/index.d.ts.map +0 -1
  150. package/lib/typescript/preset.d.ts.map +0 -1
  151. package/lib/typescript/storage/components/DiffViewer/DiffOptionsPanel.d.ts +0 -18
  152. package/lib/typescript/storage/components/DiffViewer/DiffOptionsPanel.d.ts.map +0 -1
  153. package/lib/typescript/storage/components/DiffViewer/TreeDiffViewer.d.ts.map +0 -1
  154. package/lib/typescript/storage/components/DiffViewer/components/DiffSummary.d.ts +0 -12
  155. package/lib/typescript/storage/components/DiffViewer/components/DiffSummary.d.ts.map +0 -1
  156. package/lib/typescript/storage/components/DiffViewer/modes/ThemedSplitView.d.ts.map +0 -1
  157. package/lib/typescript/storage/components/DiffViewer/themes/diffThemes.d.ts.map +0 -1
  158. package/lib/typescript/storage/components/GameUIStorageBrowser.d.ts.map +0 -1
  159. package/lib/typescript/storage/components/MMKVInstanceInfoPanel.d.ts.map +0 -1
  160. package/lib/typescript/storage/components/MMKVInstanceSelector.d.ts.map +0 -1
  161. package/lib/typescript/storage/components/SelectionActionBar.d.ts.map +0 -1
  162. package/lib/typescript/storage/components/StorageActionButtons.d.ts.map +0 -1
  163. package/lib/typescript/storage/components/StorageBrowserMode.d.ts.map +0 -1
  164. package/lib/typescript/storage/components/StorageEventActionButton.d.ts.map +0 -1
  165. package/lib/typescript/storage/components/StorageEventCard.d.ts.map +0 -1
  166. package/lib/typescript/storage/components/StorageEventDetailContent.d.ts.map +0 -1
  167. package/lib/typescript/storage/components/StorageEventFilterView.d.ts.map +0 -1
  168. package/lib/typescript/storage/components/StorageEventsSection.d.ts.map +0 -1
  169. package/lib/typescript/storage/components/StorageFilterCards.d.ts.map +0 -1
  170. package/lib/typescript/storage/components/StorageKeyCard.d.ts.map +0 -1
  171. package/lib/typescript/storage/components/StorageKeyDetailScreen.d.ts.map +0 -1
  172. package/lib/typescript/storage/components/StorageKeyEditorScreen.d.ts +0 -42
  173. package/lib/typescript/storage/components/StorageKeyEditorScreen.d.ts.map +0 -1
  174. package/lib/typescript/storage/components/StorageKeyRow.d.ts.map +0 -1
  175. package/lib/typescript/storage/components/StorageKeySection.d.ts.map +0 -1
  176. package/lib/typescript/storage/components/StorageKeyStats.d.ts.map +0 -1
  177. package/lib/typescript/storage/components/StorageModalWithTabs.d.ts.map +0 -1
  178. package/lib/typescript/storage/components/StorageSaveNotice.d.ts.map +0 -1
  179. package/lib/typescript/storage/components/StorageScalarKeyEditor.d.ts +0 -24
  180. package/lib/typescript/storage/components/StorageScalarKeyEditor.d.ts.map +0 -1
  181. package/lib/typescript/storage/components/StorageSection.d.ts.map +0 -1
  182. package/lib/typescript/storage/components/StorageTypeFilterBar.d.ts.map +0 -1
  183. package/lib/typescript/storage/components/StorageValueEditModal.d.ts +0 -14
  184. package/lib/typescript/storage/components/StorageValueEditModal.d.ts.map +0 -1
  185. package/lib/typescript/storage/hooks/useAsyncStorageKeys.d.ts.map +0 -1
  186. package/lib/typescript/storage/hooks/useKeyEditor.d.ts +0 -27
  187. package/lib/typescript/storage/hooks/useKeyEditor.d.ts.map +0 -1
  188. package/lib/typescript/storage/hooks/useMMKVInstances.d.ts.map +0 -1
  189. package/lib/typescript/storage/hooks/useMMKVKeys.d.ts.map +0 -1
  190. package/lib/typescript/storage/hooks/useSecureStoreKeys.d.ts.map +0 -1
  191. package/lib/typescript/storage/hooks/useStorageEvents.d.ts.map +0 -1
  192. package/lib/typescript/storage/hooks/useTreeDraft.d.ts +0 -16
  193. package/lib/typescript/storage/hooks/useTreeDraft.d.ts.map +0 -1
  194. package/lib/typescript/storage/stores/storageEventStore.d.ts.map +0 -1
  195. package/lib/typescript/storage/sync/storageSyncAdapter.d.ts.map +0 -1
  196. package/lib/typescript/storage/types.d.ts.map +0 -1
  197. package/lib/typescript/storage/utils/AsyncStorageListener.d.ts.map +0 -1
  198. package/lib/typescript/storage/utils/MMKVInstanceRegistry.d.ts.map +0 -1
  199. package/lib/typescript/storage/utils/MMKVListener.d.ts.map +0 -1
  200. package/lib/typescript/storage/utils/SecureStoreRegistry.d.ts.map +0 -1
  201. package/lib/typescript/storage/utils/asyncStorageCompat.d.ts.map +0 -1
  202. package/lib/typescript/storage/utils/clearAllStorage.d.ts.map +0 -1
  203. package/lib/typescript/storage/utils/deleteStorageKeys.d.ts.map +0 -1
  204. package/lib/typescript/storage/utils/lineDiff.d.ts.map +0 -1
  205. package/lib/typescript/storage/utils/mmkvAvailability.d.ts.map +0 -1
  206. package/lib/typescript/storage/utils/mmkvTypeDetection.d.ts.map +0 -1
  207. package/lib/typescript/storage/utils/requiredStorageKeyScope.d.ts.map +0 -1
  208. package/lib/typescript/storage/utils/setStorageValue.d.ts.map +0 -1
  209. package/lib/typescript/storage/utils/snapshotProvider.d.ts.map +0 -1
  210. package/lib/typescript/storage/utils/storageActionHelpers.d.ts.map +0 -1
  211. package/lib/typescript/storage/utils/storageBrowserRefresh.d.ts.map +0 -1
  212. package/lib/typescript/storage/utils/storageOps.d.ts.map +0 -1
  213. package/lib/typescript/storage/utils/storageQueryUtils.d.ts.map +0 -1
  214. package/lib/typescript/storage/utils/storageTimeTravelUtils.d.ts.map +0 -1
  215. package/lib/typescript/storage/utils/valueType.d.ts.map +0 -1
@@ -1,352 +0,0 @@
1
- "use strict";
2
-
3
- import { View, Text, StyleSheet, TouchableOpacity, Switch } from "react-native";
4
- import { night, Settings, Hash, FileText, Filter, monoFont } from "@buoy-gg/shared-ui";
5
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- const COMPARE_METHODS = [{
7
- id: "chars",
8
- label: "Chars",
9
- description: "Shows every single character change. Best for spotting typos or small edits in strings."
10
- }, {
11
- id: "words",
12
- label: "Words",
13
- description: "Highlights changed words while preserving context. Default mode, ideal for most text changes."
14
- }, {
15
- id: "lines",
16
- label: "Lines",
17
- description: "Shows entire line as changed without word-level detail. Good for completely rewritten lines."
18
- }, {
19
- id: "trimmedLines",
20
- label: "Trim",
21
- description: "Ignores leading/trailing spaces when comparing. Useful when indentation changes."
22
- }];
23
- const CONTEXT_OPTIONS = [0, 1, 3, 5, 10];
24
- export function DiffOptionsPanel({
25
- options,
26
- onOptionsChange,
27
- isExpanded,
28
- onToggleExpanded
29
- }) {
30
- const updateOption = (key, value) => {
31
- onOptionsChange({
32
- ...options,
33
- [key]: value
34
- });
35
- };
36
-
37
- // Check if any non-default options are active
38
- const hasActiveFilters = options.hideLineNumbers || options.disableWordDiff || options.showDiffOnly || options.compareMethod !== "words";
39
- return /*#__PURE__*/_jsxs(View, {
40
- style: styles.container,
41
- children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
42
- style: styles.toggleButton,
43
- onPress: onToggleExpanded,
44
- activeOpacity: 0.7,
45
- children: [/*#__PURE__*/_jsx(Settings, {
46
- size: 12,
47
- color: night.color.accent
48
- }), /*#__PURE__*/_jsx(Text, {
49
- style: styles.toggleText,
50
- children: "Options"
51
- }), hasActiveFilters && /*#__PURE__*/_jsx(View, {
52
- style: styles.activeIndicator,
53
- children: /*#__PURE__*/_jsx(Text, {
54
- style: styles.activeIndicatorText,
55
- children: [options.hideLineNumbers && "No#", options.disableWordDiff && "NoWord", options.showDiffOnly && `Diff${options.contextLines}`, options.compareMethod !== "words" && options.compareMethod].filter(Boolean).join(" ")
56
- })
57
- }), /*#__PURE__*/_jsx(Text, {
58
- style: styles.toggleIndicator,
59
- children: isExpanded ? "▼" : "▶"
60
- })]
61
- }), isExpanded && /*#__PURE__*/_jsxs(View, {
62
- style: styles.optionsContent,
63
- children: [/*#__PURE__*/_jsxs(View, {
64
- style: styles.section,
65
- children: [/*#__PURE__*/_jsx(Text, {
66
- style: styles.sectionTitle,
67
- children: "DISPLAY"
68
- }), /*#__PURE__*/_jsxs(View, {
69
- style: styles.optionContainer,
70
- children: [/*#__PURE__*/_jsxs(View, {
71
- style: styles.option,
72
- children: [/*#__PURE__*/_jsxs(View, {
73
- style: styles.optionLeft,
74
- children: [/*#__PURE__*/_jsx(Hash, {
75
- size: 11,
76
- color: night.color.textSecondary
77
- }), /*#__PURE__*/_jsx(Text, {
78
- style: styles.optionLabel,
79
- children: "Line Numbers"
80
- })]
81
- }), /*#__PURE__*/_jsx(Switch, {
82
- value: !options.hideLineNumbers,
83
- onValueChange: value => updateOption("hideLineNumbers", !value),
84
- trackColor: {
85
- false: night.color.surfaceElevated,
86
- true: night.color.accent
87
- },
88
- thumbColor: night.color.knob,
89
- style: styles.switch
90
- })]
91
- }), /*#__PURE__*/_jsx(Text, {
92
- style: styles.optionDescription,
93
- children: !options.hideLineNumbers ? "Shows line numbers for easier navigation and reference" : "Line numbers hidden for cleaner view"
94
- })]
95
- }), /*#__PURE__*/_jsxs(View, {
96
- style: styles.optionContainer,
97
- children: [/*#__PURE__*/_jsxs(View, {
98
- style: styles.option,
99
- children: [/*#__PURE__*/_jsxs(View, {
100
- style: styles.optionLeft,
101
- children: [/*#__PURE__*/_jsx(FileText, {
102
- size: 11,
103
- color: night.color.textSecondary
104
- }), /*#__PURE__*/_jsx(Text, {
105
- style: styles.optionLabel,
106
- children: "Word Diff"
107
- })]
108
- }), /*#__PURE__*/_jsx(Switch, {
109
- value: !options.disableWordDiff,
110
- onValueChange: value => updateOption("disableWordDiff", !value),
111
- trackColor: {
112
- false: night.color.surfaceElevated,
113
- true: night.color.accent
114
- },
115
- thumbColor: night.color.knob,
116
- style: styles.switch
117
- })]
118
- }), /*#__PURE__*/_jsx(Text, {
119
- style: styles.optionDescription,
120
- children: !options.disableWordDiff ? "Highlights specific words/characters that changed within modified lines" : "Shows entire lines as changed without detailed highlighting"
121
- })]
122
- }), /*#__PURE__*/_jsxs(View, {
123
- style: styles.optionContainer,
124
- children: [/*#__PURE__*/_jsxs(View, {
125
- style: styles.option,
126
- children: [/*#__PURE__*/_jsxs(View, {
127
- style: styles.optionLeft,
128
- children: [/*#__PURE__*/_jsx(Filter, {
129
- size: 11,
130
- color: night.color.textSecondary
131
- }), /*#__PURE__*/_jsx(Text, {
132
- style: styles.optionLabel,
133
- children: "Diff Only"
134
- })]
135
- }), /*#__PURE__*/_jsx(Switch, {
136
- value: options.showDiffOnly,
137
- onValueChange: value => updateOption("showDiffOnly", value),
138
- trackColor: {
139
- false: night.color.surfaceElevated,
140
- true: night.color.accent
141
- },
142
- thumbColor: night.color.knob,
143
- style: styles.switch
144
- })]
145
- }), /*#__PURE__*/_jsx(Text, {
146
- style: styles.optionDescription,
147
- children: options.showDiffOnly ? `Shows only changed lines with ${options.contextLines} lines of context around them` : "Shows complete content with all lines visible"
148
- })]
149
- })]
150
- }), /*#__PURE__*/_jsxs(View, {
151
- style: styles.section,
152
- children: [/*#__PURE__*/_jsx(Text, {
153
- style: styles.sectionTitle,
154
- children: "COMPARE METHOD"
155
- }), /*#__PURE__*/_jsx(View, {
156
- style: styles.methodButtons,
157
- children: COMPARE_METHODS.map(method => /*#__PURE__*/_jsx(TouchableOpacity, {
158
- style: [styles.methodButton, options.compareMethod === method.id && styles.methodButtonActive],
159
- onPress: () => updateOption("compareMethod", method.id),
160
- activeOpacity: 0.7,
161
- children: /*#__PURE__*/_jsx(Text, {
162
- style: [styles.methodButtonText, options.compareMethod === method.id && styles.methodButtonTextActive],
163
- children: method.label
164
- })
165
- }, method.id))
166
- }), /*#__PURE__*/_jsx(Text, {
167
- style: styles.methodDescription,
168
- children: COMPARE_METHODS.find(m => m.id === options.compareMethod)?.description
169
- })]
170
- }), options.showDiffOnly && /*#__PURE__*/_jsxs(View, {
171
- style: styles.section,
172
- children: [/*#__PURE__*/_jsx(Text, {
173
- style: styles.sectionTitle,
174
- children: "CONTEXT LINES"
175
- }), /*#__PURE__*/_jsx(View, {
176
- style: styles.contextButtons,
177
- children: CONTEXT_OPTIONS.map(lines => /*#__PURE__*/_jsx(TouchableOpacity, {
178
- style: [styles.contextButton, options.contextLines === lines && styles.contextButtonActive],
179
- onPress: () => updateOption("contextLines", lines),
180
- activeOpacity: 0.7,
181
- children: /*#__PURE__*/_jsx(Text, {
182
- style: [styles.contextButtonText, options.contextLines === lines && styles.contextButtonTextActive],
183
- children: lines
184
- })
185
- }, lines))
186
- }), /*#__PURE__*/_jsx(Text, {
187
- style: styles.contextDescription,
188
- children: options.contextLines === 0 ? "Shows only the exact lines that changed with no surrounding context" : `Shows ${options.contextLines} unchanged line${options.contextLines === 1 ? "" : "s"} before and after each change for context`
189
- })]
190
- })]
191
- })]
192
- });
193
- }
194
- const styles = StyleSheet.create({
195
- container: {
196
- marginVertical: 8
197
- },
198
- toggleButton: {
199
- flexDirection: "row",
200
- alignItems: "center",
201
- backgroundColor: night.color.surface,
202
- paddingVertical: 6,
203
- paddingHorizontal: 10,
204
- borderRadius: 4,
205
- gap: 6
206
- },
207
- toggleText: {
208
- fontSize: 10,
209
- fontWeight: "600",
210
- color: night.color.accent,
211
- fontFamily: monoFont,
212
- flex: 1
213
- },
214
- toggleIndicator: {
215
- fontSize: 8,
216
- color: night.color.textTertiary,
217
- fontFamily: monoFont
218
- },
219
- optionsContent: {
220
- marginTop: 8,
221
- backgroundColor: night.color.surface,
222
- borderRadius: 6,
223
- padding: 12,
224
- gap: 16
225
- },
226
- section: {
227
- gap: 8
228
- },
229
- sectionTitle: {
230
- fontSize: 9,
231
- fontWeight: "700",
232
- color: night.color.accent,
233
- fontFamily: monoFont,
234
- letterSpacing: 0.5,
235
- marginBottom: 4
236
- },
237
- optionContainer: {
238
- marginBottom: 12
239
- },
240
- option: {
241
- flexDirection: "row",
242
- alignItems: "center",
243
- justifyContent: "space-between",
244
- paddingVertical: 4
245
- },
246
- optionLeft: {
247
- flexDirection: "row",
248
- alignItems: "center",
249
- gap: 8
250
- },
251
- optionLabel: {
252
- fontSize: 11,
253
- color: night.color.text,
254
- fontFamily: monoFont
255
- },
256
- optionDescription: {
257
- fontSize: 9,
258
- color: night.color.textTertiary,
259
- fontFamily: monoFont,
260
- marginTop: 4,
261
- marginLeft: 19,
262
- lineHeight: 12
263
- },
264
- switch: {
265
- transform: [{
266
- scaleX: 0.8
267
- }, {
268
- scaleY: 0.8
269
- }]
270
- },
271
- methodButtons: {
272
- flexDirection: "row",
273
- gap: 4,
274
- flexWrap: "wrap"
275
- },
276
- methodButton: {
277
- paddingVertical: 6,
278
- paddingHorizontal: 10,
279
- backgroundColor: night.color.surfaceElevated,
280
- borderRadius: 4,
281
- borderWidth: 1,
282
- borderColor: night.color.border
283
- },
284
- methodButtonActive: {
285
- backgroundColor: night.color.accentSoft,
286
- borderColor: night.color.accentBorderStrong
287
- },
288
- methodButtonText: {
289
- fontSize: 9,
290
- fontFamily: monoFont,
291
- color: night.color.textTertiary,
292
- fontWeight: "600"
293
- },
294
- methodButtonTextActive: {
295
- color: night.color.accent
296
- },
297
- methodDescription: {
298
- fontSize: 9,
299
- color: night.color.textTertiary,
300
- fontFamily: monoFont,
301
- marginTop: 8,
302
- lineHeight: 12
303
- },
304
- contextButtons: {
305
- flexDirection: "row",
306
- gap: 6
307
- },
308
- contextButton: {
309
- width: 32,
310
- height: 28,
311
- justifyContent: "center",
312
- alignItems: "center",
313
- backgroundColor: night.color.surfaceElevated,
314
- borderRadius: 4,
315
- borderWidth: 1,
316
- borderColor: night.color.border
317
- },
318
- contextButtonActive: {
319
- backgroundColor: night.color.accentSoft,
320
- borderColor: night.color.accentBorderStrong
321
- },
322
- contextButtonText: {
323
- fontSize: 10,
324
- fontFamily: monoFont,
325
- color: night.color.textTertiary,
326
- fontWeight: "600"
327
- },
328
- contextButtonTextActive: {
329
- color: night.color.accent
330
- },
331
- contextDescription: {
332
- fontSize: 9,
333
- color: night.color.textTertiary,
334
- fontFamily: monoFont,
335
- marginTop: 8,
336
- lineHeight: 12
337
- },
338
- activeIndicator: {
339
- backgroundColor: night.color.warningSoft,
340
- paddingHorizontal: 6,
341
- paddingVertical: 2,
342
- borderRadius: 3,
343
- marginLeft: "auto",
344
- marginRight: 4
345
- },
346
- activeIndicatorText: {
347
- fontSize: 8,
348
- fontFamily: monoFont,
349
- color: night.color.warning,
350
- fontWeight: "600"
351
- }
352
- });
@@ -1,118 +0,0 @@
1
- "use strict";
2
-
3
- import { View, Text, StyleSheet } from "react-native";
4
- import { monoFont } from "@buoy-gg/shared-ui";
5
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- export function DiffSummary({
7
- added,
8
- removed,
9
- modified,
10
- theme,
11
- style
12
- }) {
13
- const hasChanges = added > 0 || removed > 0 || modified > 0;
14
- if (!hasChanges) {
15
- return null;
16
- }
17
- return /*#__PURE__*/_jsxs(View, {
18
- style: [styles.container, {
19
- backgroundColor: theme.summaryBackground,
20
- borderTopColor: theme.borderColor
21
- }, style],
22
- children: [added > 0 && /*#__PURE__*/_jsxs(View, {
23
- style: [styles.badge, {
24
- backgroundColor: theme.addedBackground
25
- }],
26
- children: [/*#__PURE__*/_jsx(Text, {
27
- style: [styles.icon, {
28
- color: theme.summaryAddedText
29
- }],
30
- children: "+"
31
- }), /*#__PURE__*/_jsx(Text, {
32
- style: [styles.count, {
33
- color: theme.summaryAddedText
34
- }],
35
- children: added
36
- }), /*#__PURE__*/_jsx(Text, {
37
- style: [styles.label, {
38
- color: theme.summaryAddedText
39
- }],
40
- children: "new"
41
- })]
42
- }), removed > 0 && /*#__PURE__*/_jsxs(View, {
43
- style: [styles.badge, {
44
- backgroundColor: theme.removedBackground
45
- }],
46
- children: [/*#__PURE__*/_jsx(Text, {
47
- style: [styles.icon, {
48
- color: theme.summaryRemovedText
49
- }],
50
- children: "\u2212"
51
- }), /*#__PURE__*/_jsx(Text, {
52
- style: [styles.count, {
53
- color: theme.summaryRemovedText
54
- }],
55
- children: removed
56
- }), /*#__PURE__*/_jsx(Text, {
57
- style: [styles.label, {
58
- color: theme.summaryRemovedText
59
- }],
60
- children: "gone"
61
- })]
62
- }), modified > 0 && /*#__PURE__*/_jsxs(View, {
63
- style: [styles.badge, {
64
- backgroundColor: theme.modifiedBackground
65
- }],
66
- children: [/*#__PURE__*/_jsx(Text, {
67
- style: [styles.icon, {
68
- color: theme.summaryModifiedText
69
- }],
70
- children: "\u2248"
71
- }), /*#__PURE__*/_jsx(Text, {
72
- style: [styles.count, {
73
- color: theme.summaryModifiedText
74
- }],
75
- children: modified
76
- }), /*#__PURE__*/_jsx(Text, {
77
- style: [styles.label, {
78
- color: theme.summaryModifiedText
79
- }],
80
- children: "modified"
81
- })]
82
- })]
83
- });
84
- }
85
- const styles = StyleSheet.create({
86
- container: {
87
- flexDirection: "row",
88
- alignItems: "center",
89
- justifyContent: "center",
90
- gap: 12,
91
- paddingVertical: 6,
92
- paddingHorizontal: 12,
93
- borderTopWidth: 1
94
- },
95
- badge: {
96
- flexDirection: "row",
97
- alignItems: "center",
98
- gap: 3,
99
- paddingHorizontal: 6,
100
- paddingVertical: 2,
101
- borderRadius: 10
102
- },
103
- icon: {
104
- fontSize: 11,
105
- fontFamily: monoFont,
106
- fontWeight: "700"
107
- },
108
- count: {
109
- fontSize: 10,
110
- fontFamily: monoFont,
111
- fontWeight: "600"
112
- },
113
- label: {
114
- fontSize: 9,
115
- fontFamily: monoFont,
116
- opacity: 0.9
117
- }
118
- });