sanity-plugin-workflow 1.0.0 → 1.0.2

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.esm.js CHANGED
@@ -664,7 +664,7 @@ function filterItemsAndSort(items, stateId) {
664
664
  return aOrderRank.localeCompare(bOrderRank);
665
665
  });
666
666
  }
667
- const QUERY = groq(_templateObject || (_templateObject = _taggedTemplateLiteral(["*[_type == \"workflow.metadata\"]|order(orderRank){\n \"_metadata\": {\n _rev,\n assignees,\n documentId,\n state,\n orderRank\n },\n ...(\n *[_id in [^.documentId, \"drafts.\" + ^.documentId]]|order(_updatedAt)[0]{ \n _id, \n _type, \n _rev, \n _updatedAt \n }\n )\n}"])));
667
+ const QUERY = groq(_templateObject || (_templateObject = _taggedTemplateLiteral(["*[_type == \"workflow.metadata\"]|order(orderRank){\n \"_metadata\": {\n _rev,\n assignees,\n documentId,\n state,\n orderRank,\n \"draftDocumentId\": \"drafts.\" + documentId,\n }\n}{\n ...,\n ...(\n *[_id == ^._metadata.documentId || _id == ^._metadata.draftDocumentId]|order(_updatedAt)[0]{ \n _id, \n _type, \n _rev, \n _updatedAt \n }\n )\n}"])));
668
668
  function useWorkflowDocuments(schemaTypes) {
669
669
  const toast = useToast();
670
670
  const client = useClient({
@@ -1822,7 +1822,7 @@ function WorkflowTool(props) {
1822
1822
  if (destinationStateIndex === 0) {
1823
1823
  newOrder = LexoRank.min().toString();
1824
1824
  } else {
1825
- newOrder = LexoRank.parse(globalStateMinimumRank).between(LexoRank.min()).toString();
1825
+ newOrder = LexoRank.min().genNext().toString();
1826
1826
  }
1827
1827
  } else if (destination.index === 0) {
1828
1828
  const firstItemOrderRank = (_b2 = (_a2 = [...destinationStateItems].shift()) == null ? void 0 : _a2._metadata) == null ? void 0 : _b2.orderRank;