sanity-plugin-workflow 1.0.1 → 1.0.3
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/lib/index.esm.js +1973 -31
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1972 -31
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
- package/src/components/DocumentCard/index.tsx +1 -2
- package/src/components/Filters.tsx +6 -0
- package/src/hooks/useWorkflowDocuments.tsx +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sanity-plugin-workflow",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "A demonstration of a custom content publishing workflow using Sanity.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"watch": "pkg-utils watch --strict"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@hello-pangea/dnd": "^16.
|
|
52
|
+
"@hello-pangea/dnd": "^16.5.0",
|
|
53
53
|
"@sanity/icons": "^2.2.2",
|
|
54
54
|
"@sanity/incompatible-plugin": "^1.0.4",
|
|
55
55
|
"@tanstack/react-virtual": "^3.0.0-beta.54",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@commitlint/cli": "^17.4.4",
|
|
65
65
|
"@commitlint/config-conventional": "^17.4.4",
|
|
66
|
-
"@sanity/pkg-utils": "^2.
|
|
66
|
+
"@sanity/pkg-utils": "^2.4.10",
|
|
67
67
|
"@sanity/plugin-kit": "^3.1.4",
|
|
68
68
|
"@sanity/semantic-release-preset": "^4.0.1",
|
|
69
69
|
"@types/react": "^18.0.27",
|
|
@@ -85,15 +85,15 @@
|
|
|
85
85
|
"react-dom": "^18.2.0",
|
|
86
86
|
"react-is": "^18.2.0",
|
|
87
87
|
"rimraf": "^4.1.2",
|
|
88
|
-
"sanity": "^3.
|
|
88
|
+
"sanity": "^3.26.0",
|
|
89
89
|
"semantic-release": "^20.1.3",
|
|
90
90
|
"typescript": "^5.0.0"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
|
-
"@sanity/ui": "^1.2.
|
|
93
|
+
"@sanity/ui": "^1.0 || ^2.0",
|
|
94
94
|
"react": "^18",
|
|
95
|
-
"
|
|
96
|
-
"
|
|
95
|
+
"react-dom": "^18",
|
|
96
|
+
"sanity": "^3.0.0"
|
|
97
97
|
},
|
|
98
98
|
"engines": {
|
|
99
99
|
"node": ">=14"
|
|
@@ -69,6 +69,8 @@ export default function Filters(props: FiltersProps) {
|
|
|
69
69
|
<MenuButton
|
|
70
70
|
button={
|
|
71
71
|
<Button
|
|
72
|
+
padding={3}
|
|
73
|
+
fontSize={1}
|
|
72
74
|
text="Filter Assignees"
|
|
73
75
|
tone="primary"
|
|
74
76
|
icon={UserIcon}
|
|
@@ -129,6 +131,8 @@ export default function Filters(props: FiltersProps) {
|
|
|
129
131
|
|
|
130
132
|
{selectedUserIds.length > 0 ? (
|
|
131
133
|
<Button
|
|
134
|
+
padding={3}
|
|
135
|
+
fontSize={1}
|
|
132
136
|
text="Clear"
|
|
133
137
|
onClick={resetSelectedUsers}
|
|
134
138
|
mode="ghost"
|
|
@@ -150,6 +154,8 @@ export default function Filters(props: FiltersProps) {
|
|
|
150
154
|
|
|
151
155
|
return (
|
|
152
156
|
<Button
|
|
157
|
+
padding={3}
|
|
158
|
+
fontSize={1}
|
|
153
159
|
key={typeName}
|
|
154
160
|
text={schemaType?.title ?? typeName}
|
|
155
161
|
icon={schemaType?.icon ?? undefined}
|
|
@@ -14,10 +14,13 @@ const QUERY = groq`*[_type == "workflow.metadata"]|order(orderRank){
|
|
|
14
14
|
assignees,
|
|
15
15
|
documentId,
|
|
16
16
|
state,
|
|
17
|
-
orderRank
|
|
18
|
-
|
|
17
|
+
orderRank,
|
|
18
|
+
"draftDocumentId": "drafts." + documentId,
|
|
19
|
+
}
|
|
20
|
+
}{
|
|
21
|
+
...,
|
|
19
22
|
...(
|
|
20
|
-
*[_id
|
|
23
|
+
*[_id == ^._metadata.documentId || _id == ^._metadata.draftDocumentId]|order(_updatedAt)[0]{
|
|
21
24
|
_id,
|
|
22
25
|
_type,
|
|
23
26
|
_rev,
|