@buoy-gg/assets 7.0.38 → 7.0.40

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 (161) hide show
  1. package/lib/commonjs/capture/expo.js +46 -1
  2. package/lib/commonjs/capture/expo.js.map +1 -0
  3. package/lib/commonjs/capture/install.js +91 -1
  4. package/lib/commonjs/capture/install.js.map +1 -0
  5. package/lib/commonjs/capture/isBuoyAsset.js +23 -1
  6. package/lib/commonjs/capture/isBuoyAsset.js.map +1 -0
  7. package/lib/commonjs/capture/measure.js +186 -1
  8. package/lib/commonjs/capture/measure.js.map +1 -0
  9. package/lib/commonjs/capture/metroGraph.js +175 -1
  10. package/lib/commonjs/capture/metroGraph.js.map +1 -0
  11. package/lib/commonjs/capture/registry.js +127 -1
  12. package/lib/commonjs/capture/registry.js.map +1 -0
  13. package/lib/commonjs/components/AssetDetail.js +211 -1
  14. package/lib/commonjs/components/AssetDetail.js.map +1 -0
  15. package/lib/commonjs/components/AssetImage.js +66 -1
  16. package/lib/commonjs/components/AssetImage.js.map +1 -0
  17. package/lib/commonjs/components/AssetRow.js +232 -1
  18. package/lib/commonjs/components/AssetRow.js.map +1 -0
  19. package/lib/commonjs/components/AssetsFilterBar.js +105 -1
  20. package/lib/commonjs/components/AssetsFilterBar.js.map +1 -0
  21. package/lib/commonjs/components/AssetsHeader.js +73 -1
  22. package/lib/commonjs/components/AssetsHeader.js.map +1 -0
  23. package/lib/commonjs/components/AssetsIcon.js +19 -1
  24. package/lib/commonjs/components/AssetsIcon.js.map +1 -0
  25. package/lib/commonjs/components/AssetsListControls.js +81 -1
  26. package/lib/commonjs/components/AssetsListControls.js.map +1 -0
  27. package/lib/commonjs/components/AssetsModal.js +378 -1
  28. package/lib/commonjs/components/AssetsModal.js.map +1 -0
  29. package/lib/commonjs/components/ScanNotice.js +85 -1
  30. package/lib/commonjs/components/ScanNotice.js.map +1 -0
  31. package/lib/commonjs/components/optionalExpoImage.js +16 -1
  32. package/lib/commonjs/components/optionalExpoImage.js.map +1 -0
  33. package/lib/commonjs/components/optionalExpoImage.web.js +11 -1
  34. package/lib/commonjs/components/optionalExpoImage.web.js.map +1 -0
  35. package/lib/commonjs/export.js +62 -1
  36. package/lib/commonjs/export.js.map +1 -0
  37. package/lib/commonjs/format.js +59 -1
  38. package/lib/commonjs/format.js.map +1 -0
  39. package/lib/commonjs/hooks/useAssetRecords.js +22 -1
  40. package/lib/commonjs/hooks/useAssetRecords.js.map +1 -0
  41. package/lib/commonjs/hooks/useAssetScanStatus.js +28 -1
  42. package/lib/commonjs/hooks/useAssetScanStatus.js.map +1 -0
  43. package/lib/commonjs/index.js +313 -1
  44. package/lib/commonjs/index.js.map +1 -0
  45. package/lib/commonjs/preset.js +39 -1
  46. package/lib/commonjs/preset.js.map +1 -0
  47. package/lib/commonjs/remote.js +68 -1
  48. package/lib/commonjs/remote.js.map +1 -0
  49. package/lib/commonjs/state.js +51 -1
  50. package/lib/commonjs/state.js.map +1 -0
  51. package/lib/commonjs/store/assetStore.js +256 -1
  52. package/lib/commonjs/store/assetStore.js.map +1 -0
  53. package/lib/commonjs/store/baseline.js +175 -1
  54. package/lib/commonjs/store/baseline.js.map +1 -0
  55. package/lib/commonjs/store/insights.js +120 -1
  56. package/lib/commonjs/store/insights.js.map +1 -0
  57. package/lib/commonjs/sync/assetsSyncAdapter.js +157 -1
  58. package/lib/commonjs/sync/assetsSyncAdapter.js.map +1 -0
  59. package/lib/commonjs/types.js +2 -1
  60. package/lib/commonjs/types.js.map +1 -0
  61. package/lib/commonjs/utils/deviceScale.js +50 -1
  62. package/lib/commonjs/utils/deviceScale.js.map +1 -0
  63. package/lib/commonjs/utils/testIDs.js +110 -1
  64. package/lib/commonjs/utils/testIDs.js.map +1 -0
  65. package/lib/module/capture/expo.js +41 -1
  66. package/lib/module/capture/expo.js.map +1 -0
  67. package/lib/module/capture/install.js +85 -1
  68. package/lib/module/capture/install.js.map +1 -0
  69. package/lib/module/capture/isBuoyAsset.js +18 -1
  70. package/lib/module/capture/isBuoyAsset.js.map +1 -0
  71. package/lib/module/capture/measure.js +179 -1
  72. package/lib/module/capture/measure.js.map +1 -0
  73. package/lib/module/capture/metroGraph.js +168 -1
  74. package/lib/module/capture/metroGraph.js.map +1 -0
  75. package/lib/module/capture/registry.js +120 -1
  76. package/lib/module/capture/registry.js.map +1 -0
  77. package/lib/module/components/AssetDetail.js +207 -1
  78. package/lib/module/components/AssetDetail.js.map +1 -0
  79. package/lib/module/components/AssetImage.js +62 -1
  80. package/lib/module/components/AssetImage.js.map +1 -0
  81. package/lib/module/components/AssetRow.js +228 -1
  82. package/lib/module/components/AssetRow.js.map +1 -0
  83. package/lib/module/components/AssetsFilterBar.js +101 -1
  84. package/lib/module/components/AssetsFilterBar.js.map +1 -0
  85. package/lib/module/components/AssetsHeader.js +69 -1
  86. package/lib/module/components/AssetsHeader.js.map +1 -0
  87. package/lib/module/components/AssetsIcon.js +12 -1
  88. package/lib/module/components/AssetsIcon.js.map +1 -0
  89. package/lib/module/components/AssetsListControls.js +77 -1
  90. package/lib/module/components/AssetsListControls.js.map +1 -0
  91. package/lib/module/components/AssetsModal.js +373 -1
  92. package/lib/module/components/AssetsModal.js.map +1 -0
  93. package/lib/module/components/ScanNotice.js +81 -1
  94. package/lib/module/components/ScanNotice.js.map +1 -0
  95. package/lib/module/components/optionalExpoImage.js +12 -1
  96. package/lib/module/components/optionalExpoImage.js.map +1 -0
  97. package/lib/module/components/optionalExpoImage.web.js +7 -1
  98. package/lib/module/components/optionalExpoImage.web.js.map +1 -0
  99. package/lib/module/export.js +57 -1
  100. package/lib/module/export.js.map +1 -0
  101. package/lib/module/format.js +51 -1
  102. package/lib/module/format.js.map +1 -0
  103. package/lib/module/hooks/useAssetRecords.js +18 -1
  104. package/lib/module/hooks/useAssetRecords.js.map +1 -0
  105. package/lib/module/hooks/useAssetScanStatus.js +23 -1
  106. package/lib/module/hooks/useAssetScanStatus.js.map +1 -0
  107. package/lib/module/index.js +63 -1
  108. package/lib/module/index.js.map +1 -0
  109. package/lib/module/preset.js +35 -1
  110. package/lib/module/preset.js.map +1 -0
  111. package/lib/module/remote.js +61 -1
  112. package/lib/module/remote.js.map +1 -0
  113. package/lib/module/state.js +47 -1
  114. package/lib/module/state.js.map +1 -0
  115. package/lib/module/store/assetStore.js +240 -1
  116. package/lib/module/store/assetStore.js.map +1 -0
  117. package/lib/module/store/baseline.js +167 -1
  118. package/lib/module/store/baseline.js.map +1 -0
  119. package/lib/module/store/insights.js +116 -1
  120. package/lib/module/store/insights.js.map +1 -0
  121. package/lib/module/sync/assetsSyncAdapter.js +153 -1
  122. package/lib/module/sync/assetsSyncAdapter.js.map +1 -0
  123. package/lib/module/types.js +2 -1
  124. package/lib/module/types.js.map +1 -0
  125. package/lib/module/utils/deviceScale.js +46 -1
  126. package/lib/module/utils/deviceScale.js.map +1 -0
  127. package/lib/module/utils/testIDs.js +99 -1
  128. package/lib/module/utils/testIDs.js.map +1 -0
  129. package/lib/typescript/capture/expo.d.ts.map +1 -0
  130. package/lib/typescript/capture/install.d.ts.map +1 -0
  131. package/lib/typescript/capture/isBuoyAsset.d.ts.map +1 -0
  132. package/lib/typescript/capture/measure.d.ts.map +1 -0
  133. package/lib/typescript/capture/metroGraph.d.ts.map +1 -0
  134. package/lib/typescript/capture/registry.d.ts.map +1 -0
  135. package/lib/typescript/components/AssetDetail.d.ts.map +1 -0
  136. package/lib/typescript/components/AssetImage.d.ts.map +1 -0
  137. package/lib/typescript/components/AssetRow.d.ts.map +1 -0
  138. package/lib/typescript/components/AssetsFilterBar.d.ts.map +1 -0
  139. package/lib/typescript/components/AssetsHeader.d.ts.map +1 -0
  140. package/lib/typescript/components/AssetsIcon.d.ts.map +1 -0
  141. package/lib/typescript/components/AssetsListControls.d.ts.map +1 -0
  142. package/lib/typescript/components/AssetsModal.d.ts.map +1 -0
  143. package/lib/typescript/components/ScanNotice.d.ts.map +1 -0
  144. package/lib/typescript/components/optionalExpoImage.d.ts.map +1 -0
  145. package/lib/typescript/components/optionalExpoImage.web.d.ts.map +1 -0
  146. package/lib/typescript/export.d.ts.map +1 -0
  147. package/lib/typescript/format.d.ts.map +1 -0
  148. package/lib/typescript/hooks/useAssetRecords.d.ts.map +1 -0
  149. package/lib/typescript/hooks/useAssetScanStatus.d.ts.map +1 -0
  150. package/lib/typescript/index.d.ts.map +1 -0
  151. package/lib/typescript/preset.d.ts.map +1 -0
  152. package/lib/typescript/remote.d.ts.map +1 -0
  153. package/lib/typescript/state.d.ts.map +1 -0
  154. package/lib/typescript/store/assetStore.d.ts.map +1 -0
  155. package/lib/typescript/store/baseline.d.ts.map +1 -0
  156. package/lib/typescript/store/insights.d.ts.map +1 -0
  157. package/lib/typescript/sync/assetsSyncAdapter.d.ts.map +1 -0
  158. package/lib/typescript/types.d.ts.map +1 -0
  159. package/lib/typescript/utils/deviceScale.d.ts.map +1 -0
  160. package/lib/typescript/utils/testIDs.d.ts.map +1 -0
  161. package/package.json +2 -2
