このコミットが含まれているのは:
@@ -304,11 +304,18 @@ export const isCountsState = (params: URLSearchParams): boolean =>
|
||||
params.get ('definition') !== 'history'
|
||||
|
||||
|
||||
export const countsUseLatest = (params: URLSearchParams): boolean =>
|
||||
params.get ('current') === '1'
|
||||
|| (params.get ('current') !== '0' && !params.get ('at'))
|
||||
|
||||
|
||||
export const countsRequestParams = (params: URLSearchParams): URLSearchParams => {
|
||||
const result = new URLSearchParams (params)
|
||||
for (const key of ['columns', 'summary_columns', 'children', 'child_sort',
|
||||
'nested_json', 'order', 'basis', 'axis', 'latest', 'grain'])
|
||||
'nested_json', 'order', 'basis', 'axis', 'latest', 'grain',
|
||||
'current', 'row_numbers'])
|
||||
result.delete (key)
|
||||
if (isCountsState (params) && countsUseLatest (params)) result.delete ('at')
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -331,10 +338,16 @@ export const exportCounts = (
|
||||
headers: string[],
|
||||
labels: Record<string, string>,
|
||||
onError?: () => void,
|
||||
): Promise<void> => apiDownload ('/counts/export', {
|
||||
...Object.fromEntries (params), resource, format,
|
||||
columns: columns.join (','), headers: JSON.stringify (headers),
|
||||
labels: JSON.stringify (labels) }, locale, onError)
|
||||
): Promise<void> => {
|
||||
const payload = new URLSearchParams (params)
|
||||
payload.delete ('current')
|
||||
payload.delete ('row_numbers')
|
||||
if (isCountsState (params) && countsUseLatest (params)) payload.delete ('at')
|
||||
return apiDownload ('/counts/export', {
|
||||
...Object.fromEntries (payload), resource, format,
|
||||
columns: columns.join (','), headers: JSON.stringify (headers),
|
||||
labels: JSON.stringify (labels) }, locale, onError)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ export const MIN_COUNT_WIDTH = 64
|
||||
export const MAX_COUNT_WIDTH = 2000
|
||||
|
||||
export const defaultCountWidths: Record<string, number> = {
|
||||
thumbnail: 88, resource_id: 88, version_no: 88, is_latest: 104,
|
||||
row_number: 72, thumbnail: 88, resource_id: 88, version_no: 88, is_latest: 104,
|
||||
title: 300, url: 300, thumbnail_base: 300, tags: 560, parents: 180,
|
||||
video_ms: 120, original_created_at: 260, original_created_from: 240,
|
||||
original_created_before: 240, name: 240, names: 480, category: 180,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useReducedMotion } from 'framer-motion'
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
import { clientAnimationTransition, clientMotionTokens } from '@/lib/clientAnimation'
|
||||
import { useClientBehaviourSettings } from '@/lib/useClientBehaviourSettings'
|
||||
@@ -7,7 +8,9 @@ import { useClientBehaviourSettings } from '@/lib/useClientBehaviourSettings'
|
||||
export const useClientMotion = () => {
|
||||
const settings = useClientBehaviourSettings ()
|
||||
const osReduced = useReducedMotion ()
|
||||
const mode = osReduced ? 'reduced' : settings.animation ?? 'normal'
|
||||
const [hydrated, setHydrated] = useState (false)
|
||||
useEffect (() => setHydrated (true), [])
|
||||
const mode = hydrated ? (osReduced ? 'reduced' : settings.animation ?? 'normal') : 'normal'
|
||||
const reduced = mode !== 'normal'
|
||||
const duration = (kind: keyof typeof clientMotionTokens.durationMS) =>
|
||||
reduced ? 0 : clientMotionTokens.durationMS[kind]
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする