@buoy-gg/storage 1.7.2

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 (187) hide show
  1. package/README.md +607 -0
  2. package/lib/commonjs/index.js +34 -0
  3. package/lib/commonjs/package.json +1 -0
  4. package/lib/commonjs/preset.js +94 -0
  5. package/lib/commonjs/storage/components/DiffViewer/DiffOptionsPanel.js +356 -0
  6. package/lib/commonjs/storage/components/DiffViewer/TreeDiffViewer.js +29 -0
  7. package/lib/commonjs/storage/components/DiffViewer/components/DiffSummary.js +121 -0
  8. package/lib/commonjs/storage/components/DiffViewer/modes/ThemedSplitView.js +419 -0
  9. package/lib/commonjs/storage/components/DiffViewer/themes/diffThemes.js +122 -0
  10. package/lib/commonjs/storage/components/GameUIStorageBrowser.js +924 -0
  11. package/lib/commonjs/storage/components/GameUIStorageStats.js +746 -0
  12. package/lib/commonjs/storage/components/MMKVInstanceInfoPanel.js +257 -0
  13. package/lib/commonjs/storage/components/MMKVInstanceSelector.js +418 -0
  14. package/lib/commonjs/storage/components/SelectionActionBar.js +224 -0
  15. package/lib/commonjs/storage/components/StorageActionButtons.js +239 -0
  16. package/lib/commonjs/storage/components/StorageActions.js +192 -0
  17. package/lib/commonjs/storage/components/StorageBrowserMode.js +31 -0
  18. package/lib/commonjs/storage/components/StorageEventDetailContent.js +1025 -0
  19. package/lib/commonjs/storage/components/StorageEventFilterView.js +141 -0
  20. package/lib/commonjs/storage/components/StorageEventListener.js +357 -0
  21. package/lib/commonjs/storage/components/StorageEventsSection.js +24 -0
  22. package/lib/commonjs/storage/components/StorageFilterCards.js +345 -0
  23. package/lib/commonjs/storage/components/StorageFilterViewV2.js +42 -0
  24. package/lib/commonjs/storage/components/StorageKeyCard.js +516 -0
  25. package/lib/commonjs/storage/components/StorageKeyRow.js +356 -0
  26. package/lib/commonjs/storage/components/StorageKeySection.js +105 -0
  27. package/lib/commonjs/storage/components/StorageKeyStats.js +344 -0
  28. package/lib/commonjs/storage/components/StorageModalWithTabs.js +871 -0
  29. package/lib/commonjs/storage/components/StorageSection.js +43 -0
  30. package/lib/commonjs/storage/hooks/useAsyncStorageKeys.js +126 -0
  31. package/lib/commonjs/storage/hooks/useMMKVInstances.js +221 -0
  32. package/lib/commonjs/storage/hooks/useMMKVKeys.js +362 -0
  33. package/lib/commonjs/storage/hooks/useTickEverySecond.js +21 -0
  34. package/lib/commonjs/storage/index.js +148 -0
  35. package/lib/commonjs/storage/types.js +5 -0
  36. package/lib/commonjs/storage/utils/AsyncStorageListener.js +510 -0
  37. package/lib/commonjs/storage/utils/MMKVInstanceRegistry.js +202 -0
  38. package/lib/commonjs/storage/utils/MMKVListener.js +380 -0
  39. package/lib/commonjs/storage/utils/clearAllStorage.js +47 -0
  40. package/lib/commonjs/storage/utils/index.js +180 -0
  41. package/lib/commonjs/storage/utils/lineDiff.js +363 -0
  42. package/lib/commonjs/storage/utils/mmkvAvailability.js +62 -0
  43. package/lib/commonjs/storage/utils/mmkvTypeDetection.js +139 -0
  44. package/lib/commonjs/storage/utils/objectDiff.js +157 -0
  45. package/lib/commonjs/storage/utils/safeAsyncStorage.js +140 -0
  46. package/lib/commonjs/storage/utils/storageActionHelpers.js +46 -0
  47. package/lib/commonjs/storage/utils/storageQueryUtils.js +35 -0
  48. package/lib/commonjs/storage/utils/valueType.js +18 -0
  49. package/lib/module/index.js +7 -0
  50. package/lib/module/preset.js +89 -0
  51. package/lib/module/storage/components/DiffViewer/DiffOptionsPanel.js +352 -0
  52. package/lib/module/storage/components/DiffViewer/TreeDiffViewer.js +25 -0
  53. package/lib/module/storage/components/DiffViewer/components/DiffSummary.js +117 -0
  54. package/lib/module/storage/components/DiffViewer/modes/ThemedSplitView.js +415 -0
  55. package/lib/module/storage/components/DiffViewer/themes/diffThemes.js +118 -0
  56. package/lib/module/storage/components/GameUIStorageBrowser.js +922 -0
  57. package/lib/module/storage/components/GameUIStorageStats.js +742 -0
  58. package/lib/module/storage/components/MMKVInstanceInfoPanel.js +253 -0
  59. package/lib/module/storage/components/MMKVInstanceSelector.js +414 -0
  60. package/lib/module/storage/components/SelectionActionBar.js +221 -0
  61. package/lib/module/storage/components/StorageActionButtons.js +236 -0
  62. package/lib/module/storage/components/StorageActions.js +189 -0
  63. package/lib/module/storage/components/StorageBrowserMode.js +27 -0
  64. package/lib/module/storage/components/StorageEventDetailContent.js +1020 -0
  65. package/lib/module/storage/components/StorageEventFilterView.js +137 -0
  66. package/lib/module/storage/components/StorageEventListener.js +354 -0
  67. package/lib/module/storage/components/StorageEventsSection.js +20 -0
  68. package/lib/module/storage/components/StorageFilterCards.js +341 -0
  69. package/lib/module/storage/components/StorageFilterViewV2.js +38 -0
  70. package/lib/module/storage/components/StorageKeyCard.js +513 -0
  71. package/lib/module/storage/components/StorageKeyRow.js +353 -0
  72. package/lib/module/storage/components/StorageKeySection.js +101 -0
  73. package/lib/module/storage/components/StorageKeyStats.js +340 -0
  74. package/lib/module/storage/components/StorageModalWithTabs.js +867 -0
  75. package/lib/module/storage/components/StorageSection.js +40 -0
  76. package/lib/module/storage/hooks/useAsyncStorageKeys.js +121 -0
  77. package/lib/module/storage/hooks/useMMKVInstances.js +216 -0
  78. package/lib/module/storage/hooks/useMMKVKeys.js +359 -0
  79. package/lib/module/storage/hooks/useTickEverySecond.js +18 -0
  80. package/lib/module/storage/index.js +25 -0
  81. package/lib/module/storage/types.js +3 -0
  82. package/lib/module/storage/utils/AsyncStorageListener.js +500 -0
  83. package/lib/module/storage/utils/MMKVInstanceRegistry.js +196 -0
  84. package/lib/module/storage/utils/MMKVListener.js +367 -0
  85. package/lib/module/storage/utils/clearAllStorage.js +42 -0
  86. package/lib/module/storage/utils/index.js +22 -0
  87. package/lib/module/storage/utils/lineDiff.js +359 -0
  88. package/lib/module/storage/utils/mmkvAvailability.js +56 -0
  89. package/lib/module/storage/utils/mmkvTypeDetection.js +133 -0
  90. package/lib/module/storage/utils/objectDiff.js +153 -0
  91. package/lib/module/storage/utils/safeAsyncStorage.js +134 -0
  92. package/lib/module/storage/utils/storageActionHelpers.js +42 -0
  93. package/lib/module/storage/utils/storageQueryUtils.js +30 -0
  94. package/lib/module/storage/utils/valueType.js +14 -0
  95. package/lib/typescript/index.d.ts +3 -0
  96. package/lib/typescript/index.d.ts.map +1 -0
  97. package/lib/typescript/preset.d.ts +90 -0
  98. package/lib/typescript/preset.d.ts.map +1 -0
  99. package/lib/typescript/storage/components/DiffViewer/DiffOptionsPanel.d.ts +18 -0
  100. package/lib/typescript/storage/components/DiffViewer/DiffOptionsPanel.d.ts.map +1 -0
  101. package/lib/typescript/storage/components/DiffViewer/TreeDiffViewer.d.ts +7 -0
  102. package/lib/typescript/storage/components/DiffViewer/TreeDiffViewer.d.ts.map +1 -0
  103. package/lib/typescript/storage/components/DiffViewer/components/DiffSummary.d.ts +12 -0
  104. package/lib/typescript/storage/components/DiffViewer/components/DiffSummary.d.ts.map +1 -0
  105. package/lib/typescript/storage/components/DiffViewer/modes/ThemedSplitView.d.ts +13 -0
  106. package/lib/typescript/storage/components/DiffViewer/modes/ThemedSplitView.d.ts.map +1 -0
  107. package/lib/typescript/storage/components/DiffViewer/themes/diffThemes.d.ts +64 -0
  108. package/lib/typescript/storage/components/DiffViewer/themes/diffThemes.d.ts.map +1 -0
  109. package/lib/typescript/storage/components/GameUIStorageBrowser.d.ts +16 -0
  110. package/lib/typescript/storage/components/GameUIStorageBrowser.d.ts.map +1 -0
  111. package/lib/typescript/storage/components/GameUIStorageStats.d.ts +7 -0
  112. package/lib/typescript/storage/components/GameUIStorageStats.d.ts.map +1 -0
  113. package/lib/typescript/storage/components/MMKVInstanceInfoPanel.d.ts +42 -0
  114. package/lib/typescript/storage/components/MMKVInstanceInfoPanel.d.ts.map +1 -0
  115. package/lib/typescript/storage/components/MMKVInstanceSelector.d.ts +35 -0
  116. package/lib/typescript/storage/components/MMKVInstanceSelector.d.ts.map +1 -0
  117. package/lib/typescript/storage/components/SelectionActionBar.d.ts +21 -0
  118. package/lib/typescript/storage/components/SelectionActionBar.d.ts.map +1 -0
  119. package/lib/typescript/storage/components/StorageActionButtons.d.ts +21 -0
  120. package/lib/typescript/storage/components/StorageActionButtons.d.ts.map +1 -0
  121. package/lib/typescript/storage/components/StorageActions.d.ts +10 -0
  122. package/lib/typescript/storage/components/StorageActions.d.ts.map +1 -0
  123. package/lib/typescript/storage/components/StorageBrowserMode.d.ts +18 -0
  124. package/lib/typescript/storage/components/StorageBrowserMode.d.ts.map +1 -0
  125. package/lib/typescript/storage/components/StorageEventDetailContent.d.ts +40 -0
  126. package/lib/typescript/storage/components/StorageEventDetailContent.d.ts.map +1 -0
  127. package/lib/typescript/storage/components/StorageEventFilterView.d.ts +11 -0
  128. package/lib/typescript/storage/components/StorageEventFilterView.d.ts.map +1 -0
  129. package/lib/typescript/storage/components/StorageEventListener.d.ts +6 -0
  130. package/lib/typescript/storage/components/StorageEventListener.d.ts.map +1 -0
  131. package/lib/typescript/storage/components/StorageEventsSection.d.ts +7 -0
  132. package/lib/typescript/storage/components/StorageEventsSection.d.ts.map +1 -0
  133. package/lib/typescript/storage/components/StorageFilterCards.d.ts +36 -0
  134. package/lib/typescript/storage/components/StorageFilterCards.d.ts.map +1 -0
  135. package/lib/typescript/storage/components/StorageFilterViewV2.d.ts +9 -0
  136. package/lib/typescript/storage/components/StorageFilterViewV2.d.ts.map +1 -0
  137. package/lib/typescript/storage/components/StorageKeyCard.d.ts +17 -0
  138. package/lib/typescript/storage/components/StorageKeyCard.d.ts.map +1 -0
  139. package/lib/typescript/storage/components/StorageKeyRow.d.ts +15 -0
  140. package/lib/typescript/storage/components/StorageKeyRow.d.ts.map +1 -0
  141. package/lib/typescript/storage/components/StorageKeySection.d.ts +25 -0
  142. package/lib/typescript/storage/components/StorageKeySection.d.ts.map +1 -0
  143. package/lib/typescript/storage/components/StorageKeyStats.d.ts +15 -0
  144. package/lib/typescript/storage/components/StorageKeyStats.d.ts.map +1 -0
  145. package/lib/typescript/storage/components/StorageModalWithTabs.d.ts +13 -0
  146. package/lib/typescript/storage/components/StorageModalWithTabs.d.ts.map +1 -0
  147. package/lib/typescript/storage/components/StorageSection.d.ts +10 -0
  148. package/lib/typescript/storage/components/StorageSection.d.ts.map +1 -0
  149. package/lib/typescript/storage/hooks/useAsyncStorageKeys.d.ts +10 -0
  150. package/lib/typescript/storage/hooks/useAsyncStorageKeys.d.ts.map +1 -0
  151. package/lib/typescript/storage/hooks/useMMKVInstances.d.ts +114 -0
  152. package/lib/typescript/storage/hooks/useMMKVInstances.d.ts.map +1 -0
  153. package/lib/typescript/storage/hooks/useMMKVKeys.d.ts +94 -0
  154. package/lib/typescript/storage/hooks/useMMKVKeys.d.ts.map +1 -0
  155. package/lib/typescript/storage/hooks/useTickEverySecond.d.ts +6 -0
  156. package/lib/typescript/storage/hooks/useTickEverySecond.d.ts.map +1 -0
  157. package/lib/typescript/storage/index.d.ts +15 -0
  158. package/lib/typescript/storage/index.d.ts.map +1 -0
  159. package/lib/typescript/storage/types.d.ts +41 -0
  160. package/lib/typescript/storage/types.d.ts.map +1 -0
  161. package/lib/typescript/storage/utils/AsyncStorageListener.d.ts +195 -0
  162. package/lib/typescript/storage/utils/AsyncStorageListener.d.ts.map +1 -0
  163. package/lib/typescript/storage/utils/MMKVInstanceRegistry.d.ts +224 -0
  164. package/lib/typescript/storage/utils/MMKVInstanceRegistry.d.ts.map +1 -0
  165. package/lib/typescript/storage/utils/MMKVListener.d.ts +218 -0
  166. package/lib/typescript/storage/utils/MMKVListener.d.ts.map +1 -0
  167. package/lib/typescript/storage/utils/clearAllStorage.d.ts +11 -0
  168. package/lib/typescript/storage/utils/clearAllStorage.d.ts.map +1 -0
  169. package/lib/typescript/storage/utils/index.d.ts +8 -0
  170. package/lib/typescript/storage/utils/index.d.ts.map +1 -0
  171. package/lib/typescript/storage/utils/lineDiff.d.ts +34 -0
  172. package/lib/typescript/storage/utils/lineDiff.d.ts.map +1 -0
  173. package/lib/typescript/storage/utils/mmkvAvailability.d.ts +23 -0
  174. package/lib/typescript/storage/utils/mmkvAvailability.d.ts.map +1 -0
  175. package/lib/typescript/storage/utils/mmkvTypeDetection.d.ts +71 -0
  176. package/lib/typescript/storage/utils/mmkvTypeDetection.d.ts.map +1 -0
  177. package/lib/typescript/storage/utils/objectDiff.d.ts +35 -0
  178. package/lib/typescript/storage/utils/objectDiff.d.ts.map +1 -0
  179. package/lib/typescript/storage/utils/safeAsyncStorage.d.ts +56 -0
  180. package/lib/typescript/storage/utils/safeAsyncStorage.d.ts.map +1 -0
  181. package/lib/typescript/storage/utils/storageActionHelpers.d.ts +5 -0
  182. package/lib/typescript/storage/utils/storageActionHelpers.d.ts.map +1 -0
  183. package/lib/typescript/storage/utils/storageQueryUtils.d.ts +6 -0
  184. package/lib/typescript/storage/utils/storageQueryUtils.d.ts.map +1 -0
  185. package/lib/typescript/storage/utils/valueType.d.ts +3 -0
  186. package/lib/typescript/storage/utils/valueType.d.ts.map +1 -0
  187. package/package.json +68 -0
