cursedbelt 6.28.0 → 6.30.0
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/dist/react/canvas-hud/HudControls.d.ts +2 -0
- package/dist/react/canvas-hud/HudControls.d.ts.map +1 -1
- package/dist/react/canvas-hud/HudControls.js +3 -1
- package/dist/react/canvas-hud/HudControls.js.map +1 -1
- package/dist/react/components/ColorSwatches.d.ts.map +1 -1
- package/dist/react/components/ColorSwatches.js +1 -1
- package/dist/react/components/ColorSwatches.js.map +1 -1
- package/dist/react/components/DataTable/serverWindowWatch.d.ts +5 -4
- package/dist/react/components/DataTable/serverWindowWatch.d.ts.map +1 -1
- package/dist/react/components/DataTable/serverWindowWatch.js +7 -9
- package/dist/react/components/DataTable/serverWindowWatch.js.map +1 -1
- package/dist/react/components/ScrollArea.d.ts +9 -1
- package/dist/react/components/ScrollArea.d.ts.map +1 -1
- package/dist/react/components/ScrollArea.js +9 -3
- package/dist/react/components/ScrollArea.js.map +1 -1
- package/dist/react/components/TagsEditor.d.ts +12 -2
- package/dist/react/components/TagsEditor.d.ts.map +1 -1
- package/dist/react/components/TagsEditor.js +23 -8
- package/dist/react/components/TagsEditor.js.map +1 -1
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/lib/keepAsking.d.ts +30 -0
- package/dist/react/lib/keepAsking.d.ts.map +1 -0
- package/dist/react/lib/keepAsking.js +57 -0
- package/dist/react/lib/keepAsking.js.map +1 -0
- package/dist/react/lib/tagList.d.ts +15 -0
- package/dist/react/lib/tagList.d.ts.map +1 -1
- package/dist/react/lib/tagList.js +29 -0
- package/dist/react/lib/tagList.js.map +1 -1
- package/dist/react/map-frame/MapFrame.d.ts +11 -1
- package/dist/react/map-frame/MapFrame.d.ts.map +1 -1
- package/dist/react/map-frame/MapFrame.js +25 -2
- package/dist/react/map-frame/MapFrame.js.map +1 -1
- package/dist/react/map-frame/geo.d.ts +27 -0
- package/dist/react/map-frame/geo.d.ts.map +1 -1
- package/dist/react/map-frame/geo.js +38 -0
- package/dist/react/map-frame/geo.js.map +1 -1
- package/dist/react/map-frame/index.d.ts +4 -4
- package/dist/react/map-frame/index.d.ts.map +1 -1
- package/dist/react/map-frame/index.js +2 -2
- package/dist/react/map-frame/index.js.map +1 -1
- package/dist/react/media/DenseGalleryShell.d.ts +7 -1
- package/dist/react/media/DenseGalleryShell.d.ts.map +1 -1
- package/dist/react/media/DenseGalleryShell.js +2 -2
- package/dist/react/media/DenseGalleryShell.js.map +1 -1
- package/dist/react/media-gallery/GalleryTable.d.ts +12 -1
- package/dist/react/media-gallery/GalleryTable.d.ts.map +1 -1
- package/dist/react/media-gallery/GalleryTable.js +37 -6
- package/dist/react/media-gallery/GalleryTable.js.map +1 -1
- package/dist/react/media-gallery/MediaGallery.d.ts +39 -3
- package/dist/react/media-gallery/MediaGallery.d.ts.map +1 -1
- package/dist/react/media-gallery/MediaGallery.js +122 -12
- package/dist/react/media-gallery/MediaGallery.js.map +1 -1
- package/dist/react/media-gallery/index.d.ts +1 -1
- package/dist/react/media-gallery/index.d.ts.map +1 -1
- package/dist/react/media-gallery/index.js.map +1 -1
- package/dist/react/media-gallery/mediaGallery.css +16 -0
- package/dist/react/usePrefixList.d.ts +82 -0
- package/dist/react/usePrefixList.d.ts.map +1 -0
- package/dist/react/usePrefixList.js +139 -0
- package/dist/react/usePrefixList.js.map +1 -0
- package/dist/styles-areas/core.css +8 -4
- package/dist/styles-utilities.css +18 -0
- package/dist/testing/shell.d.ts +1 -0
- package/dist/testing/shell.d.ts.map +1 -1
- package/dist/testing/shell.js +2 -0
- package/dist/testing/shell.js.map +1 -1
- package/package.json +9 -3
- package/scripts/build.spec.ts +39 -0
- package/scripts/build.ts +131 -0
- package/scripts/styleAreas.ts +2 -0
- package/src/buildIsStaged.spec.ts +57 -47
- package/src/react/canvas-hud/HudControls.spec.tsx +13 -1
- package/src/react/canvas-hud/HudControls.tsx +3 -1
- package/src/react/components/ColorSwatches.tsx +5 -1
- package/src/react/components/DataTable/serverWindowWatch.ts +8 -9
- package/src/react/components/ScrollArea.spec.tsx +25 -0
- package/src/react/components/ScrollArea.tsx +18 -1
- package/src/react/components/TagsEditor.spec.tsx +66 -0
- package/src/react/components/TagsEditor.tsx +31 -7
- package/src/react/index.ts +6 -0
- package/src/react/lib/keepAsking.spec.ts +89 -0
- package/src/react/lib/keepAsking.ts +63 -0
- package/src/react/lib/tagList.spec.ts +23 -1
- package/src/react/lib/tagList.ts +33 -0
- package/src/react/map-frame/MapFrame.tsx +33 -0
- package/src/react/map-frame/MapFrame.wheel.spec.tsx +69 -0
- package/src/react/map-frame/geo.spec.ts +32 -0
- package/src/react/map-frame/geo.ts +54 -0
- package/src/react/map-frame/index.ts +5 -2
- package/src/react/media/DenseGalleryShell.tsx +8 -0
- package/src/react/media-gallery/GalleryTable.tsx +54 -6
- package/src/react/media-gallery/MediaGallery.spec.tsx +61 -0
- package/src/react/media-gallery/MediaGallery.tsx +170 -12
- package/src/react/media-gallery/index.ts +1 -0
- package/src/react/media-gallery/mediaGallery.css +16 -0
- package/src/react/usePrefixList.spec.tsx +156 -0
- package/src/react/usePrefixList.ts +229 -0
- package/src/styles-areas/core.css +8 -4
- package/src/styles-utilities.css +18 -0
- package/src/stylesAreas.spec.ts +2 -1
- package/src/stylesStaticMatches.spec.ts +2 -3
- package/src/stylesUtilitiesMatches.spec.ts +2 -3
- package/src/testing/shell.ts +2 -0
- package/src/verifyGraph.spec.ts +22 -6
|
@@ -946,7 +946,7 @@ function KindChips({ options, value, onChange, tags, activeTag, onTagChange, })
|
|
|
946
946
|
* The fleet's shared media gallery. Feed it `MediaGalleryItem`s (any binary kind); it
|
|
947
947
|
* renders the dense browse grid and the in-page detail view with the right viewer.
|
|
948
948
|
*/
|
|
949
|
-
export function MediaGallery({ items, title = 'Media', loading, onNearEnd, fastScroll, initialOrder = 'recent', order: controlledOrder, onOrderChange, tagStrip = true, detailActions, detailBelow, detailToolPanel, detailTools = 'inline', onDelete, headerExtra, displayControls, viewToggle = 'pair', kindFilter, kindChips = 'always', tagFilter, tableRowSize, chrome = 'header', previewAll, tileCaptions = true, onPreviewAllChange, onPreviewableChange, viewMode: controlledViewMode, onViewModeChange, query: controlledQuery, onQueryChange, onSelectedChange, selectedId: controlledSelectedId, pinStage: controlledPinStage, onPinStageChange, loadBytes, empty, emptyAction, minColumnWidth, nativeVideoStage, searchPlaceholder = 'Search files…', selectable = false, selectionReveal = 'always', selectArmed: controlledSelectArmed, onSelectArmedChange, onBulkDelete, bulkDeleteOptions, bulkActions, bulkMenu, onSelectionChange, onItemDragStart, onItemDragEnd, onRename, onSaveThumbnail, onSaveSnapshot, onSaveEdit, onSaveOrientation, allowPictureReplace = false, pictureControls = true, onTrimVideo, onSavePlayback, trimPace, trimKeyframes, onSaveChapters, onSaveMeta, tagSuggestions, trimNote, trimming, onTrimmingChange, tool, onToolChange, meta, ...rest }) {
|
|
949
|
+
export function MediaGallery({ items, title = 'Media', loading, onNearEnd, serverWindow, fastScroll, initialOrder = 'recent', order: controlledOrder, onOrderChange, tagStrip = true, detailActions, detailBelow, detailToolPanel, detailTools = 'inline', onDelete, headerExtra, displayControls, viewToggle = 'pair', kindFilter, kindChips = 'always', tagFilter, tableRowSize, chrome = 'header', previewAll, tileCaptions = true, onPreviewAllChange, onPreviewableChange, viewMode: controlledViewMode, onViewModeChange, query: controlledQuery, onQueryChange, onSelectedChange, selectedId: controlledSelectedId, pinStage: controlledPinStage, onPinStageChange, loadBytes, empty, emptyAction, minColumnWidth, nativeVideoStage, searchPlaceholder = 'Search files…', selectable = false, selectionReveal = 'always', selectArmed: controlledSelectArmed, onSelectArmedChange, onBulkDelete, bulkDeleteOptions, bulkActions, bulkMenu, onSelectionChange, onItemDragStart, onItemDragEnd, onRename, onSaveThumbnail, onSaveSnapshot, onSaveEdit, onSaveOrientation, allowPictureReplace = false, pictureControls = true, onTrimVideo, onSavePlayback, trimPace, trimKeyframes, onSaveChapters, onSaveMeta, tagSuggestions, trimNote, trimming, onTrimmingChange, tool, onToolChange, meta, ...rest }) {
|
|
950
950
|
const [uncontrolledQuery, setUncontrolledQuery] = useState('');
|
|
951
951
|
/** Controlled when the consumer passes `query`, uncontrolled otherwise — see the prop. */
|
|
952
952
|
const query = controlledQuery !== undefined ? controlledQuery : uncontrolledQuery;
|
|
@@ -1064,14 +1064,61 @@ export function MediaGallery({ items, title = 'Media', loading, onNearEnd, fastS
|
|
|
1064
1064
|
const activeKind = kindFilter ? kindFilter.value : kind;
|
|
1065
1065
|
const tag = tagFilter ? tagFilter.value : ownTag;
|
|
1066
1066
|
const stripQuiet = kindChips === 'on' && activeKind === null && tag === null;
|
|
1067
|
-
|
|
1068
|
-
|
|
1067
|
+
/*
|
|
1068
|
+
* ── The server window (`serverWindow`, forge task 5701) ─────────────────────────────────
|
|
1069
|
+
* `windowTotal` is the whole set's size; `windowed` is the window IN FORCE — the server's prefix drawn as given, with
|
|
1070
|
+
* no narrowing of the gallery's own on top (the prop's doc says why a narrowing stands it down).
|
|
1071
|
+
*/
|
|
1072
|
+
const windowTotal = serverWindow ? Math.max(serverWindow.total, items.length) : items.length;
|
|
1073
|
+
const windowed = serverWindow !== undefined && !query.trim() && localKind === null && tag === null;
|
|
1074
|
+
const displayItems = useMemo(() => (windowed ? items : sortGalleryItems(filterGalleryItems(items, { query, kind: localKind, tag }), order)), [windowed, items, query, localKind, tag, order]);
|
|
1075
|
+
/** Ask for the first `end` items — read through refs, so the asks below are stable callbacks. */
|
|
1076
|
+
const windowLive = useRef({ serverWindow, loaded: items.length, total: windowTotal });
|
|
1077
|
+
windowLive.current = { serverWindow, loaded: items.length, total: windowTotal };
|
|
1078
|
+
const needThrough = useCallback((end) => {
|
|
1079
|
+
const now = windowLive.current;
|
|
1080
|
+
if (!now.serverWindow || now.loaded >= now.total || end <= now.loaded)
|
|
1081
|
+
return;
|
|
1082
|
+
now.serverWindow.onNeedThrough(Math.min(end, now.total));
|
|
1083
|
+
}, []);
|
|
1084
|
+
/** The browse grid's window, in `VirtualCardGrid`'s terms: a window that always starts at 0. */
|
|
1085
|
+
const gridWindow = useMemo(() => windowed
|
|
1086
|
+
? {
|
|
1087
|
+
start: 0,
|
|
1088
|
+
total: windowTotal,
|
|
1089
|
+
onReachEnd: () => needThrough(windowLive.current.loaded + 1),
|
|
1090
|
+
onNeedWindow: (_first, last) => needThrough(last),
|
|
1091
|
+
}
|
|
1092
|
+
: undefined, [windowed, windowTotal, needThrough]);
|
|
1093
|
+
/** The browse table's, in `GalleryTable`'s. */
|
|
1094
|
+
const tableWindow = useMemo(() => (windowed ? { total: windowTotal, onNeedThrough: needThrough } : undefined), [windowed, windowTotal, needThrough]);
|
|
1095
|
+
/**
|
|
1096
|
+
* Appending a page at a time: the app's own `onNearEnd`, or — with a window the strip under an open file and a
|
|
1097
|
+
* narrowed grid do not lay out — the next page of the prefix.
|
|
1098
|
+
*/
|
|
1099
|
+
const appendMore = serverWindow
|
|
1100
|
+
? items.length < windowTotal
|
|
1101
|
+
? () => needThrough(windowLive.current.loaded + 1)
|
|
1102
|
+
: undefined
|
|
1103
|
+
: onNearEnd;
|
|
1104
|
+
const browseNearEnd = windowed ? undefined : appendMore;
|
|
1105
|
+
/*
|
|
1106
|
+
* The fast scroller names where the finger is by the key the gallery is sorted by, unless the app says otherwise. Over
|
|
1107
|
+
* a place the window has not loaded there is no item to name, so it says which of how many it is.
|
|
1108
|
+
*/
|
|
1069
1109
|
const galleryFastScroll = useMemo(() => {
|
|
1070
1110
|
if (!fastScroll)
|
|
1071
1111
|
return undefined;
|
|
1072
1112
|
const { bubble, ...options } = fastScroll === true ? {} : fastScroll;
|
|
1073
|
-
|
|
1074
|
-
|
|
1113
|
+
const named = galleryBubble(displayItems, order, bubble);
|
|
1114
|
+
if (!windowed)
|
|
1115
|
+
return { ...options, bubble: named };
|
|
1116
|
+
const shown = displayItems.length;
|
|
1117
|
+
return {
|
|
1118
|
+
...options,
|
|
1119
|
+
bubble: (index) => (index < shown ? named(index) : `${(index + 1).toLocaleString()} of ${windowTotal.toLocaleString()}`),
|
|
1120
|
+
};
|
|
1121
|
+
}, [fastScroll, displayItems, order, windowed, windowTotal]);
|
|
1075
1122
|
/*
|
|
1076
1123
|
* Is there anything to preview at all?
|
|
1077
1124
|
*
|
|
@@ -1154,6 +1201,23 @@ export function MediaGallery({ items, title = 'Media', loading, onNearEnd, fastS
|
|
|
1154
1201
|
setUncontrolledId(item?.id ?? null);
|
|
1155
1202
|
onSelectedChange?.(item);
|
|
1156
1203
|
};
|
|
1204
|
+
/**
|
|
1205
|
+
* 🔴 A step off the loaded edge of a {@link MediaGalleryProps.serverWindow} is NOT a wrap: the item after the last
|
|
1206
|
+
* loaded one is the next item of the set, and the one before the first is the set's true last. So the step is held,
|
|
1207
|
+
* the prefix is asked to load through its target, and the step lands once it has (the effect below) — unless the
|
|
1208
|
+
* reader has moved on by then. True when the step was held.
|
|
1209
|
+
*/
|
|
1210
|
+
const pendingStep = useRef(null);
|
|
1211
|
+
const stepPastWindow = (delta) => {
|
|
1212
|
+
if (!windowed || !selectedId || displayItems.length >= windowTotal)
|
|
1213
|
+
return false;
|
|
1214
|
+
const at = displayIds.indexOf(selectedId);
|
|
1215
|
+
if (at < 0 || (at + delta >= 0 && at + delta < displayItems.length))
|
|
1216
|
+
return false;
|
|
1217
|
+
pendingStep.current = { from: selectedId, delta };
|
|
1218
|
+
needThrough(delta > 0 ? at + delta + 1 : windowTotal);
|
|
1219
|
+
return true;
|
|
1220
|
+
};
|
|
1157
1221
|
/**
|
|
1158
1222
|
* Step through the DISPLAYED order — the same order the grid shows, so "next" always means
|
|
1159
1223
|
* the tile to the right rather than a hidden neighbor from the unfiltered set.
|
|
@@ -1170,11 +1234,48 @@ export function MediaGallery({ items, title = 'Media', loading, onNearEnd, fastS
|
|
|
1170
1234
|
* mean different things — see the note on `stepId`.
|
|
1171
1235
|
*/
|
|
1172
1236
|
const step = (delta) => {
|
|
1237
|
+
if (stepPastWindow(delta))
|
|
1238
|
+
return;
|
|
1173
1239
|
const nextId = stepId(displayIds, selectedId, delta);
|
|
1174
1240
|
const next = nextId ? displayItems.find((i) => i.id === nextId) : undefined;
|
|
1175
1241
|
if (next)
|
|
1176
1242
|
select(next);
|
|
1177
1243
|
};
|
|
1244
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: the loaded prefix growing IS the trigger; `select` is read fresh each render.
|
|
1245
|
+
useEffect(() => {
|
|
1246
|
+
const held = pendingStep.current;
|
|
1247
|
+
if (!held)
|
|
1248
|
+
return;
|
|
1249
|
+
if (held.from !== selectedId) {
|
|
1250
|
+
pendingStep.current = null;
|
|
1251
|
+
return;
|
|
1252
|
+
}
|
|
1253
|
+
const target = displayIds.indexOf(held.from) + held.delta;
|
|
1254
|
+
const next = target >= 0 ? displayItems[target] : undefined;
|
|
1255
|
+
if (next) {
|
|
1256
|
+
pendingStep.current = null;
|
|
1257
|
+
select(next);
|
|
1258
|
+
}
|
|
1259
|
+
else if (!windowed || displayItems.length >= windowTotal) {
|
|
1260
|
+
// Everything is in (or the window stood down): an ordinary step, which wraps.
|
|
1261
|
+
pendingStep.current = null;
|
|
1262
|
+
const nextId = stepId(displayIds, selectedId, held.delta);
|
|
1263
|
+
const wrapped = nextId ? displayItems.find((i) => i.id === nextId) : undefined;
|
|
1264
|
+
if (wrapped)
|
|
1265
|
+
select(wrapped);
|
|
1266
|
+
}
|
|
1267
|
+
}, [displayItems, displayIds, selectedId, windowed, windowTotal]);
|
|
1268
|
+
/*
|
|
1269
|
+
* The stage nearing the loaded end asks for the next page ahead of the reader, so Next rarely has to wait. Twelve is
|
|
1270
|
+
* a little more than a phone's screen of tiles under the stage.
|
|
1271
|
+
*/
|
|
1272
|
+
useEffect(() => {
|
|
1273
|
+
if (!windowed || !selectedId)
|
|
1274
|
+
return;
|
|
1275
|
+
const at = displayIds.indexOf(selectedId);
|
|
1276
|
+
if (at >= 0 && at >= displayIds.length - 12)
|
|
1277
|
+
needThrough(at + 13);
|
|
1278
|
+
}, [windowed, selectedId, displayIds, needThrough]);
|
|
1178
1279
|
/*
|
|
1179
1280
|
* ── The standard detail capabilities' own state ───────────────────────────────────────
|
|
1180
1281
|
*
|
|
@@ -1419,6 +1520,8 @@ export function MediaGallery({ items, title = 'Media', loading, onNearEnd, fastS
|
|
|
1419
1520
|
selectedIdRef.current = selectedId;
|
|
1420
1521
|
itemsRef.current = items;
|
|
1421
1522
|
selectRef.current = select;
|
|
1523
|
+
const stepPastWindowRef = useRef(stepPastWindow);
|
|
1524
|
+
stepPastWindowRef.current = stepPastWindow;
|
|
1422
1525
|
const playedRef = useRef([]);
|
|
1423
1526
|
const advance = useCallback(() => {
|
|
1424
1527
|
const step = nextInRun({
|
|
@@ -1428,6 +1531,13 @@ export function MediaGallery({ items, title = 'Media', loading, onNearEnd, fastS
|
|
|
1428
1531
|
played: playedRef.current,
|
|
1429
1532
|
});
|
|
1430
1533
|
playedRef.current = step.played;
|
|
1534
|
+
// The run's end of a server window's PREFIX is not the end of the set: the next item is the one not loaded yet.
|
|
1535
|
+
const ids = displayIdsRef.current;
|
|
1536
|
+
const current = selectedIdRef.current;
|
|
1537
|
+
const pastWindow = stepPastWindowRef.current;
|
|
1538
|
+
const behavior = playbackEndRef.current;
|
|
1539
|
+
if (runAdvances(behavior) && behavior !== 'shuffle' && current && ids[ids.length - 1] === current && pastWindow(1))
|
|
1540
|
+
return;
|
|
1431
1541
|
if (!step.nextId)
|
|
1432
1542
|
return;
|
|
1433
1543
|
const next = itemsRef.current.find((i) => i.id === step.nextId);
|
|
@@ -2116,12 +2226,12 @@ export function MediaGallery({ items, title = 'Media', loading, onNearEnd, fastS
|
|
|
2116
2226
|
className: cn(RAW_BUTTON, 'cbgd-order-btn is-icon cbgd-action-lead'), "aria-label": 'Back to grid', onClick: () => select(null), children: _jsx(ArrowLeft, { "aria-hidden": true }) }) }))] }),
|
|
2117
2227
|
/* Not "More files" — the strip holds the open file too now, so "more" would be the
|
|
2118
2228
|
heading contradicting the list under it. */
|
|
2119
|
-
relatedLabel: 'Files', itemCount: displayItems.length, loading: loading, onNearEnd:
|
|
2229
|
+
relatedLabel: 'Files', itemCount: displayItems.length, loading: loading, onNearEnd: appendMore, minColumnWidth: minColumnWidth, ...(viewMode === 'table'
|
|
2120
2230
|
? {
|
|
2121
2231
|
relatedBody: (_jsx(GalleryTable, { items: displayItems,
|
|
2122
2232
|
// The open file is in this list exactly as it is in the tile strip, so it is
|
|
2123
2233
|
// marked here exactly as it is there.
|
|
2124
|
-
playing: { id: selected.id, label: stageMark }, cache: mediaCache, order: order, onOrderChange: setOrder, onOpen: select, ...(
|
|
2234
|
+
playing: { id: selected.id, label: stageMark }, cache: mediaCache, order: order, onOrderChange: setOrder, onOpen: select, ...(appendMore ? { onNearEnd: appendMore } : {}), ...(loading === undefined ? {} : { loading }),
|
|
2125
2235
|
/* 🔴 The same `thumbAutoplay` the tiles take. Owner, 2026-09-11: *"in table
|
|
2126
2236
|
view the play all thumbnails isn't working but if I go back to grid view it
|
|
2127
2237
|
works."* This is the RELATED list under an open file, and it is the same
|
|
@@ -2169,7 +2279,7 @@ export function MediaGallery({ items, title = 'Media', loading, onNearEnd, fastS
|
|
|
2169
2279
|
// and searching — see the `tagStrip` prop.
|
|
2170
2280
|
tags: tagStrip && !stripQuiet ? tags : [], activeTag: tag, onTagChange: tagFilter ? tagFilter.onChange : setOwnTag }), bulkBar:
|
|
2171
2281
|
// An app arming selection from its own chrome holds the at-rest toggle — see `selectArmed`.
|
|
2172
|
-
selectable && !(chrome === 'none' && controlledSelectArmed !== undefined && !selectArmed && checks.count === 0) ? (_jsx(BulkBar, { count: checks.count, total: displayItems.length, headerState: checks.headerState, onToggleAll: checks.toggleAll, ...(selectionReveal === 'on-demand'
|
|
2282
|
+
selectable && !(chrome === 'none' && controlledSelectArmed !== undefined && !selectArmed && checks.count === 0) ? (_jsx(BulkBar, { count: checks.count, total: displayItems.length, ...(windowed && displayItems.length < windowTotal ? { partial: true } : {}), headerState: checks.headerState, onToggleAll: checks.toggleAll, ...(selectionReveal === 'on-demand'
|
|
2173
2283
|
? { armed: selectArmed, onToggleArmed: () => setSelectArmed(!selectArmed) }
|
|
2174
2284
|
: {}) })) : null, selectionBar: selectable && checks.count > 0 ? (_jsx(SelectionBar, { count: checks.count, onClear: () => {
|
|
2175
2285
|
checks.clear();
|
|
@@ -2182,10 +2292,10 @@ export function MediaGallery({ items, title = 'Media', loading, onNearEnd, fastS
|
|
|
2182
2292
|
checks.clear();
|
|
2183
2293
|
},
|
|
2184
2294
|
}
|
|
2185
|
-
: {}), ...(bulkDeleteOptions ? { deleteOptions: bulkDeleteOptions } : {}), ...(onSaveMeta ? { onTag: () => setTaggingItems(checkedItems) } : {}), extra: bulkActions?.(checkedItems, checks.clear), ...(bulkMenu ? { menu: bulkMenu(checkedItems, checks.clear) } : {}) })) : null, itemCount: displayItems.length, loading: loading, onNearEnd:
|
|
2295
|
+
: {}), ...(bulkDeleteOptions ? { deleteOptions: bulkDeleteOptions } : {}), ...(onSaveMeta ? { onTag: () => setTaggingItems(checkedItems) } : {}), extra: bulkActions?.(checkedItems, checks.clear), ...(bulkMenu ? { menu: bulkMenu(checkedItems, checks.clear) } : {}) })) : null, itemCount: displayItems.length, loading: loading, onNearEnd: browseNearEnd, ...(gridWindow ? { serverWindow: gridWindow } : {}), fastScroll: galleryFastScroll, empty: empty ?? _jsx("div", { className: 'cbgd-empty', children: "No files yet." }), emptyAction: emptyAction, minColumnWidth: minColumnWidth, body: viewMode === 'table' ? (_jsx(GalleryTable, { items: displayItems, cache: mediaCache, order: order,
|
|
2186
2296
|
// 🔴 The table drives the gallery's OWN sort. Two views with two sorts is a
|
|
2187
2297
|
// question nobody should have to answer; see GalleryTable's header.
|
|
2188
|
-
onOrderChange: setOrder, onOpen: select, ...(
|
|
2298
|
+
onOrderChange: setOrder, onOpen: select, ...(browseNearEnd ? { onNearEnd: browseNearEnd } : {}), ...(tableWindow ? { serverWindow: tableWindow } : {}), fastScroll: galleryFastScroll, ...(loading === undefined ? {} : { loading }), ...(empty === undefined ? {} : { empty }),
|
|
2189
2299
|
/* See the related table in the detail view above — "Preview all" has to mean the
|
|
2190
2300
|
same thing in both views or it is two features wearing one label. */
|
|
2191
2301
|
autoPreview: thumbAutoplay, exactBytes: meta?.exactBytes === true, ...(tableRowSize ? { rowSize: tableRowSize } : {}), ...(selectable
|
|
@@ -2230,7 +2340,7 @@ function stageMeta(line, description) {
|
|
|
2230
2340
|
* options for deleting the selection, tagging the selection, or other things … in a modern way
|
|
2231
2341
|
* instead of multiple pills"*).
|
|
2232
2342
|
*/
|
|
2233
|
-
function BulkBar({ count, total, headerState, armed, onToggleArmed, onToggleAll, }) {
|
|
2343
|
+
function BulkBar({ count, total, partial, headerState, armed, onToggleArmed, onToggleAll, }) {
|
|
2234
2344
|
return (_jsxs("div", { className: 'cbmg-bulkbar', children: [onToggleArmed ? (_jsx(Tooltip, { content: armed ? 'Hide the tick boxes again' : 'Show a tick box on every tile', children: _jsx("button", {
|
|
2235
2345
|
// guardrails-ignore no-raw-action-button: action pill styled by the dense
|
|
2236
2346
|
// gallery's own plain CSS, matching its neighbors.
|
|
@@ -2240,7 +2350,7 @@ function BulkBar({ count, total, headerState, armed, onToggleArmed, onToggleAll,
|
|
|
2240
2350
|
type: 'checkbox', checked: headerState === true, ref: (el) => {
|
|
2241
2351
|
if (el)
|
|
2242
2352
|
el.indeterminate = headerState === 'indeterminate';
|
|
2243
|
-
}, readOnly: true, onClick: onToggleAll, disabled: total === 0 }), _jsx("span", { className: 'cbmg-bulkbar-all-idle', children: count > 0 && headerState === true ? 'All selected' : 'Select all' })] })] }));
|
|
2353
|
+
}, readOnly: true, onClick: onToggleAll, disabled: total === 0 }), _jsx("span", { className: 'cbmg-bulkbar-all-idle', children: count > 0 && headerState === true ? (partial ? 'All loaded selected' : 'All selected') : partial ? 'Select loaded' : 'Select all' })] })] }));
|
|
2244
2354
|
}
|
|
2245
2355
|
/**
|
|
2246
2356
|
* One verb on the selection bar: an icon and a word, the word dropping to the accessible name
|