sanity-plugin-taxonomy-manager 2.0.0-beta.0 → 2.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/README.md +41 -41
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Sanity
|
|
1
|
+
# Sanity Taxonomy Manager Plugin
|
|
2
2
|

|
|
3
3
|

|
|
4
4
|
|
|
@@ -11,7 +11,7 @@ Taxonomies are crucial tools for organization and interoperability between and a
|
|
|
11
11
|
|
|
12
12
|
The Taxonomy Manager document schema is based on the [World Wide Web Consortium](https://www.w3.org/) (W3C) [Simple Knowledge Organization Scheme](https://www.w3.org/TR/skos-reference/) (SKOS) recommendation. Concept and concept scheme editor tools include standard SKOS properties, hints for creating consistent concepts and vocabularies, and validation functions for preventing consistency errors.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
<img src="https://user-images.githubusercontent.com/3710835/212743871-14760a60-0689-4cc3-a13e-55dd7a4ef19a.png" width="700">
|
|
15
15
|
|
|
16
16
|
## Features
|
|
17
17
|
|
|
@@ -32,23 +32,25 @@ $ npm i sanity-plugin-taxonomy-manager
|
|
|
32
32
|
Add the plugin to your project configuration to make the skosConcept and skosConceptScheme document types available in your studio.
|
|
33
33
|
|
|
34
34
|
```js
|
|
35
|
-
// sanity.config.
|
|
35
|
+
// sanity.config.js
|
|
36
36
|
|
|
37
|
-
import {
|
|
38
|
-
|
|
39
|
-
import {
|
|
37
|
+
import {defineConfig} from 'sanity'
|
|
38
|
+
import {deskTool} from 'sanity/desk'
|
|
39
|
+
import {structure} from "./deskStructure"
|
|
40
|
+
import {taxonomyManager} from 'sanity-plugin-taxonomy-manager'
|
|
41
|
+
import {schemaTypes} from './schemas'
|
|
40
42
|
|
|
41
43
|
export default defineConfig({
|
|
42
44
|
name: 'default',
|
|
43
|
-
title: '
|
|
44
|
-
projectId: '
|
|
45
|
+
title: 'Sanity Studio',
|
|
46
|
+
projectId: 'project-id',
|
|
45
47
|
dataset: 'production',
|
|
46
48
|
plugins: [
|
|
47
|
-
// Include the taxonomy manager plugin
|
|
48
|
-
taxonomyManager(),
|
|
49
49
|
deskTool({
|
|
50
|
-
structure
|
|
51
|
-
})
|
|
50
|
+
structure
|
|
51
|
+
}),
|
|
52
|
+
// Include the taxonomy manager plugin
|
|
53
|
+
taxonomyManager()
|
|
52
54
|
],
|
|
53
55
|
schema: {
|
|
54
56
|
types: schemaTypes,
|
|
@@ -62,36 +64,34 @@ Use [Structure Builder](https://www.sanity.io/docs/structure-builder-reference)
|
|
|
62
64
|
// ./deskStructure.js
|
|
63
65
|
import {TreeView} from 'sanity-plugin-taxonomy-manager'
|
|
64
66
|
|
|
65
|
-
export const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
S.listItem()
|
|
71
|
-
.title('Concept Schemes')
|
|
72
|
-
.schemaType('skosConceptScheme')
|
|
73
|
-
.child(
|
|
74
|
-
S.documentTypeList('skosConceptScheme')
|
|
67
|
+
export const structure = (S) =>
|
|
68
|
+
S.list()
|
|
69
|
+
.title('Content')
|
|
70
|
+
.items([
|
|
71
|
+
S.listItem()
|
|
75
72
|
.title('Concept Schemes')
|
|
76
|
-
.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
.
|
|
80
|
-
.
|
|
81
|
-
S.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
73
|
+
.schemaType('skosConceptScheme')
|
|
74
|
+
.child(
|
|
75
|
+
S.documentTypeList('skosConceptScheme')
|
|
76
|
+
.title('Concept Schemes')
|
|
77
|
+
.child(id =>
|
|
78
|
+
S.document()
|
|
79
|
+
.schemaType('skosConceptScheme')
|
|
80
|
+
.documentId(id)
|
|
81
|
+
.views([
|
|
82
|
+
S.view.component(TreeView).title('Tree View'),
|
|
83
|
+
S.view.form()
|
|
84
|
+
])
|
|
85
|
+
)
|
|
86
|
+
),
|
|
87
|
+
S.documentTypeListItem("skosConcept").title("Concepts"),
|
|
88
|
+
S.divider(),
|
|
89
|
+
|
|
90
|
+
// Remove Taxonomy Manager types from the default document type list
|
|
91
|
+
...S.documentTypeListItems().filter(
|
|
92
|
+
(listItem) => !['skosConcept', 'skosConceptScheme'].includes(listItem.getId())
|
|
93
|
+
),
|
|
94
|
+
])
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
## Usage
|
package/package.json
CHANGED