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