@sanity/embeddings-index-ui 3.0.1 → 4.0.0
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/LICENSE +1 -1
- package/README.md +31 -35
- package/dist/index.d.ts +49 -60
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +766 -2198
- package/dist/index.js.map +1 -1
- package/package.json +36 -69
- package/dist/index.d.mts +0 -74
- package/dist/index.mjs +0 -2353
- package/dist/index.mjs.map +0 -1
- package/sanity.json +0 -8
- package/src/api/embeddingsApi.ts +0 -68
- package/src/api/embeddingsApiHooks.ts +0 -17
- package/src/api/isEnabled.tsx +0 -65
- package/src/embeddingsIndexDashboard/EmbeddingsIndexTool.tsx +0 -168
- package/src/embeddingsIndexDashboard/IndexEditor.tsx +0 -185
- package/src/embeddingsIndexDashboard/IndexFormInput.tsx +0 -86
- package/src/embeddingsIndexDashboard/IndexInfo.tsx +0 -117
- package/src/embeddingsIndexDashboard/IndexList.tsx +0 -87
- package/src/embeddingsIndexDashboard/QueryIndex.tsx +0 -32
- package/src/embeddingsIndexDashboard/dashboardPlugin.ts +0 -16
- package/src/embeddingsIndexDashboard/hooks.ts +0 -37
- package/src/index.ts +0 -10
- package/src/preview/DocumentPreview.tsx +0 -139
- package/src/referenceInput/SemanticSearchAutocomplete.tsx +0 -213
- package/src/referenceInput/SemanticSearchReferenceInput.tsx +0 -169
- package/src/referenceInput/referencePlugin.tsx +0 -44
- package/src/referenceInput/types.ts +0 -0
- package/src/schemas/typeDefExtensions.ts +0 -27
- package/src/utils/id.ts +0 -3
- package/src/utils/types.ts +0 -11
- package/v2-incompatible.js +0 -11
package/package.json
CHANGED
|
@@ -1,93 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/embeddings-index-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Various Sanity Studio plugins for integrating with the embeddings index API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
7
7
|
"sanity-plugin"
|
|
8
8
|
],
|
|
9
|
-
"homepage": "https://github.com/sanity-io/embeddings-index-ui#readme",
|
|
9
|
+
"homepage": "https://github.com/sanity-io/plugins/tree/main/plugins/@sanity/embeddings-index-ui#readme",
|
|
10
10
|
"bugs": {
|
|
11
|
-
"url": "https://github.com/sanity-io/
|
|
11
|
+
"url": "https://github.com/sanity-io/plugins/issues"
|
|
12
12
|
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": "Sanity.io <hello@sanity.io>",
|
|
13
15
|
"repository": {
|
|
14
16
|
"type": "git",
|
|
15
|
-
"url": "git@github.com
|
|
16
|
-
|
|
17
|
-
"license": "MIT",
|
|
18
|
-
"author": "Sanity <hello@sanity.io>",
|
|
19
|
-
"sideEffects": false,
|
|
20
|
-
"type": "commonjs",
|
|
21
|
-
"exports": {
|
|
22
|
-
".": {
|
|
23
|
-
"source": "./src/index.ts",
|
|
24
|
-
"import": "./dist/index.mjs",
|
|
25
|
-
"default": "./dist/index.js"
|
|
26
|
-
},
|
|
27
|
-
"./package.json": "./package.json"
|
|
17
|
+
"url": "git+ssh://git@github.com/sanity-io/plugins.git",
|
|
18
|
+
"directory": "plugins/@sanity/embeddings-index-ui"
|
|
28
19
|
},
|
|
29
|
-
"main": "./dist/index.js",
|
|
30
|
-
"types": "./dist/index.d.ts",
|
|
31
20
|
"files": [
|
|
32
|
-
"dist"
|
|
33
|
-
"sanity.json",
|
|
34
|
-
"src",
|
|
35
|
-
"v2-incompatible.js"
|
|
21
|
+
"dist"
|
|
36
22
|
],
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"lint": "eslint .",
|
|
43
|
-
"prepublishOnly": "npm run build",
|
|
44
|
-
"watch": "pkg-utils watch --strict",
|
|
45
|
-
"prepare": "husky install"
|
|
23
|
+
"type": "module",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": "./dist/index.js",
|
|
27
|
+
"./package.json": "./package.json"
|
|
46
28
|
},
|
|
47
29
|
"dependencies": {
|
|
48
|
-
"@sanity/icons": "^3.7.
|
|
49
|
-
"@sanity/
|
|
50
|
-
"
|
|
30
|
+
"@sanity/icons": "^3.7.4",
|
|
31
|
+
"@sanity/ui": "^3.2.0",
|
|
32
|
+
"react-rx": "^4.2.2"
|
|
51
33
|
},
|
|
52
34
|
"devDependencies": {
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"eslint-plugin-react": "^7.37.5",
|
|
66
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
67
|
-
"husky": "^8.0.3",
|
|
68
|
-
"lint-staged": "^14.0.1",
|
|
69
|
-
"npm-run-all": "^4.1.5",
|
|
70
|
-
"prettier": "^3.5.3",
|
|
71
|
-
"prettier-plugin-packagejson": "^2.5.10",
|
|
72
|
-
"react": "^19.1.0",
|
|
73
|
-
"react-dom": "^19.1.0",
|
|
74
|
-
"react-is": "^18.2.0",
|
|
75
|
-
"rimraf": "^5.0.1",
|
|
76
|
-
"sanity": "^4.2.0",
|
|
77
|
-
"semantic-release": "^21.1.1",
|
|
78
|
-
"styled-components": "^6.1.17",
|
|
79
|
-
"typescript": "^5.8.3"
|
|
35
|
+
"@sanity/pkg-utils": "^10.5.7",
|
|
36
|
+
"@types/node": "^24.13.2",
|
|
37
|
+
"@types/react": "^19.2.17",
|
|
38
|
+
"@types/react-dom": "^19.2.3",
|
|
39
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
40
|
+
"babel-plugin-styled-components": "^2.3.0",
|
|
41
|
+
"react": "^19.2.7",
|
|
42
|
+
"react-dom": "^19.2.7",
|
|
43
|
+
"sanity": "^6.1.0",
|
|
44
|
+
"styled-components": "^6.4.2",
|
|
45
|
+
"@repo/package.config": "0.0.0",
|
|
46
|
+
"@repo/tsconfig": "0.0.0"
|
|
80
47
|
},
|
|
81
48
|
"peerDependencies": {
|
|
82
|
-
"react": "^
|
|
83
|
-
"
|
|
49
|
+
"react": "^19.2",
|
|
50
|
+
"react-dom": "^19.2",
|
|
51
|
+
"sanity": "^5 || ^6.0.0-0",
|
|
52
|
+
"styled-components": "^6.1"
|
|
84
53
|
},
|
|
85
54
|
"engines": {
|
|
86
|
-
"node": ">=
|
|
55
|
+
"node": ">=20.19 <22 || >=22.12"
|
|
87
56
|
},
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
"publishConfig": {
|
|
91
|
-
"access": "public"
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "pkg build --strict --check --clean"
|
|
92
59
|
}
|
|
93
|
-
}
|
|
60
|
+
}
|
package/dist/index.d.mts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import {Plugin as Plugin_2} from 'sanity'
|
|
2
|
-
import {SanityClient} from 'sanity'
|
|
3
|
-
|
|
4
|
-
export declare function deleteIndex(indexName: string, client: SanityClient): Promise<IndexState>
|
|
5
|
-
|
|
6
|
-
declare interface EmbeddingsIndexConfig {
|
|
7
|
-
/**
|
|
8
|
-
* Name of the index
|
|
9
|
-
*/
|
|
10
|
-
indexName: string
|
|
11
|
-
maxResults?: number
|
|
12
|
-
/**
|
|
13
|
-
* Determines if which search mode is enabled by default for the reference field.
|
|
14
|
-
* Default is the studio default search, while 'embeddings' enables
|
|
15
|
-
* Defaults to 'default' behaviour
|
|
16
|
-
*/
|
|
17
|
-
searchMode?: 'embeddings' | 'default'
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export declare const embeddingsIndexDashboard: Plugin_2<void>
|
|
21
|
-
|
|
22
|
-
export declare const embeddingsIndexReferenceInput: Plugin_2<void | EmbeddingsIndexConfig>
|
|
23
|
-
|
|
24
|
-
export declare function getIndexes(client: SanityClient): Promise<IndexState[]>
|
|
25
|
-
|
|
26
|
-
export declare interface IndexState extends NamedIndex {
|
|
27
|
-
status: string
|
|
28
|
-
startDocumentCount: number
|
|
29
|
-
remainingDocumentCount: number
|
|
30
|
-
failedDocumentCount: number
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export declare interface NamedIndex {
|
|
34
|
-
indexName: string
|
|
35
|
-
dataset: string
|
|
36
|
-
project: string
|
|
37
|
-
projection: string
|
|
38
|
-
filter: string
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export declare interface QueryConfig {
|
|
42
|
-
query: string
|
|
43
|
-
indexName: string
|
|
44
|
-
maxResults?: number
|
|
45
|
-
filter?: {
|
|
46
|
-
type?: string | string[]
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export declare function queryIndex(
|
|
51
|
-
queryConfig: QueryConfig,
|
|
52
|
-
client: SanityClient,
|
|
53
|
-
): Promise<QueryResult[]>
|
|
54
|
-
|
|
55
|
-
export declare interface QueryResult {
|
|
56
|
-
score: number
|
|
57
|
-
value: {
|
|
58
|
-
documentId: string
|
|
59
|
-
type: string
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export {}
|
|
64
|
-
|
|
65
|
-
declare module 'sanity' {
|
|
66
|
-
interface ReferenceBaseOptions {
|
|
67
|
-
/**
|
|
68
|
-
* Enables toggleable semantic search for a reference field.
|
|
69
|
-
*
|
|
70
|
-
* When `true`: will use default plugin configuration (if no config has been for the plugin provided ,this will throw an error)
|
|
71
|
-
*/
|
|
72
|
-
embeddingsIndex?: true | EmbeddingsIndexConfig
|
|
73
|
-
}
|
|
74
|
-
}
|