@buoy-gg/assets 7.0.29 → 7.0.30
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/lib/commonjs/components/AssetRow.js +13 -4
- package/lib/commonjs/components/AssetRow.js.map +1 -1
- package/lib/commonjs/utils/testIDs.js +114 -0
- package/lib/commonjs/utils/testIDs.js.map +1 -0
- package/lib/module/components/AssetRow.js +13 -4
- package/lib/module/components/AssetRow.js.map +1 -1
- package/lib/module/utils/testIDs.js +103 -0
- package/lib/module/utils/testIDs.js.map +1 -0
- package/lib/typescript/components/AssetRow.d.ts.map +1 -1
- package/lib/typescript/utils/testIDs.d.ts +75 -0
- package/lib/typescript/utils/testIDs.d.ts.map +1 -0
- package/package.json +5 -6
- package/src/capture/expo.ts +0 -45
- package/src/capture/install.ts +0 -73
- package/src/capture/measure.ts +0 -167
- package/src/capture/metroGraph.ts +0 -146
- package/src/capture/registry.ts +0 -137
- package/src/components/AssetDetail.tsx +0 -207
- package/src/components/AssetRow.tsx +0 -243
- package/src/components/AssetsFilterBar.tsx +0 -99
- package/src/components/AssetsHeader.tsx +0 -75
- package/src/components/AssetsIcon.tsx +0 -9
- package/src/components/AssetsListControls.tsx +0 -101
- package/src/components/AssetsModal.tsx +0 -371
- package/src/components/BaselineBar.tsx +0 -98
- package/src/export.ts +0 -110
- package/src/format.ts +0 -53
- package/src/hooks/useAssetRecords.ts +0 -26
- package/src/index.tsx +0 -87
- package/src/preset.tsx +0 -35
- package/src/remote.ts +0 -65
- package/src/state.ts +0 -84
- package/src/store/assetStore.ts +0 -209
- package/src/store/baseline.ts +0 -152
- package/src/store/insights.ts +0 -145
- package/src/sync/assetsSyncAdapter.ts +0 -151
- package/src/types.ts +0 -160
|
@@ -9,6 +9,7 @@ var _sharedUi = require("@buoy-gg/shared-ui");
|
|
|
9
9
|
var _measure = require("../capture/measure");
|
|
10
10
|
var _format = require("../format");
|
|
11
11
|
var _assetStore = require("../store/assetStore");
|
|
12
|
+
var _testIDs = require("../utils/testIDs");
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
/**
|
|
14
15
|
* AssetRow — one bundled asset as a family-style card (matching the network
|
|
@@ -27,12 +28,14 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
27
28
|
|
|
28
29
|
function Badge({
|
|
29
30
|
label,
|
|
30
|
-
color
|
|
31
|
+
color,
|
|
32
|
+
testID
|
|
31
33
|
}) {
|
|
32
34
|
// Quiet chip: legibility from light-gray text on a neutral fill. Only the
|
|
33
35
|
// serious tiers (red) and WEBP (blue) carry a small dot; the rest are plain.
|
|
34
36
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
35
37
|
style: styles.badgePill,
|
|
38
|
+
testID: testID,
|
|
36
39
|
children: [color ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
37
40
|
style: [styles.badgeDot, {
|
|
38
41
|
backgroundColor: color
|
|
@@ -77,14 +80,17 @@ function AssetRow({
|
|
|
77
80
|
});
|
|
78
81
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
79
82
|
style: styles.card,
|
|
80
|
-
testID:
|
|
83
|
+
testID: (0, _testIDs.assetRowTestID)(record.name, record.type),
|
|
81
84
|
onPress: () => onPress(record.id),
|
|
82
85
|
activeOpacity: 0.7,
|
|
83
86
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
84
87
|
style: styles.body,
|
|
85
88
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
86
89
|
style: styles.thumbBox,
|
|
87
|
-
children: thumbSource != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image
|
|
90
|
+
children: thumbSource != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image
|
|
91
|
+
// buoy-internal- prefix: the images tool skips its own toolchain's
|
|
92
|
+
// views, so previewing an asset never records a render of itself.
|
|
93
|
+
, {
|
|
88
94
|
testID: "buoy-internal-assets-thumb",
|
|
89
95
|
source: thumbSource,
|
|
90
96
|
style: styles.thumb,
|
|
@@ -100,6 +106,7 @@ function AssetRow({
|
|
|
100
106
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
101
107
|
style: styles.name,
|
|
102
108
|
numberOfLines: 1,
|
|
109
|
+
testID: `${(0, _testIDs.assetRowTestID)(record.name, record.type)}-name`,
|
|
103
110
|
children: [record.name, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
104
111
|
style: styles.ext,
|
|
105
112
|
children: [".", record.type]
|
|
@@ -118,12 +125,14 @@ function AssetRow({
|
|
|
118
125
|
style: styles.right,
|
|
119
126
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
120
127
|
style: styles.size,
|
|
128
|
+
testID: `${(0, _testIDs.assetRowTestID)(record.name, record.type)}-size`,
|
|
121
129
|
children: (0, _format.formatSize)(record, (0, _assetStore.estDecodedBytes)(record))
|
|
122
130
|
}), badges.length ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
123
131
|
style: styles.badgeRow,
|
|
124
132
|
children: badges.slice(0, 3).map(b => /*#__PURE__*/(0, _jsxRuntime.jsx)(Badge, {
|
|
125
133
|
label: b.label,
|
|
126
|
-
color: b.color
|
|
134
|
+
color: b.color,
|
|
135
|
+
testID: (0, _testIDs.assetBadgeTestID)(record.name, record.type, b.label)
|
|
127
136
|
}, b.label))
|
|
128
137
|
}) : null]
|
|
129
138
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_sharedUi","_measure","_format","_assetStore","_jsxRuntime","Badge","label","color","jsxs","View","style","styles","badgePill","children","jsx","badgeDot","backgroundColor","Text","badgePillText","AssetRow","record","flags","sizeFraction","onPress","accent","KIND_COLORS","kind","thumbSource","displaySource","badges","loaded","push","oversize","macOSColors","semantic","error","duplicate","heavy","scaleAnomaly","scaleGap","webp","info","TouchableOpacity","card","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_sharedUi","_measure","_format","_assetStore","_testIDs","_jsxRuntime","Badge","label","color","testID","jsxs","View","style","styles","badgePill","children","jsx","badgeDot","backgroundColor","Text","badgePillText","AssetRow","record","flags","sizeFraction","onPress","accent","KIND_COLORS","kind","thumbSource","displaySource","badges","loaded","push","oversize","macOSColors","semantic","error","duplicate","heavy","scaleAnomaly","scaleGap","webp","info","TouchableOpacity","card","assetRowTestID","name","type","id","activeOpacity","body","thumbBox","Image","source","thumb","resizeMode","thumbFallback","KIND_LABELS","main","numberOfLines","ext","metaRow","width","meta","formatDimensions","scales","length","formatScales","right","size","formatSize","estDecodedBytes","badgeRow","slice","map","b","assetBadgeTestID","sizeTrack","sizeFill","Math","max","round","StyleSheet","create","marginHorizontal","marginTop","borderRadius","night","surface","borderWidth","borderColor","border","overflow","flexDirection","alignItems","paddingVertical","paddingHorizontal","gap","height","justifyContent","fontSize","fontWeight","letterSpacing","flex","text","textTertiary","textSecondary","fontVariant","opacity","borderTopRightRadius"],"sourceRoot":"../../../src","sources":["components/AssetRow.tsx"],"mappings":";;;;;;AAaA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAOA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAAoE,IAAAM,WAAA,GAAAN,OAAA;AAxBpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;;AAkBA,SAASO,KAAKA,CAAC;EACbC,KAAK;EACLC,KAAK;EACLC;AAKF,CAAC,EAAE;EACD;EACA;EACA,oBACE,IAAAJ,WAAA,CAAAK,IAAA,EAACZ,YAAA,CAAAa,IAAI;IA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EACD/E,QAAQ,EAAE;IACR8C,KAAK,EAAE,CAAC;IACRoC,MAAM,EAAE,CAAC;IACTZ,YAAY,EAAE;EAChB,CAAC;EACDnE,aAAa,EAAE;IACbZ,KAAK,EAAEgF,eAAK,CAAChF,KAAK,CAACmG,aAAa;IAChCN,QAAQ,EAAE,CAAC;IACXC,UAAU,EAAE,KAAK;IACjBC,aAAa,EAAE;EACjB,CAAC;EACDzB,SAAS,EAAE;IACTqB,MAAM,EAAE,CAAC;IACTjF,eAAe,EAAE;EACnB,CAAC;EACD6D,QAAQ,EAAE;IACRoB,MAAM,EAAE,CAAC;IACTU,OAAO,EAAE,IAAI;IACbC,oBAAoB,EAAE;EACxB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ASSETS_TEST_IDS = void 0;
|
|
7
|
+
exports.assetBadgeTestID = assetBadgeTestID;
|
|
8
|
+
exports.assetDetailRowTestID = assetDetailRowTestID;
|
|
9
|
+
exports.assetFilterTestID = assetFilterTestID;
|
|
10
|
+
exports.assetFindingTestID = assetFindingTestID;
|
|
11
|
+
exports.assetFontChipTestID = assetFontChipTestID;
|
|
12
|
+
exports.assetRowTestID = assetRowTestID;
|
|
13
|
+
exports.assetSlug = assetSlug;
|
|
14
|
+
/**
|
|
15
|
+
* Automation handles for the Assets tool.
|
|
16
|
+
*
|
|
17
|
+
* Every handle the tool renders is built here rather than inlined at the call
|
|
18
|
+
* site, for the same reason the highlight tool does it: the ids for rows,
|
|
19
|
+
* badges, filter chips and detail fields are DERIVED from data, and a suite
|
|
20
|
+
* that reimplements the derivation is a suite that can drift from the tool
|
|
21
|
+
* without either side failing. `detox-e2e/assets/fixture.js` mirrors these
|
|
22
|
+
* rules in CommonJS (the tests can't import TypeScript) and asserts the two
|
|
23
|
+
* still agree before any flow trusts a handle.
|
|
24
|
+
*
|
|
25
|
+
* Naming: `buoy-assets-<area>[-<detail>]`, one prefix for the whole tool.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Lowercase, hyphen-joined, never empty.
|
|
30
|
+
*
|
|
31
|
+
* Shared by rows, badges, filter chips and detail fields so one asset's row
|
|
32
|
+
* handle and its detail handles are slugged the same way — `back-icon.png`
|
|
33
|
+
* becomes `back-icon-png` everywhere it appears.
|
|
34
|
+
*/
|
|
35
|
+
function assetSlug(value) {
|
|
36
|
+
return String(value).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "unknown";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* One inventory row, addressed by filename rather than by store id.
|
|
41
|
+
*
|
|
42
|
+
* The store's numeric ids are assigned in first-sighting order and are NOT
|
|
43
|
+
* stable: clearing the inventory and rescanning renumbers everything, and the
|
|
44
|
+
* order the registry walk and the Metro graph merge in depends on what the app
|
|
45
|
+
* has evaluated so far. A handle built from those makes a test that passes
|
|
46
|
+
* only on the run that recorded it.
|
|
47
|
+
*
|
|
48
|
+
* The tradeoff is that two assets with the same filename in different
|
|
49
|
+
* directories collide. That's a real ambiguity rather than a hidden one —
|
|
50
|
+
* Detox reports it as "multiple elements matched", which names the problem —
|
|
51
|
+
* and it's the same tradeoff the row itself makes, since the row shows the
|
|
52
|
+
* filename and not the path.
|
|
53
|
+
*/
|
|
54
|
+
function assetRowTestID(name, type) {
|
|
55
|
+
return `buoy-assets-row-${assetSlug(`${name}.${type}`)}`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** A finding badge inside a row: `…-badge-low-res`, `…-badge-dup`. */
|
|
59
|
+
function assetBadgeTestID(name, type, label) {
|
|
60
|
+
return `${assetRowTestID(name, type)}-badge-${assetSlug(label)}`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** A kind/status filter chip: `buoy-assets-filter-font`, `…-filter-unused`. */
|
|
64
|
+
function assetFilterTestID(filter) {
|
|
65
|
+
return `buoy-assets-filter-${assetSlug(filter)}`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** One label/value pair in the detail view: `buoy-assets-detail-row-hash`. */
|
|
69
|
+
function assetDetailRowTestID(label) {
|
|
70
|
+
return `buoy-assets-detail-row-${assetSlug(label)}`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** A loaded font-family chip: `buoy-assets-font-ionicons`. */
|
|
74
|
+
function assetFontChipTestID(family) {
|
|
75
|
+
return `buoy-assets-font-${assetSlug(family)}`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Fixed handles — everything that isn't derived from a record. */
|
|
79
|
+
const ASSETS_TEST_IDS = exports.ASSETS_TEST_IDS = {
|
|
80
|
+
// header
|
|
81
|
+
title: "buoy-assets-title",
|
|
82
|
+
copy: "buoy-assets-copy",
|
|
83
|
+
clear: "buoy-assets-clear",
|
|
84
|
+
// list chrome
|
|
85
|
+
list: "buoy-assets-list",
|
|
86
|
+
search: "buoy-assets-search",
|
|
87
|
+
sort: "buoy-assets-sort",
|
|
88
|
+
saveBaseline: "buoy-assets-save-baseline",
|
|
89
|
+
filterBar: "buoy-assets-filter-bar",
|
|
90
|
+
notice: "buoy-assets-notice",
|
|
91
|
+
noticeText: "buoy-assets-notice-text",
|
|
92
|
+
fonts: "buoy-assets-fonts",
|
|
93
|
+
fontsTitle: "buoy-assets-fonts-title",
|
|
94
|
+
empty: "buoy-assets-empty",
|
|
95
|
+
emptyTitle: "buoy-assets-empty-title",
|
|
96
|
+
emptyText: "buoy-assets-empty-text",
|
|
97
|
+
// baseline bar
|
|
98
|
+
baseline: "buoy-assets-baseline",
|
|
99
|
+
baselineSummary: "buoy-assets-baseline-summary",
|
|
100
|
+
baselineUpdate: "buoy-assets-baseline-update",
|
|
101
|
+
baselineClear: "buoy-assets-baseline-clear",
|
|
102
|
+
// detail
|
|
103
|
+
detail: "buoy-assets-detail",
|
|
104
|
+
detailScroll: "buoy-assets-detail-scroll",
|
|
105
|
+
detailPreview: "buoy-assets-detail-preview",
|
|
106
|
+
detailFontPreview: "buoy-assets-detail-font-preview",
|
|
107
|
+
detailFindings: "buoy-assets-detail-findings"
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/** One finding sentence in the detail view, by position. */
|
|
111
|
+
function assetFindingTestID(index) {
|
|
112
|
+
return `buoy-assets-detail-finding-${index}`;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=testIDs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["assetSlug","value","String","toLowerCase","replace","assetRowTestID","name","type","assetBadgeTestID","label","assetFilterTestID","filter","assetDetailRowTestID","assetFontChipTestID","family","ASSETS_TEST_IDS","exports","title","copy","clear","list","search","sort","saveBaseline","filterBar","notice","noticeText","fonts","fontsTitle","empty","emptyTitle","emptyText","baseline","baselineSummary","baselineUpdate","baselineClear","detail","detailScroll","detailPreview","detailFontPreview","detailFindings","assetFindingTestID","index"],"sourceRoot":"../../../src","sources":["utils/testIDs.ts"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,SAASA,CAACC,KAAsB,EAAU;EACxD,OACEC,MAAM,CAACD,KAAK,CAAC,CACVE,WAAW,CAAC,CAAC,CACbC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAC3BA,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,SAAS;AAE3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAACC,IAAY,EAAEC,IAAY,EAAU;EACjE,OAAO,mBAAmBP,SAAS,CAAC,GAAGM,IAAI,IAAIC,IAAI,EAAE,CAAC,EAAE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AAc,EAAE;AAClB,CAAU;;AAEV;AACO,SAASC,kBAAkBA,CAACC,KAAa,EAAU;EACxD,OAAO,8BAA8BA,KAAK,EAAE;AAC9C","ignoreList":[]}
|
|
@@ -18,17 +18,20 @@ import { macOSColors, night } from "@buoy-gg/shared-ui";
|
|
|
18
18
|
import { displaySource } from "../capture/measure";
|
|
19
19
|
import { formatDimensions, formatScales, formatSize, KIND_COLORS, KIND_LABELS } from "../format";
|
|
20
20
|
import { estDecodedBytes } from "../store/assetStore";
|
|
21
|
+
import { assetBadgeTestID, assetRowTestID } from "../utils/testIDs";
|
|
21
22
|
|
|
22
23
|
/** Which audit findings apply to this record (drives the row badges). */
|
|
23
24
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
25
|
function Badge({
|
|
25
26
|
label,
|
|
26
|
-
color
|
|
27
|
+
color,
|
|
28
|
+
testID
|
|
27
29
|
}) {
|
|
28
30
|
// Quiet chip: legibility from light-gray text on a neutral fill. Only the
|
|
29
31
|
// serious tiers (red) and WEBP (blue) carry a small dot; the rest are plain.
|
|
30
32
|
return /*#__PURE__*/_jsxs(View, {
|
|
31
33
|
style: styles.badgePill,
|
|
34
|
+
testID: testID,
|
|
32
35
|
children: [color ? /*#__PURE__*/_jsx(View, {
|
|
33
36
|
style: [styles.badgeDot, {
|
|
34
37
|
backgroundColor: color
|
|
@@ -73,14 +76,17 @@ export function AssetRow({
|
|
|
73
76
|
});
|
|
74
77
|
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
75
78
|
style: styles.card,
|
|
76
|
-
testID:
|
|
79
|
+
testID: assetRowTestID(record.name, record.type),
|
|
77
80
|
onPress: () => onPress(record.id),
|
|
78
81
|
activeOpacity: 0.7,
|
|
79
82
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
80
83
|
style: styles.body,
|
|
81
84
|
children: [/*#__PURE__*/_jsx(View, {
|
|
82
85
|
style: styles.thumbBox,
|
|
83
|
-
children: thumbSource != null ? /*#__PURE__*/_jsx(Image
|
|
86
|
+
children: thumbSource != null ? /*#__PURE__*/_jsx(Image
|
|
87
|
+
// buoy-internal- prefix: the images tool skips its own toolchain's
|
|
88
|
+
// views, so previewing an asset never records a render of itself.
|
|
89
|
+
, {
|
|
84
90
|
testID: "buoy-internal-assets-thumb",
|
|
85
91
|
source: thumbSource,
|
|
86
92
|
style: styles.thumb,
|
|
@@ -96,6 +102,7 @@ export function AssetRow({
|
|
|
96
102
|
children: [/*#__PURE__*/_jsxs(Text, {
|
|
97
103
|
style: styles.name,
|
|
98
104
|
numberOfLines: 1,
|
|
105
|
+
testID: `${assetRowTestID(record.name, record.type)}-name`,
|
|
99
106
|
children: [record.name, /*#__PURE__*/_jsxs(Text, {
|
|
100
107
|
style: styles.ext,
|
|
101
108
|
children: [".", record.type]
|
|
@@ -114,12 +121,14 @@ export function AssetRow({
|
|
|
114
121
|
style: styles.right,
|
|
115
122
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
116
123
|
style: styles.size,
|
|
124
|
+
testID: `${assetRowTestID(record.name, record.type)}-size`,
|
|
117
125
|
children: formatSize(record, estDecodedBytes(record))
|
|
118
126
|
}), badges.length ? /*#__PURE__*/_jsx(View, {
|
|
119
127
|
style: styles.badgeRow,
|
|
120
128
|
children: badges.slice(0, 3).map(b => /*#__PURE__*/_jsx(Badge, {
|
|
121
129
|
label: b.label,
|
|
122
|
-
color: b.color
|
|
130
|
+
color: b.color,
|
|
131
|
+
testID: assetBadgeTestID(record.name, record.type, b.label)
|
|
123
132
|
}, b.label))
|
|
124
133
|
}) : null]
|
|
125
134
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Image","StyleSheet","Text","TouchableOpacity","View","macOSColors","night","displaySource","formatDimensions","formatScales","formatSize","KIND_COLORS","KIND_LABELS","estDecodedBytes","jsx","_jsx","jsxs","_jsxs","Badge","label","color","style","styles","badgePill","children","badgeDot","backgroundColor","badgePillText","AssetRow","record","flags","sizeFraction","onPress","accent","kind","thumbSource","badges","loaded","push","oversize","semantic","error","duplicate","heavy","scaleAnomaly","scaleGap","webp","info","card","
|
|
1
|
+
{"version":3,"names":["Image","StyleSheet","Text","TouchableOpacity","View","macOSColors","night","displaySource","formatDimensions","formatScales","formatSize","KIND_COLORS","KIND_LABELS","estDecodedBytes","assetBadgeTestID","assetRowTestID","jsx","_jsx","jsxs","_jsxs","Badge","label","color","testID","style","styles","badgePill","children","badgeDot","backgroundColor","badgePillText","AssetRow","record","flags","sizeFraction","onPress","accent","kind","thumbSource","badges","loaded","push","oversize","semantic","error","duplicate","heavy","scaleAnomaly","scaleGap","webp","info","card","name","type","id","activeOpacity","body","thumbBox","source","thumb","resizeMode","thumbFallback","main","numberOfLines","ext","metaRow","width","meta","scales","length","right","size","badgeRow","slice","map","b","sizeTrack","sizeFill","Math","max","round","create","marginHorizontal","marginTop","borderRadius","surface","borderWidth","borderColor","border","overflow","flexDirection","alignItems","paddingVertical","paddingHorizontal","gap","height","justifyContent","fontSize","fontWeight","letterSpacing","flex","text","textTertiary","textSecondary","fontVariant","opacity","borderTopRightRadius"],"sourceRoot":"../../../src","sources":["components/AssetRow.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,EAAEC,UAAU,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AAC9E,SAASC,WAAW,EAAEC,KAAK,QAAQ,oBAAoB;AACvD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SACEC,gBAAgB,EAChBC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXC,WAAW,QACN,WAAW;AAClB,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,kBAAkB;;AAGnE;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAkBA,SAASC,KAAKA,CAAC;EACbC,KAAK;EACLC,K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K,CAACiF,aAAa;IAChCN,QAAQ,EAAE,EAAE;IACZO,WAAW,EAAE,CAAC,cAAc;EAC9B,CAAC;EACDlC,KAAK,EAAE;IACLqB,UAAU,EAAE,UAAU;IACtBG,GAAG,EAAE;EACP,CAAC;EACDvB,IAAI,EAAE;IACJjD,KAAK,EAAEhB,KAAK,CAACgB,KAAK,CAAC+E,IAAI;IACvBJ,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBM,WAAW,EAAE,CAAC,cAAc;EAC9B,CAAC;EACDhC,QAAQ,EAAE;IACRkB,aAAa,EAAE,KAAK;IACpBI,GAAG,EAAE;EACP,CAAC;EACDpE,SAAS,EAAE;IACTgE,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBG,GAAG,EAAE,CAAC;IACNjE,eAAe,EAAE,wBAAwB;IACzCuD,YAAY,EAAE,CAAC;IACfS,iBAAiB,EAAE,CAAC;IACpBD,eAAe,EAAE;EACnB,CAAC;EACDhE,QAAQ,EAAE;IACRsC,KAAK,EAAE,CAAC;IACR6B,MAAM,EAAE,CAAC;IACTX,YAAY,EAAE;EAChB,CAAC;EACDtD,aAAa,EAAE;IACbR,KAAK,EAAEhB,KAAK,CAACgB,KAAK,CAACiF,aAAa;IAChCN,QAAQ,EAAE,CAAC;IACXC,UAAU,EAAE,KAAK;IACjBC,aAAa,EAAE;EACjB,CAAC;EACDvB,SAAS,EAAE;IACTmB,MAAM,EAAE,CAAC;IACTlE,eAAe,EAAE;EACnB,CAAC;EACDgD,QAAQ,EAAE;IACRkB,MAAM,EAAE,CAAC;IACTU,OAAO,EAAE,IAAI;IACbC,oBAAoB,EAAE;EACxB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Automation handles for the Assets tool.
|
|
5
|
+
*
|
|
6
|
+
* Every handle the tool renders is built here rather than inlined at the call
|
|
7
|
+
* site, for the same reason the highlight tool does it: the ids for rows,
|
|
8
|
+
* badges, filter chips and detail fields are DERIVED from data, and a suite
|
|
9
|
+
* that reimplements the derivation is a suite that can drift from the tool
|
|
10
|
+
* without either side failing. `detox-e2e/assets/fixture.js` mirrors these
|
|
11
|
+
* rules in CommonJS (the tests can't import TypeScript) and asserts the two
|
|
12
|
+
* still agree before any flow trusts a handle.
|
|
13
|
+
*
|
|
14
|
+
* Naming: `buoy-assets-<area>[-<detail>]`, one prefix for the whole tool.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Lowercase, hyphen-joined, never empty.
|
|
19
|
+
*
|
|
20
|
+
* Shared by rows, badges, filter chips and detail fields so one asset's row
|
|
21
|
+
* handle and its detail handles are slugged the same way — `back-icon.png`
|
|
22
|
+
* becomes `back-icon-png` everywhere it appears.
|
|
23
|
+
*/
|
|
24
|
+
export function assetSlug(value) {
|
|
25
|
+
return String(value).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "unknown";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* One inventory row, addressed by filename rather than by store id.
|
|
30
|
+
*
|
|
31
|
+
* The store's numeric ids are assigned in first-sighting order and are NOT
|
|
32
|
+
* stable: clearing the inventory and rescanning renumbers everything, and the
|
|
33
|
+
* order the registry walk and the Metro graph merge in depends on what the app
|
|
34
|
+
* has evaluated so far. A handle built from those makes a test that passes
|
|
35
|
+
* only on the run that recorded it.
|
|
36
|
+
*
|
|
37
|
+
* The tradeoff is that two assets with the same filename in different
|
|
38
|
+
* directories collide. That's a real ambiguity rather than a hidden one —
|
|
39
|
+
* Detox reports it as "multiple elements matched", which names the problem —
|
|
40
|
+
* and it's the same tradeoff the row itself makes, since the row shows the
|
|
41
|
+
* filename and not the path.
|
|
42
|
+
*/
|
|
43
|
+
export function assetRowTestID(name, type) {
|
|
44
|
+
return `buoy-assets-row-${assetSlug(`${name}.${type}`)}`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** A finding badge inside a row: `…-badge-low-res`, `…-badge-dup`. */
|
|
48
|
+
export function assetBadgeTestID(name, type, label) {
|
|
49
|
+
return `${assetRowTestID(name, type)}-badge-${assetSlug(label)}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** A kind/status filter chip: `buoy-assets-filter-font`, `…-filter-unused`. */
|
|
53
|
+
export function assetFilterTestID(filter) {
|
|
54
|
+
return `buoy-assets-filter-${assetSlug(filter)}`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** One label/value pair in the detail view: `buoy-assets-detail-row-hash`. */
|
|
58
|
+
export function assetDetailRowTestID(label) {
|
|
59
|
+
return `buoy-assets-detail-row-${assetSlug(label)}`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** A loaded font-family chip: `buoy-assets-font-ionicons`. */
|
|
63
|
+
export function assetFontChipTestID(family) {
|
|
64
|
+
return `buoy-assets-font-${assetSlug(family)}`;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Fixed handles — everything that isn't derived from a record. */
|
|
68
|
+
export const ASSETS_TEST_IDS = {
|
|
69
|
+
// header
|
|
70
|
+
title: "buoy-assets-title",
|
|
71
|
+
copy: "buoy-assets-copy",
|
|
72
|
+
clear: "buoy-assets-clear",
|
|
73
|
+
// list chrome
|
|
74
|
+
list: "buoy-assets-list",
|
|
75
|
+
search: "buoy-assets-search",
|
|
76
|
+
sort: "buoy-assets-sort",
|
|
77
|
+
saveBaseline: "buoy-assets-save-baseline",
|
|
78
|
+
filterBar: "buoy-assets-filter-bar",
|
|
79
|
+
notice: "buoy-assets-notice",
|
|
80
|
+
noticeText: "buoy-assets-notice-text",
|
|
81
|
+
fonts: "buoy-assets-fonts",
|
|
82
|
+
fontsTitle: "buoy-assets-fonts-title",
|
|
83
|
+
empty: "buoy-assets-empty",
|
|
84
|
+
emptyTitle: "buoy-assets-empty-title",
|
|
85
|
+
emptyText: "buoy-assets-empty-text",
|
|
86
|
+
// baseline bar
|
|
87
|
+
baseline: "buoy-assets-baseline",
|
|
88
|
+
baselineSummary: "buoy-assets-baseline-summary",
|
|
89
|
+
baselineUpdate: "buoy-assets-baseline-update",
|
|
90
|
+
baselineClear: "buoy-assets-baseline-clear",
|
|
91
|
+
// detail
|
|
92
|
+
detail: "buoy-assets-detail",
|
|
93
|
+
detailScroll: "buoy-assets-detail-scroll",
|
|
94
|
+
detailPreview: "buoy-assets-detail-preview",
|
|
95
|
+
detailFontPreview: "buoy-assets-detail-font-preview",
|
|
96
|
+
detailFindings: "buoy-assets-detail-findings"
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/** One finding sentence in the detail view, by position. */
|
|
100
|
+
export function assetFindingTestID(index) {
|
|
101
|
+
return `buoy-assets-detail-finding-${index}`;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=testIDs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["assetSlug","value","String","toLowerCase","replace","assetRowTestID","name","type","assetBadgeTestID","label","assetFilterTestID","filter","assetDetailRowTestID","assetFontChipTestID","family","ASSETS_TEST_IDS","title","copy","clear","list","search","sort","saveBaseline","filterBar","notice","noticeText","fonts","fontsTitle","empty","emptyTitle","emptyText","baseline","baselineSummary","baselineUpdate","baselineClear","detail","detailScroll","detailPreview","detailFontPreview","detailFindings","assetFindingTestID","index"],"sourceRoot":"../../../src","sources":["utils/testIDs.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,SAASA,CAACC,KAAsB,EAAU;EACxD,OACEC,MAAM,CAACD,KAAK,CAAC,CACVE,WAAW,CAAC,CAAC,CACbC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAC3BA,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI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,sBAAsB;EAChCC,eAAe,EAAE,8BAA8B;EAC/CC,cAAc,EAAE,6BAA6B;EAC7CC,aAAa,EAAE,4BAA4B;EAC3C;EACAC,MAAM,EAAE,oBAAoB;EAC5BC,YAAY,EAAE,2BAA2B;EACzCC,aAAa,EAAE,4BAA4B;EAC3CC,iBAAiB,EAAE,iCAAiC;EACpDC,cAAc,EAAE;AAClB,CAAU;;AAEV;AACA,OAAO,SAASC,kBAAkBA,CAACC,KAAa,EAAU;EACxD,OAAO,8BAA8BA,KAAK,EAAE;AAC9C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetRow.d.ts","sourceRoot":"","sources":["../../../src/components/AssetRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"AssetRow.d.ts","sourceRoot":"","sources":["../../../src/components/AssetRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAcH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,yEAAyE;AACzE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,UAAU,aAAa;IACrB,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,aAAa,CAAC;IACrB,oEAAoE;IACpE,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AAqBD,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,aAAa,+BA+F/E"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Automation handles for the Assets tool.
|
|
3
|
+
*
|
|
4
|
+
* Every handle the tool renders is built here rather than inlined at the call
|
|
5
|
+
* site, for the same reason the highlight tool does it: the ids for rows,
|
|
6
|
+
* badges, filter chips and detail fields are DERIVED from data, and a suite
|
|
7
|
+
* that reimplements the derivation is a suite that can drift from the tool
|
|
8
|
+
* without either side failing. `detox-e2e/assets/fixture.js` mirrors these
|
|
9
|
+
* rules in CommonJS (the tests can't import TypeScript) and asserts the two
|
|
10
|
+
* still agree before any flow trusts a handle.
|
|
11
|
+
*
|
|
12
|
+
* Naming: `buoy-assets-<area>[-<detail>]`, one prefix for the whole tool.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Lowercase, hyphen-joined, never empty.
|
|
16
|
+
*
|
|
17
|
+
* Shared by rows, badges, filter chips and detail fields so one asset's row
|
|
18
|
+
* handle and its detail handles are slugged the same way — `back-icon.png`
|
|
19
|
+
* becomes `back-icon-png` everywhere it appears.
|
|
20
|
+
*/
|
|
21
|
+
export declare function assetSlug(value: string | number): string;
|
|
22
|
+
/**
|
|
23
|
+
* One inventory row, addressed by filename rather than by store id.
|
|
24
|
+
*
|
|
25
|
+
* The store's numeric ids are assigned in first-sighting order and are NOT
|
|
26
|
+
* stable: clearing the inventory and rescanning renumbers everything, and the
|
|
27
|
+
* order the registry walk and the Metro graph merge in depends on what the app
|
|
28
|
+
* has evaluated so far. A handle built from those makes a test that passes
|
|
29
|
+
* only on the run that recorded it.
|
|
30
|
+
*
|
|
31
|
+
* The tradeoff is that two assets with the same filename in different
|
|
32
|
+
* directories collide. That's a real ambiguity rather than a hidden one —
|
|
33
|
+
* Detox reports it as "multiple elements matched", which names the problem —
|
|
34
|
+
* and it's the same tradeoff the row itself makes, since the row shows the
|
|
35
|
+
* filename and not the path.
|
|
36
|
+
*/
|
|
37
|
+
export declare function assetRowTestID(name: string, type: string): string;
|
|
38
|
+
/** A finding badge inside a row: `…-badge-low-res`, `…-badge-dup`. */
|
|
39
|
+
export declare function assetBadgeTestID(name: string, type: string, label: string): string;
|
|
40
|
+
/** A kind/status filter chip: `buoy-assets-filter-font`, `…-filter-unused`. */
|
|
41
|
+
export declare function assetFilterTestID(filter: string): string;
|
|
42
|
+
/** One label/value pair in the detail view: `buoy-assets-detail-row-hash`. */
|
|
43
|
+
export declare function assetDetailRowTestID(label: string): string;
|
|
44
|
+
/** A loaded font-family chip: `buoy-assets-font-ionicons`. */
|
|
45
|
+
export declare function assetFontChipTestID(family: string): string;
|
|
46
|
+
/** Fixed handles — everything that isn't derived from a record. */
|
|
47
|
+
export declare const ASSETS_TEST_IDS: {
|
|
48
|
+
readonly title: "buoy-assets-title";
|
|
49
|
+
readonly copy: "buoy-assets-copy";
|
|
50
|
+
readonly clear: "buoy-assets-clear";
|
|
51
|
+
readonly list: "buoy-assets-list";
|
|
52
|
+
readonly search: "buoy-assets-search";
|
|
53
|
+
readonly sort: "buoy-assets-sort";
|
|
54
|
+
readonly saveBaseline: "buoy-assets-save-baseline";
|
|
55
|
+
readonly filterBar: "buoy-assets-filter-bar";
|
|
56
|
+
readonly notice: "buoy-assets-notice";
|
|
57
|
+
readonly noticeText: "buoy-assets-notice-text";
|
|
58
|
+
readonly fonts: "buoy-assets-fonts";
|
|
59
|
+
readonly fontsTitle: "buoy-assets-fonts-title";
|
|
60
|
+
readonly empty: "buoy-assets-empty";
|
|
61
|
+
readonly emptyTitle: "buoy-assets-empty-title";
|
|
62
|
+
readonly emptyText: "buoy-assets-empty-text";
|
|
63
|
+
readonly baseline: "buoy-assets-baseline";
|
|
64
|
+
readonly baselineSummary: "buoy-assets-baseline-summary";
|
|
65
|
+
readonly baselineUpdate: "buoy-assets-baseline-update";
|
|
66
|
+
readonly baselineClear: "buoy-assets-baseline-clear";
|
|
67
|
+
readonly detail: "buoy-assets-detail";
|
|
68
|
+
readonly detailScroll: "buoy-assets-detail-scroll";
|
|
69
|
+
readonly detailPreview: "buoy-assets-detail-preview";
|
|
70
|
+
readonly detailFontPreview: "buoy-assets-detail-font-preview";
|
|
71
|
+
readonly detailFindings: "buoy-assets-detail-findings";
|
|
72
|
+
};
|
|
73
|
+
/** One finding sentence in the detail view, by position. */
|
|
74
|
+
export declare function assetFindingTestID(index: number): string;
|
|
75
|
+
//# sourceMappingURL=testIDs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testIDs.d.ts","sourceRoot":"","sources":["../../../src/utils/testIDs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAOxD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,MAAM,CAER;AAED,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,8EAA8E;AAC9E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,8DAA8D;AAC9D,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,mEAAmE;AACnE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;CA6BlB,CAAC;AAEX,4DAA4D;AAC5D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAExD"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/assets",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.30",
|
|
4
4
|
"description": "See every asset shipped in your React Native app — bundled images, fonts, video and audio with dimensions, scale variants, byte sizes, duplicate detection and WebP-savings audit. Part of Buoy devtools.",
|
|
5
|
-
"main": "lib/commonjs/index",
|
|
6
|
-
"module": "lib/module/index",
|
|
5
|
+
"main": "lib/commonjs/index.js",
|
|
6
|
+
"module": "lib/module/index.js",
|
|
7
7
|
"types": "lib/typescript/index.d.ts",
|
|
8
|
-
"react-native": "
|
|
8
|
+
"react-native": "lib/module/index.js",
|
|
9
9
|
"source": "src/index.tsx",
|
|
10
10
|
"files": [
|
|
11
|
-
"src",
|
|
12
11
|
"lib"
|
|
13
12
|
],
|
|
14
13
|
"sideEffects": [
|
|
15
14
|
"**/index.*"
|
|
16
15
|
],
|
|
17
16
|
"dependencies": {
|
|
18
|
-
"@buoy-gg/shared-ui": "^7.0.
|
|
17
|
+
"@buoy-gg/shared-ui": "^7.0.30"
|
|
19
18
|
},
|
|
20
19
|
"peerDependencies": {
|
|
21
20
|
"expo-asset": "*",
|
package/src/capture/expo.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Expo enrichment — all optional, all read through globalThis.expo guards so
|
|
3
|
-
* bare RN apps (no expo-modules) silently get none of it and no imports are
|
|
4
|
-
* added for anyone.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
interface ExpoGlobal {
|
|
8
|
-
modules?: {
|
|
9
|
-
ExpoFontLoader?: { getLoadedFonts?: () => string[] };
|
|
10
|
-
ExpoUpdates?: { localAssets?: Record<string, string> };
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function expoModules(): ExpoGlobal["modules"] {
|
|
15
|
-
return (globalThis as { expo?: ExpoGlobal }).expo?.modules;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Every loaded font family — build-time embedded (config plugin / UIAppFonts /
|
|
20
|
-
* android assets/fonts) AND runtime Font.loadAsync, straight from the native
|
|
21
|
-
* module Expo documents as a stable global. [] when unavailable (bare RN).
|
|
22
|
-
*/
|
|
23
|
-
export function getLoadedFontFamilies(): string[] {
|
|
24
|
-
try {
|
|
25
|
-
const fonts = expoModules()?.ExpoFontLoader?.getLoadedFonts?.();
|
|
26
|
-
return Array.isArray(fonts) ? [...fonts].sort() : [];
|
|
27
|
-
} catch {
|
|
28
|
-
return [];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* expo-updates' per-file-hash → local URI map: the COMPLETE shipped asset set
|
|
34
|
-
* in Expo Go / OTA environments, independent of what JS has evaluated.
|
|
35
|
-
* null when not running in an updates-managed environment.
|
|
36
|
-
*/
|
|
37
|
-
export function getLocalAssets(): Record<string, string> | null {
|
|
38
|
-
try {
|
|
39
|
-
const map = expoModules()?.ExpoUpdates?.localAssets;
|
|
40
|
-
if (map && typeof map === "object" && Object.keys(map).length > 0) return map;
|
|
41
|
-
return null;
|
|
42
|
-
} catch {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
}
|