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.
Files changed (2) hide show
  1. package/README.md +41 -41
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Sanity Plugin Taxonomy Manager
1
+ # Sanity Taxonomy Manager Plugin
2
2
  ![NPM Version](https://img.shields.io/npm/v/sanity-plugin-taxonomy-manager?style=flat-square)
3
3
  ![License](https://img.shields.io/npm/l/sanity-plugin-taxonomy-manager?style=flat-square)
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
- <!-- Add screenshot of hierarchy view from a demo studio -->
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.ts
35
+ // sanity.config.js
36
36
 
37
- import { defineConfig } from 'sanity';
38
-
39
- import {taxonomyManager} from 'sanity-plugin-taxonomy-manager';
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: 'My Cool Project',
44
- projectId: 'my-project-id',
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: deskStructure,
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 myStructure = (S) =>
66
-
67
- // ... other structure builder items
68
-
69
- S.divider(),
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
- .child(id =>
77
- S.document()
78
- .schemaType('skosConceptScheme')
79
- .documentId(id)
80
- .views([
81
- S.view.component(TreeView).title('Tree View'),
82
- S.view.form()
83
- ])
84
- )
85
- ),
86
- S.documentTypeListItem("skosConcept").title("Concepts"),
87
- S.divider(),
88
-
89
- // ... other structure builder items
90
-
91
- // Be sure to remove Taxonomy Manager types from the main list
92
- ...S.documentTypeListItems().filter(
93
- (listItem) => !['skosConcept', 'skosConceptScheme'].includes(listItem.getId())
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanity-plugin-taxonomy-manager",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0",
4
4
  "description": "Create and manage SKOS compliant taxonomies, thesauri, and classification schemes in Sanity Studio.",
5
5
  "keywords": [
6
6
  "sanity",