@buoy-gg/storage 7.0.40 → 7.0.41

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