@@ -0,0 +1,415 @@
1
+ "use strict";
2
+
3
+ import { Fragment } from "react";
4
+ import { View, Text, ScrollView, StyleSheet } from "react-native";
5
+ import { computeLineDiff, DiffType } from "../../../utils/lineDiff";
6
+ import { DiffSummary } from "../components/DiffSummary";
7
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
8
+ export function ThemedSplitView({
9
+ oldValue,
10
+ newValue,
11
+ theme,
12
+ options = {
13
+ hideLineNumbers: false,
14
+ disableWordDiff: false,
15
+ showDiffOnly: false,
16
+ compareMethod: "words",
17
+ contextLines: 3,
18
+ lineOffset: 0
19
+ },
20
+ showThemeName = false
21
+ }) {
22
+ // Compute line-by-line diff with options
23
+ const diffComputeOptions = {
24
+ compareMethod: options.compareMethod,
25
+ disableWordDiff: options.disableWordDiff,
26
+ showDiffOnly: options.showDiffOnly,
27
+ contextLines: options.contextLines
28
+ };
29
+ const lineDiffs = computeLineDiff(oldValue, newValue, diffComputeOptions);
30
+
31
+ // Create dynamic styles based on theme
32
+ const dynamicStyles = createDynamicStyles(theme);
33
+
34
+ // Render word diff content
35
+ const renderWordDiff = wordDiffs => {
36
+ return wordDiffs.map((word, idx) => {
37
+ let backgroundColor = "transparent";
38
+ if (word.type === DiffType.ADDED) {
39
+ backgroundColor = theme.addedWordHighlight;
40
+ } else if (word.type === DiffType.REMOVED) {
41
+ backgroundColor = theme.removedWordHighlight;
42
+ }
43
+ return /*#__PURE__*/_jsx(Text, {
44
+ style: [dynamicStyles.wordDiff, {
45
+ backgroundColor
46
+ }],
47
+ children: word.value
48
+ }, idx);
49
+ });
50
+ };
51
+
52
+ // Get colors for diff type
53
+ const getDiffColors = (type, isModified = false) => {
54
+ if (isModified) {
55
+ return {
56
+ background: theme.modifiedBackground,
57
+ text: theme.modifiedText,
58
+ markerBg: theme.markerModifiedBackground
59
+ };
60
+ }
61
+ switch (type) {
62
+ case DiffType.ADDED:
63
+ return {
64
+ background: theme.addedBackground,
65
+ text: theme.addedText,
66
+ markerBg: theme.markerAddedBackground
67
+ };
68
+ case DiffType.REMOVED:
69
+ return {
70
+ background: theme.removedBackground,
71
+ text: theme.removedText,
72
+ markerBg: theme.markerRemovedBackground
73
+ };
74
+ case DiffType.DEFAULT:
75
+ return {
76
+ background: theme.unchangedBackground,
77
+ text: theme.unchangedText,
78
+ markerBg: "transparent"
79
+ };
80
+ default:
81
+ return {
82
+ background: theme.unchangedBackground,
83
+ text: theme.unchangedText,
84
+ markerBg: "transparent"
85
+ };
86
+ }
87
+ };
88
+
89
+ // Render a single line side (left or right)
90
+ const renderLineSide = (lineNumber, content, type, marker, isEmpty = false) => {
91
+ if (isEmpty) {
92
+ return /*#__PURE__*/_jsxs(_Fragment, {
93
+ children: [!options.hideLineNumbers && /*#__PURE__*/_jsx(View, {
94
+ style: [dynamicStyles.gutter, dynamicStyles.emptyGutter],
95
+ children: /*#__PURE__*/_jsx(Text, {
96
+ style: dynamicStyles.lineNumber,
97
+ children: " "
98
+ })
99
+ }), /*#__PURE__*/_jsx(View, {
100
+ style: [dynamicStyles.marker, dynamicStyles.emptyMarker],
101
+ children: /*#__PURE__*/_jsx(Text, {
102
+ style: dynamicStyles.markerText,
103
+ children: " "
104
+ })
105
+ }), /*#__PURE__*/_jsx(View, {
106
+ style: [dynamicStyles.contentCell, dynamicStyles.emptyContent],
107
+ children: /*#__PURE__*/_jsx(Text, {
108
+ style: dynamicStyles.content,
109
+ children: " "
110
+ })
111
+ })]
112
+ });
113
+ }
114
+ const colors = getDiffColors(type);
115
+ return /*#__PURE__*/_jsxs(_Fragment, {
116
+ children: [!options.hideLineNumbers && /*#__PURE__*/_jsx(View, {
117
+ style: [dynamicStyles.gutter, {
118
+ backgroundColor: theme.lineNumberBackground
119
+ }],
120
+ children: /*#__PURE__*/_jsx(Text, {
121
+ style: dynamicStyles.lineNumber,
122
+ children: lineNumber || " "
123
+ })
124
+ }), /*#__PURE__*/_jsx(View, {
125
+ style: [dynamicStyles.marker, {
126
+ backgroundColor: colors.markerBg
127
+ }],
128
+ children: /*#__PURE__*/_jsx(Text, {
129
+ style: [dynamicStyles.markerText, {
130
+ color: theme.markerText
131
+ }],
132
+ children: marker
133
+ })
134
+ }), /*#__PURE__*/_jsx(View, {
135
+ style: [dynamicStyles.contentCell, {
136
+ backgroundColor: colors.background
137
+ }],
138
+ children: /*#__PURE__*/_jsx(Text, {
139
+ style: [dynamicStyles.content, {
140
+ color: colors.text
141
+ }],
142
+ children: Array.isArray(content) ? renderWordDiff(content) : content || " "
143
+ })
144
+ })]
145
+ });
146
+ };
147
+
148
+ // Check if we should show a separator (gap in line numbers)
149
+ const shouldShowSeparator = (idx, diffs) => {
150
+ if (!options.showDiffOnly || idx === 0) return false;
151
+ const prevDiff = diffs[idx - 1];
152
+ const currDiff = diffs[idx];
153
+
154
+ // Check for gap in line numbers
155
+ const leftGap = currDiff.leftLineNumber && prevDiff.leftLineNumber && currDiff.leftLineNumber - prevDiff.leftLineNumber > 1;
156
+ const rightGap = currDiff.rightLineNumber && prevDiff.rightLineNumber && currDiff.rightLineNumber - prevDiff.rightLineNumber > 1;
157
+ return leftGap || rightGap;
158
+ };
159
+
160
+ // Render a complete row with both left and right sides
161
+ const renderDiffRow = (diff, idx, diffs) => {
162
+ const isRemoved = diff.type === DiffType.REMOVED;
163
+ const isAdded = diff.type === DiffType.ADDED;
164
+ const isModified = diff.type === DiffType.MODIFIED;
165
+ const isDefault = diff.type === DiffType.DEFAULT;
166
+ return /*#__PURE__*/_jsxs(Fragment, {
167
+ children: [shouldShowSeparator(idx, diffs) && /*#__PURE__*/_jsx(View, {
168
+ style: dynamicStyles.separator,
169
+ children: /*#__PURE__*/_jsx(Text, {
170
+ style: dynamicStyles.separatorText,
171
+ children: "\u2022 \u2022 \u2022"
172
+ })
173
+ }), /*#__PURE__*/_jsxs(View, {
174
+ style: dynamicStyles.row,
175
+ children: [/*#__PURE__*/_jsx(View, {
176
+ style: dynamicStyles.leftSide,
177
+ children: isRemoved || isModified || isDefault ? renderLineSide(diff.leftLineNumber, diff.leftContent, isModified ? DiffType.REMOVED : diff.type, isRemoved || isModified ? "-" : " ") : renderLineSide(undefined, undefined, DiffType.DEFAULT, " ", true)
178
+ }), /*#__PURE__*/_jsx(View, {
179
+ style: dynamicStyles.centerDivider
180
+ }), /*#__PURE__*/_jsx(View, {
181
+ style: dynamicStyles.rightSide,
182
+ children: isAdded || isModified || isDefault ? renderLineSide(diff.rightLineNumber, diff.rightContent, isModified ? DiffType.ADDED : diff.type, isAdded || isModified ? "+" : " ") : renderLineSide(undefined, undefined, DiffType.DEFAULT, " ", true)
183
+ })]
184
+ })]
185
+ }, idx);
186
+ };
187
+ return /*#__PURE__*/_jsxs(View, {
188
+ style: [dynamicStyles.container, theme.glowColor && {
189
+ shadowColor: theme.glowColor,
190
+ shadowOffset: {
191
+ width: 0,
192
+ height: 0
193
+ },
194
+ shadowOpacity: theme.neonIntensity && theme.neonIntensity > 0.7 ? 0.5 : theme.neonIntensity && theme.neonIntensity > 0.3 ? 0.3 : 0.1,
195
+ shadowRadius: theme.neonIntensity && theme.neonIntensity > 0.7 ? 10 : theme.neonIntensity && theme.neonIntensity > 0.3 ? 5 : 2
196
+ }],
197
+ children: [showThemeName && /*#__PURE__*/_jsxs(View, {
198
+ style: dynamicStyles.themeBadge,
199
+ children: [/*#__PURE__*/_jsx(Text, {
200
+ style: dynamicStyles.themeName,
201
+ children: theme.name
202
+ }), /*#__PURE__*/_jsx(Text, {
203
+ style: dynamicStyles.themeDescription,
204
+ children: theme.description
205
+ })]
206
+ }), /*#__PURE__*/_jsxs(View, {
207
+ style: dynamicStyles.header,
208
+ children: [/*#__PURE__*/_jsx(View, {
209
+ style: dynamicStyles.headerLeft,
210
+ children: /*#__PURE__*/_jsx(Text, {
211
+ style: dynamicStyles.headerTitle,
212
+ children: "PREV"
213
+ })
214
+ }), /*#__PURE__*/_jsx(View, {
215
+ style: dynamicStyles.divider
216
+ }), /*#__PURE__*/_jsx(View, {
217
+ style: dynamicStyles.headerRight,
218
+ children: /*#__PURE__*/_jsx(Text, {
219
+ style: dynamicStyles.headerTitle,
220
+ children: "CUR"
221
+ })
222
+ })]
223
+ }), /*#__PURE__*/_jsx(DiffSummary, {
224
+ added: lineDiffs.filter(d => d.type === DiffType.ADDED).length,
225
+ removed: lineDiffs.filter(d => d.type === DiffType.REMOVED).length,
226
+ modified: lineDiffs.filter(d => d.type === DiffType.MODIFIED).length,
227
+ theme: theme
228
+ }), /*#__PURE__*/_jsx(ScrollView, {
229
+ style: dynamicStyles.scrollView,
230
+ showsVerticalScrollIndicator: false,
231
+ contentContainerStyle: dynamicStyles.scrollContent,
232
+ children: lineDiffs.length === 0 ? /*#__PURE__*/_jsx(View, {
233
+ style: dynamicStyles.emptyState,
234
+ children: /*#__PURE__*/_jsx(Text, {
235
+ style: dynamicStyles.emptyText,
236
+ children: options.showDiffOnly ? "No differences found" : "No content to display"
237
+ })
238
+ }) : lineDiffs.map((diff, idx) => renderDiffRow(diff, idx, lineDiffs))
239
+ })]
240
+ });
241
+ }
242
+
243
+ // Create dynamic styles based on theme
244
+ function createDynamicStyles(theme) {
245
+ return StyleSheet.create({
246
+ container: {
247
+ height: 400,
248
+ backgroundColor: theme.background,
249
+ borderRadius: 8,
250
+ overflow: "hidden",
251
+ borderWidth: 1,
252
+ borderColor: theme.borderColor
253
+ },
254
+ themeBadge: {
255
+ backgroundColor: theme.panelBackground,
256
+ paddingHorizontal: 12,
257
+ paddingVertical: 8,
258
+ borderBottomWidth: 1,
259
+ borderBottomColor: theme.borderColor
260
+ },
261
+ themeName: {
262
+ fontSize: 12,
263
+ fontWeight: "700",
264
+ color: theme.accentColor || theme.unchangedText,
265
+ fontFamily: "monospace",
266
+ letterSpacing: 0.5
267
+ },
268
+ themeDescription: {
269
+ fontSize: 10,
270
+ color: theme.unchangedText,
271
+ fontFamily: "monospace",
272
+ marginTop: 2,
273
+ opacity: 0.8
274
+ },
275
+ header: {
276
+ flexDirection: "row",
277
+ backgroundColor: theme.headerBackground,
278
+ borderBottomWidth: 1,
279
+ borderBottomColor: theme.borderColor
280
+ },
281
+ headerLeft: {
282
+ flex: 1,
283
+ paddingVertical: 8,
284
+ paddingHorizontal: 12
285
+ },
286
+ headerRight: {
287
+ flex: 1,
288
+ paddingVertical: 8,
289
+ paddingHorizontal: 12
290
+ },
291
+ headerTitle: {
292
+ fontSize: 10,
293
+ fontWeight: "700",
294
+ color: theme.accentColor || theme.unchangedText,
295
+ fontFamily: "monospace",
296
+ letterSpacing: 0.5,
297
+ textTransform: "uppercase"
298
+ },
299
+ divider: {
300
+ width: 1,
301
+ backgroundColor: theme.dividerColor
302
+ },
303
+ scrollView: {
304
+ flex: 1
305
+ },
306
+ scrollContent: {
307
+ paddingBottom: 10
308
+ },
309
+ row: {
310
+ flexDirection: "row",
311
+ minHeight: 20
312
+ },
313
+ leftSide: {
314
+ flex: 1,
315
+ flexDirection: "row"
316
+ },
317
+ rightSide: {
318
+ flex: 1,
319
+ flexDirection: "row"
320
+ },
321
+ centerDivider: {
322
+ width: 1,
323
+ backgroundColor: theme.dividerColor
324
+ },
325
+ gutter: {
326
+ width: 35,
327
+ paddingHorizontal: 4,
328
+ justifyContent: "center",
329
+ alignItems: "flex-end",
330
+ backgroundColor: theme.lineNumberBackground,
331
+ borderRightWidth: 1,
332
+ borderRightColor: theme.lineNumberBorder
333
+ },
334
+ emptyGutter: {
335
+ backgroundColor: theme.contextBackground
336
+ },
337
+ lineNumber: {
338
+ fontSize: 9,
339
+ fontFamily: "monospace",
340
+ color: theme.lineNumberText
341
+ },
342
+ marker: {
343
+ width: 20,
344
+ justifyContent: "center",
345
+ alignItems: "center"
346
+ },
347
+ emptyMarker: {
348
+ backgroundColor: theme.contextBackground
349
+ },
350
+ markerText: {
351
+ fontSize: 10,
352
+ fontFamily: "monospace",
353
+ fontWeight: "600"
354
+ },
355
+ contentCell: {
356
+ flex: 1,
357
+ paddingHorizontal: 8,
358
+ paddingVertical: 2
359
+ },
360
+ emptyContent: {
361
+ backgroundColor: theme.contextBackground
362
+ },
363
+ content: {
364
+ fontSize: 10,
365
+ fontFamily: "monospace",
366
+ lineHeight: 16
367
+ },
368
+ wordDiff: {
369
+ fontSize: 10,
370
+ fontFamily: "monospace"
371
+ },
372
+ summaryBar: {
373
+ flexDirection: "row",
374
+ alignItems: "center",
375
+ justifyContent: "center",
376
+ gap: 16,
377
+ paddingVertical: 6,
378
+ backgroundColor: theme.summaryBackground,
379
+ borderTopWidth: 1,
380
+ borderTopColor: theme.borderColor
381
+ },
382
+ summaryItem: {
383
+ flexDirection: "row",
384
+ alignItems: "center"
385
+ },
386
+ summaryText: {
387
+ fontSize: 10,
388
+ fontFamily: "monospace",
389
+ fontWeight: "700"
390
+ },
391
+ separator: {
392
+ height: 20,
393
+ justifyContent: "center",
394
+ alignItems: "center",
395
+ backgroundColor: theme.separatorBackground
396
+ },
397
+ separatorText: {
398
+ fontSize: 8,
399
+ color: theme.separatorText,
400
+ fontFamily: "monospace",
401
+ letterSpacing: 2
402
+ },
403
+ emptyState: {
404
+ padding: 40,
405
+ alignItems: "center",
406
+ justifyContent: "center"
407
+ },
408
+ emptyText: {
409
+ fontSize: 11,
410
+ color: theme.emptyStateText,
411
+ fontStyle: "italic",
412
+ fontFamily: "monospace"
413
+ }
414
+ });
415
+ }
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Diff Viewer Theme System
5
+ *
6
+ * Only three official themes:
7
+ * 1. Git Classic - Traditional Git colors
8
+ * 2. VS Code Dark Modern - Exact VS Code Dark Modern theme
9
+ * 3. Dev Tools Default - Custom dark theme for our dev tools
10
+ */
11
+
12
+ /**
13
+ * Git Classic Theme
14
+ * Traditional Git diff colors - simple and familiar
15
+ */
16
+ export const gitClassicTheme = {
17
+ name: "Git Classic",
18
+ description: "Traditional Git diff colors - simple and familiar",
19
+ background: "#FFFFFF",
20
+ panelBackground: "#F8F8F8",
21
+ headerBackground: "#F0F0F0",
22
+ addedBackground: "#E6FFED",
23
+ removedBackground: "#FFEEF0",
24
+ modifiedBackground: "#FFF5DD",
25
+ unchangedBackground: "transparent",
26
+ contextBackground: "#FAFAFA",
27
+ addedText: "#22863A",
28
+ removedText: "#CB2431",
29
+ modifiedText: "#B08800",
30
+ unchangedText: "#24292E",
31
+ addedWordHighlight: "#ACF2BD",
32
+ removedWordHighlight: "#FDB8C0",
33
+ lineNumberBackground: "#F6F8FA",
34
+ lineNumberText: "#959DA5",
35
+ lineNumberBorder: "#E1E4E8",
36
+ markerAddedBackground: "#CDFFD8",
37
+ markerRemovedBackground: "#FFDCE0",
38
+ markerModifiedBackground: "#FFF5B1",
39
+ markerText: "#666666",
40
+ borderColor: "#E1E4E8",
41
+ dividerColor: "#E1E4E8",
42
+ summaryBackground: "#F6F8FA",
43
+ summaryAddedText: "#28A745",
44
+ summaryRemovedText: "#D73A49",
45
+ summaryModifiedText: "#0366D6",
46
+ emptyStateText: "#586069",
47
+ separatorBackground: "#F6F8FA",
48
+ separatorText: "#586069"
49
+ };
50
+
51
+ /**
52
+ * Dev Tools Default Theme
53
+ * Clean dark theme using our gameUIColors
54
+ */
55
+ export const devToolsDefaultTheme = {
56
+ name: "Dev Tools Default",
57
+ description: "Clean dark theme with our game UI colors",
58
+ // Use our gameUIColors-inspired dark theme
59
+ background: "#0A0E1A",
60
+ // Dark background
61
+ panelBackground: "#0F1420",
62
+ // Slightly lighter panel
63
+ headerBackground: "#141925",
64
+ // Header background
65
+
66
+ // Diff colors with our cyan/yellow/red scheme
67
+ addedBackground: "rgba(74, 255, 159, 0.1)",
68
+ // Green-cyan for additions
69
+ removedBackground: "rgba(255, 82, 82, 0.1)",
70
+ // Red for removals
71
+ modifiedBackground: "rgba(0, 184, 230, 0.1)",
72
+ // Cyan for modifications
73
+ unchangedBackground: "transparent",
74
+ contextBackground: "rgba(255, 255, 255, 0.02)",
75
+ // Text colors
76
+ addedText: "#4AFF9F",
77
+ // Bright green-cyan
78
+ removedText: "#FF5252",
79
+ // Bright red
80
+ modifiedText: "#00B8E6",
81
+ // Bright cyan
82
+ unchangedText: "#B8BFC9",
83
+ // Muted text
84
+
85
+ // Word-level highlights
86
+ addedWordHighlight: "rgba(74, 255, 159, 0.3)",
87
+ removedWordHighlight: "rgba(255, 82, 82, 0.3)",
88
+ // UI elements
89
+ lineNumberBackground: "#0A0E1A",
90
+ lineNumberText: "#7A8599",
91
+ lineNumberBorder: "#1F2937",
92
+ // Markers
93
+ markerAddedBackground: "rgba(74, 255, 159, 0.2)",
94
+ markerRemovedBackground: "rgba(255, 82, 82, 0.2)",
95
+ markerModifiedBackground: "rgba(0, 184, 230, 0.2)",
96
+ markerText: "#7A8599",
97
+ // Borders and dividers
98
+ borderColor: "#1F2937",
99
+ dividerColor: "#1F2937",
100
+ // Summary bar
101
+ summaryBackground: "#0F1420",
102
+ summaryAddedText: "#4AFF9F",
103
+ summaryRemovedText: "#FF5252",
104
+ summaryModifiedText: "#00B8E6",
105
+ // Empty state
106
+ emptyStateText: "#7A8599",
107
+ // Separator
108
+ separatorBackground: "#141925",
109
+ separatorText: "#7A8599"
110
+ };
111
+
112
+ /**
113
+ * Theme collection
114
+ */
115
+ export const diffThemes = {
116
+ gitClassic: gitClassicTheme,
117
+ devToolsDefault: devToolsDefaultTheme
118
+ };