@bundle-stats/ui 4.18.0-beta.0 → 4.18.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/app.js +17 -7
- package/lib/app/app.js.map +1 -1
- package/lib/assets/icons.svg.js +17 -7
- package/lib/assets/icons.svg.js.map +1 -1
- package/lib/components/asset-info/asset-info.i18n.js +11 -0
- package/lib/components/asset-info/asset-info.i18n.js.map +1 -0
- package/lib/components/asset-info/asset-info.js +26 -15
- package/lib/components/asset-info/asset-info.js.map +1 -1
- package/lib/components/browsertime-table/browsertime-table.js +17 -7
- package/lib/components/browsertime-table/browsertime-table.js.map +1 -1
- package/lib/components/bundle-assets/bundle-assets.i18n.js +10 -1
- package/lib/components/bundle-assets/bundle-assets.i18n.js.map +1 -1
- package/lib/components/bundle-assets/bundle-assets.js +19 -9
- package/lib/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib/components/bundle-assets/bundle-assets.utils.js +56 -11
- package/lib/components/bundle-assets/bundle-assets.utils.js.map +1 -1
- package/lib/components/bundle-assets/index.js +17 -7
- package/lib/components/bundle-assets/index.js.map +1 -1
- package/lib/components/bundle-assets-totals/bundle-assets-totals.js +17 -7
- package/lib/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
- package/lib/components/bundle-modules/bundle-modules.js +17 -7
- package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib/components/bundle-modules/bundle-modules.utils.js +17 -7
- package/lib/components/bundle-modules/bundle-modules.utils.js.map +1 -1
- package/lib/components/bundle-modules/index.js +17 -7
- package/lib/components/bundle-modules/index.js.map +1 -1
- package/lib/components/bundle-packages/bundle-packages.js +17 -7
- package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib/components/bundle-packages/index.js +17 -7
- package/lib/components/bundle-packages/index.js.map +1 -1
- package/lib/components/entry-info/entry-info.js +17 -7
- package/lib/components/entry-info/entry-info.js.map +1 -1
- package/lib/components/lighthouse-table/lighthouse-table.js +17 -7
- package/lib/components/lighthouse-table/lighthouse-table.js.map +1 -1
- package/lib/components/metric-run-info/metric-run-info.js +17 -7
- package/lib/components/metric-run-info/metric-run-info.js.map +1 -1
- package/lib/components/metrics-table/index.js +17 -7
- package/lib/components/metrics-table/index.js.map +1 -1
- package/lib/components/metrics-table/metrics-table.js +17 -7
- package/lib/components/metrics-table/metrics-table.js.map +1 -1
- package/lib/components/metrics-table-export/metrics-table-export.js +17 -7
- package/lib/components/metrics-table-export/metrics-table-export.js.map +1 -1
- package/lib/components/metrics-table-header/metrics-table-header.js +17 -7
- package/lib/components/metrics-table-header/metrics-table-header.js.map +1 -1
- package/lib/components/metrics-treemap/metrics-treemap.js +17 -7
- package/lib/components/metrics-treemap/metrics-treemap.js.map +1 -1
- package/lib/components/module-info/module-info.js +17 -7
- package/lib/components/module-info/module-info.js.map +1 -1
- package/lib/components/package-info/package-info.js +17 -7
- package/lib/components/package-info/package-info.js.map +1 -1
- package/lib/components/run-info/run-info.js +17 -7
- package/lib/components/run-info/run-info.js.map +1 -1
- package/lib/components/sort-button/sort-button.js +17 -7
- package/lib/components/sort-button/sort-button.js.map +1 -1
- package/lib/query-state.js +17 -7
- package/lib/query-state.js.map +1 -1
- package/lib/ui/copy-to-clipboard/copy-to-clipboard.js +17 -7
- package/lib/ui/copy-to-clipboard/copy-to-clipboard.js.map +1 -1
- package/lib/ui/filters/filters.js +17 -7
- package/lib/ui/filters/filters.js.map +1 -1
- package/lib/ui/filters/index.js +17 -7
- package/lib/ui/filters/index.js.map +1 -1
- package/lib/ui/hover-card/hover-card.js +17 -7
- package/lib/ui/hover-card/hover-card.js.map +1 -1
- package/lib/ui/input-search/input-search.js +17 -7
- package/lib/ui/input-search/input-search.js.map +1 -1
- package/lib/ui/markdown/markdown.js +17 -7
- package/lib/ui/markdown/markdown.js.map +1 -1
- package/lib-esm/components/asset-info/asset-info.i18n.js +8 -0
- package/lib-esm/components/asset-info/asset-info.i18n.js.map +1 -0
- package/lib-esm/components/asset-info/asset-info.js +9 -8
- package/lib-esm/components/asset-info/asset-info.js.map +1 -1
- package/lib-esm/components/bundle-assets/bundle-assets.i18n.js +9 -0
- package/lib-esm/components/bundle-assets/bundle-assets.i18n.js.map +1 -1
- package/lib-esm/components/bundle-assets/bundle-assets.js +2 -2
- package/lib-esm/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib-esm/components/bundle-assets/bundle-assets.utils.js +24 -11
- package/lib-esm/components/bundle-assets/bundle-assets.utils.js.map +1 -1
- package/package.json +12 -12
- package/src/app/app-gladys.stories.tsx +7 -1
- package/src/app/app-home-assistant.stories.tsx +8 -2
- package/src/app/app-outline.stories.tsx +7 -1
- package/src/app/app-trans-masc-futures.stories.tsx +47 -0
- package/src/components/asset-info/asset-info.i18n.ts +7 -0
- package/src/components/asset-info/asset-info.tsx +9 -14
- package/src/components/bundle-assets/bundle-assets.i18n.ts +9 -0
- package/src/components/bundle-assets/bundle-assets.tsx +2 -2
- package/src/components/bundle-assets/bundle-assets.utils.ts +29 -13
- package/types/components/asset-info/asset-info.i18n.d.ts +7 -0
- package/types/components/bundle-assets/bundle-assets.i18n.d.ts +9 -0
|
@@ -17,6 +17,7 @@ import { FlexStack } from '../../layout/flex-stack';
|
|
|
17
17
|
import { AssetMetaTag } from '../asset-meta-tag';
|
|
18
18
|
import { ComponentLink } from '../component-link';
|
|
19
19
|
import { EntryInfo, EntryInfoMetaLink } from '../entry-info';
|
|
20
|
+
import * as I18N from './asset-info.i18n';
|
|
20
21
|
import css from './asset-info.module.css';
|
|
21
22
|
|
|
22
23
|
interface ChunkModulesLinkProps {
|
|
@@ -57,9 +58,9 @@ const AssetRunName = (props: AssetRunNameProps) => {
|
|
|
57
58
|
return (
|
|
58
59
|
<>
|
|
59
60
|
<span className={css.runNameTags}>
|
|
60
|
-
{run.isEntry && <AssetMetaTag tag="entry" title=
|
|
61
|
-
{run.isInitial && <AssetMetaTag tag="initial" title=
|
|
62
|
-
{run.isChunk && <AssetMetaTag tag="chunk" title=
|
|
61
|
+
{run.isEntry && <AssetMetaTag tag="entry" title={I18N.ENTRY} size="small" />}
|
|
62
|
+
{run.isInitial && <AssetMetaTag tag="initial" title={I18N.INITIAL} size="small" />}
|
|
63
|
+
{run.isChunk && <AssetMetaTag tag="chunk" title={I18N.CHUNK} size="small" />}
|
|
63
64
|
</span>
|
|
64
65
|
{children}
|
|
65
66
|
</>
|
|
@@ -104,7 +105,7 @@ export const AssetInfo = (props: AssetInfoProps & ComponentProps<'div'>) => {
|
|
|
104
105
|
status={item.isEntry}
|
|
105
106
|
className={css.assetNameTag}
|
|
106
107
|
>
|
|
107
|
-
|
|
108
|
+
{I18N.ENTRYPOINT}
|
|
108
109
|
</AssetMetaTag>
|
|
109
110
|
)}
|
|
110
111
|
{item.isInitial && (
|
|
@@ -117,7 +118,7 @@ export const AssetInfo = (props: AssetInfoProps & ComponentProps<'div'>) => {
|
|
|
117
118
|
status={item.isInitial}
|
|
118
119
|
className={cx(css.assetNameTag, css.assetNameTagInitial)}
|
|
119
120
|
>
|
|
120
|
-
|
|
121
|
+
{I18N.INITIAL}
|
|
121
122
|
</AssetMetaTag>
|
|
122
123
|
)}
|
|
123
124
|
{item.isChunk && (
|
|
@@ -130,7 +131,7 @@ export const AssetInfo = (props: AssetInfoProps & ComponentProps<'div'>) => {
|
|
|
130
131
|
status={item.isChunk}
|
|
131
132
|
className={cx(css.assetNameTag, css.assetNameTagChunk)}
|
|
132
133
|
>
|
|
133
|
-
|
|
134
|
+
{I18N.CHUNK}
|
|
134
135
|
</AssetMetaTag>
|
|
135
136
|
)}
|
|
136
137
|
</FlexStack>
|
|
@@ -153,10 +154,7 @@ export const AssetInfo = (props: AssetInfoProps & ComponentProps<'div'>) => {
|
|
|
153
154
|
className={cx(css.root, className)}
|
|
154
155
|
>
|
|
155
156
|
{item.fileType && (
|
|
156
|
-
<EntryInfo.Meta
|
|
157
|
-
label="File type"
|
|
158
|
-
tooltip="Asset file type: JS, CSS, image, media, fonts, HTML, or other"
|
|
159
|
-
>
|
|
157
|
+
<EntryInfo.Meta label={I18N.FILE_TYPE} tooltip={I18N.FILE_TYPE_TOOLTIP}>
|
|
160
158
|
<EntryInfoMetaLink
|
|
161
159
|
as={CustomComponentLink}
|
|
162
160
|
{...getBundleAssetsFileTypeComponentLink(item.fileType, fileTypeLabel)}
|
|
@@ -168,10 +166,7 @@ export const AssetInfo = (props: AssetInfoProps & ComponentProps<'div'>) => {
|
|
|
168
166
|
)}
|
|
169
167
|
|
|
170
168
|
{currentChunk && (
|
|
171
|
-
<EntryInfo.Meta
|
|
172
|
-
label="Chunk"
|
|
173
|
-
tooltip="The bundler's chunk from witch the assets was originated"
|
|
174
|
-
>
|
|
169
|
+
<EntryInfo.Meta label={I18N.CHUNK} tooltip={I18N.CHUNK_TOOLTIP}>
|
|
175
170
|
<EntryInfoMetaLink
|
|
176
171
|
as={CustomComponentLink}
|
|
177
172
|
{...getBundleAssetsByChunk(chunkIds, currentRun.chunkId)}
|
|
@@ -1 +1,10 @@
|
|
|
1
1
|
export const SEARCH_PLACEHOLDER = 'Search by asset path';
|
|
2
|
+
export const CHANGED = 'Changed';
|
|
3
|
+
export const ASSET_TYPE = 'Asset type';
|
|
4
|
+
export const FILE_TYPE = 'File type';
|
|
5
|
+
export const CHUNKS = 'Chunks';
|
|
6
|
+
export const NO_CHUNK = 'No chunk';
|
|
7
|
+
export const ENTRY = 'Entry';
|
|
8
|
+
export const INITIAL = 'Initial';
|
|
9
|
+
export const CHUNK = 'Chunk';
|
|
10
|
+
export const OTHER = 'Other';
|
|
@@ -29,7 +29,7 @@ import { MetricsTableTitle } from '../metrics-table-title';
|
|
|
29
29
|
import { MetricsDisplaySelector } from '../metrics-display-selector';
|
|
30
30
|
import { MetricsTableHeader } from '../metrics-table-header';
|
|
31
31
|
import { MetricsTreemap, getTreemapNodes, getTreemapNodesGroupedByPath } from '../metrics-treemap';
|
|
32
|
-
import
|
|
32
|
+
import * as BUNDLE_ASSETS_I18N from './bundle-assets.i18n';
|
|
33
33
|
import { getFilters } from './bundle-assets.utils';
|
|
34
34
|
import css from './bundle-assets.module.css';
|
|
35
35
|
|
|
@@ -259,7 +259,7 @@ export const BundleAssets = (props: BundleAssetsProps) => {
|
|
|
259
259
|
<FlexStack space="xxsmall">
|
|
260
260
|
<InputSearch
|
|
261
261
|
className={css.toolbarSearch}
|
|
262
|
-
placeholder={SEARCH_PLACEHOLDER}
|
|
262
|
+
placeholder={BUNDLE_ASSETS_I18N.SEARCH_PLACEHOLDER}
|
|
263
263
|
defaultValue={search}
|
|
264
264
|
onChange={updateSearch}
|
|
265
265
|
/>
|
|
@@ -12,12 +12,16 @@ import {
|
|
|
12
12
|
FILE_TYPE_LABELS,
|
|
13
13
|
getFileType,
|
|
14
14
|
} from '@bundle-stats/utils';
|
|
15
|
+
|
|
15
16
|
import type {
|
|
16
17
|
FilterFieldsData,
|
|
17
18
|
ReportMetricAssetRow,
|
|
18
19
|
ReportMetricAssetRowMetaStatus,
|
|
19
20
|
FilterGroupFieldData,
|
|
20
21
|
} from '../../types';
|
|
22
|
+
import * as I18N from './bundle-assets.i18n';
|
|
23
|
+
|
|
24
|
+
const NO_CHUNK_FILTER = 'NO_CHUNK';
|
|
21
25
|
|
|
22
26
|
/**
|
|
23
27
|
* Check if the asset cache is not predictive
|
|
@@ -139,8 +143,8 @@ export const getCustomSort = (item: ReportMetricAssetRow): Array<boolean | strin
|
|
|
139
143
|
item.key,
|
|
140
144
|
];
|
|
141
145
|
|
|
142
|
-
|
|
143
|
-
|
|
146
|
+
/* eslint-disable prettier/prettier */
|
|
147
|
+
const getFileTypeFilters = (filters: Record<string, unknown>): FilterGroupFieldData['children'] => Object.entries(FILE_TYPE_LABELS).map(([key, label]) => ({
|
|
144
148
|
key,
|
|
145
149
|
label,
|
|
146
150
|
defaultValue: get(filters, `${ASSET_FILE_TYPE}.${key}`, true) as boolean,
|
|
@@ -159,14 +163,24 @@ export const getFilters = ({
|
|
|
159
163
|
}: GetFiltersOptions): FilterFieldsData => {
|
|
160
164
|
const result: FilterFieldsData = {
|
|
161
165
|
[ASSET_FILTERS.CHANGED]: {
|
|
162
|
-
label:
|
|
166
|
+
label: I18N.CHANGED,
|
|
163
167
|
defaultValue: filters[ASSET_FILTERS.CHANGED],
|
|
164
168
|
disabled: !compareMode,
|
|
165
169
|
},
|
|
166
170
|
};
|
|
167
171
|
|
|
168
172
|
if (!isEmpty(chunks)) {
|
|
169
|
-
const chunksFilter: FilterGroupFieldData = {
|
|
173
|
+
const chunksFilter: FilterGroupFieldData = {
|
|
174
|
+
label: I18N.CHUNKS,
|
|
175
|
+
children: [
|
|
176
|
+
{
|
|
177
|
+
key: NO_CHUNK_FILTER,
|
|
178
|
+
label: I18N.NO_CHUNK,
|
|
179
|
+
defaultValue: filters[`${ASSET_CHUNK}.${NO_CHUNK_FILTER}`] ?? true,
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
};
|
|
183
|
+
|
|
170
184
|
const chunksOrderedByName = orderBy(chunks, 'name');
|
|
171
185
|
|
|
172
186
|
chunksOrderedByName.forEach((chunk) => {
|
|
@@ -181,33 +195,33 @@ export const getFilters = ({
|
|
|
181
195
|
}
|
|
182
196
|
|
|
183
197
|
result[ASSET_ENTRY_TYPE] = {
|
|
184
|
-
label:
|
|
198
|
+
label: I18N.ASSET_TYPE,
|
|
185
199
|
children: [
|
|
186
200
|
{
|
|
187
201
|
key: ASSET_FILTERS.ENTRY,
|
|
188
|
-
label:
|
|
202
|
+
label: I18N.ENTRY,
|
|
189
203
|
defaultValue: get(filters, `${ASSET_ENTRY_TYPE}.${ASSET_FILTERS.ENTRY}`, true),
|
|
190
204
|
},
|
|
191
205
|
{
|
|
192
206
|
key: ASSET_FILTERS.INITIAL,
|
|
193
|
-
label:
|
|
207
|
+
label: I18N.INITIAL,
|
|
194
208
|
defaultValue: get(filters, `${ASSET_ENTRY_TYPE}.${ASSET_FILTERS.INITIAL}`, true),
|
|
195
209
|
},
|
|
196
210
|
{
|
|
197
211
|
key: ASSET_FILTERS.CHUNK,
|
|
198
|
-
label:
|
|
212
|
+
label: I18N.CHUNK,
|
|
199
213
|
defaultValue: get(filters, `${ASSET_ENTRY_TYPE}.${ASSET_FILTERS.CHUNK}`, true),
|
|
200
214
|
},
|
|
201
215
|
{
|
|
202
216
|
key: ASSET_FILTERS.OTHER,
|
|
203
|
-
label:
|
|
217
|
+
label: I18N.OTHER,
|
|
204
218
|
defaultValue: get(filters, `${ASSET_ENTRY_TYPE}.${ASSET_FILTERS.OTHER}`, true),
|
|
205
219
|
},
|
|
206
220
|
],
|
|
207
221
|
};
|
|
208
222
|
|
|
209
223
|
result[ASSET_FILE_TYPE] = {
|
|
210
|
-
label:
|
|
224
|
+
label: I18N.FILE_TYPE,
|
|
211
225
|
children: getFileTypeFilters(filters),
|
|
212
226
|
};
|
|
213
227
|
|
|
@@ -219,15 +233,17 @@ export const generateGetRowFilter =
|
|
|
219
233
|
({ chunkIds }: GenerateGetRowFilterOptions) => (filters: Record<string, unknown>) => {
|
|
220
234
|
// List of chunkIds with filter value set to `true`
|
|
221
235
|
const checkedChunkIds: Array<string> = [];
|
|
236
|
+
// List of chunks ids, including the NO_CHUNK
|
|
237
|
+
const filtersChunkIds = [NO_CHUNK_FILTER, ...chunkIds];
|
|
222
238
|
|
|
223
|
-
|
|
239
|
+
filtersChunkIds.forEach((chunkId) => {
|
|
224
240
|
if (filters[`${ASSET_CHUNK}.${chunkId}`]) {
|
|
225
241
|
checkedChunkIds.push(chunkId);
|
|
226
242
|
}
|
|
227
243
|
});
|
|
228
244
|
|
|
229
245
|
const hasChunkFilters =
|
|
230
|
-
checkedChunkIds.length > 0 && checkedChunkIds.length !==
|
|
246
|
+
checkedChunkIds.length > 0 && checkedChunkIds.length !== filtersChunkIds.length;
|
|
231
247
|
|
|
232
248
|
return (item: ReportMetricAssetRow) => {
|
|
233
249
|
if (filters[ASSET_FILTERS.CHANGED] && !item.changed) {
|
|
@@ -251,7 +267,7 @@ export const generateGetRowFilter =
|
|
|
251
267
|
|
|
252
268
|
// Filter if any of the chunkIds are checked
|
|
253
269
|
if (hasChunkFilters) {
|
|
254
|
-
const rowRunsChunkIds = item?.runs?.map((run) => run?.chunkId) || [];
|
|
270
|
+
const rowRunsChunkIds = item?.runs?.map((run) => run?.chunkId || NO_CHUNK_FILTER) || [];
|
|
255
271
|
return intersection(rowRunsChunkIds, checkedChunkIds).length > 0;
|
|
256
272
|
}
|
|
257
273
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const ENTRY = "Entry";
|
|
2
|
+
export declare const INITIAL = "Initial";
|
|
3
|
+
export declare const CHUNK = "Chunk";
|
|
4
|
+
export declare const CHUNK_TOOLTIP = "The bundler's chunk from which the assets originated";
|
|
5
|
+
export declare const ENTRYPOINT = "Entrypoint";
|
|
6
|
+
export declare const FILE_TYPE = "File type";
|
|
7
|
+
export declare const FILE_TYPE_TOOLTIP = "Asset file type: JS, CSS, image, media, fonts, HTML, or other";
|
|
@@ -1 +1,10 @@
|
|
|
1
1
|
export declare const SEARCH_PLACEHOLDER = "Search by asset path";
|
|
2
|
+
export declare const CHANGED = "Changed";
|
|
3
|
+
export declare const ASSET_TYPE = "Asset type";
|
|
4
|
+
export declare const FILE_TYPE = "File type";
|
|
5
|
+
export declare const CHUNKS = "Chunks";
|
|
6
|
+
export declare const NO_CHUNK = "No chunk";
|
|
7
|
+
export declare const ENTRY = "Entry";
|
|
8
|
+
export declare const INITIAL = "Initial";
|
|
9
|
+
export declare const CHUNK = "Chunk";
|
|
10
|
+
export declare const OTHER = "Other";
|