diff --git a/package.json b/package.json index 85efb29be6d..f75e688acf3 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "check:deps": "pnpm --recursive --parallel exec depcheck", "check:format": "prettier . --check", "check:lint": "turbo run lint --continue -- --quiet", - "check:react-compiler": "eslint --no-inline-config --no-eslintrc --ext .cjs,.mjs,.js,.jsx,.ts,.tsx --parser @typescript-eslint/parser --plugin react-compiler --rule 'react-compiler/react-compiler: [warn]' --ignore-path .eslintignore.react-compiler --max-warnings 27 .", + "check:react-compiler": "eslint --no-inline-config --no-eslintrc --ext .cjs,.mjs,.js,.jsx,.ts,.tsx --parser @typescript-eslint/parser --plugin react-compiler --rule 'react-compiler/react-compiler: [warn]' --ignore-path .eslintignore.react-compiler --max-warnings 14 .", "check:test": "run-s test -- --silent", "check:types": "tsc && turbo run check:types --filter='./packages/*' --filter='./packages/@sanity/*'", "chore:format:fix": "prettier --cache --write .", diff --git a/packages/sanity/src/core/studio/components/navbar/search/components/filters/filter/inputs/asset/Asset.tsx b/packages/sanity/src/core/studio/components/navbar/search/components/filters/filter/inputs/asset/Asset.tsx index f5de825f541..fc536adaa88 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/components/filters/filter/inputs/asset/Asset.tsx +++ b/packages/sanity/src/core/studio/components/navbar/search/components/filters/filter/inputs/asset/Asset.tsx @@ -12,7 +12,6 @@ import {useClient} from '../../../../../../../../../hooks' import {useTranslation} from '../../../../../../../../../i18n' import {DEFAULT_STUDIO_CLIENT_OPTIONS} from '../../../../../../../../../studioClient' import {useSource} from '../../../../../../../../source' -import {useSearchState} from '../../../../../contexts/search/useSearchState' import {type OperatorInputComponentProps} from '../../../../../definitions/operators/operatorTypes' import {AssetSourceError} from './AssetSourceError' import {AssetPreview} from './preview/AssetPreview' @@ -28,7 +27,7 @@ const ContainerBox = styled(Box)` width: min(calc(100vw - 40px), 320px); ` -export function SearchFilterAssetInput(type?: AssetType) { +export function renderSearchFilterAssetInput(type?: AssetType) { return function FieldInputAssetWithType({ onChange, value, @@ -38,10 +37,6 @@ export function SearchFilterAssetInput(type?: AssetType) { null, ) - const { - state: {fullscreen}, - } = useSearchState() - const {file, image} = useSource().form const {t} = useTranslation() @@ -102,8 +97,6 @@ export function SearchFilterAssetInput(type?: AssetType) { const AssetSourceComponent = selectedAssetSource?.component - const fontSize = fullscreen ? 2 : 1 - const buttonText = t(value ? 'search.filter-asset-change' : 'search.filter-asset-select', { context: type, }) diff --git a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/assetOperators.ts b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/assetOperators.ts index 1b51f9f77e2..7e5fe4ac7bc 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/assetOperators.ts +++ b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/assetOperators.ts @@ -1,7 +1,7 @@ import {type ReferenceValue} from '@sanity/types' import {SearchButtonValueReference} from '../../components/filters/common/ButtonValue' -import {SearchFilterAssetInput} from '../../components/filters/filter/inputs/asset/Asset' +import {renderSearchFilterAssetInput} from '../../components/filters/filter/inputs/asset/Asset' import {defineSearchOperator, type SearchOperatorButtonValue} from './operatorTypes' import {toJSON} from './operatorUtils' @@ -15,7 +15,7 @@ export const assetOperators = { groqFilter: ({fieldPath, value}) => value?._ref && fieldPath ? `${fieldPath}.asset._ref == ${toJSON(value._ref)}` : null, initialValue: null, - inputComponent: SearchFilterAssetInput('file'), + inputComponent: renderSearchFilterAssetInput('file'), label: 'is', type: 'assetFileEqual', }), @@ -26,7 +26,7 @@ export const assetOperators = { groqFilter: ({fieldPath, value}) => value?._ref && fieldPath ? `${fieldPath}.asset._ref != ${toJSON(value._ref)}` : null, initialValue: null, - inputComponent: SearchFilterAssetInput('file'), + inputComponent: renderSearchFilterAssetInput('file'), label: 'is not', type: 'assetFileNotEqual', }), @@ -37,7 +37,7 @@ export const assetOperators = { groqFilter: ({fieldPath, value}) => value?._ref && fieldPath ? `${fieldPath}.asset._ref == ${toJSON(value._ref)}` : null, initialValue: null, - inputComponent: SearchFilterAssetInput('image'), + inputComponent: renderSearchFilterAssetInput('image'), label: 'is', type: 'assetImageEqual', }), @@ -48,7 +48,7 @@ export const assetOperators = { groqFilter: ({fieldPath, value}) => value?._ref && fieldPath ? `${fieldPath}.asset._ref != ${toJSON(value._ref)}` : null, initialValue: null, - inputComponent: SearchFilterAssetInput('image'), + inputComponent: renderSearchFilterAssetInput('image'), label: 'is not', type: 'assetImageNotEqual', }), diff --git a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/referenceOperators.ts b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/referenceOperators.ts index da1a63b5e45..9ea000f8621 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/referenceOperators.ts +++ b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/referenceOperators.ts @@ -1,7 +1,7 @@ import {type ReferenceValue} from '@sanity/types' import {SearchButtonValueReference} from '../../components/filters/common/ButtonValue' -import {SearchFilterAssetInput} from '../../components/filters/filter/inputs/asset/Asset' +import {renderSearchFilterAssetInput} from '../../components/filters/filter/inputs/asset/Asset' import {SearchFilterReferenceInput} from '../../components/filters/filter/inputs/reference/Reference' import { defineSearchOperator, @@ -39,7 +39,7 @@ export const referenceOperators = { buttonValueComponent: SearchButtonValueReference as SearchOperatorButtonValue, groqFilter: ({value}) => (value?._ref ? `references(${toJSON(value._ref)})` : null), initialValue: null, - inputComponent: SearchFilterAssetInput('file'), + inputComponent: renderSearchFilterAssetInput('file'), type: 'referencesAssetFile', }), referencesAssetImage: defineSearchOperator({ @@ -48,7 +48,7 @@ export const referenceOperators = { buttonValueComponent: SearchButtonValueReference as SearchOperatorButtonValue, groqFilter: ({value}) => (value?._ref ? `references(${toJSON(value._ref)})` : null), initialValue: null, - inputComponent: SearchFilterAssetInput('image'), + inputComponent: renderSearchFilterAssetInput('image'), type: 'referencesAssetImage', }), referencesDocument: defineSearchOperator({