sanity-plugin-media 5.0.10 → 5.0.12
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/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/package.json +6 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ImageIcon } from "@sanity/icons/Image";
|
|
2
2
|
import { FieldDefinitionBase, FileDefinition, ImageDefinition, InputProps, WidenInitialValue, WidenValidation } from "sanity";
|
|
3
3
|
import { ComponentType, JSX } from "react";
|
|
4
|
+
import "@reduxjs/toolkit";
|
|
5
|
+
import "redux-observable";
|
|
4
6
|
import { Control, FieldErrors, UseFormRegister } from "react-hook-form";
|
|
5
7
|
import * as z from "zod";
|
|
6
8
|
import { SanityAssetDocument, SanityImageAssetDocument } from "@sanity/client";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/DialogAssetEdit/Details.tsx","../src/formSchema/index.ts","../src/types/index.ts","../src/plugin.tsx","../src/components/AutoTagInputWrapper/index.tsx","../src/utils/mediaField.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/DialogAssetEdit/Details.tsx","../src/formSchema/index.ts","../src/types/index.ts","../src/plugin.tsx","../src/components/AutoTagInputWrapper/index.tsx","../src/utils/mediaField.ts"],"mappings":";;;;;;;;KAqBY;EACV;EACA,kBAAkB;EAClB,SAAS,QAAQ;EACjB,QAAQ,YAAY;EACpB,UAAU,gBAAgB;EAC1B,eAAe;EACf,iBAAiB;EACjB,cAAc;EACd;IACE;IACA;;EAEF,UAAU;;cCpBC,iBAAe,EAAA;;;;;;;;;;iBAKZ,mBAAmB;EAAW;MAAa,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KCJ/C;EACV;;KAGU;EACV;EACA;EACA;IACE,UAAU,cACR;MAAgB,uBAAuB,OAAO,iBAAiB,IAAI;;;EAGvE;IACE;IACA;;EAEF;;;;;EAKA,UAAU;;KAGA;EACV;EACA;GACC;;KAGE,2BAA2B;KAE3B;EACH,UAAU;EACV,cAAc;EACd;IACE;MACE,OAAO;;;EAGX,QAAQ;;KAYE,QAAQ,YAAY;KAEpB,gBAAgB,EAAE,MAAM,kBAAkB;KA8F1C,YAAY,sBACtB;EACE;;KAGQ,aAAa,2BACvB;EACE;EACA,aAAa;;KAqBL;EACV;EACA;EACA;;KAuIU,kBAAkB,EAAE,aAAa;cC3ThC;eAAA;;;;;cAWA,wBAAK,cAAA;KCVN,oBAAoB;EAC9B;;;;;;;;;;;;;;;;;;;;;iBAsBc,aAAa,OAAO,oCAAiB,IAAA;KC7BhD,wBAAwB,KAAK,8BAChC;EACE;EACA;EACA,UAAU;;KAGT,uBAAuB,KAAK,6BAC/B;EACE;EACA;EACA,UAAU;;KAGT,wBAAwB,KAAK,8BAChC;EACE,UAAU;IAA8B;;EACxC;IAAa,cAAc;;IACzB,kBACJ;KAEG,uBAAuB,KAAK,6BAC/B;EACE,UAAU;IAA6B;;EACvC;IAAa,cAAc;;IACzB,kBACJ;;;;;;;;;;;;;;;;;;;;;;iBAuBc,WAAW,QAAQ,wBAAwB;iBAC3C,WAAW,QAAQ,uBAAuB"}
|
package/dist/index.js
CHANGED
|
@@ -2906,13 +2906,19 @@ const DialogAssetEdit = (props) => {
|
|
|
2906
2906
|
client,
|
|
2907
2907
|
handleAssetUpdate
|
|
2908
2908
|
]), useEffect(() => {
|
|
2909
|
-
|
|
2909
|
+
if (lastCreatedTag) {
|
|
2910
|
+
let updatedTags = (getValues("opt.media.tags") || []).concat([lastCreatedTag]);
|
|
2911
|
+
setValue("opt.media.tags", updatedTags, { shouldDirty: !0 });
|
|
2912
|
+
}
|
|
2910
2913
|
}, [
|
|
2911
2914
|
getValues,
|
|
2912
2915
|
lastCreatedTag,
|
|
2913
2916
|
setValue
|
|
2914
2917
|
]), useEffect(() => {
|
|
2915
|
-
|
|
2918
|
+
if (lastRemovedTagIds) {
|
|
2919
|
+
let updatedTags = (getValues("opt.media.tags") || []).filter((tag) => !lastRemovedTagIds.includes(tag.value));
|
|
2920
|
+
setValue("opt.media.tags", updatedTags, { shouldDirty: !0 });
|
|
2921
|
+
}
|
|
2916
2922
|
}, [
|
|
2917
2923
|
getValues,
|
|
2918
2924
|
lastRemovedTagIds,
|
|
@@ -3881,7 +3887,7 @@ const createBlob = (img) => new Promise((resolve) => {
|
|
|
3881
3887
|
window.URL.revokeObjectURL(blobUrlLarge), resolve(img);
|
|
3882
3888
|
}, img.src = blobUrlLarge;
|
|
3883
3889
|
}), generatePreviewBlobUrl = async (file) => {
|
|
3884
|
-
let
|
|
3890
|
+
let imageEl = await createImageEl(file), blob = await createBlob(imageEl);
|
|
3885
3891
|
if (!blob) throw Error("Unable to generate file Blob");
|
|
3886
3892
|
return window.URL.createObjectURL(blob);
|
|
3887
3893
|
}, generatePreviewBlobUrl$ = (file) => of(null).pipe(mergeMap(() => from(generatePreviewBlobUrl(file))));
|
|
@@ -4167,10 +4173,10 @@ const CardWrapper = styled(Flex).withConfig({
|
|
|
4167
4173
|
},
|
|
4168
4174
|
endReached: onLoadMore,
|
|
4169
4175
|
itemContent: (index) => {
|
|
4170
|
-
let item = items[index];
|
|
4176
|
+
let item = items[index], selected = selectedIds.includes(item.id);
|
|
4171
4177
|
return /* @__PURE__ */ jsx(VirtualCell, {
|
|
4172
4178
|
item,
|
|
4173
|
-
selected
|
|
4179
|
+
selected
|
|
4174
4180
|
});
|
|
4175
4181
|
},
|
|
4176
4182
|
overscan: 48,
|
|
@@ -4689,10 +4695,10 @@ const TableRowUpload = (props) => {
|
|
|
4689
4695
|
groupCounts: [,].fill(totalCount),
|
|
4690
4696
|
groupContent: () => /* @__PURE__ */ jsx(TableHeader, {}),
|
|
4691
4697
|
itemContent: (index) => {
|
|
4692
|
-
let item = items[index];
|
|
4698
|
+
let item = items[index], selected = selectedIds.includes(item?.id || "");
|
|
4693
4699
|
return /* @__PURE__ */ jsx(VirtualRow, {
|
|
4694
4700
|
item,
|
|
4695
|
-
selected
|
|
4701
|
+
selected
|
|
4696
4702
|
});
|
|
4697
4703
|
},
|
|
4698
4704
|
style: { overflowX: "hidden" }
|