@sanity/vision 5.8.1-next.9 → 5.8.1
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/lib/index.d.ts +63 -117
- package/package.json +10 -10
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ComponentType } from "react";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import * as sanity0 from "sanity";
|
|
4
3
|
/** @public */
|
|
5
|
-
declare type DatasetAclMode =
|
|
6
|
-
|
|
4
|
+
declare type DatasetAclMode = 'public' | 'private' | 'custom';
|
|
7
5
|
/** @public */
|
|
8
6
|
declare type DatasetsResponse = {
|
|
9
7
|
name: string;
|
|
@@ -15,139 +13,87 @@ declare type DatasetsResponse = {
|
|
|
15
13
|
features: string[];
|
|
16
14
|
tags: string[];
|
|
17
15
|
}[];
|
|
18
|
-
|
|
19
|
-
declare interface VisionConfig {
|
|
20
|
-
datasets?: string[] | ((datasets: DatasetsResponse) => DatasetsResponse);
|
|
21
|
-
defaultApiVersion: string;
|
|
22
|
-
defaultDataset?: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @alpha
|
|
27
|
-
*/
|
|
28
|
-
export declare type VisionLocaleResourceKeys = keyof typeof visionLocaleStrings;
|
|
29
|
-
|
|
30
16
|
/**
|
|
31
17
|
* Defined locale strings for the vision tool, in US English.
|
|
32
18
|
*
|
|
33
19
|
* @internal
|
|
34
20
|
*/
|
|
35
21
|
declare const visionLocaleStrings: {
|
|
36
|
-
/** Label for action "Copy to clipboard", tied to the "Query URL" field. Also used for accessibility purposes on button */
|
|
37
|
-
readonly
|
|
38
|
-
/** Label for
|
|
39
|
-
readonly
|
|
40
|
-
/** Label for
|
|
41
|
-
readonly
|
|
42
|
-
/** Label for
|
|
43
|
-
readonly
|
|
44
|
-
/** Label for
|
|
45
|
-
readonly
|
|
46
|
-
/** Label for
|
|
47
|
-
readonly
|
|
48
|
-
|
|
49
|
-
readonly "action.load-query": "Load query";
|
|
50
|
-
/** Label for cancelling an ongoing query */
|
|
51
|
-
readonly "action.query-cancel": "Cancel";
|
|
52
|
-
/** Label for executing the query, eg doing a fetch */
|
|
53
|
-
readonly "action.query-execute": "Fetch";
|
|
54
|
-
/** Label for saving a query */
|
|
55
|
-
readonly "action.save-query": "Save query";
|
|
56
|
-
/** Label for updating a query */
|
|
57
|
-
readonly "action.update": "Update";
|
|
58
|
-
/** Label for actions user can take */
|
|
59
|
-
readonly "label.actions": "Actions";
|
|
60
|
-
/** Label for saved queries that have been edited */
|
|
61
|
-
readonly "label.edited": "Edited";
|
|
22
|
+
/** 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 */
|
|
23
|
+
readonly 'action.delete': "Delete"; /** Label for editing a query's title */
|
|
24
|
+
readonly 'action.edit-title': "Edit title"; /** Label for stopping an ongoing listen operation */
|
|
25
|
+
readonly 'action.listen-cancel': "Stop"; /** Label for setting up a listener */
|
|
26
|
+
readonly 'action.listen-execute': "Listen"; /** Label for query loading table */
|
|
27
|
+
readonly 'action.load-queries': "Load queries"; /** Label for loading a query */
|
|
28
|
+
readonly 'action.load-query': "Load query"; /** Label for cancelling an ongoing query */
|
|
29
|
+
readonly 'action.query-cancel': "Cancel"; /** Label for executing the query, eg doing a fetch */
|
|
30
|
+
readonly 'action.query-execute': "Fetch"; /** Label for saving a query */
|
|
31
|
+
readonly 'action.save-query': "Save query"; /** Label for updating a query */
|
|
32
|
+
readonly 'action.update': "Update"; /** Label for actions user can take */
|
|
33
|
+
readonly 'label.actions': "Actions"; /** Label for saved queries that have been edited */
|
|
34
|
+
readonly 'label.edited': "Edited";
|
|
62
35
|
/**
|
|
63
36
|
* Some features has a "New" label indicating that the feature was recently introduced.
|
|
64
37
|
* This defines what the text of that label is. Keep it short and sweet.
|
|
65
38
|
*/
|
|
66
|
-
readonly
|
|
67
|
-
/** Label for
|
|
68
|
-
readonly
|
|
69
|
-
|
|
70
|
-
readonly
|
|
71
|
-
/**
|
|
72
|
-
readonly
|
|
73
|
-
/**
|
|
74
|
-
readonly
|
|
75
|
-
/**
|
|
76
|
-
readonly
|
|
77
|
-
/** Label for
|
|
78
|
-
readonly
|
|
79
|
-
|
|
80
|
-
readonly
|
|
81
|
-
|
|
82
|
-
readonly
|
|
83
|
-
|
|
84
|
-
readonly "query.error.column": "Column";
|
|
85
|
-
/** Label for 'Line' indicator when there is an error within the query */
|
|
86
|
-
readonly "query.error.line": "Line";
|
|
87
|
-
/** Label for "Query" editor/input */
|
|
88
|
-
readonly "query.label": "Query";
|
|
89
|
-
/** Label for the "Query URL" field, shown after executing a query, and allows for copying */
|
|
90
|
-
readonly "query.url": "Query URL";
|
|
91
|
-
/** Label for "End to End time" information of the fetched query */
|
|
92
|
-
readonly "result.end-to-end-time-label": "End-to-end";
|
|
93
|
-
/** Label for "Execution time" information of the fetched query */
|
|
94
|
-
readonly "result.execution-time-label": "Execution";
|
|
95
|
-
/** Label for "Result" explorer/view */
|
|
96
|
-
readonly "result.label": "Result";
|
|
97
|
-
/** Tooltip text shown when the query result is not encodable as CSV */
|
|
98
|
-
readonly "result.save-result-as-csv.not-csv-encodable": "Result cannot be encoded as CSV";
|
|
99
|
-
/** Label for "Save result as" result action */
|
|
100
|
-
readonly "result.save-result-as-format": "Save result as <SaveResultButtons/>";
|
|
39
|
+
readonly 'label.new': "New"; /** Label for query type "personal" */
|
|
40
|
+
readonly 'label.personal': "Personal"; /** Label for savedAt date */
|
|
41
|
+
readonly 'label.saved-at': "Saved at"; /** Saved queries */
|
|
42
|
+
readonly 'label.saved-queries': "Saved queries"; /** Search queries */
|
|
43
|
+
readonly 'label.search-queries': "Search queries"; /** Share query */
|
|
44
|
+
readonly 'label.share': "Share"; /** Label for saved query type "team" */
|
|
45
|
+
readonly 'label.team': "Team"; /** Error message for when the "Params" input are not a valid json */
|
|
46
|
+
readonly 'params.error.params-invalid-json': "Parameters are not valid JSON"; /** Label for "Params" (parameters) editor/input */
|
|
47
|
+
readonly 'params.label': "Params"; /** Label for 'Column' indicator when there is an error within the query */
|
|
48
|
+
readonly 'query.error.column': "Column"; /** Label for 'Line' indicator when there is an error within the query */
|
|
49
|
+
readonly 'query.error.line': "Line"; /** Label for "Query" editor/input */
|
|
50
|
+
readonly 'query.label': "Query"; /** Label for the "Query URL" field, shown after executing a query, and allows for copying */
|
|
51
|
+
readonly 'query.url': "Query URL"; /** Label for "End to End time" information of the fetched query */
|
|
52
|
+
readonly 'result.end-to-end-time-label': "End-to-end"; /** Label for "Execution time" information of the fetched query */
|
|
53
|
+
readonly 'result.execution-time-label': "Execution"; /** Label for "Result" explorer/view */
|
|
54
|
+
readonly 'result.label': "Result"; /** Tooltip text shown when the query result is not encodable as CSV */
|
|
55
|
+
readonly 'result.save-result-as-csv.not-csv-encodable': "Result cannot be encoded as CSV"; /** Label for "Save result as" result action */
|
|
56
|
+
readonly 'result.save-result-as-format': "Save result as <SaveResultButtons/>";
|
|
101
57
|
/**
|
|
102
58
|
* "Not applicable" message for when there is no Execution time or End to End time information
|
|
103
59
|
* available for the query (eg when the query has not been executed, or errored)
|
|
104
60
|
*/
|
|
105
|
-
readonly
|
|
106
|
-
|
|
107
|
-
readonly
|
|
108
|
-
/**
|
|
109
|
-
readonly
|
|
110
|
-
/**
|
|
111
|
-
readonly
|
|
112
|
-
/** Label for the "API version" dropdown
|
|
113
|
-
readonly
|
|
114
|
-
/** Label for the "Custom API version" input in settings, shown when "other" is chosen as API version */
|
|
115
|
-
readonly "settings.custom-api-version-label": "Custom API version";
|
|
116
|
-
/** Label for the "Dataset" dropdown in vision settings */
|
|
117
|
-
readonly "settings.dataset-label": "Dataset";
|
|
118
|
-
/** Error label for when the API version in 'Custom API version' input is invalid */
|
|
119
|
-
readonly "settings.error.invalid-api-version": "Invalid API version";
|
|
120
|
-
/** Label for the "other" versions within the "API version" dropdown */
|
|
121
|
-
readonly "settings.other-api-version-label": "Other";
|
|
61
|
+
readonly 'result.timing-not-applicable': "n/a"; /** Query already saved error label */
|
|
62
|
+
readonly 'save-query.already-saved': "Query already saved"; /** Save error label */
|
|
63
|
+
readonly 'save-query.error': "Error saving query"; /** Save success label */
|
|
64
|
+
readonly 'save-query.success': "Query saved"; /** Label for the "API version" dropdown in settings */
|
|
65
|
+
readonly 'settings.api-version-label': "API version"; /** Label for the "Custom API version" input in settings, shown when "other" is chosen as API version */
|
|
66
|
+
readonly 'settings.custom-api-version-label': "Custom API version"; /** Label for the "Dataset" dropdown in vision settings */
|
|
67
|
+
readonly 'settings.dataset-label': "Dataset"; /** Error label for when the API version in 'Custom API version' input is invalid */
|
|
68
|
+
readonly 'settings.error.invalid-api-version': "Invalid API version"; /** Label for the "other" versions within the "API version" dropdown */
|
|
69
|
+
readonly 'settings.other-api-version-label': "Other";
|
|
122
70
|
/**
|
|
123
71
|
* Label for the "Perspective" dropdown in vision settings
|
|
124
72
|
* @see {@link https://www.sanity.io/docs/perspectives}
|
|
125
73
|
*/
|
|
126
|
-
readonly
|
|
127
|
-
|
|
128
|
-
readonly
|
|
129
|
-
|
|
130
|
-
readonly
|
|
131
|
-
/**
|
|
132
|
-
readonly
|
|
133
|
-
/**
|
|
134
|
-
readonly
|
|
135
|
-
/** Description for upcoming default perspective change */
|
|
136
|
-
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.';
|
|
137
|
-
/** Label for the pinned release perspective */
|
|
138
|
-
readonly "settings.perspectives.pinned-release-label": "Pinned release";
|
|
139
|
-
/** Label for the scheduled drafts perspective */
|
|
140
|
-
readonly "settings.perspectives.scheduled-drafts": "Scheduled drafts";
|
|
141
|
-
/** Title for popover that explains what "Perspectives" are */
|
|
142
|
-
readonly "settings.perspectives.title": "Perspectives";
|
|
74
|
+
readonly 'settings.perspective-label': "Perspective"; /** Notification about previewDrafts to drafts rename */
|
|
75
|
+
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" */
|
|
76
|
+
readonly 'settings.perspectives.action.docs-link': "Read docs"; /** Option for selecting default perspective */
|
|
77
|
+
readonly 'settings.perspectives.default': "No perspective (API default)"; /** Description for popover that explains what "Perspectives" are */
|
|
78
|
+
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 */
|
|
79
|
+
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 */
|
|
80
|
+
readonly 'settings.perspectives.pinned-release-label': "Pinned release"; /** Label for the scheduled drafts perspective */
|
|
81
|
+
readonly 'settings.perspectives.scheduled-drafts': "Scheduled drafts"; /** Title for popover that explains what "Perspectives" are */
|
|
82
|
+
readonly 'settings.perspectives.title': "Perspectives";
|
|
143
83
|
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
84
|
+
/**
|
|
85
|
+
* @alpha
|
|
86
|
+
*/
|
|
87
|
+
type VisionLocaleResourceKeys = keyof typeof visionLocaleStrings;
|
|
88
|
+
interface VisionConfig {
|
|
89
|
+
datasets?: string[] | ((datasets: DatasetsResponse) => DatasetsResponse);
|
|
90
|
+
defaultApiVersion: string;
|
|
91
|
+
defaultDataset?: string;
|
|
92
|
+
}
|
|
93
|
+
interface VisionToolConfig extends Partial<VisionConfig> {
|
|
148
94
|
name?: string;
|
|
149
95
|
title?: string;
|
|
150
96
|
icon?: ComponentType;
|
|
151
97
|
}
|
|
152
|
-
|
|
153
|
-
export {};
|
|
98
|
+
declare const visionTool: sanity0.Plugin<void | VisionToolConfig>;
|
|
99
|
+
export { type VisionLocaleResourceKeys, type VisionToolConfig, visionTool };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/vision",
|
|
3
|
-
"version": "5.8.1
|
|
3
|
+
"version": "5.8.1",
|
|
4
4
|
"description": "Sanity plugin for running/debugging GROQ-queries against Sanity datasets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"admin",
|
|
@@ -67,24 +67,24 @@
|
|
|
67
67
|
"@sanity/pkg-utils": "^10.4.4",
|
|
68
68
|
"@testing-library/react": "^16.3.1",
|
|
69
69
|
"@types/lodash-es": "^4.17.12",
|
|
70
|
-
"@types/react": "^19.2.
|
|
70
|
+
"@types/react": "^19.2.11",
|
|
71
71
|
"@typescript/native-preview": "7.0.0-dev.20260112.1",
|
|
72
72
|
"@vitejs/plugin-react": "^5.1.2",
|
|
73
73
|
"babel-plugin-react-compiler": "1.0.0",
|
|
74
74
|
"babel-plugin-styled-components": "^2.1.4",
|
|
75
75
|
"eslint": "^9.39.2",
|
|
76
|
-
"react": "^19.2.
|
|
77
|
-
"react-dom": "^19.2.
|
|
76
|
+
"react": "^19.2.4",
|
|
77
|
+
"react-dom": "^19.2.4",
|
|
78
78
|
"rimraf": "^5.0.10",
|
|
79
|
-
"sanity": "5.8.1
|
|
79
|
+
"sanity": "^5.8.1",
|
|
80
80
|
"styled-components": "npm:@sanity/styled-components@^6.1.24",
|
|
81
81
|
"vite": "^7.3.1",
|
|
82
82
|
"vitest": "^4.0.18",
|
|
83
|
-
"@repo/eslint-config": "5.8.1
|
|
84
|
-
"@repo/package.
|
|
85
|
-
"@repo/package.
|
|
86
|
-
"@repo/
|
|
87
|
-
"@repo/
|
|
83
|
+
"@repo/eslint-config": "5.8.1",
|
|
84
|
+
"@repo/package.config": "5.8.1",
|
|
85
|
+
"@repo/package.bundle": "5.8.1",
|
|
86
|
+
"@repo/tsconfig": "5.8.1",
|
|
87
|
+
"@repo/test-config": "5.8.1"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
90
|
"react": "^19.2.2",
|