@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,94 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createStorageTool = createStorageTool;
7
+ exports.storageToolPreset = void 0;
8
+ var _floatingToolsCore = require("@buoy-gg/floating-tools-core");
9
+ var _StorageModalWithTabs = require("./storage/components/StorageModalWithTabs");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ /**
12
+ * Pre-configured AsyncStorage browser tool for FloatingDevTools
13
+ *
14
+ * This preset provides a zero-config way to add AsyncStorage inspection to your dev tools.
15
+ * Just import and add it to your apps array!
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * import { storageToolPreset } from '@buoy-gg/storage';
20
+ *
21
+ * const installedApps = [
22
+ * storageToolPreset, // That's it!
23
+ * // ...other tools
24
+ * ];
25
+ * ```
26
+ */
27
+
28
+ /**
29
+ * Pre-configured AsyncStorage browser tool for FloatingDevTools.
30
+ * Includes:
31
+ * - Browse all AsyncStorage keys and values
32
+ * - Edit, delete, and add storage items
33
+ * - Live storage event monitoring
34
+ * - Required key validation
35
+ */
36
+ const storageToolPreset = exports.storageToolPreset = {
37
+ id: "storage",
38
+ name: "STORAGE",
39
+ description: "AsyncStorage browser",
40
+ slot: "both",
41
+ icon: ({
42
+ size
43
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.StorageIcon, {
44
+ size: size
45
+ }),
46
+ component: _StorageModalWithTabs.StorageModalWithTabs,
47
+ props: {
48
+ requiredStorageKeys: [],
49
+ enableSharedModalDimensions: false
50
+ }
51
+ };
52
+
53
+ /**
54
+ * Create a custom AsyncStorage browser tool configuration.
55
+ * Use this if you want to override default settings or provide required storage keys.
56
+ *
57
+ * @example
58
+ * ```tsx
59
+ * import { createStorageTool } from '@buoy-gg/storage';
60
+ *
61
+ * const requiredStorageKeys = [
62
+ * {
63
+ * key: "@app/session",
64
+ * expectedType: "string",
65
+ * description: "User session token",
66
+ * storageType: "async",
67
+ * },
68
+ * ];
69
+ *
70
+ * const myStorageTool = createStorageTool({
71
+ * requiredStorageKeys,
72
+ * colorPreset: "purple",
73
+ * enableSharedModalDimensions: true,
74
+ * });
75
+ * ```
76
+ */
77
+ function createStorageTool(options) {
78
+ return {
79
+ id: options?.id || "storage",
80
+ name: options?.name || "STORAGE",
81
+ description: options?.description || "AsyncStorage browser",
82
+ slot: "both",
83
+ icon: ({
84
+ size
85
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.StorageIcon, {
86
+ size: size
87
+ }),
88
+ component: _StorageModalWithTabs.StorageModalWithTabs,
89
+ props: {
90
+ requiredStorageKeys: options?.requiredStorageKeys || [],
91
+ enableSharedModalDimensions: options?.enableSharedModalDimensions !== undefined ? options.enableSharedModalDimensions : false
92
+ }
93
+ };
94
+ }
@@ -0,0 +1,356 @@
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.macOSColors.semantic.info
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.macOSColors.text.secondary
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.macOSColors.border.default,
90
+ true: _sharedUi.macOSColors.semantic.success + "60"
91
+ },
92
+ thumbColor: !options.hideLineNumbers ? _sharedUi.macOSColors.semantic.success : _sharedUi.macOSColors.text.muted,
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.macOSColors.text.secondary
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.macOSColors.border.default,
117
+ true: _sharedUi.macOSColors.semantic.success + "60"
118
+ },
119
+ thumbColor: !options.disableWordDiff ? _sharedUi.macOSColors.semantic.success : _sharedUi.macOSColors.text.muted,
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.macOSColors.text.secondary
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.macOSColors.border.default,
144
+ true: _sharedUi.macOSColors.semantic.success + "60"
145
+ },
146
+ thumbColor: options.showDiffOnly ? _sharedUi.macOSColors.semantic.success : _sharedUi.macOSColors.text.muted,
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.macOSColors.background.card,
206
+ paddingVertical: 6,
207
+ paddingHorizontal: 10,
208
+ borderRadius: 4,
209
+ gap: 6
210
+ },
211
+ toggleText: {
212
+ fontSize: 10,
213
+ fontWeight: "600",
214
+ color: _sharedUi.macOSColors.semantic.info,
215
+ fontFamily: "monospace",
216
+ flex: 1
217
+ },
218
+ toggleIndicator: {
219
+ fontSize: 8,
220
+ color: _sharedUi.macOSColors.text.muted,
221
+ fontFamily: "monospace"
222
+ },
223
+ optionsContent: {
224
+ marginTop: 8,
225
+ backgroundColor: _sharedUi.macOSColors.background.input,
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.macOSColors.semantic.info,
237
+ fontFamily: "monospace",
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.macOSColors.text.primary,
258
+ fontFamily: "monospace"
259
+ },
260
+ optionDescription: {
261
+ fontSize: 9,
262
+ color: _sharedUi.macOSColors.text.muted,
263
+ fontFamily: "monospace",
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.macOSColors.background.input,
284
+ borderRadius: 4,
285
+ borderWidth: 1,
286
+ borderColor: _sharedUi.macOSColors.border.default
287
+ },
288
+ methodButtonActive: {
289
+ backgroundColor: _sharedUi.macOSColors.semantic.infoBackground,
290
+ borderColor: _sharedUi.macOSColors.semantic.info + "40"
291
+ },
292
+ methodButtonText: {
293
+ fontSize: 9,
294
+ fontFamily: "monospace",
295
+ color: _sharedUi.macOSColors.text.muted,
296
+ fontWeight: "600"
297
+ },
298
+ methodButtonTextActive: {
299
+ color: _sharedUi.macOSColors.semantic.info
300
+ },
301
+ methodDescription: {
302
+ fontSize: 9,
303
+ color: _sharedUi.macOSColors.text.muted,
304
+ fontFamily: "monospace",
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.macOSColors.background.input,
318
+ borderRadius: 4,
319
+ borderWidth: 1,
320
+ borderColor: _sharedUi.macOSColors.border.default
321
+ },
322
+ contextButtonActive: {
323
+ backgroundColor: _sharedUi.macOSColors.semantic.warningBackground,
324
+ borderColor: _sharedUi.macOSColors.semantic.warning + "40"
325
+ },
326
+ contextButtonText: {
327
+ fontSize: 10,
328
+ fontFamily: "monospace",
329
+ color: _sharedUi.macOSColors.text.muted,
330
+ fontWeight: "600"
331
+ },
332
+ contextButtonTextActive: {
333
+ color: _sharedUi.macOSColors.semantic.warning
334
+ },
335
+ contextDescription: {
336
+ fontSize: 9,
337
+ color: _sharedUi.macOSColors.text.muted,
338
+ fontFamily: "monospace",
339
+ marginTop: 8,
340
+ lineHeight: 12
341
+ },
342
+ activeIndicator: {
343
+ backgroundColor: _sharedUi.macOSColors.semantic.warningBackground,
344
+ paddingHorizontal: 6,
345
+ paddingVertical: 2,
346
+ borderRadius: 3,
347
+ marginLeft: "auto",
348
+ marginRight: 4
349
+ },
350
+ activeIndicatorText: {
351
+ fontSize: 8,
352
+ fontFamily: "monospace",
353
+ color: _sharedUi.macOSColors.semantic.warning,
354
+ fontWeight: "600"
355
+ }
356
+ });
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TreeDiffViewer = TreeDiffViewer;
7
+ var _reactNative = require("react-native");
8
+ var _sharedUi = require("@buoy-gg/shared-ui");
9
+ var _dataViewer = require("@buoy-gg/shared-ui/dataViewer");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function TreeDiffViewer({
12
+ oldValue,
13
+ newValue
14
+ }) {
15
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
16
+ style: styles.container,
17
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataViewer.TreeDiffViewer, {
18
+ oldValue: oldValue,
19
+ newValue: newValue,
20
+ theme: "dark"
21
+ })
22
+ });
23
+ }
24
+ const styles = _reactNative.StyleSheet.create({
25
+ container: {
26
+ flex: 1,
27
+ backgroundColor: _sharedUi.gameUIColors.background
28
+ }
29
+ });
@@ -0,0 +1,121 @@
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 _jsxRuntime = require("react/jsx-runtime");
9
+ function DiffSummary({
10
+ added,
11
+ removed,
12
+ modified,
13
+ theme,
14
+ style
15
+ }) {
16
+ const hasChanges = added > 0 || removed > 0 || modified > 0;
17
+ if (!hasChanges) {
18
+ return null;
19
+ }
20
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
21
+ style: [styles.container, {
22
+ backgroundColor: theme.summaryBackground,
23
+ borderTopColor: theme.borderColor
24
+ }, style],
25
+ children: [added > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
26
+ style: [styles.badge, {
27
+ backgroundColor: theme.addedBackground
28
+ }],
29
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
30
+ style: [styles.icon, {
31
+ color: theme.summaryAddedText
32
+ }],
33
+ children: "+"
34
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
35
+ style: [styles.count, {
36
+ color: theme.summaryAddedText
37
+ }],
38
+ children: added
39
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
40
+ style: [styles.label, {
41
+ color: theme.summaryAddedText
42
+ }],
43
+ children: "new"
44
+ })]
45
+ }), removed > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
46
+ style: [styles.badge, {
47
+ backgroundColor: theme.removedBackground
48
+ }],
49
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
50
+ style: [styles.icon, {
51
+ color: theme.summaryRemovedText
52
+ }],
53
+ children: "\u2212"
54
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
55
+ style: [styles.count, {
56
+ color: theme.summaryRemovedText
57
+ }],
58
+ children: removed
59
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
60
+ style: [styles.label, {
61
+ color: theme.summaryRemovedText
62
+ }],
63
+ children: "gone"
64
+ })]
65
+ }), modified > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
66
+ style: [styles.badge, {
67
+ backgroundColor: theme.modifiedBackground
68
+ }],
69
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
70
+ style: [styles.icon, {
71
+ color: theme.summaryModifiedText
72
+ }],
73
+ children: "\u2248"
74
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
75
+ style: [styles.count, {
76
+ color: theme.summaryModifiedText
77
+ }],
78
+ children: modified
79
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
80
+ style: [styles.label, {
81
+ color: theme.summaryModifiedText
82
+ }],
83
+ children: "modified"
84
+ })]
85
+ })]
86
+ });
87
+ }
88
+ const styles = _reactNative.StyleSheet.create({
89
+ container: {
90
+ flexDirection: "row",
91
+ alignItems: "center",
92
+ justifyContent: "center",
93
+ gap: 12,
94
+ paddingVertical: 6,
95
+ paddingHorizontal: 12,
96
+ borderTopWidth: 1
97
+ },
98
+ badge: {
99
+ flexDirection: "row",
100
+ alignItems: "center",
101
+ gap: 3,
102
+ paddingHorizontal: 6,
103
+ paddingVertical: 2,
104
+ borderRadius: 10
105
+ },
106
+ icon: {
107
+ fontSize: 11,
108
+ fontFamily: "monospace",
109
+ fontWeight: "700"
110
+ },
111
+ count: {
112
+ fontSize: 10,
113
+ fontFamily: "monospace",
114
+ fontWeight: "600"
115
+ },
116
+ label: {
117
+ fontSize: 9,
118
+ fontFamily: "monospace",
119
+ opacity: 0.9
120
+ }
121
+ });