@sanity/vision
Advanced tools
Comparing version 3.19.0 to 3.21.0
@@ -9,2 +9,74 @@ import type {ComponentType} from 'react' | ||
/** | ||
* @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 stopping an ongoing listen operation */ | ||
readonly 'action.listen-cancel': 'Stop' | ||
/** Label for setting up a listener */ | ||
readonly 'action.listen-execute': 'Listen' | ||
/** 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' | ||
/** | ||
* 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' | ||
/** 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' | ||
/** | ||
* "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' | ||
/** 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' | ||
/** Call to action to read the docs related to "Perspectives" */ | ||
readonly 'settings.perspectives.action.docs-link': 'Read docs' | ||
/** 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' | ||
/** Title for popover that explains what "Perspectives" are */ | ||
readonly 'settings.perspectives.title': 'Perspectives' | ||
} | ||
export declare const visionTool: Plugin_2<void | VisionToolConfig> | ||
@@ -11,0 +83,0 @@ |
@@ -1,25 +0,2 @@ | ||
import { lazy } from 'react'; | ||
import { definePlugin } from 'sanity'; | ||
import { route } from 'sanity/router'; | ||
import { EyeOpenIcon } from '@sanity/icons'; | ||
const visionTool = definePlugin(options => { | ||
const { | ||
name, | ||
title, | ||
icon, | ||
...config | ||
} = options || {}; | ||
return { | ||
name: "@sanity/vision", | ||
tools: [{ | ||
name: name || "vision", | ||
title: title || "Vision", | ||
icon: icon || EyeOpenIcon, | ||
component: lazy(() => import('./_chunks/SanityVision-83ee3a3d.js')), | ||
options: config, | ||
router: route.create("/*") | ||
}] | ||
}; | ||
}); | ||
export { visionTool }; | ||
export { visionTool } from './_chunks/index-ShIdQoSo.js'; | ||
//# sourceMappingURL=index.esm.js.map |
@@ -6,28 +6,4 @@ 'use strict'; | ||
}); | ||
var React = require('react'); | ||
var sanity = require('sanity'); | ||
var router = require('sanity/router'); | ||
var icons = require('@sanity/icons'); | ||
const visionTool = sanity.definePlugin(options => { | ||
const { | ||
name, | ||
title, | ||
icon, | ||
...config | ||
} = options || {}; | ||
return { | ||
name: "@sanity/vision", | ||
tools: [{ | ||
name: name || "vision", | ||
title: title || "Vision", | ||
icon: icon || icons.EyeOpenIcon, | ||
component: React.lazy(() => Promise.resolve().then(function () { | ||
return require('./_chunks/SanityVision-f66e51dd.js'); | ||
})), | ||
options: config, | ||
router: router.route.create("/*") | ||
}] | ||
}; | ||
}); | ||
exports.visionTool = visionTool; | ||
var index = require('./_chunks/index-8Htx5mL9.js'); | ||
exports.visionTool = index.visionTool; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@sanity/vision", | ||
"version": "3.19.0", | ||
"version": "3.21.0", | ||
"description": "Sanity plugin for running/debugging GROQ-queries against Sanity datasets", | ||
@@ -33,4 +33,4 @@ "keywords": [ | ||
"node": { | ||
"import": "./lib/index.cjs.mjs", | ||
"require": "./lib/index.js" | ||
"module": "./lib/index.esm.js", | ||
"import": "./lib/index.cjs.mjs" | ||
}, | ||
@@ -71,3 +71,3 @@ "import": "./lib/index.esm.js", | ||
"@sanity/icons": "^2.6.0", | ||
"@sanity/ui": "^1.8.3", | ||
"@sanity/ui": "^1.9.3", | ||
"@uiw/react-codemirror": "^4.11.4", | ||
@@ -80,6 +80,6 @@ "hashlru": "^2.3.0", | ||
"devDependencies": { | ||
"@sanity/client": "^6.7.0", | ||
"@sanity/client": "^6.8.6", | ||
"react": "^18.2.0", | ||
"sanity": "3.19.0", | ||
"styled-components": "^6.1.0" | ||
"sanity": "3.21.0", | ||
"styled-components": "^6.1.1" | ||
}, | ||
@@ -90,3 +90,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "275293c7e3e9bbb6474ba09cb7607591f3b4d3f6" | ||
"gitHead": "57dfb68069770647461a5f1a570419103bd2c795" | ||
} |
@@ -1,2 +0,2 @@ | ||
export const API_VERSIONS = ['v1', 'vX', 'v2021-03-25', 'v2021-10-21'] | ||
export const API_VERSIONS = ['v1', 'vX', 'v2021-03-25', 'v2021-10-21', 'v2022-03-07'] | ||
export const [DEFAULT_API_VERSION] = API_VERSIONS.slice(-1) |
export {visionTool} from './visionTool' | ||
export type {VisionToolConfig} from './types' | ||
export type {VisionToolConfig, VisionLocaleResourceKeys} from './types' |
@@ -19,1 +19,3 @@ import type {SanityClient} from '@sanity/client' | ||
} | ||
export type {VisionLocaleResourceKeys} from './i18n/resources' |
import JSON5 from 'json5' | ||
import {TFunction} from 'sanity' | ||
export function tryParseParams(val: string): Record<string, unknown> | Error { | ||
export function tryParseParams( | ||
val: string, | ||
t: TFunction<'vision', undefined>, | ||
): Record<string, unknown> | Error { | ||
try { | ||
@@ -10,5 +14,8 @@ const parsed = val ? JSON5.parse(val) : {} | ||
// to clean up the error tooltip | ||
err.message = `Parameters are not valid JSON:\n\n${err.message.replace('JSON5:', '')}` | ||
err.message = `${t('params.error.params-invalid-json')}:\n\n${err.message.replace( | ||
'JSON5:', | ||
'', | ||
)}` | ||
return err | ||
} | ||
} |
@@ -5,2 +5,3 @@ import {lazy} from 'react' | ||
import {EyeOpenIcon} from '@sanity/icons' | ||
import {visionUsEnglishLocaleBundle} from './i18n' | ||
import {VisionToolConfig} from './types' | ||
@@ -22,3 +23,6 @@ | ||
], | ||
i18n: { | ||
bundles: [visionUsEnglishLocaleBundle], | ||
}, | ||
} | ||
}) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
447759
54
5075
1
Updated@sanity/ui@^1.9.3