UNPKG

@sanity/vision

Version:

Sanity plugin for running/debugging GROQ-queries against Sanity datasets

152 lines (143 loc) 6.84 kB
import {ComponentType} from 'react' import {Plugin as Plugin_2} from 'sanity' /** @public */ declare type DatasetAclMode = 'public' | 'private' | 'custom' /** @public */ declare type DatasetsResponse = { name: string aclMode: DatasetAclMode createdAt: string createdByUserId: string addonFor: string | null datasetProfile: string features: string[] tags: string[] }[] declare interface VisionConfig { datasets?: string[] | ((datasets: DatasetsResponse) => DatasetsResponse) defaultApiVersion: string defaultDataset?: string } /** * @alpha */ export declare type VisionLocaleResourceKeys = keyof typeof visionLocaleStrings /** * Defined locale strings for the vision tool, in US English. * * @internal */ declare const visionLocaleStrings: { /** Label for action "Copy to clipboard", tied to the "Query URL" field. Also used for accessibility purposes on button */ readonly 'action.copy-url-to-clipboard': 'Copy to clipboard' /** Label for deleting a query */ readonly 'action.delete': 'Delete' /** Label for editing a query's title */ readonly 'action.edit-title': 'Edit title' /** Label for stopping an ongoing listen operation */ readonly 'action.listen-cancel': 'Stop' /** Label for setting up a listener */ readonly 'action.listen-execute': 'Listen' /** Label for query loading table */ readonly 'action.load-queries': 'Load queries' /** Label for loading a query */ readonly 'action.load-query': 'Load query' /** Label for cancelling an ongoing query */ readonly 'action.query-cancel': 'Cancel' /** Label for executing the query, eg doing a fetch */ readonly 'action.query-execute': 'Fetch' /** Label for saving a query */ readonly 'action.save-query': 'Save query' /** Label for updating a query */ readonly 'action.update': 'Update' /** Label for actions user can take */ readonly 'label.actions': 'Actions' /** Label for saved queries that have been edited */ readonly 'label.edited': 'Edited' /** * Some features has a "New" label indicating that the feature was recently introduced. * This defines what the text of that label is. Keep it short and sweet. */ readonly 'label.new': 'New' /** Label for query type "personal" */ readonly 'label.personal': 'Personal' /** Label for savedAt date */ readonly 'label.saved-at': 'Saved at' /** Saved queries */ readonly 'label.saved-queries': 'Saved queries' /** Search queries */ readonly 'label.search-queries': 'Search queries' /** Share query */ readonly 'label.share': 'Share' /** Label for saved query type "team" */ readonly 'label.team': 'Team' /** Error message for when the "Params" input are not a valid json */ readonly 'params.error.params-invalid-json': 'Parameters are not valid JSON' /** Label for "Params" (parameters) editor/input */ readonly 'params.label': 'Params' /** Label for 'Column' indicator when there is an error within the query */ readonly 'query.error.column': 'Column' /** Label for 'Line' indicator when there is an error within the query */ readonly 'query.error.line': 'Line' /** Label for "Query" editor/input */ readonly 'query.label': 'Query' /** Label for the "Query URL" field, shown after executing a query, and allows for copying */ readonly 'query.url': 'Query URL' /** Label for "End to End time" information of the fetched query */ readonly 'result.end-to-end-time-label': 'End-to-end' /** Label for "Execution time" information of the fetched query */ readonly 'result.execution-time-label': 'Execution' /** Label for "Result" explorer/view */ readonly 'result.label': 'Result' /** Tooltip text shown when the query result is not encodable as CSV */ readonly 'result.save-result-as-csv.not-csv-encodable': 'Result cannot be encoded as CSV' /** Label for "Save result as" result action */ readonly 'result.save-result-as-format': 'Save result as <SaveResultButtons/>' /** * "Not applicable" message for when there is no Execution time or End to End time information * available for the query (eg when the query has not been executed, or errored) */ readonly 'result.timing-not-applicable': 'n/a' /** Query already saved error label */ readonly 'save-query.already-saved': 'Query already saved' /** Save error label */ readonly 'save-query.error': 'Error saving query' /** Save success label */ readonly 'save-query.success': 'Query saved' /** Label for the "API version" dropdown in settings */ readonly 'settings.api-version-label': 'API version' /** Label for the "Custom API version" input in settings, shown when "other" is chosen as API version */ readonly 'settings.custom-api-version-label': 'Custom API version' /** Label for the "Dataset" dropdown in vision settings */ readonly 'settings.dataset-label': 'Dataset' /** Error label for when the API version in 'Custom API version' input is invalid */ readonly 'settings.error.invalid-api-version': 'Invalid API version' /** Label for the "other" versions within the "API version" dropdown */ readonly 'settings.other-api-version-label': 'Other' /** * Label for the "Perspective" dropdown in vision settings * @see {@link https://www.sanity.io/docs/perspectives} */ readonly 'settings.perspective-label': 'Perspective' /** Notification about previewDrafts to drafts rename */ readonly 'settings.perspective.preview-drafts-renamed-to-drafts.description': 'The "<code>previewDrafts</code>" perspective has been renamed to "<code>drafts</code>" and is now deprecated. This change is effective for all versions with perspective support (>= v2021-03-25).' /** Call to action to read the docs related to "Perspectives" */ readonly 'settings.perspectives.action.docs-link': 'Read docs' /** Option for selecting default perspective */ readonly 'settings.perspectives.default': 'No perspective (API default)' /** Description for popover that explains what "Perspectives" are */ readonly 'settings.perspectives.description': 'Perspectives allow your query to run against different "views" of the content in your dataset' /** Description for upcoming default perspective change */ readonly 'settings.perspectives.new-default.description': 'The default perspective will change from "<code>raw</code>" to "<code>published</code>" in an upcoming API version. Please consult docs for more details.' /** Label for the pinned release perspective */ readonly 'settings.perspectives.pinned-release-label': 'Pinned release' /** Title for popover that explains what "Perspectives" are */ readonly 'settings.perspectives.title': 'Perspectives' } export declare const visionTool: Plugin_2<void | VisionToolConfig> export declare interface VisionToolConfig extends Partial<VisionConfig> { name?: string title?: string icon?: ComponentType } export {}