dshmarket 1.66.33 → 1.66.34
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/client/client.js +3 -3
- package/package.json +1 -1
- package/src/client/MarketSection.tsx +7 -3
package/client/client.js
CHANGED
|
@@ -9587,12 +9587,12 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
9587
9587
|
const row = recentRowRef.current;
|
|
9588
9588
|
if (row === null || typeof ResizeObserver === "undefined") return;
|
|
9589
9589
|
const observer = new ResizeObserver(([entry]) => {
|
|
9590
|
-
if (entry !== void 0) setRecentColumns(Math.max(1, Math.floor((entry.contentRect.width + 10) / 290)));
|
|
9590
|
+
if (entry !== void 0) setRecentColumns(Math.min(2, Math.max(1, Math.floor((entry.contentRect.width + 10) / 290))));
|
|
9591
9591
|
});
|
|
9592
9592
|
observer.observe(row);
|
|
9593
9593
|
return () => observer.disconnect();
|
|
9594
9594
|
}, [hasRecent, loadError]);
|
|
9595
|
-
const recentPlugins = recentlyAdded.slice(0, recentColumns);
|
|
9595
|
+
const recentPlugins = recentlyAdded.slice(0, recentColumns * 2);
|
|
9596
9596
|
const { currentPage, totalPages, pageSize, goToPage, changePageSize } = usePagination(plugins.length, [
|
|
9597
9597
|
q,
|
|
9598
9598
|
cat,
|
|
@@ -13188,7 +13188,7 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
13188
13188
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
13189
13189
|
ref: recentRowRef,
|
|
13190
13190
|
className: Market_module_css_default.recentRow,
|
|
13191
|
-
style: { gridTemplateColumns: `repeat(${
|
|
13191
|
+
style: { gridTemplateColumns: `repeat(${recentColumns}, minmax(0, 1fr))` },
|
|
13192
13192
|
children: recentPlugins.map((plugin) => pluginCard(plugin, `recent:${plugin.url}`))
|
|
13193
13193
|
})]
|
|
13194
13194
|
}),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dshmarket",
|
|
3
3
|
"description": "Visual plugin market inside DeepSeek Harness — browse, search, and one-click install community plugins. · DSH 可视化插件市场:逛一逛,点一下,装好。",
|
|
4
|
-
"version": "1.66.
|
|
4
|
+
"version": "1.66.34",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/types/index.d.ts",
|
|
@@ -3074,18 +3074,22 @@ export function MarketSection(props: MarketSectionProps) {
|
|
|
3074
3074
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3075
3075
|
[data, tab, q, cat, timeRange, lang, hostCompatibility, compatibleWithHost, blockedNameSet, installed, repoIdentities, repoHints])
|
|
3076
3076
|
const recentRowRef = useRef<HTMLDivElement>(null)
|
|
3077
|
+
// Two per row, like the grid below it: three across read as a different
|
|
3078
|
+
// list rather than the same one (and left an odd one out at any width).
|
|
3079
|
+
// Two rows of two keeps the block square and the cards the size of the
|
|
3080
|
+
// cards underneath.
|
|
3077
3081
|
const [recentColumns, setRecentColumns] = useState(1)
|
|
3078
3082
|
const hasRecent = recentlyAdded.length > 0
|
|
3079
3083
|
useLayoutEffect(() => {
|
|
3080
3084
|
const row = recentRowRef.current
|
|
3081
3085
|
if (row === null || typeof ResizeObserver === 'undefined') return
|
|
3082
3086
|
const observer = new ResizeObserver(([entry]) => {
|
|
3083
|
-
if (entry !== undefined) setRecentColumns(Math.max(1, Math.floor((entry.contentRect.width + 10) / 290)))
|
|
3087
|
+
if (entry !== undefined) setRecentColumns(Math.min(2, Math.max(1, Math.floor((entry.contentRect.width + 10) / 290))))
|
|
3084
3088
|
})
|
|
3085
3089
|
observer.observe(row)
|
|
3086
3090
|
return () => observer.disconnect()
|
|
3087
3091
|
}, [hasRecent, loadError])
|
|
3088
|
-
const recentPlugins = recentlyAdded.slice(0, recentColumns)
|
|
3092
|
+
const recentPlugins = recentlyAdded.slice(0, recentColumns * 2)
|
|
3089
3093
|
const { currentPage, totalPages, pageSize, goToPage, changePageSize } =
|
|
3090
3094
|
usePagination(plugins.length, [q, cat, sortField, sortDir, timeRange, compatibleWithHost], scrollToTop)
|
|
3091
3095
|
const pagePlugins = plugins.slice((currentPage - 1) * pageSize, currentPage * pageSize)
|
|
@@ -6490,7 +6494,7 @@ export function MarketSection(props: MarketSectionProps) {
|
|
|
6490
6494
|
{hasRecent && (
|
|
6491
6495
|
<section aria-labelledby="dshm-recently-added">
|
|
6492
6496
|
<h3 id="dshm-recently-added" className={css.favoritesSectionHead}>{t('recentlyAdded')}</h3>
|
|
6493
|
-
<div ref={recentRowRef} className={css.recentRow} style={{ gridTemplateColumns: `repeat(${
|
|
6497
|
+
<div ref={recentRowRef} className={css.recentRow} style={{ gridTemplateColumns: `repeat(${recentColumns}, minmax(0, 1fr))` }}>
|
|
6494
6498
|
{recentPlugins.map(plugin => pluginCard(plugin, `recent:${plugin.url}`))}
|
|
6495
6499
|
</div>
|
|
6496
6500
|
</section>
|