@@ -1 +1,81 @@
1
- "use strict";import{useEffect,useState}from"react";import{ActivityIndicator,StyleSheet,Text,TouchableOpacity,View}from"react-native";import{night}from"@buoy-gg/shared-ui";import{ASSETS_TEST_IDS}from"../utils/testIDs";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function ScanNotice({status:t,total:e,onRetry:r}){const[s,i]=useState(!1);useEffect(()=>{if(i(!1),!t.graphFetchInFlight)return;const e=null==t.graphFetchStartedAt?0:Math.max(0,Date.now()-t.graphFetchStartedAt),r=setTimeout(()=>i(!0),Math.max(0,8e3-e));return()=>clearTimeout(r)},[t.graphFetchInFlight,t.graphFetchStartedAt]);const n=[];t.graphFetchInFlight&&(n.push(`Finding assets… ${e} found so far.`),s&&n.push("Still finding assets. This is taking longer than usual.")),t.registryAvailable||n.push("The asset registry is unavailable in this environment."),t.graphFetchInFlight||t.graphSupported||!t.graphError||n.push("Showing runtime-registered assets only. A development server is needed to find more assets and measure their sizes.");const o=!t.graphFetchInFlight&&t.graphSupported&&!!t.graphError;return o&&n.push(`Couldn't finish finding assets. Showing ${e} assets found so far.`),t.measuring&&!t.graphFetchInFlight&&n.push("Checking asset sizes…"),0===n.length?null:_jsxs(View,{style:styles.notice,testID:ASSETS_TEST_IDS.notice,children:[t.graphFetchInFlight?_jsx(ActivityIndicator,{size:"small",color:night.color.textSecondary,accessibilityLabel:"Finding assets",testID:ASSETS_TEST_IDS.discoverySpinner}):null,n.map(t=>_jsx(Text,{style:styles.noticeText,testID:ASSETS_TEST_IDS.noticeText,children:t},t)),o?_jsx(TouchableOpacity,{accessibilityRole:"button",onPress:r,testID:ASSETS_TEST_IDS.retry,children:_jsx(Text,{style:styles.retryText,children:"Retry"})}):null]})}const styles=StyleSheet.create({notice:{marginHorizontal:10,marginBottom:8,padding:10,borderRadius:8,borderWidth:1,borderColor:night.color.border,backgroundColor:night.color.surface,gap:4},noticeText:{color:night.color.textSecondary,fontSize:11},retryText:{color:night.color.text,fontSize:12,paddingVertical:6}});
1
+ "use strict";
2
+
3
+ import { useEffect, useState } from "react";
4
+ import { ActivityIndicator, StyleSheet, Text, TouchableOpacity, View } from "react-native";
5
+ import { night } from "@buoy-gg/shared-ui";
6
+ import { ASSETS_TEST_IDS } from "../utils/testIDs";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ export function ScanNotice({
9
+ status,
10
+ total,
11
+ onRetry
12
+ }) {
13
+ const [slow, setSlow] = useState(false);
14
+ useEffect(() => {
15
+ setSlow(false);
16
+ if (!status.graphFetchInFlight) return;
17
+ // Start locally for older snapshots that omit the device timestamp.
18
+ const elapsed = status.graphFetchStartedAt == null ? 0 : Math.max(0, Date.now() - status.graphFetchStartedAt);
19
+ const timer = setTimeout(() => setSlow(true), Math.max(0, 8_000 - elapsed));
20
+ return () => clearTimeout(timer);
21
+ }, [status.graphFetchInFlight, status.graphFetchStartedAt]);
22
+ const notices = [];
23
+ if (status.graphFetchInFlight) {
24
+ notices.push(`Finding assets… ${total} found so far.`);
25
+ if (slow) notices.push("Still finding assets. This is taking longer than usual.");
26
+ }
27
+ if (!status.registryAvailable) {
28
+ notices.push("The asset registry is unavailable in this environment.");
29
+ }
30
+ if (!status.graphFetchInFlight && !status.graphSupported && status.graphError) {
31
+ notices.push("Showing runtime-registered assets only. A development server is needed to find more assets and measure their sizes.");
32
+ }
33
+ const failed = !status.graphFetchInFlight && status.graphSupported && !!status.graphError;
34
+ if (failed) notices.push(`Couldn't finish finding assets. Showing ${total} assets found so far.`);
35
+ if (status.measuring && !status.graphFetchInFlight) notices.push("Checking asset sizes…");
36
+ if (notices.length === 0) return null;
37
+ return /*#__PURE__*/_jsxs(View, {
38
+ style: styles.notice,
39
+ testID: ASSETS_TEST_IDS.notice,
40
+ children: [status.graphFetchInFlight ? /*#__PURE__*/_jsx(ActivityIndicator, {
41
+ size: "small",
42
+ color: night.color.textSecondary,
43
+ accessibilityLabel: "Finding assets",
44
+ testID: ASSETS_TEST_IDS.discoverySpinner
45
+ }) : null, notices.map(n => /*#__PURE__*/_jsx(Text, {
46
+ style: styles.noticeText,
47
+ testID: ASSETS_TEST_IDS.noticeText,
48
+ children: n
49
+ }, n)), failed ? /*#__PURE__*/_jsx(TouchableOpacity, {
50
+ accessibilityRole: "button",
51
+ onPress: onRetry,
52
+ testID: ASSETS_TEST_IDS.retry,
53
+ children: /*#__PURE__*/_jsx(Text, {
54
+ style: styles.retryText,
55
+ children: "Retry"
56
+ })
57
+ }) : null]
58
+ });
59
+ }
60
+ const styles = StyleSheet.create({
61
+ notice: {
62
+ marginHorizontal: 10,
63
+ marginBottom: 8,
64
+ padding: 10,
65
+ borderRadius: 8,
66
+ borderWidth: 1,
67
+ borderColor: night.color.border,
68
+ backgroundColor: night.color.surface,
69
+ gap: 4
70
+ },
71
+ noticeText: {
72
+ color: night.color.textSecondary,
73
+ fontSize: 11
74
+ },
75
+ retryText: {
76
+ color: night.color.text,
77
+ fontSize: 12,
78
+ paddingVertical: 6
79
+ }
80
+ });
81
+ //# sourceMappingURL=ScanNotice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useState","ActivityIndicator","StyleSheet","Text","TouchableOpacity","View","night","ASSETS_TEST_IDS","jsx","_jsx","jsxs","_jsxs","ScanNotice","status","total","onRetry","slow","setSlow","graphFetchInFlight","elapsed","graphFetchStartedAt","Math","max","Date","now","timer","setTimeout","clearTimeout","notices","push","registryAvailable","graphSupported","graphError","failed","measuring","length","style","styles","notice","testID","children","size","color","textSecondary","accessibilityLabel","discoverySpinner","map","n","noticeText","accessibilityRole","onPress","retry","retryText","create","marginHorizontal","marginBottom","padding","borderRadius","borderWidth","borderColor","border","backgroundColor","surface","gap","fontSize","text","paddingVertical"],"sourceRoot":"../../../src","sources":["components/ScanNotice.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,iBAAiB,EAAEC,UAAU,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AAC1F,SAASC,KAAK,QAAQ,oBAAoB;AAE1C,SAASC,eAAe,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnD,OAAO,SAASC,UAAUA,CAAC;EAAEC,MAAM;EAAEC,KAAK;EAAEC;AAI5C,CAAC,EAAE;EACD,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGjB,QAAQ,CAAC,KAAK,CAAC;EACvCD,SAAS,CAAC,MAAM;IACdkB,OAAO,CAAC,KAAK,CAAC;IACd,IAAI,CAACJ,MAAM,CAACK,kBAAkB,EAAE;IAChC;IACA,MAAMC,OAAO,GAAGN,MAAM,CAACO,mBAAmB,IAAI,IAAI,GAC9C,CAAC,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGX,MAAM,CAACO,mBAAmB,CAAC;IAC5D,MAAMK,KAAK,GAAGC,UAAU,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EAAE;IAAEE,eAAe,EAAE;EAAE;AACzE,CAAC,CAAC","ignoreList":[]}
@@ -1 +1,12 @@
1
- "use strict";let ExpoImage=null;try{ExpoImage=require("expo-image").Image??null}catch{}export function getExpoPreviewImage(){return ExpoImage}
1
+ "use strict";
2
+
3
+ let ExpoImage = null;
4
+ try {
5
+ ExpoImage = require("expo-image").Image ?? null;
6
+ } catch {
7
+ // Optional peer: the package or its native module may be unavailable.
8
+ }
9
+ export function getExpoPreviewImage() {
10
+ return ExpoImage;
11
+ }
12
+ //# sourceMappingURL=optionalExpoImage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ExpoImage","require","Image","getExpoPreviewImage"],"sourceRoot":"../../../src","sources":["components/optionalExpoImage.ts"],"mappings":";;AAWA,IAAIA,SAAiD,GAAG,IAAI;AAC5D,IAAI;EACFA,SAAS,GAAGC,OAAO,CAAC,YAAY,CAAC,CAACC,KAAK,IAAI,IAAI;AACjD,CAAC,CAAC,MAAM;EACN;AAAA;AAGF,OAAO,SAASC,mBAAmBA,CAAA,EAA2C;EAC5E,OAAOH,SAAS;AAClB","ignoreList":[]}
@@ -1 +1,7 @@
1
- "use strict";export function getExpoPreviewImage(){return null}
1
+ "use strict";
2
+
3
+ /** Browser image elements already support SVG. */
4
+ export function getExpoPreviewImage() {
5
+ return null;
6
+ }
7
+ //# sourceMappingURL=optionalExpoImage.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getExpoPreviewImage"],"sourceRoot":"../../../src","sources":["components/optionalExpoImage.web.ts"],"mappings":";;AAAA;AACA,OAAO,SAASA,mBAAmBA,CAAA,EAAS;EAC1C,OAAO,IAAI;AACb","ignoreList":[]}
@@ -1 +1,57 @@
1
- "use strict";import{formatBytes,formatDimensions,formatScales}from"./format";import{estDecodedBytes}from"./store/assetStore";export function formatAssetMarkdown(e){const s=[`# Asset: ${e.name}.${e.type}`,"",`- Kind: ${e.kind}`,"- Status: "+(e.loaded?"loaded at runtime":"not observed in the runtime registry")];"image"===e.kind&&s.push(`- Dimensions: ${formatDimensions(e)} (logical)`),e.scales.length&&s.push(`- Scales: ${formatScales(e.scales)}`),null!=e.sizeBytes&&"measured"===e.sizeSource&&s.push(`- Size (all variants): ${formatBytes(e.sizeBytes)}`);const t=estDecodedBytes(e);return t>0&&s.push(`- Decoded memory: ~${formatBytes(t)}`),e.hash&&s.push(`- Hash: ${e.hash}`),e.httpServerLocation&&s.push(`- Location: ${e.httpServerLocation}`),e.fileSystemLocation&&s.push(`- Source dir: ${e.fileSystemLocation}`),e.resolvedUri&&s.push(`- Resolved URI: ${e.resolvedUri}`),s.join("\n")}export function formatInventoryMarkdown(e,s,t,o,n){const a=["# Asset inventory","",`${s.total} assets · ${s.loaded} loaded · ${s.neverLoaded} not observed`+(s.totalBytes>0?` · ${formatBytes(s.totalBytes)} measured (${s.measuredCount}/${s.total})`:"")];if(o.fontFamilies.length&&a.push(`Fonts loaded: ${o.fontFamilies.join(", ")}`),o.graphSupported||a.push(o.graphError?`_Metro bundle graph unavailable (${o.graphError}) — runtime-registered assets only._`:"_No Metro bundle graph — runtime-registered assets only (release build)._"),n){const e=null!=n.netBytes?`${n.netBytes>=0?"+":"−"}${formatBytes(Math.abs(n.netBytes))} net`:"net size unknown";a.push("",`## Since baseline (${new Date(n.baselineSavedAt).toISOString()})`,`- ${n.added.length} added · ${n.removed.length} removed · ${n.grown.length} grew · ${e}`);for(const e of n.removed.slice(0,20))a.push(`- removed: ${e.name}.${e.type}`)}const r=[];t.neverLoaded.length&&r.push(`- ${t.neverLoaded.length} shipped but not observed`),t.duplicates.length&&r.push(`- ${t.duplicates.length} duplicate content groups`),t.webpCandidates.length&&r.push(`- ${t.webpCandidates.length} WebP conversion candidates`),t.scaleGaps.length&&r.push(`- ${t.scaleGaps.length} scale-coverage gaps`),t.overDecode.length&&r.push(`- ${t.overDecode.length} images decoding larger than 2× the screen`),t.heavyGifs.length&&r.push(`- ${t.heavyGifs.length} heavy GIFs (convert to video/Lottie)`),t.heavyFonts.length&&r.push(`- ${t.heavyFonts.length} heavy fonts (subset candidates)`),t.scaleAnomalies.length&&r.push(`- ${t.scaleAnomalies.length} scale-variant anomalies (check exports)`),r.length&&a.push("","## Findings",...r),a.push("","## Assets (largest first)","","| Asset | Kind | Dimensions | Scales | Size | Loaded |","| --- | --- | --- | --- | --- | --- |");for(const s of e){const e=null!=s.sizeBytes&&"measured"===s.sizeSource?formatBytes(s.sizeBytes):estDecodedBytes(s)>0?`~${formatBytes(estDecodedBytes(s))}`:"—";a.push(`| ${s.name}.${s.type} | ${s.kind} | ${"image"===s.kind?formatDimensions(s):"—"} | ${formatScales(s.scales)} | ${e} | ${s.loaded?"yes":"NO"} |`)}return a.join("\n")}
1
+ "use strict";
2
+
3
+ /**
4
+ * Markdown reports for the shared ToolbarCopyButton — the paste-into-your-
5
+ * issue-tracker view of the inventory.
6
+ */
7
+
8
+ import { formatBytes, formatDimensions, formatScales } from "./format";
9
+ import { estDecodedBytes } from "./store/assetStore";
10
+ export function formatAssetMarkdown(record) {
11
+ const lines = [`# Asset: ${record.name}.${record.type}`, "", `- Kind: ${record.kind}`, `- Status: ${record.loaded ? "loaded at runtime" : "not observed in the runtime registry"}`];
12
+ if (record.kind === "image") lines.push(`- Dimensions: ${formatDimensions(record)} (logical)`);
13
+ if (record.scales.length) lines.push(`- Scales: ${formatScales(record.scales)}`);
14
+ if (record.sizeBytes != null && record.sizeSource === "measured") {
15
+ lines.push(`- Size (all variants): ${formatBytes(record.sizeBytes)}`);
16
+ }
17
+ const estimate = estDecodedBytes(record);
18
+ if (estimate > 0) lines.push(`- Decoded memory: ~${formatBytes(estimate)}`);
19
+ if (record.hash) lines.push(`- Hash: ${record.hash}`);
20
+ if (record.httpServerLocation) lines.push(`- Location: ${record.httpServerLocation}`);
21
+ if (record.fileSystemLocation) lines.push(`- Source dir: ${record.fileSystemLocation}`);
22
+ if (record.resolvedUri) lines.push(`- Resolved URI: ${record.resolvedUri}`);
23
+ return lines.join("\n");
24
+ }
25
+ export function formatInventoryMarkdown(records, stats, insights, scanStatus, diff) {
26
+ const lines = ["# Asset inventory", "", `${stats.total} assets · ${stats.loaded} loaded · ${stats.neverLoaded} not observed` + (stats.totalBytes > 0 ? ` · ${formatBytes(stats.totalBytes)} measured (${stats.measuredCount}/${stats.total})` : "")];
27
+ if (scanStatus.fontFamilies.length) {
28
+ lines.push(`Fonts loaded: ${scanStatus.fontFamilies.join(", ")}`);
29
+ }
30
+ if (!scanStatus.graphSupported) {
31
+ lines.push(scanStatus.graphError ? `_Metro bundle graph unavailable (${scanStatus.graphError}) — runtime-registered assets only._` : "_No Metro bundle graph — runtime-registered assets only (release build)._");
32
+ }
33
+ if (diff) {
34
+ const net = diff.netBytes != null ? `${diff.netBytes >= 0 ? "+" : "−"}${formatBytes(Math.abs(diff.netBytes))} net` : "net size unknown";
35
+ lines.push("", `## Since baseline (${new Date(diff.baselineSavedAt).toISOString()})`, `- ${diff.added.length} added · ${diff.removed.length} removed · ${diff.grown.length} grew · ${net}`);
36
+ for (const gone of diff.removed.slice(0, 20)) {
37
+ lines.push(`- removed: ${gone.name}.${gone.type}`);
38
+ }
39
+ }
40
+ const findings = [];
41
+ if (insights.neverLoaded.length) findings.push(`- ${insights.neverLoaded.length} shipped but not observed`);
42
+ if (insights.duplicates.length) findings.push(`- ${insights.duplicates.length} duplicate content groups`);
43
+ if (insights.webpCandidates.length) findings.push(`- ${insights.webpCandidates.length} WebP conversion candidates`);
44
+ if (insights.scaleGaps.length) findings.push(`- ${insights.scaleGaps.length} scale-coverage gaps`);
45
+ if (insights.overDecode.length) findings.push(`- ${insights.overDecode.length} images decoding larger than 2× the screen`);
46
+ if (insights.heavyGifs.length) findings.push(`- ${insights.heavyGifs.length} heavy GIFs (convert to video/Lottie)`);
47
+ if (insights.heavyFonts.length) findings.push(`- ${insights.heavyFonts.length} heavy fonts (subset candidates)`);
48
+ if (insights.scaleAnomalies.length) findings.push(`- ${insights.scaleAnomalies.length} scale-variant anomalies (check exports)`);
49
+ if (findings.length) lines.push("", "## Findings", ...findings);
50
+ lines.push("", "## Assets (largest first)", "", "| Asset | Kind | Dimensions | Scales | Size | Loaded |", "| --- | --- | --- | --- | --- | --- |");
51
+ for (const r of records) {
52
+ const size = r.sizeBytes != null && r.sizeSource === "measured" ? formatBytes(r.sizeBytes) : estDecodedBytes(r) > 0 ? `~${formatBytes(estDecodedBytes(r))}` : "—";
53
+ lines.push(`| ${r.name}.${r.type} | ${r.kind} | ${r.kind === "image" ? formatDimensions(r) : "—"} | ${formatScales(r.scales)} | ${size} | ${r.loaded ? "yes" : "NO"} |`);
54
+ }
55
+ return lines.join("\n");
56
+ }
57
+ //# sourceMappingURL=export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["formatBytes","formatDimensions","formatScales","estDecodedBytes","formatAssetMarkdown","record","lines","name","type","kind","loaded","push","scales","length","sizeBytes","sizeSource","estimate","hash","httpServerLocation","fileSystemLocation","resolvedUri","join","formatInventoryMarkdown","records","stats","insights","scanStatus","diff","total","neverLoaded","totalBytes","measuredCount","fontFamilies","graphSupported","graphError","net","netBytes","Math","abs","Date","baselineSavedAt","toISOString","added","removed","grown","gone","slice","findings","duplicates","webpCandidates","scaleGaps","overDecode","heavyGifs","heavyFonts","scaleAnomalies","r","size"],"sourceRoot":"../../src","sources":["export.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,EAAEC,gBAAgB,EAAEC,YAAY,QAAQ,UAAU;AACtE,SAASC,eAAe,QAAQ,oBAAoB;AASpD,OAAO,SAASC,mBAAmBA,CAACC,MAAmB,EAAU;EAC/D,MAAMC,KAAK,GAAG,CACZ,YAAYD,MAAM,CAACE,IAAI,IAAIF,MAAM,CAACG,IAAI,EAAE,EACxC,EAAE,EACF,WAAWH,MAAM,CAACI,IAAI,EAAE,EACxB,aAAaJ,MAAM,CAACK,MAAM,GAAG,mBAAmB,GAAG,sCAAsC,EAAE,CAC5F;EACD,IAAIL,MAAM,CAACI,IAAI,K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K,CAACK,IAAI,CAAC,EAAE,EAAE,aAAa,EAAE,GAAGoC,QAAQ,CAAC;EAE/DzC,KAAK,CAACK,IAAI,CACR,EAAE,EACF,2BAA2B,EAC3B,EAAE,EACF,wDAAwD,EACxD,uCACF,CAAC;EACD,KAAK,MAAM4C,CAAC,IAAIhC,OAAO,EAAE;IACvB,MAAMiC,IAAI,GACRD,CAAC,CAACzC,SAAS,IAAI,IAAI,IAAIyC,CAAC,CAACxC,UAAU,KAAK,UAAU,GAC9Cf,WAAW,CAACuD,CAAC,CAACzC,SAAS,CAAC,GACxBX,eAAe,CAACoD,CAAC,CAAC,GAAG,CAAC,GACpB,IAAIvD,WAAW,CAACG,eAAe,CAACoD,CAAC,CAAC,CAAC,EAAE,GACrC,GAAG;IACXjD,KAAK,CAACK,IAAI,CACR,KAAK4C,CAAC,CAAChD,IAAI,IAAIgD,CAAC,CAAC/C,IAAI,MAAM+C,CAAC,CAAC9C,IAAI,MAC/B8C,CAAC,CAAC9C,IAAI,KAAK,OAAO,GAAGR,gBAAgB,CAACsD,CAAC,CAAC,GAAG,GAAG,MAC1CrD,YAAY,CAACqD,CAAC,CAAC3C,MAAM,CAAC,MAAM4C,IAAI,MAAMD,CAAC,CAAC7C,MAAM,GAAG,KAAK,GAAG,IAAI,IACrE,CAAC;EACH;EACA,OAAOJ,KAAK,CAACe,IAAI,CAAC,IAAI,CAAC;AACzB","ignoreList":[]}
@@ -1 +1,51 @@
1
- "use strict";export function formatBytes(t){return null==t||t<=0?"—":t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(2)} MB`}export function formatScales(t){const e=[...new Set(t)].sort((t,e)=>t-e);return e.length?1===e.length?`@${e[0]}x`:e.length<=3?e.map(t=>`@${t}x`).join(" "):`@${e[0]}x–@${e[e.length-1]}x`:"—"}export function formatDimensions(t){return null==t.width||null==t.height?"—":`${Math.round(t.width)}×${Math.round(t.height)}`}export function formatSize(t,e){return null!=t.sizeBytes&&"measured"===t.sizeSource?formatBytes(t.sizeBytes):e>0?`~${formatBytes(e)}`:"—"}export const KIND_LABELS={image:"IMG",font:"FONT",video:"VID",audio:"AUD",data:"DATA",other:"MISC"};export const KIND_COLORS={image:"#2DD4BF",font:"#C084FC",video:"#FF9F1C",audio:"#FF3366",data:"#00D4FF",other:"#8E8E93"};
1
+ "use strict";
2
+
3
+ /**
4
+ * Shared formatting helpers for rows, detail view, and markdown export.
5
+ */
6
+
7
+ export function formatBytes(bytes) {
8
+ if (bytes == null || bytes <= 0) return "—";
9
+ if (bytes < 1024) return `${bytes} B`;
10
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
11
+ return `${(bytes / (1024 * 1024)).toFixed(2)} MB`;
12
+ }
13
+ export function formatScales(scales) {
14
+ const unique = [...new Set(scales)].sort((a, b) => a - b);
15
+ if (!unique.length) return "—";
16
+ if (unique.length === 1) return `@${unique[0]}x`;
17
+ if (unique.length <= 3) return unique.map(s => `@${s}x`).join(" ");
18
+ return `@${unique[0]}x–@${unique[unique.length - 1]}x`;
19
+ }
20
+ export function formatDimensions(record) {
21
+ if (record.width == null || record.height == null) return "—";
22
+ return `${Math.round(record.width)}×${Math.round(record.height)}`;
23
+ }
24
+
25
+ /** Display size: measured bytes, or "~" decoded estimate for unmeasured images. */
26
+ export function formatSize(record, estDecoded) {
27
+ if (record.sizeBytes != null && record.sizeSource === "measured") {
28
+ return formatBytes(record.sizeBytes);
29
+ }
30
+ if (estDecoded > 0) return `~${formatBytes(estDecoded)}`;
31
+ return "—";
32
+ }
33
+ export const KIND_LABELS = {
34
+ image: "IMG",
35
+ font: "FONT",
36
+ video: "VID",
37
+ audio: "AUD",
38
+ data: "DATA",
39
+ other: "MISC"
40
+ };
41
+
42
+ /** Family accent per kind — the card's left edge, like network's method bar. */
43
+ export const KIND_COLORS = {
44
+ image: "#2DD4BF",
45
+ font: "#C084FC",
46
+ video: "#FF9F1C",
47
+ audio: "#FF3366",
48
+ data: "#00D4FF",
49
+ other: "#8E8E93"
50
+ };
51
+ //# sourceMappingURL=format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["formatBytes","bytes","toFixed","formatScales","scales","unique","Set","sort","a","b","length","map","s","join","formatDimensions","record","width","height","Math","round","formatSize","estDecoded","sizeBytes","sizeSource","KIND_LABELS","image","font","video","audio","data","other","KIND_COLORS"],"sourceRoot":"../../src","sources":["format.ts"],"mappings":";;AAAA;AACA;AACA;;AAIA,OAAO,SAASA,WAAWA,CAACC,KAAgC,EAAU;EACpE,IAAIA,KAAK,IAAI,IAAI,IAAIA,KAAK,IAAI,CAAC,EAAE,OAAO,GAAG;EAC3C,IAAIA,KAAK,GAAG,IAAI,EAAE,OAAO,GAAGA,KAAK,IAAI;EACrC,IAAIA,KAAK,GAAG,IAAI,GAAG,IAAI,EAAE,OAAO,GAAG,CAACA,KAAK,GAAG,IAAI,EAAEC,OAAO,CAAC,CAAC,CAAC,KAAK;EACjE,OAAO,GAAG,CAACD,KAAK,IAAI,IAAI,GAAG,IAAI,CAAC,EAAEC,OAAO,CAAC,CAAC,CAAC,KAAK;AACnD;AAEA,OAAO,SAASC,YAAYA,CAACC,MAAgB,EAAU;EACrD,MAAMC,MAAM,GAAG,CAAC,GAAG,IAAIC,GAAG,CAACF,MAAM,CAAC,CAAC,CAACG,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,GAAGC,CAAC,CAAC;EACzD,IAAI,CAACJ,MAAM,CAACK,MAAM,EAAE,OAAO,GAAG;EAC9B,IAAIL,MAAM,CAACK,MAAM,KAAK,CAAC,EAAE,OAAO,IAAIL,MAAM,CAAC,CAAC,CAAC,GAAG;EAChD,IAAIA,MAAM,CAACK,MAAM,IAAI,CAAC,EAAE,OAAOL,MAAM,CAACM,GAAG,CAAEC,CAAC,IAAK,IAAIA,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EACpE,OAAO,IAAIR,MAAM,CAAC,CAAC,CAAC,MAAMA,MAAM,CAACA,MAAM,CAACK,MAAM,GAAG,CAAC,CAAC,GAAG;AACxD;AAEA,OAAO,SAASI,gBAAgBA,CAACC,MAAmB,EAAU;EAC5D,IAAIA,MAAM,CAACC,KAAK,IAAI,IAAI,IAAID,MAAM,CAACE,MAAM,IAAI,IAAI,EAAE,OAAO,GAAG;EAC7D,OAAO,GAAGC,IAAI,CAACC,KAAK,CAACJ,MAAM,CAACC,KAAK,CAAC,IAAIE,IAAI,CAACC,KAAK,CAACJ,MAAM,CAACE,MAAM,CAAC,EAAE;AACnE;;AAEA;AACA,OAAO,SAASG,UAAUA,CAACL,MAAmB,EAAEM,UAAkB,EAAU;EAC1E,IAAIN,MAAM,CAACO,SAAS,IAAI,IAAI,IAAIP,MAAM,CAACQ,UAAU,KAAK,UAAU,EAAE;IAChE,OAAOvB,WAAW,CAACe,MAAM,CAACO,SAAS,CAAC;EACtC;EACA,IAAID,UAAU,GAAG,CAAC,EAAE,OAAO,IAAIrB,WAAW,CAACqB,UAAU,CAAC,EAAE;EACxD,OAAO,GAAG;AACZ;AAEA,OAAO,MAAMG,WAAsC,GAAG;EACpDC,KAAK,EAAE,KAAK;EACZC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,KAAK;EACZC,KAAK,EAAE,KAAK;EACZC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE;AACT,CAAC;;AAED;AACA,OAAO,MAAMC,WAAsC,GAAG;EACpDN,KAAK,EAAE,SAAS;EAChBC,IAAI,EAAE,SAAS;EACfC,KAAK,EAAE,SAAS;EAChBC,KAAK,EAAE,SAAS;EAChBC,IAAI,EAAE,SAAS;EACfC,KAAK,EAAE;AACT,CAAC","ignoreList":[]}
@@ -1 +1,18 @@
1
- "use strict";import{useMemo,useSyncExternalStore}from"react";import{computeStats,getSnapshot,subscribe}from"../store/assetStore";import{computeInsights}from"../store/insights";export function useAssetRecords(){const t=useSyncExternalStore(subscribe,getSnapshot,getSnapshot);return useMemo(()=>({records:t,stats:computeStats(t),insights:computeInsights(t)}),[t])}
1
+ "use strict";
2
+
3
+ /**
4
+ * React bindings for the asset store.
5
+ */
6
+
7
+ import { useMemo, useSyncExternalStore } from "react";
8
+ import { computeStats, getSnapshot, subscribe } from "../store/assetStore";
9
+ import { computeInsights } from "../store/insights";
10
+ export function useAssetRecords() {
11
+ const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
12
+ return useMemo(() => ({
13
+ records: snapshot,
14
+ stats: computeStats(snapshot),
15
+ insights: computeInsights(snapshot)
16
+ }), [snapshot]);
17
+ }
18
+ //# sourceMappingURL=useAssetRecords.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useMemo","useSyncExternalStore","computeStats","getSnapshot","subscribe","computeInsights","useAssetRecords","snapshot","records","stats","insights"],"sourceRoot":"../../../src","sources":["hooks/useAssetRecords.ts"],"mappings":";;AAAA;AACA;AACA;;AAEA,SAASA,OAAO,EAAEC,oBAAoB,QAAQ,OAAO;AACrD,SAASC,YAAY,EAAEC,WAAW,EAAEC,SAAS,QAAQ,qBAAqB;AAC1E,SAASC,eAAe,QAAQ,mBAAmB;AASnD,OAAO,SAASC,eAAeA,CAAA,EAA0B;EACvD,MAAMC,QAAQ,GAAGN,oBAAoB,CAACG,SAAS,EAAED,WAAW,EAAEA,WAAW,CAAC;EAC1E,OAAOH,OAAO,CACZ,OAAO;IACLQ,OAAO,EAAED,QAAQ;IACjBE,KAAK,EAAEP,YAAY,CAACK,QAAQ,CAAC;IAC7BG,QAAQ,EAAEL,eAAe,CAACE,QAAQ;EACpC,CAAC,CAAC,EACF,CAACA,QAAQ,CACX,CAAC;AACH","ignoreList":[]}
@@ -1 +1,23 @@
1
- "use strict";import{useSyncExternalStore}from"react";import{getScanStatus}from"../capture/install";import{getSnapshot,subscribe}from"../store/assetStore";let previousRecords,previousStatus;export function getAssetScanSnapshot(){const t=getSnapshot();return t!==previousRecords&&(previousRecords=t,previousStatus=getScanStatus()),previousStatus}export function useAssetScanStatus(){return useSyncExternalStore(subscribe,getAssetScanSnapshot,getAssetScanSnapshot)}
1
+ "use strict";
2
+
3
+ import { useSyncExternalStore } from "react";
4
+ import { getScanStatus } from "../capture/install";
5
+ import { getSnapshot, subscribe } from "../store/assetStore";
6
+ let previousRecords;
7
+ let previousStatus;
8
+
9
+ /** Each store notification replaces the records snapshot, including status-only updates. */
10
+ export function getAssetScanSnapshot() {
11
+ const records = getSnapshot();
12
+ if (records !== previousRecords) {
13
+ previousRecords = records;
14
+ previousStatus = getScanStatus();
15
+ }
16
+ return previousStatus;
17
+ }
18
+
19
+ /** Keep scan status reactive in apps that use React Compiler. */
20
+ export function useAssetScanStatus() {
21
+ return useSyncExternalStore(subscribe, getAssetScanSnapshot, getAssetScanSnapshot);
22
+ }
23
+ //# sourceMappingURL=useAssetScanStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSyncExternalStore","getScanStatus","getSnapshot","subscribe","previousRecords","previousStatus","getAssetScanSnapshot","records","useAssetScanStatus"],"sourceRoot":"../../../src","sources":["hooks/useAssetScanStatus.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,OAAO;AAC5C,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,WAAW,EAAEC,SAAS,QAAQ,qBAAqB;AAG5D,IAAIC,eAA0C;AAC9C,IAAIC,cAAgC;;AAEpC;AACA,OAAO,SAASC,oBAAoBA,CAAA,EAAqB;EACvD,MAAMC,OAAO,GAAGL,WAAW,CAAC,CAAC;EAC7B,IAAIK,OAAO,KAAKH,eAAe,EAAE;IAC/BA,eAAe,GAAGG,OAAO;IACzBF,cAAc,GAAGJ,aAAa,CAAC,CAAC;EAClC;EACA,OAAOI,cAAc;AACvB;;AAEA;AACA,OAAO,SAASG,kBAAkBA,CAAA,EAAqB;EACrD,OAAOR,oBAAoB,CAACG,SAAS,EAAEG,oBAAoB,EAAEA,oBAAoB,CAAC;AACpF","ignoreList":[]}
@@ -1 +1,63 @@
1
- "use strict";export{assetsToolPreset,createAssetsTool}from"./preset";export{AssetsModal,AssetsToolView}from"./components/AssetsModal";export{AssetsIcon,ASSETS_ICON_COLOR}from"./components/AssetsIcon";export{installAssetCapture,rescan,getScanStatus}from"./capture/install";export{measureSizes}from"./capture/measure";export{fetchAssetGraph,getDevServerOrigin}from"./capture/metroGraph";export{getLoadedFontFamilies,getLocalAssets}from"./capture/expo";export{clearRecords,computeStats,estDecodedBytes,getRecord,getSnapshot,subscribe}from"./store/assetStore";export{computeInsights}from"./store/insights";export{clearBaseline,computeDiff,getDiff,loadBaseline,saveBaseline}from"./store/baseline";export{useAssetRecords}from"./hooks/useAssetRecords";export{formatAssetMarkdown,formatInventoryMarkdown}from"./export";export{assetsSyncAdapter}from"./sync/assetsSyncAdapter";export{disableAssetsCapture,replaceAssetsFromSnapshot,setRemoteAssetsHandler}from"./remote";export{ASSETS_TEST_IDS,assetBadgeTestID,assetDetailRowTestID,assetFilterTestID,assetFindingTestID,assetFontChipTestID,assetRowTestID,assetSlug}from"./utils/testIDs";import{installAssetCapture as installOnImport}from"./capture/install";installOnImport();
1
+ "use strict";
2
+
3
+ /**
4
+ * @buoy-gg/assets — bundled-asset inventory for React Native / Expo.
5
+ *
6
+ * Enumerates every asset in the app (images, fonts, video, audio, …) via the
7
+ * runtime asset registry, enriched in dev with the Metro graph (full-bundle
8
+ * coverage, byte sizes, never-loaded detection) and on Expo with loaded font
9
+ * families + the updates localAssets map. Zero configuration: importing this
10
+ * package installs the (cheap, synchronous) registry capture.
11
+ */
12
+
13
+ // ---------------------------------------------------------------------------
14
+ // Tool preset (FloatingDevTools)
15
+ // ---------------------------------------------------------------------------
16
+ export { assetsToolPreset, createAssetsTool } from "./preset";
17
+
18
+ // ---------------------------------------------------------------------------
19
+ // Components
20
+ // ---------------------------------------------------------------------------
21
+ export { AssetsModal, AssetsToolView } from "./components/AssetsModal";
22
+ export { AssetsIcon, ASSETS_ICON_COLOR } from "./components/AssetsIcon";
23
+
24
+ // ---------------------------------------------------------------------------
25
+ // Capture / scanning
26
+ // ---------------------------------------------------------------------------
27
+ export { installAssetCapture, rescan, getScanStatus } from "./capture/install";
28
+ export { measureSizes } from "./capture/measure";
29
+ export { fetchAssetGraph, getDevServerOrigin } from "./capture/metroGraph";
30
+ export { getLoadedFontFamilies, getLocalAssets } from "./capture/expo";
31
+
32
+ // ---------------------------------------------------------------------------
33
+ // Store
34
+ // ---------------------------------------------------------------------------
35
+ export { clearRecords, computeStats, estDecodedBytes, getRecord, getSnapshot, subscribe } from "./store/assetStore";
36
+ export { computeInsights } from "./store/insights";
37
+ export { clearBaseline, computeDiff, getDiff, loadBaseline, saveBaseline } from "./store/baseline";
38
+ export { useAssetRecords } from "./hooks/useAssetRecords";
39
+
40
+ // ---------------------------------------------------------------------------
41
+ // Reports
42
+ // ---------------------------------------------------------------------------
43
+ export { formatAssetMarkdown, formatInventoryMarkdown } from "./export";
44
+
45
+ // ---------------------------------------------------------------------------
46
+ // External sync (desktop dashboard + MCP)
47
+ // ---------------------------------------------------------------------------
48
+ export { assetsSyncAdapter } from "./sync/assetsSyncAdapter";
49
+ export { disableAssetsCapture, replaceAssetsFromSnapshot, setRemoteAssetsHandler } from "./remote";
50
+ // ---------------------------------------------------------------------------
51
+ // Automation handles
52
+ // ---------------------------------------------------------------------------
53
+ export { ASSETS_TEST_IDS, assetBadgeTestID, assetDetailRowTestID, assetFilterTestID, assetFindingTestID, assetFontChipTestID, assetRowTestID, assetSlug } from "./utils/testIDs";
54
+
55
+ // ---------------------------------------------------------------------------
56
+ // Types
57
+ // ---------------------------------------------------------------------------
58
+
59
+ // Side effect: install the registry capture at import (walk + patch — cheap,
60
+ // synchronous, no network). The Metro graph fetch waits for the modal/action.
61
+ import { installAssetCapture as installOnImport } from "./capture/install";
62
+ installOnImport();
63
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["assetsToolPreset","createAssetsTool","AssetsModal","AssetsToolView","AssetsIcon","ASSETS_ICON_COLOR","installAssetCapture","rescan","getScanStatus","measureSizes","fetchAssetGraph","getDevServerOrigin","getLoadedFontFamilies","getLocalAssets","clearRecords","computeStats","estDecodedBytes","getRecord","getSnapshot","subscribe","computeInsights","clearBaseline","computeDiff","getDiff","loadBaseline","saveBaseline","useAssetRecords","formatAssetMarkdown","formatInventoryMarkdown","assetsSyncAdapter","disableAssetsCapture","replaceAssetsFromSnapshot","setRemoteAssetsHandler","ASSETS_TEST_IDS","assetBadgeTestID","assetDetailRowTestID","assetFilterTestID","assetFindingTestID","assetFontChipTestID","assetRowTestID","assetSlug","installOnImport"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,gBAAgB,QAAQ,UAAU;;AAE7D;AACA;AACA;AACA,SAASC,WAAW,EAAEC,cAAc,QAAQ,0BAA0B;AACtE,SAASC,UAAU,EAAEC,iBAAiB,QAAQ,yBAAyB;;AAEvE;AACA;AACA;AACA,SAASC,mBAAmB,EAAEC,MAAM,EAAEC,aAAa,QAAQ,mBAAmB;AAC9E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,sBAAsB;AAC1E,SAASC,qBAAqB,EAAEC,cAAc,QAAQ,gBAAgB;;AAEtE;AACA;AACA;AACA,SACEC,YAAY,EACZC,YAAY,EACZC,eAAe,EACfC,SAAS,EACTC,WAAW,EACXC,SAAS,QACJ,oBAAoB;AAC3B,SAASC,eAAe,QAAQ,kBAAkB;AAClD,SACEC,aAAa,EACbC,WAAW,EACXC,OAAO,EACPC,YAAY,EACZC,YAAY,QACP,kBAAkB;AACzB,SAASC,eAAe,QAAQ,yBAAyB;;AAEzD;AACA;AACA;AACA,SAASC,mBAAmB,EAAEC,uBAAuB,QAAQ,UAAU;;AAEvE;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SACEC,oBAAoB,EACpBC,yBAAyB,EACzBC,sBAAsB,QACjB,UAAU;AAGjB;AACA;AACA;AACA,SACEC,eAAe,EACfC,gBAAgB,EAChBC,oBAAoB,EACpBC,iBAAiB,EACjBC,kBAAkB,EAClBC,mBAAmB,EACnBC,cAAc,EACdC,SAAS,QACJ,iBAAiB;;AAExB;AACA;AACA;;AAeA;AACA;AACA,SAASlC,mBAAmB,IAAImC,eAAe,QAAQ,mBAAmB;AAC1EA,eAAe,CAAC,CAAC","ignoreList":[]}
@@ -1 +1,35 @@
1
- "use strict";import{AssetsIcon,ASSETS_ICON_COLOR}from"./components/AssetsIcon";import{AssetsModal}from"./components/AssetsModal";import{createToolFactory,defineToolPreset}from"@buoy-gg/shared-ui";import{jsx as _jsx}from"react/jsx-runtime";export const assetsToolPreset=defineToolPreset({id:"assets",name:"ASSETS",description:"Every bundled asset — sizes, scale coverage, unused detection",slot:"both",icon:({size:s,color:e})=>_jsx(AssetsIcon,{size:s,color:e||ASSETS_ICON_COLOR}),component:AssetsModal});export const createAssetsTool=createToolFactory(assetsToolPreset);
1
+ "use strict";
2
+
3
+ /**
4
+ * Pre-configured Assets tool for FloatingDevTools.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * import { assetsToolPreset } from '@buoy-gg/assets';
9
+ *
10
+ * <FloatingDevTools apps={[assetsToolPreset]} />
11
+ * ```
12
+ */
13
+
14
+ import { AssetsIcon, ASSETS_ICON_COLOR } from "./components/AssetsIcon";
15
+ import { AssetsModal } from "./components/AssetsModal";
16
+ import { createToolFactory, defineToolPreset } from "@buoy-gg/shared-ui";
17
+ import { jsx as _jsx } from "react/jsx-runtime";
18
+ export const assetsToolPreset = defineToolPreset({
19
+ id: "assets",
20
+ name: "ASSETS",
21
+ description: "Every bundled asset — sizes, scale coverage, unused detection",
22
+ slot: "both",
23
+ icon: ({
24
+ size,
25
+ color
26
+ }) => /*#__PURE__*/_jsx(AssetsIcon, {
27
+ size: size,
28
+ color: color || ASSETS_ICON_COLOR
29
+ }),
30
+ component: AssetsModal
31
+ });
32
+
33
+ /** Create a custom Assets tool configuration. */
34
+ export const createAssetsTool = createToolFactory(assetsToolPreset);
35
+ //# sourceMappingURL=preset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AssetsIcon","ASSETS_ICON_COLOR","AssetsModal","createToolFactory","defineToolPreset","jsx","_jsx","assetsToolPreset","id","name","description","slot","icon","size","color","component","createAssetsTool"],"sourceRoot":"../../src","sources":["preset.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,iBAAiB,QAAQ,yBAAyB;AACvE,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,iBAAiB,EAAEC,gBAAgB,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzE,OAAO,MAAMC,gBAAgB,GAAGH,gBAAgB,CAAC;EAC/CI,EAAE,EAAE,QAAQ;EACZC,IAAI,EAAE,QAAQ;EACdC,WAAW,EAAE,+DAA+D;EAC5EC,IAAI,EAAE,MAAe;EACrBC,IAAI,EAAEA,CAAC;IAAEC,IAAI;IAAEC;EAAwC,CAAC,kBACtDR,IAAA,CAACN,UAAU;IAACa,IAAI,EAAEA,IAAK;IAACC,KAAK,EAAEA,KAAK,IAAIb;EAAkB,CAAE,CAC7D;EACDc,SAAS,EAAEb;AACb,CAAC,CAAC;;AAEF;AACA,OAAO,MAAMc,gBAAgB,GAAGb,iBAAiB,CAACI,gBAAgB,CAAC","ignoreList":[]}
@@ -1 +1,61 @@
1
- "use strict";import{assetsState}from"./state";import{invalidate}from"./store/assetStore";export function setRemoteAssetsHandler(e){assetsState().remoteDispatch=e}export function remoteAssetsDispatch(){return assetsState().remoteDispatch}export function disableAssetsCapture(){assetsState().captureDisabled=!0}export function replaceAssetsFromSnapshot(e){const t=assetsState(),s=e.records??[];t.records=s.map(e=>({id:e.id,key:e.key,registryId:e.registryId??void 0,name:e.name,type:e.type,kind:e.kind,hash:e.hash??void 0,httpServerLocation:e.location??void 0,width:e.width??void 0,height:e.height??void 0,scales:e.scales,resolvedUri:e.uri??void 0,loaded:e.loaded,origin:null!=e.registryId?"registry":"graph",sizeBytes:e.sizeBytes??void 0,sizeSource:e.sizeSource??void 0,firstSeenAt:Date.now()})),t.byKey=new Map(t.records.map(e=>[e.key,e])),t.byId=new Map(t.records.map(e=>[e.id,e])),e.scanStatus&&(t.fontFamilies=[...new Set(e.scanStatus.fontFamilies??[])],t.mirrorScanStatus={...e.scanStatus,fontFamilies:t.fontFamilies}),t.mirrorDiff=e.diff??null,invalidate()}
1
+ "use strict";
2
+
3
+ /**
4
+ * Remote-dispatch seam for dashboard mirrors (Buoy Desktop).
5
+ *
6
+ * On device this stays null and every action runs locally. A dashboard sets
7
+ * a handler that forwards action name + params over external-sync to the
8
+ * SAME adapter actions the MCP uses (sync/assetsSyncAdapter.ts), so one
9
+ * action vocabulary serves phone UI, desktop UI, and LLM automation.
10
+ */
11
+
12
+ import { assetsState } from "./state";
13
+ import { invalidate } from "./store/assetStore";
14
+ export function setRemoteAssetsHandler(handler) {
15
+ assetsState().remoteDispatch = handler;
16
+ }
17
+ export function remoteAssetsDispatch() {
18
+ return assetsState().remoteDispatch;
19
+ }
20
+
21
+ /** Dashboards never scan their own bundle — the store is purely a mirror. */
22
+ export function disableAssetsCapture() {
23
+ assetsState().captureDisabled = true;
24
+ }
25
+
26
+ /** Replace the whole store from a synced adapter snapshot. */
27
+ export function replaceAssetsFromSnapshot(payload) {
28
+ const s = assetsState();
29
+ const wire = payload.records ?? [];
30
+ s.records = wire.map(w => ({
31
+ id: w.id,
32
+ key: w.key,
33
+ registryId: w.registryId ?? undefined,
34
+ name: w.name,
35
+ type: w.type,
36
+ kind: w.kind,
37
+ hash: w.hash ?? undefined,
38
+ httpServerLocation: w.location ?? undefined,
39
+ width: w.width ?? undefined,
40
+ height: w.height ?? undefined,
41
+ scales: w.scales,
42
+ resolvedUri: w.uri ?? undefined,
43
+ loaded: w.loaded,
44
+ origin: w.registryId != null ? "registry" : "graph",
45
+ sizeBytes: w.sizeBytes ?? undefined,
46
+ sizeSource: w.sizeSource ?? undefined,
47
+ firstSeenAt: Date.now()
48
+ }));
49
+ s.byKey = new Map(s.records.map(r => [r.key, r]));
50
+ s.byId = new Map(s.records.map(r => [r.id, r]));
51
+ if (payload.scanStatus) {
52
+ s.fontFamilies = [...new Set(payload.scanStatus.fontFamilies ?? [])];
53
+ s.mirrorScanStatus = {
54
+ ...payload.scanStatus,
55
+ fontFamilies: s.fontFamilies
56
+ };
57
+ }
58
+ s.mirrorDiff = payload.diff ?? null;
59
+ invalidate();
60
+ }
61
+ //# sourceMappingURL=remote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["assetsState","invalidate","setRemoteAssetsHandler","handler","remoteDispatch","remoteAssetsDispatch","disableAssetsCapture","captureDisabled","replaceAssetsFromSnapshot","payload","s","wire","records","map","w","id","key","registryId","undefined","name","type","kind","hash","httpServerLocation","location","width","height","scales","resolvedUri","uri","loaded","origin","sizeBytes","sizeSource","firstSeenAt","Date","now","byKey","Map","r","byId","scanStatus","fontFamilies","Set","mirrorScanStatus","mirrorDiff","diff"],"sourceRoot":"../../src","sources":["remote.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,SAAS;AACrC,SAASC,UAAU,QAAQ,oBAAoB;AAQ/C,OAAO,SAASC,sBAAsBA,CACpCC,OAAoC,EAC9B;EACNH,WAAW,CAAC,CAAC,CAACI,cAAc,GAAGD,OAAO;AACxC;AAEA,OAAO,SAASE,oBAAoBA,CAAA,EAAgC;EAClE,OAAOL,WAAW,CAAC,CAAC,CAACI,cAAc;AACrC;;AAEA;AACA,OAAO,SAASE,oBAAoBA,CAAA,EAAS;EAC3CN,WAAW,CAAC,CAAC,CAACO,eAAe,GAAG,IAAI;AACtC;;AAEA;AACA,OAAO,SAASC,yBAAyBA,CAACC,OAA8B,EAA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5B,CAAC,CAACE,OAAO,CAACC,GAAG,CAAE0B,CAAC,IAAK,CAACA,CAAC,CAACxB,EAAE,EAAEwB,CAAC,CAAC,CAAC,CAAC;EACjD,IAAI9B,OAAO,CAACgC,UAAU,EAAE;IACtB/B,CAAC,CAACgC,YAAY,GAAG,CAAC,GAAG,IAAIC,GAAG,CAAClC,OAAO,CAACgC,UAAU,CAACC,YAAY,IAAI,EAAE,CAAC,CAAC;IACpEhC,CAAC,CAACkC,gBAAgB,GAAG;MAAE,GAAGnC,OAAO,CAACgC,UAAU;MAAEC,YAAY,EAAEhC,CAAC,CAACgC;IAAa,CAAC;EAC9E;EACAhC,CAAC,CAACmC,UAAU,GAAGpC,OAAO,CAACqC,IAAI,IAAI,IAAI;EACnC7C,UAAU,CAAC,CAAC;AACd","ignoreList":[]}
@@ -1 +1,47 @@
1
- "use strict";const KEY=Symbol.for("buoy.assets.globalState.v1");export function assetsState(){const e=globalThis;return e[KEY]||(e[KEY]={records:[],byKey:new Map,byId:new Map,nextId:1,listeners:new Set,snapshot:[],emitScheduled:!1,installed:!1,patched:!1,registryAvailable:!1,graphSupported:!1,graphCount:null,graphError:null,graphFetchInFlight:!1,lastScanAt:null,measuring:!1,measuredCount:0,fontFamilies:[],localAssetCount:null,baseline:null,baselineLoaded:!1,captureDisabled:!1,remoteDispatch:null,mirrorScanStatus:null,mirrorPixelRatio:null,mirrorDiff:null}),e[KEY]}
1
+ "use strict";
2
+
3
+ /**
4
+ * Global singleton state for the Assets tool.
5
+ *
6
+ * Same rationale as the images tool: the package can be evaluated as two
7
+ * module instances (lib vs src resolution), and the registerAsset patch must
8
+ * share one store with whichever copy the UI renders from. All mutable state
9
+ * lives on globalThis under a well-known symbol.
10
+ */
11
+
12
+ const KEY = Symbol.for("buoy.assets.globalState.v1");
13
+ export function assetsState() {
14
+ const g = globalThis;
15
+ if (!g[KEY]) {
16
+ g[KEY] = {
17
+ records: [],
18
+ byKey: new Map(),
19
+ byId: new Map(),
20
+ nextId: 1,
21
+ listeners: new Set(),
22
+ snapshot: [],
23
+ emitScheduled: false,
24
+ installed: false,
25
+ patched: false,
26
+ registryAvailable: false,
27
+ graphSupported: false,
28
+ graphCount: null,
29
+ graphError: null,
30
+ graphFetchInFlight: false,
31
+ lastScanAt: null,
32
+ measuring: false,
33
+ measuredCount: 0,
34
+ fontFamilies: [],
35
+ localAssetCount: null,
36
+ baseline: null,
37
+ baselineLoaded: false,
38
+ captureDisabled: false,
39
+ remoteDispatch: null,
40
+ mirrorScanStatus: null,
41
+ mirrorPixelRatio: null,
42
+ mirrorDiff: null
43
+ };
44
+ }
45
+ return g[KEY];
46
+ }
47
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["KEY","Symbol","for","assetsState","g","globalThis","records","byKey","Map","byId","nextId","listeners","Set","snapshot","emitScheduled","installed","patched","registryAvailable","graphSupported","graphCount","graphError","graphFetchInFlight","lastScanAt","measuring","measuredCount","fontFamilies","localAssetCount","baseline","baselineLoaded","captureDisabled","remoteDispatch","mirrorScanStatus","mirrorPixelRatio","mirrorDiff"],"sourceRoot":"../../src","sources":["state.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2CA,MAAMA,GAAG,GAAGC,MAAM,CAACC,GAAG,CAAC,4BAA4B,CAAC;AAEpD,OAAO,SAASC,WAAWA,CAAA,EAAsB;EAC/C,MAAMC,CAAC,GAAGC,UAA2D;EACrE,IAAI,CAACD,CAAC,CAACJ,GAAG,CAAC,EAAE;IACXI,CAAC,CAACJ,GAAG,CAAC,GAAG;MACPM,OAAO,EAAE,EAAE;MACXC,KAAK,EAAE,IAAIC,GAAG,CAAC,CAAC;MAChBC,IAAI,EAAE,IAAID,GAAG,CAAC,CAAC;MACfE,MAAM,EAAE,CAAC;MACTC,SAAS,EAAE,IAAIC,GAAG,CAAC,CAAC;MACpBC,QAAQ,EAAE,EAAE;MACZC,aAAa,EAAE,KAAK;MACpBC,SAAS,EAAE,KAAK;MAChBC,OAAO,EAAE,KAAK;MACdC,iBAAiB,EAAE,KAAK;MACxBC,cAAc,EAAE,KAAK;MACrBC,UAAU,EAAE,IAAI;MAChBC,UAAU,EAAE,IAAI;MAChBC,kBAAkB,EAAE,KAAK;MACzBC,UAAU,EAAE,IAAI;MAChBC,SAAS,EAAE,KAAK;MAChBC,aAAa,EAAE,CAAC;MAChBC,YAAY,EAAE,EAAE;MAChBC,eAAe,EAAE,IAAI;MACrBC,QAAQ,EAAE,IAAI;MACdC,cAAc,EAAE,KAAK;MACrBC,eAAe,EAAE,KAAK;MACtBC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE,IAAI;MACtBC,gBAAgB,EAAE,IAAI;MACtBC,UAAU,EAAE;IACd,CAAC;EACH;EACA,OAAO7B,CAAC,CAACJ,GAAG,CAAC;AACf","ignoreList":[]}