sanity-plugin-media 6.1.3 → 6.1.5
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.map +1 -1
- package/dist/index.js +123 -119
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/FormBuilderTool/index.tsx","../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":";;;;;;;;cAQM,kBAAe,OAAW,8CAAyB,IAAA;KCsB7C;EACV;EACA,kBAAkB;EAClB,SAAS,QAAQ;EACjB,QAAQ,YAAY;EACpB,UAAU,gBAAgB;EAC1B,eAAe;EACf,iBAAiB;EACjB,cAAc;EACd;EACA;EACA;EACA;EACA;IACE;IACA;;EAEF,UAAU;;cCjCC,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;;;;;;;EAOA;;;;;EAKA,UAAU;;KAGA;EACV;EACA;GACC;;KAGE,2BAA2B;KAE3B;EACH,UAAU;EACV,cAAc;EACd;IACE;MACE,SAAS;MACT,OAAO;;;EAGX,QAAQ;;KAYE,QAAQ,YAAY;KAEpB,gBAAgB,EAAE,MAAM,kBAAkB;KAgJ1C,YAAY,sBACtB;EACE;;KAuBQ,aAAa,2BACvB;EACE;EACA,aAAa;;KAqBL;EACV;EACA;EACA;;KA0IU,kBAAkB,EAAE,aAAa;cCzYhC;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/FormBuilderTool/index.tsx","../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":";;;;;;;;cAQM,kBAAe,OAAW,8CAAyB,IAAA;KCsB7C;EACV;EACA,kBAAkB;EAClB,SAAS,QAAQ;EACjB,QAAQ,YAAY;EACpB,UAAU,gBAAgB;EAC1B,eAAe;EACf,iBAAiB;EACjB,cAAc;EACd;EACA;EACA;EACA;EACA;IACE;IACA;;EAEF,UAAU;;cCjCC,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;;;;;;;EAOA;;;;;EAKA,UAAU;;KAGA;EACV;EACA;GACC;;KAGE,2BAA2B;KAE3B;EACH,UAAU;EACV,cAAc;EACd;IACE;MACE,SAAS;MACT,OAAO;;;EAGX,QAAQ;;KAYE,QAAQ,YAAY;KAEpB,gBAAgB,EAAE,MAAM,kBAAkB;KAgJ1C,YAAY,sBACtB;EACE;;KAuBQ,aAAa,2BACvB;EACE;EACA,aAAa;;KAqBL;EACV;EACA;EACA;;KA0IU,kBAAkB,EAAE,aAAa;cCzYhC;;;;;;cAmBA,wBAAK,cAAA;KCrBN,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
|
@@ -11,7 +11,7 @@ import { combineReducers, configureStore, createAction, createSelector, createSl
|
|
|
11
11
|
import groq from "groq";
|
|
12
12
|
import { nanoid } from "nanoid";
|
|
13
13
|
import { combineEpics, createEpicMiddleware, ofType } from "redux-observable";
|
|
14
|
-
import { EMPTY, Observable, Subject,
|
|
14
|
+
import { EMPTY, Observable, Subject, from, iif, merge, of, throwError } from "rxjs";
|
|
15
15
|
import { bufferTime, catchError, concatMap, debounceTime, delay, filter, first, map, mergeMap, switchMap, takeUntil, withLatestFrom } from "rxjs/operators";
|
|
16
16
|
import { uuid } from "@sanity/uuid";
|
|
17
17
|
import pluralize from "pluralize";
|
|
@@ -494,10 +494,10 @@ const useTypedSelector = useSelector, useVersionedClient = () => {
|
|
|
494
494
|
SMALL: "3rem 100px auto 1.5rem",
|
|
495
495
|
LARGE: "3rem 100px auto 5.5rem 5.5rem 3.5rem 8.5rem 4.75rem 2rem"
|
|
496
496
|
}, FOLDER_DOCUMENT_NAME = "media.folder", TAG_DOCUMENT_NAME = "media.tag", debugThrottle = (throttled) => function(source) {
|
|
497
|
-
return iif(() => !!throttled, source.pipe(delay(3e3), mergeMap((v) => Math.random() > .5 ? throwError({
|
|
497
|
+
return iif(() => !!throttled, source.pipe(delay(3e3), mergeMap((v) => Math.random() > .5 ? throwError(() => ({
|
|
498
498
|
message: "Test error",
|
|
499
499
|
statusCode: 500
|
|
500
|
-
}) : of(v))), source);
|
|
500
|
+
})) : of(v))), source);
|
|
501
501
|
}, buildExcludeTagsFragment = (excludeTagSlugs) => {
|
|
502
502
|
let serializedExcludeTagSlugs = excludeTagSlugs?.length ? JSON.stringify(excludeTagSlugs) : void 0;
|
|
503
503
|
return serializedExcludeTagSlugs ? groq`!(defined(opt.media.tags) && count(opt.media.tags[@._ref in *[_type == "${TAG_DOCUMENT_NAME}" && name.current in ${serializedExcludeTagSlugs}]._id]) > 0)` : void 0;
|
|
@@ -555,10 +555,10 @@ function repointNestedImages(node, newAsset, assetToReplaceId, topLevelField, ma
|
|
|
555
555
|
for (let [key, value] of Object.entries(node)) typeof value == "object" && value && repointNestedImages(value, newAsset, assetToReplaceId, topLevelField || key, matchedTopLevelFields);
|
|
556
556
|
}
|
|
557
557
|
const checkTagName = (client, name) => function(source) {
|
|
558
|
-
return source.pipe(mergeMap(() => from(client.fetch(groq`count(*[_type == "${TAG_DOCUMENT_NAME}" && name.current == $name])`, { name }))), mergeMap((existingTagCount) => existingTagCount > 0 ? throwError({
|
|
558
|
+
return source.pipe(mergeMap(() => from(client.fetch(groq`count(*[_type == "${TAG_DOCUMENT_NAME}" && name.current == $name])`, { name }))), mergeMap((existingTagCount) => existingTagCount > 0 ? throwError(() => ({
|
|
559
559
|
message: "Tag already exists",
|
|
560
560
|
statusCode: 409
|
|
561
|
-
}) : of(!0)));
|
|
561
|
+
})) : of(!0)));
|
|
562
562
|
}, getTagSelectOptions = (tags) => tags.reduce((acc, val) => {
|
|
563
563
|
let tag = val?.tag;
|
|
564
564
|
return tag && acc.push({
|
|
@@ -2110,7 +2110,7 @@ const ButtonAssetCopy = (t0) => {
|
|
|
2110
2110
|
}), $[2] = doc, $[3] = onClick, $[4] = schemaType, $[5] = t1) : t1 = $[5], t1;
|
|
2111
2111
|
}, Container$2 = /* @__PURE__ */ styled(Box).withConfig({
|
|
2112
2112
|
displayName: "Container",
|
|
2113
|
-
componentId: "sc-
|
|
2113
|
+
componentId: "sc-ov4bwf-0"
|
|
2114
2114
|
})(({ theme }) => css`text{font-family:${theme.sanity.fonts.text.family} !important;font-size:8px !important;font-weight:500 !important;}`), FileIcon$1 = (props) => {
|
|
2115
2115
|
let $ = c(11), { extension, onClick, width } = props, t0;
|
|
2116
2116
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { height: "100%" }, $[0] = t0) : t0 = $[0];
|
|
@@ -2173,20 +2173,21 @@ const ButtonAssetCopy = (t0) => {
|
|
|
2173
2173
|
}), $[7] = asset.extension, $[8] = t0), t0;
|
|
2174
2174
|
}, FormSubmitButton = (props) => {
|
|
2175
2175
|
let $ = c(14), { disabled, isValid, lastUpdated, onClick } = props, content;
|
|
2176
|
-
if (isValid)
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2176
|
+
if (isValid) {
|
|
2177
|
+
if (lastUpdated) {
|
|
2178
|
+
let t0;
|
|
2179
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ jsx("br", {}), $[0] = t0) : t0 = $[0];
|
|
2180
|
+
let t1;
|
|
2181
|
+
$[1] === lastUpdated ? t1 = $[2] : (t1 = format(new Date(lastUpdated), "PPp"), $[1] = lastUpdated, $[2] = t1);
|
|
2182
|
+
let t2;
|
|
2183
|
+
$[3] === t1 ? t2 = $[4] : (t2 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2184
|
+
"Last updated",
|
|
2185
|
+
t0,
|
|
2186
|
+
" ",
|
|
2187
|
+
t1
|
|
2188
|
+
] }), $[3] = t1, $[4] = t2), content = t2;
|
|
2189
|
+
} else content = "No unpublished changes";
|
|
2190
|
+
} else content = "There are validation errors that need to be fixed before this document can be published";
|
|
2190
2191
|
let t0;
|
|
2191
2192
|
$[5] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { maxWidth: "185px" }, $[5] = t0) : t0 = $[5];
|
|
2192
2193
|
let t1;
|
|
@@ -2216,7 +2217,7 @@ const ButtonAssetCopy = (t0) => {
|
|
|
2216
2217
|
portal: !0,
|
|
2217
2218
|
children: t2
|
|
2218
2219
|
}), $[11] = t1, $[12] = t2, $[13] = t3) : t3 = $[13], t3;
|
|
2219
|
-
}, SCHEME_COLORS = {
|
|
2220
|
+
}, { color: themeColor } = studioTheme, SCHEME_COLORS = {
|
|
2220
2221
|
bg: {
|
|
2221
2222
|
dark: hues.gray[950].hex,
|
|
2222
2223
|
light: hues.gray[50].hex
|
|
@@ -2226,28 +2227,28 @@ const ButtonAssetCopy = (t0) => {
|
|
|
2226
2227
|
light: hues.gray[100].hex
|
|
2227
2228
|
},
|
|
2228
2229
|
inputEnabledBorder: {
|
|
2229
|
-
dark:
|
|
2230
|
-
light:
|
|
2230
|
+
dark: themeColor.dark.default.input.default.enabled.border,
|
|
2231
|
+
light: themeColor.light.default.input.default.enabled.border
|
|
2231
2232
|
},
|
|
2232
2233
|
inputHoveredBorder: {
|
|
2233
|
-
dark:
|
|
2234
|
-
light:
|
|
2234
|
+
dark: themeColor.dark.default.input.default.hovered.border,
|
|
2235
|
+
light: themeColor.light.default.input.default.hovered.border
|
|
2235
2236
|
},
|
|
2236
2237
|
mutedHoveredBg: {
|
|
2237
|
-
dark:
|
|
2238
|
-
light:
|
|
2238
|
+
dark: themeColor.dark.primary.muted.primary.hovered.bg,
|
|
2239
|
+
light: themeColor.light.primary.muted.primary.hovered.bg
|
|
2239
2240
|
},
|
|
2240
2241
|
mutedHoveredFg: {
|
|
2241
|
-
dark:
|
|
2242
|
-
light:
|
|
2242
|
+
dark: themeColor.dark.primary.muted.primary.hovered.fg,
|
|
2243
|
+
light: themeColor.light.primary.muted.primary.hovered.fg
|
|
2243
2244
|
},
|
|
2244
2245
|
mutedSelectedBg: {
|
|
2245
|
-
dark:
|
|
2246
|
-
light:
|
|
2246
|
+
dark: themeColor.dark.primary.muted.primary.selected.bg,
|
|
2247
|
+
light: themeColor.light.primary.muted.primary.selected.bg
|
|
2247
2248
|
},
|
|
2248
2249
|
spotBlue: {
|
|
2249
|
-
dark:
|
|
2250
|
-
light:
|
|
2250
|
+
dark: themeColor.dark.primary.spot.blue,
|
|
2251
|
+
light: themeColor.light.primary.spot.blue
|
|
2251
2252
|
}
|
|
2252
2253
|
};
|
|
2253
2254
|
function getSchemeColor(scheme, colorKey) {
|
|
@@ -2255,10 +2256,10 @@ function getSchemeColor(scheme, colorKey) {
|
|
|
2255
2256
|
}
|
|
2256
2257
|
const Image$1 = styled.img.attrs({ crossOrigin: "anonymous" }).withConfig({
|
|
2257
2258
|
displayName: "Image",
|
|
2258
|
-
componentId: "sc-
|
|
2259
|
+
componentId: "sc-nu8r0m-0"
|
|
2259
2260
|
})`--checkerboard-color:${(props) => props.$scheme ? getSchemeColor(props.$scheme, "bg2") : "inherit"};display:block;width:100%;height:100%;object-fit:contain;${(props) => props.$showCheckerboard && css`background-image:linear-gradient(45deg,var(--checkerboard-color) 25%,transparent 25%),linear-gradient(-45deg,var(--checkerboard-color) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--checkerboard-color) 75%),linear-gradient(-45deg,transparent 75%,var(--checkerboard-color) 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0;`}`, StyledErrorOutlineIcon = /* @__PURE__ */ styled(ErrorOutlineIcon).withConfig({
|
|
2260
2261
|
displayName: "StyledErrorOutlineIcon",
|
|
2261
|
-
componentId: "sc-
|
|
2262
|
+
componentId: "sc-ec70oi-0"
|
|
2262
2263
|
})(({ theme }) => ({ color: theme.sanity.color.spot.red })), FormFieldInputLabel = (props) => {
|
|
2263
2264
|
let $ = c(14), { description, error, label, name } = props, t0;
|
|
2264
2265
|
$[0] !== label || $[1] !== name ? (t0 = /* @__PURE__ */ jsx(Text, {
|
|
@@ -2766,7 +2767,7 @@ function renderDefaultDetails(props) {
|
|
|
2766
2767
|
return /* @__PURE__ */ jsx(Details, { ...props });
|
|
2767
2768
|
}
|
|
2768
2769
|
const DialogAssetEdit = (props) => {
|
|
2769
|
-
let $ = c(
|
|
2770
|
+
let $ = c(150), { children, dialog: t0 } = props, { assetId, id, lastCreatedTag, lastRemovedTagIds } = t0, client = useVersionedClient(), scheme = useColorSchemeValue(), documentStore = useDocumentStore(), dispatch = useDispatch(), t1;
|
|
2770
2771
|
$[0] === assetId ? t1 = $[1] : (t1 = (state) => selectAssetById(state, String(assetId)), $[0] = assetId, $[1] = t1);
|
|
2771
2772
|
let assetItem = useTypedSelector(t1), tags = useTypedSelector(selectTags), assetUpdatedPrev = useRef(void 0), [assetSnapshot, setAssetSnapshot] = useState(assetItem?.asset), [tabSection, setTabSection] = useState("details"), currentAsset = assetItem ? assetItem?.asset : assetSnapshot, t2;
|
|
2772
2773
|
$[2] === tags ? t2 = $[3] : (t2 = getTagSelectOptions(tags), $[2] = tags, $[3] = t2);
|
|
@@ -2905,7 +2906,7 @@ const DialogAssetEdit = (props) => {
|
|
|
2905
2906
|
}).commit();
|
|
2906
2907
|
}, $[44] = client, $[45] = currentAsset, $[46] = locales, $[47] = t20) : t20 = $[47];
|
|
2907
2908
|
let handleCleanupLocales = t20, t21;
|
|
2908
|
-
$[48] !== assetItem?.asset || $[49] !== dispatch ? (t21 = (formData) => {
|
|
2909
|
+
$[48] !== assetItem?.asset || $[49] !== currentAsset || $[50] !== dispatch ? (t21 = (formData) => {
|
|
2909
2910
|
if (!assetItem?.asset) return;
|
|
2910
2911
|
let sanitizedFormData = sanitizeFormData(formData);
|
|
2911
2912
|
formData.description === "" && (sanitizedFormData.description = ""), dispatch(assetsActions.updateRequest({
|
|
@@ -2915,27 +2916,28 @@ const DialogAssetEdit = (props) => {
|
|
|
2915
2916
|
...sanitizedFormData,
|
|
2916
2917
|
opt: { media: {
|
|
2917
2918
|
...sanitizedFormData.opt.media,
|
|
2918
|
-
tags: sanitizedFormData.opt.media.tags?.map(_temp7$1) || null
|
|
2919
|
+
tags: sanitizedFormData.opt.media.tags?.map(_temp7$1) || null,
|
|
2920
|
+
...currentAsset?.opt?.media?.folder && { folder: currentAsset.opt.media.folder }
|
|
2919
2921
|
} }
|
|
2920
2922
|
}
|
|
2921
2923
|
}));
|
|
2922
|
-
}, $[48] = assetItem?.asset, $[49] =
|
|
2924
|
+
}, $[48] = assetItem?.asset, $[49] = currentAsset, $[50] = dispatch, $[51] = t21) : t21 = $[51], assetItem?.asset;
|
|
2923
2925
|
let onSubmit = t21, t22;
|
|
2924
|
-
$[
|
|
2926
|
+
$[52] !== assetItem?.asset || $[53] !== client ? (t22 = () => {
|
|
2925
2927
|
if (!assetItem?.asset) return;
|
|
2926
2928
|
let subscriptionAsset = client.listen(groq`*[_id == $id]`, { id: assetItem?.asset._id }).subscribe(handleAssetUpdate);
|
|
2927
2929
|
return () => {
|
|
2928
2930
|
subscriptionAsset?.unsubscribe();
|
|
2929
2931
|
};
|
|
2930
|
-
}, $[
|
|
2932
|
+
}, $[52] = assetItem?.asset, $[53] = client, $[54] = t22) : t22 = $[54];
|
|
2931
2933
|
let t23 = assetItem?.asset, t24;
|
|
2932
|
-
$[
|
|
2934
|
+
$[55] !== client || $[56] !== t23 ? (t24 = [
|
|
2933
2935
|
t23,
|
|
2934
2936
|
client,
|
|
2935
2937
|
handleAssetUpdate
|
|
2936
|
-
], $[
|
|
2938
|
+
], $[55] = client, $[56] = t23, $[57] = t24) : t24 = $[57], useEffect(t22, t24);
|
|
2937
2939
|
let t25, t26;
|
|
2938
|
-
$[
|
|
2940
|
+
$[58] !== getValues || $[59] !== lastCreatedTag || $[60] !== setValue ? (t25 = () => {
|
|
2939
2941
|
if (lastCreatedTag) {
|
|
2940
2942
|
let updatedTags = (getValues("opt.media.tags") || []).concat([lastCreatedTag]);
|
|
2941
2943
|
setValue("opt.media.tags", updatedTags, { shouldDirty: !0 });
|
|
@@ -2944,9 +2946,9 @@ const DialogAssetEdit = (props) => {
|
|
|
2944
2946
|
getValues,
|
|
2945
2947
|
lastCreatedTag,
|
|
2946
2948
|
setValue
|
|
2947
|
-
], $[
|
|
2949
|
+
], $[58] = getValues, $[59] = lastCreatedTag, $[60] = setValue, $[61] = t25, $[62] = t26) : (t25 = $[61], t26 = $[62]), useEffect(t25, t26);
|
|
2948
2950
|
let t27, t28;
|
|
2949
|
-
$[
|
|
2951
|
+
$[63] !== getValues || $[64] !== lastRemovedTagIds || $[65] !== setValue ? (t27 = () => {
|
|
2950
2952
|
if (lastRemovedTagIds) {
|
|
2951
2953
|
let updatedTags_0 = (getValues("opt.media.tags") || []).filter((tag_0) => !lastRemovedTagIds.includes(tag_0.value));
|
|
2952
2954
|
setValue("opt.media.tags", updatedTags_0, { shouldDirty: !0 });
|
|
@@ -2955,19 +2957,19 @@ const DialogAssetEdit = (props) => {
|
|
|
2955
2957
|
getValues,
|
|
2956
2958
|
lastRemovedTagIds,
|
|
2957
2959
|
setValue
|
|
2958
|
-
], $[
|
|
2960
|
+
], $[63] = getValues, $[64] = lastRemovedTagIds, $[65] = setValue, $[66] = t27, $[67] = t28) : (t27 = $[66], t28 = $[67]), useEffect(t27, t28);
|
|
2959
2961
|
let t29;
|
|
2960
|
-
$[
|
|
2962
|
+
$[68] !== assetItem?.asset || $[69] !== generateDefaultValues || $[70] !== reset ? (t29 = () => {
|
|
2961
2963
|
assetUpdatedPrev.current !== assetItem?.asset._updatedAt && reset(generateDefaultValues(assetItem?.asset)), assetUpdatedPrev.current = assetItem?.asset._updatedAt;
|
|
2962
|
-
}, $[
|
|
2964
|
+
}, $[68] = assetItem?.asset, $[69] = generateDefaultValues, $[70] = reset, $[71] = t29) : t29 = $[71];
|
|
2963
2965
|
let t30 = assetItem?.asset, t31;
|
|
2964
|
-
$[
|
|
2966
|
+
$[72] !== generateDefaultValues || $[73] !== reset || $[74] !== t30 ? (t31 = [
|
|
2965
2967
|
t30,
|
|
2966
2968
|
generateDefaultValues,
|
|
2967
2969
|
reset
|
|
2968
|
-
], $[
|
|
2970
|
+
], $[72] = generateDefaultValues, $[73] = reset, $[74] = t30, $[75] = t31) : t31 = $[75], useEffect(t29, t31);
|
|
2969
2971
|
let t32;
|
|
2970
|
-
$[
|
|
2972
|
+
$[76] !== handleCleanupLocales || $[77] !== hasOrphanedLocales ? (t32 = hasOrphanedLocales && /* @__PURE__ */ jsx(Card, {
|
|
2971
2973
|
padding: 3,
|
|
2972
2974
|
radius: 2,
|
|
2973
2975
|
shadow: 1,
|
|
@@ -2987,42 +2989,42 @@ const DialogAssetEdit = (props) => {
|
|
|
2987
2989
|
tone: "caution"
|
|
2988
2990
|
})]
|
|
2989
2991
|
})
|
|
2990
|
-
}), $[
|
|
2992
|
+
}), $[76] = handleCleanupLocales, $[77] = hasOrphanedLocales, $[78] = t32) : t32 = $[78];
|
|
2991
2993
|
let t33;
|
|
2992
|
-
$[
|
|
2994
|
+
$[79] !== formUpdating || $[80] !== handleDelete ? (t33 = /* @__PURE__ */ jsx(Button, {
|
|
2993
2995
|
disabled: formUpdating,
|
|
2994
2996
|
fontSize: 1,
|
|
2995
2997
|
mode: "bleed",
|
|
2996
2998
|
onClick: handleDelete,
|
|
2997
2999
|
text: "Delete",
|
|
2998
3000
|
tone: "critical"
|
|
2999
|
-
}), $[
|
|
3001
|
+
}), $[79] = formUpdating, $[80] = handleDelete, $[81] = t33) : t33 = $[81];
|
|
3000
3002
|
let t34 = formUpdating || !isDirty || !isValid || hasOrphanedLocales, t35 = currentAsset?._updatedAt, t36;
|
|
3001
|
-
$[
|
|
3003
|
+
$[82] !== handleSubmit || $[83] !== onSubmit ? (t36 = handleSubmit(onSubmit), $[82] = handleSubmit, $[83] = onSubmit, $[84] = t36) : t36 = $[84];
|
|
3002
3004
|
let t37;
|
|
3003
|
-
$[
|
|
3005
|
+
$[85] !== isValid || $[86] !== t34 || $[87] !== t35 || $[88] !== t36 ? (t37 = /* @__PURE__ */ jsx(FormSubmitButton, {
|
|
3004
3006
|
disabled: t34,
|
|
3005
3007
|
isValid,
|
|
3006
3008
|
lastUpdated: t35,
|
|
3007
3009
|
onClick: t36
|
|
3008
|
-
}), $[
|
|
3010
|
+
}), $[85] = isValid, $[86] = t34, $[87] = t35, $[88] = t36, $[89] = t37) : t37 = $[89];
|
|
3009
3011
|
let t38;
|
|
3010
|
-
$[
|
|
3012
|
+
$[90] !== t33 || $[91] !== t37 ? (t38 = /* @__PURE__ */ jsxs(Flex, {
|
|
3011
3013
|
justify: "space-between",
|
|
3012
3014
|
children: [t33, t37]
|
|
3013
|
-
}), $[
|
|
3015
|
+
}), $[90] = t33, $[91] = t37, $[92] = t38) : t38 = $[92];
|
|
3014
3016
|
let t39;
|
|
3015
|
-
$[
|
|
3017
|
+
$[93] !== t32 || $[94] !== t38 ? (t39 = /* @__PURE__ */ jsx(Box, {
|
|
3016
3018
|
padding: 3,
|
|
3017
3019
|
children: /* @__PURE__ */ jsxs(Stack, {
|
|
3018
3020
|
gap: 3,
|
|
3019
3021
|
children: [t32, t38]
|
|
3020
3022
|
})
|
|
3021
|
-
}), $[
|
|
3023
|
+
}), $[93] = t32, $[94] = t38, $[95] = t39) : t39 = $[95];
|
|
3022
3024
|
let footer = t39;
|
|
3023
3025
|
if (!currentAsset) return null;
|
|
3024
3026
|
let t40 = !!currentFolderId && !currentFolderPath, t41;
|
|
3025
|
-
$[
|
|
3027
|
+
$[96] !== allTagOptions || $[97] !== assetTagOptions || $[98] !== control || $[99] !== creditLine || $[100] !== currentAsset || $[101] !== currentFolderPath || $[102] !== errors || $[103] !== formUpdating || $[104] !== handleChangeFolder || $[105] !== handleCreateTag || $[106] !== handleRemoveFolder || $[107] !== locales || $[108] !== register || $[109] !== setValue || $[110] !== t40 ? (t41 = {
|
|
3026
3028
|
control,
|
|
3027
3029
|
errors,
|
|
3028
3030
|
formUpdating,
|
|
@@ -3038,21 +3040,21 @@ const DialogAssetEdit = (props) => {
|
|
|
3038
3040
|
onRemoveFolder: handleRemoveFolder,
|
|
3039
3041
|
creditLine,
|
|
3040
3042
|
locales
|
|
3041
|
-
}, $[
|
|
3043
|
+
}, $[96] = allTagOptions, $[97] = assetTagOptions, $[98] = control, $[99] = creditLine, $[100] = currentAsset, $[101] = currentFolderPath, $[102] = errors, $[103] = formUpdating, $[104] = handleChangeFolder, $[105] = handleCreateTag, $[106] = handleRemoveFolder, $[107] = locales, $[108] = register, $[109] = setValue, $[110] = t40, $[111] = t41) : t41 = $[111];
|
|
3042
3044
|
let detailsProps = t41, t42;
|
|
3043
|
-
$[
|
|
3045
|
+
$[112] === Symbol.for("react.memo_cache_sentinel") ? (t42 = [
|
|
3044
3046
|
"column-reverse",
|
|
3045
3047
|
"column-reverse",
|
|
3046
3048
|
"row-reverse"
|
|
3047
|
-
], $[
|
|
3049
|
+
], $[112] = t42) : t42 = $[112];
|
|
3048
3050
|
let t43;
|
|
3049
|
-
$[
|
|
3051
|
+
$[113] === Symbol.for("react.memo_cache_sentinel") ? (t43 = [
|
|
3050
3052
|
5,
|
|
3051
3053
|
5,
|
|
3052
3054
|
0
|
|
3053
|
-
], $[
|
|
3055
|
+
], $[113] = t43) : t43 = $[113];
|
|
3054
3056
|
let t44;
|
|
3055
|
-
$[
|
|
3057
|
+
$[114] !== CustomDetails || $[115] !== assetItem || $[116] !== detailsProps || $[117] !== formUpdating || $[118] !== handleSubmit || $[119] !== onSubmit || $[120] !== tabSection ? (t44 = (t45) => {
|
|
3056
3058
|
let { isLoading, referringDocuments } = t45, uniqueReferringDocuments = getUniqueDocuments(referringDocuments);
|
|
3057
3059
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(TabList, {
|
|
3058
3060
|
gap: 2,
|
|
@@ -3117,9 +3119,9 @@ const DialogAssetEdit = (props) => {
|
|
|
3117
3119
|
})
|
|
3118
3120
|
]
|
|
3119
3121
|
})] });
|
|
3120
|
-
}, $[
|
|
3122
|
+
}, $[114] = CustomDetails, $[115] = assetItem, $[116] = detailsProps, $[117] = formUpdating, $[118] = handleSubmit, $[119] = onSubmit, $[120] = tabSection, $[121] = t44) : t44 = $[121];
|
|
3121
3123
|
let t45;
|
|
3122
|
-
$[
|
|
3124
|
+
$[122] !== currentAsset._id || $[123] !== documentStore || $[124] !== t44 ? (t45 = /* @__PURE__ */ jsx(Box, {
|
|
3123
3125
|
flex: 1,
|
|
3124
3126
|
marginTop: t43,
|
|
3125
3127
|
padding: 4,
|
|
@@ -3128,13 +3130,13 @@ const DialogAssetEdit = (props) => {
|
|
|
3128
3130
|
id: currentAsset._id,
|
|
3129
3131
|
children: t44
|
|
3130
3132
|
})
|
|
3131
|
-
}), $[
|
|
3133
|
+
}), $[122] = currentAsset._id, $[123] = documentStore, $[124] = t44, $[125] = t45) : t45 = $[125];
|
|
3132
3134
|
let t46;
|
|
3133
|
-
$[
|
|
3135
|
+
$[126] === Symbol.for("react.memo_cache_sentinel") ? (t46 = { aspectRatio: "1" }, $[126] = t46) : t46 = $[126];
|
|
3134
3136
|
let t47;
|
|
3135
|
-
$[
|
|
3137
|
+
$[127] === currentAsset ? t47 = $[128] : (t47 = isFileAsset(currentAsset) && /* @__PURE__ */ jsx(FileAssetPreview, { asset: currentAsset }), $[127] = currentAsset, $[128] = t47);
|
|
3136
3138
|
let t48;
|
|
3137
|
-
$[
|
|
3139
|
+
$[129] !== currentAsset || $[130] !== scheme ? (t48 = isImageAsset(currentAsset) && /* @__PURE__ */ jsx(Image$1, {
|
|
3138
3140
|
draggable: !1,
|
|
3139
3141
|
$scheme: scheme,
|
|
3140
3142
|
$showCheckerboard: !currentAsset?.metadata?.isOpaque,
|
|
@@ -3142,33 +3144,33 @@ const DialogAssetEdit = (props) => {
|
|
|
3142
3144
|
height: 600,
|
|
3143
3145
|
width: 600
|
|
3144
3146
|
})
|
|
3145
|
-
}), $[
|
|
3147
|
+
}), $[129] = currentAsset, $[130] = scheme, $[131] = t48) : t48 = $[131];
|
|
3146
3148
|
let t49;
|
|
3147
|
-
$[
|
|
3149
|
+
$[132] !== t47 || $[133] !== t48 ? (t49 = /* @__PURE__ */ jsxs(Box, {
|
|
3148
3150
|
style: t46,
|
|
3149
3151
|
children: [t47, t48]
|
|
3150
|
-
}), $[
|
|
3152
|
+
}), $[132] = t47, $[133] = t48, $[134] = t49) : t49 = $[134];
|
|
3151
3153
|
let t50;
|
|
3152
|
-
$[
|
|
3154
|
+
$[135] !== assetItem || $[136] !== currentAsset ? (t50 = currentAsset && /* @__PURE__ */ jsx(Box, {
|
|
3153
3155
|
marginTop: 4,
|
|
3154
3156
|
children: /* @__PURE__ */ jsx(AssetMetadata, {
|
|
3155
3157
|
asset: currentAsset,
|
|
3156
3158
|
item: assetItem
|
|
3157
3159
|
})
|
|
3158
|
-
}), $[
|
|
3160
|
+
}), $[135] = assetItem, $[136] = currentAsset, $[137] = t50) : t50 = $[137];
|
|
3159
3161
|
let t51;
|
|
3160
|
-
$[
|
|
3162
|
+
$[138] !== t49 || $[139] !== t50 ? (t51 = /* @__PURE__ */ jsxs(Box, {
|
|
3161
3163
|
flex: 1,
|
|
3162
3164
|
padding: 4,
|
|
3163
3165
|
children: [t49, t50]
|
|
3164
|
-
}), $[
|
|
3166
|
+
}), $[138] = t49, $[139] = t50, $[140] = t51) : t51 = $[140];
|
|
3165
3167
|
let t52;
|
|
3166
|
-
$[
|
|
3168
|
+
$[141] !== t45 || $[142] !== t51 ? (t52 = /* @__PURE__ */ jsxs(Flex, {
|
|
3167
3169
|
direction: t42,
|
|
3168
3170
|
children: [t45, t51]
|
|
3169
|
-
}), $[
|
|
3171
|
+
}), $[141] = t45, $[142] = t51, $[143] = t52) : t52 = $[143];
|
|
3170
3172
|
let t53;
|
|
3171
|
-
return $[
|
|
3173
|
+
return $[144] !== children || $[145] !== footer || $[146] !== handleClose || $[147] !== id || $[148] !== t52 ? (t53 = /* @__PURE__ */ jsxs(Dialog$1, {
|
|
3172
3174
|
animate: !0,
|
|
3173
3175
|
footer,
|
|
3174
3176
|
header: "Asset details",
|
|
@@ -3176,7 +3178,7 @@ const DialogAssetEdit = (props) => {
|
|
|
3176
3178
|
onClose: handleClose,
|
|
3177
3179
|
width: 3,
|
|
3178
3180
|
children: [t52, children]
|
|
3179
|
-
}), $[
|
|
3181
|
+
}), $[144] = children, $[145] = footer, $[146] = handleClose, $[147] = id, $[148] = t52, $[149] = t53) : t53 = $[149], t53;
|
|
3180
3182
|
};
|
|
3181
3183
|
function _temp$35(v) {
|
|
3182
3184
|
return v;
|
|
@@ -3243,16 +3245,16 @@ const selectCombinedItems = createSelector([
|
|
|
3243
3245
|
}), t3 = [downHandler, upHandler], $[4] = downHandler, $[5] = t2, $[6] = t3), useEffect(t2, t3), keyPressed;
|
|
3244
3246
|
}, CardWrapper$2 = styled(Flex).withConfig({
|
|
3245
3247
|
displayName: "CardWrapper",
|
|
3246
|
-
componentId: "sc-
|
|
3248
|
+
componentId: "sc-e6odx5-0"
|
|
3247
3249
|
})`box-sizing:border-box;height:100%;overflow:hidden;position:relative;width:100%;`, CardContainer = /* @__PURE__ */ styled(Flex).withConfig({
|
|
3248
3250
|
displayName: "CardContainer",
|
|
3249
|
-
componentId: "sc-
|
|
3251
|
+
componentId: "sc-e6odx5-1"
|
|
3250
3252
|
})(({ $picked, theme, $updating }) => css`border:1px solid transparent;height:100%;pointer-events:${$updating ? "none" : "auto"};position:relative;transition:all 300ms;user-select:none;width:100%;border:${$picked ? `1px solid ${theme.sanity.color.spot.orange} !important` : "1px solid inherit"};${!$updating && css`@media (hover:hover) and (pointer:fine){&:hover{border:1px solid var(--card-border-color);}}`}`), ContextActionContainer$2 = /* @__PURE__ */ styled(Flex).withConfig({
|
|
3251
3253
|
displayName: "ContextActionContainer",
|
|
3252
|
-
componentId: "sc-
|
|
3254
|
+
componentId: "sc-e6odx5-2"
|
|
3253
3255
|
})(({ $scheme }) => css`cursor:pointer;height:${32}px;transition:all 300ms;@media (hover:hover) and (pointer:fine){&:hover{background:${getSchemeColor($scheme, "bg")};}}`), StyledWarningOutlineIcon = /* @__PURE__ */ styled(WarningFilledIcon).withConfig({
|
|
3254
3256
|
displayName: "StyledWarningOutlineIcon",
|
|
3255
|
-
componentId: "sc-
|
|
3257
|
+
componentId: "sc-e6odx5-3"
|
|
3256
3258
|
})(({ theme }) => ({ color: theme.sanity.color.spot.red })), CardAsset = (props) => {
|
|
3257
3259
|
let $ = c(83), { id, selected, source } = props, scheme = useColorSchemeValue(), toast = useToast(), shiftPressed = useKeyPress("shift"), dispatch = useDispatch(), lastPicked = useTypedSelector(_temp$34), assetsPicked = useTypedSelector(selectAssetsPicked), t0;
|
|
3258
3260
|
$[0] === id ? t0 = $[1] : (t0 = (state_0) => selectAssetById(state_0, id), $[0] = id, $[1] = t0);
|
|
@@ -3473,13 +3475,13 @@ function _temp2$20(d) {
|
|
|
3473
3475
|
}
|
|
3474
3476
|
const CardWrapper$1 = styled(Flex).withConfig({
|
|
3475
3477
|
displayName: "CardWrapper",
|
|
3476
|
-
componentId: "sc-
|
|
3478
|
+
componentId: "sc-l04v0k-0"
|
|
3477
3479
|
})`box-sizing:border-box;height:100%;overflow:hidden;position:relative;width:100%;`, FolderCard = styled(Card).withConfig({
|
|
3478
3480
|
displayName: "FolderCard",
|
|
3479
|
-
componentId: "sc-
|
|
3481
|
+
componentId: "sc-l04v0k-1"
|
|
3480
3482
|
})`cursor:pointer;height:100%;transition:border-color 200ms ease;width:100%;@media (hover:hover) and (pointer:fine){&:hover{border-color:var(--card-border-color);}}`, FolderGlyph = /* @__PURE__ */ styled(Box).withConfig({
|
|
3481
3483
|
displayName: "FolderGlyph",
|
|
3482
|
-
componentId: "sc-
|
|
3484
|
+
componentId: "sc-l04v0k-2"
|
|
3483
3485
|
})(({ theme }) => css`align-items:flex-end;background:linear-gradient( 180deg,${theme.sanity.color.spot.yellow} 0%,${theme.sanity.color.spot.yellow} 100% );border-radius:8px;display:flex;height:72px;position:relative;width:96px;&::before{background:${theme.sanity.color.spot.yellow};border-radius:8px 8px 0 0;content:'';height:18px;left:0;position:absolute;top:-8px;width:38px;}`), CardFolder = (t0) => {
|
|
3484
3486
|
let $ = c(22), { folderId, name, totalCount } = t0, dispatch = useDispatch(), scheme = useColorSchemeValue(), t1;
|
|
3485
3487
|
$[0] !== dispatch || $[1] !== folderId ? (t1 = () => dispatch(foldersActions.currentFolderSet({ folderId })), $[0] = dispatch, $[1] = folderId, $[2] = t1) : t1 = $[2];
|
|
@@ -3596,13 +3598,13 @@ const createThrottler = (concurrency = 4) => {
|
|
|
3596
3598
|
}, reader.readAsArrayBuffer(file), () => {
|
|
3597
3599
|
reader.abort();
|
|
3598
3600
|
};
|
|
3599
|
-
}), hexFromBuffer = (buffer) => Array.prototype.map.call(new Uint8Array(buffer), (x) => `00${x.toString(16)}`.slice(-2)).join(""), hashFile$ = (file) => !window.crypto || !window.crypto.subtle || !window.FileReader ? throwError({
|
|
3601
|
+
}), hexFromBuffer = (buffer) => Array.prototype.map.call(new Uint8Array(buffer), (x) => `00${x.toString(16)}`.slice(-2)).join(""), hashFile$ = (file) => !window.crypto || !window.crypto.subtle || !window.FileReader ? throwError(() => ({
|
|
3600
3602
|
message: "Unable to generate hash: uploads are only allowed in secure contexts",
|
|
3601
3603
|
statusCode: 500
|
|
3602
|
-
}) : readFile$(file).pipe(mergeMap((arrayBuffer) => window.crypto.subtle.digest("SHA-1", arrayBuffer)), map(hexFromBuffer)), uploadSanityAsset$ = (client, assetType, file, hash) => of(null).pipe(mergeMap(() => fetchExisting$(client, `sanity.${assetType}Asset`, hash)), mergeMap((existingAsset) => existingAsset ? throwError({
|
|
3604
|
+
})) : readFile$(file).pipe(mergeMap((arrayBuffer) => window.crypto.subtle.digest("SHA-1", arrayBuffer)), map(hexFromBuffer)), uploadSanityAsset$ = (client, assetType, file, hash) => of(null).pipe(mergeMap(() => fetchExisting$(client, `sanity.${assetType}Asset`, hash)), mergeMap((existingAsset) => existingAsset ? throwError(() => ({
|
|
3603
3605
|
message: "Asset already exists",
|
|
3604
3606
|
statusCode: 409
|
|
3605
|
-
}) : of(null)), mergeMap(() => client.observable.assets.upload(assetType, file, {
|
|
3607
|
+
})) : of(null)), mergeMap(() => client.observable.assets.upload(assetType, file, {
|
|
3606
3608
|
extract: [
|
|
3607
3609
|
"blurhash",
|
|
3608
3610
|
"exif",
|
|
@@ -3679,7 +3681,7 @@ const createThrottler = (concurrency = 4) => {
|
|
|
3679
3681
|
return event?.type === "progress" && event?.stage === "upload" ? of(uploadsActions.uploadProgress({
|
|
3680
3682
|
event,
|
|
3681
3683
|
uploadHash: uploadItem.hash
|
|
3682
|
-
})) :
|
|
3684
|
+
})) : EMPTY;
|
|
3683
3685
|
}), catchError((error) => of(uploadsActions.uploadError({
|
|
3684
3686
|
error: {
|
|
3685
3687
|
message: error?.message || "Internal error",
|
|
@@ -4817,7 +4819,7 @@ const DialogFolders = (props) => {
|
|
|
4817
4819
|
}), $[3] = children, $[4] = handleClose, $[5] = id, $[6] = t3) : t3 = $[6], t3;
|
|
4818
4820
|
}, Container$1 = /* @__PURE__ */ styled(Box).withConfig({
|
|
4819
4821
|
displayName: "Container",
|
|
4820
|
-
componentId: "sc-
|
|
4822
|
+
componentId: "sc-iuc26f-0"
|
|
4821
4823
|
})(({ $scheme, theme }) => css`background:${getSchemeColor($scheme, "bg")};border-radius:${rem(theme.sanity.radius[2])};`), SearchFacet = (props) => {
|
|
4822
4824
|
let $ = c(22), { children, facet } = props, scheme = useColorSchemeValue(), dispatch = useDispatch(), t0;
|
|
4823
4825
|
$[0] !== dispatch || $[1] !== facet.id ? (t0 = () => {
|
|
@@ -5115,7 +5117,7 @@ const DialogFolders = (props) => {
|
|
|
5115
5117
|
facet,
|
|
5116
5118
|
children: [t3, t4]
|
|
5117
5119
|
}), $[15] = facet, $[16] = t3, $[17] = t4, $[18] = t5) : t5 = $[18], t5;
|
|
5118
|
-
}, { fonts
|
|
5120
|
+
}, { fonts, radius: themeRadius, space: themeSpace } = studioTheme, themeTextSizes = fonts.text.sizes, reactSelectStyles = (scheme) => ({
|
|
5119
5121
|
control: (styles, { isDisabled, isFocused }) => {
|
|
5120
5122
|
let boxShadow = "inset 0 0 0 1px var(--card-border-color)";
|
|
5121
5123
|
return isFocused && (boxShadow = `inset 0 0 0 1px ${getSchemeColor(scheme, "inputEnabledBorder")},
|
|
@@ -5360,7 +5362,7 @@ function _temp3$6() {
|
|
|
5360
5362
|
}
|
|
5361
5363
|
const StackContainer = /* @__PURE__ */ styled(Flex).withConfig({
|
|
5362
5364
|
displayName: "StackContainer",
|
|
5363
|
-
componentId: "sc-
|
|
5365
|
+
componentId: "sc-g9phkp-0"
|
|
5364
5366
|
})(({ theme }) => css`> *{margin-bottom:${rem(theme.sanity.space[2])};}`), SearchFacets = (props) => {
|
|
5365
5367
|
let $ = c(6), { layout: t0 } = props, layout = t0 === void 0 ? "inline" : t0, searchFacets = useTypedSelector(_temp$26), t1;
|
|
5366
5368
|
$[0] === searchFacets ? t1 = $[1] : (t1 = searchFacets.map(_temp2$13), $[0] = searchFacets, $[1] = t1);
|
|
@@ -7064,16 +7066,18 @@ function _temp2$5(state_0) {
|
|
|
7064
7066
|
const TableHeaderItem = (props) => {
|
|
7065
7067
|
let $ = c(26), { field, title } = props, dispatch = useDispatch(), order = useTypedSelector(_temp$8), isActive = order.field === field, t0;
|
|
7066
7068
|
$[0] !== dispatch || $[1] !== field || $[2] !== isActive || $[3] !== order.direction || $[4] !== title ? (t0 = () => {
|
|
7067
|
-
if (!(!field || !title))
|
|
7068
|
-
|
|
7069
|
-
|
|
7069
|
+
if (!(!field || !title)) {
|
|
7070
|
+
if (isActive) {
|
|
7071
|
+
let direction = order.direction === "asc" ? "desc" : "asc";
|
|
7072
|
+
dispatch(assetsActions.orderSet({ order: {
|
|
7073
|
+
field,
|
|
7074
|
+
direction
|
|
7075
|
+
} }));
|
|
7076
|
+
} else dispatch(assetsActions.orderSet({ order: {
|
|
7070
7077
|
field,
|
|
7071
|
-
direction
|
|
7078
|
+
direction: "asc"
|
|
7072
7079
|
} }));
|
|
7073
|
-
}
|
|
7074
|
-
field,
|
|
7075
|
-
direction: "asc"
|
|
7076
|
-
} }));
|
|
7080
|
+
}
|
|
7077
7081
|
}, $[0] = dispatch, $[1] = field, $[2] = isActive, $[3] = order.direction, $[4] = title, $[5] = t0) : t0 = $[5];
|
|
7078
7082
|
let handleClick = t0, t1 = !field, t2 = field ? handleClick : void 0, t3 = field ? "pointer" : "default", t4;
|
|
7079
7083
|
$[6] === t3 ? t4 = $[7] : (t4 = {
|
|
@@ -7114,7 +7118,7 @@ function _temp$8(state) {
|
|
|
7114
7118
|
}
|
|
7115
7119
|
const ContextActionContainer$1 = /* @__PURE__ */ styled(Flex).withConfig({
|
|
7116
7120
|
displayName: "ContextActionContainer",
|
|
7117
|
-
componentId: "sc-
|
|
7121
|
+
componentId: "sc-00jl3m-0"
|
|
7118
7122
|
})(({ $scheme }) => css`cursor:pointer;@media (hover:hover) and (pointer:fine){&:hover{background:${getSchemeColor($scheme, "bg")};}}`), TableHeader = () => {
|
|
7119
7123
|
let $ = c(24), scheme = useColorSchemeValue(), dispatch = useDispatch(), fetching = useTypedSelector(_temp$7), itemsLength = useTypedSelector(selectAssetsLength), numPickedAssets = useTypedSelector(selectAssetsPickedLength), mediaIndex = useMediaIndex(), { onSelect } = useAssetSourceActions(), allSelected = numPickedAssets === itemsLength, t0;
|
|
7120
7124
|
$[0] !== allSelected || $[1] !== dispatch ? (t0 = (e) => {
|
|
@@ -7125,7 +7129,7 @@ const ContextActionContainer$1 = /* @__PURE__ */ styled(Flex).withConfig({
|
|
|
7125
7129
|
alignItems: "center",
|
|
7126
7130
|
background: "var(--card-bg-color)",
|
|
7127
7131
|
borderBottom: "1px solid var(--card-border-color)",
|
|
7128
|
-
|
|
7132
|
+
columnGap: t1,
|
|
7129
7133
|
gridTemplateColumns: GRID_TEMPLATE_COLUMNS.LARGE,
|
|
7130
7134
|
height: t2,
|
|
7131
7135
|
letterSpacing: "0.025em",
|
|
@@ -7190,13 +7194,13 @@ function _temp$7(state) {
|
|
|
7190
7194
|
}
|
|
7191
7195
|
const ContainerGrid$1 = /* @__PURE__ */ styled(Grid).withConfig({
|
|
7192
7196
|
displayName: "ContainerGrid",
|
|
7193
|
-
componentId: "sc-
|
|
7197
|
+
componentId: "sc-phlfmf-0"
|
|
7194
7198
|
})(({ $scheme, $selected, $updating }) => css`align-items:center;cursor:${$selected ? "default" : "pointer"};height:100%;pointer-events:${$updating ? "none" : "auto"};user-select:none;white-space:nowrap;${!$updating && css`@media (hover:hover) and (pointer:fine){&:hover{background:${getSchemeColor($scheme, "bg")};}}`}`), ContextActionContainer = /* @__PURE__ */ styled(Flex).withConfig({
|
|
7195
7199
|
displayName: "ContextActionContainer",
|
|
7196
|
-
componentId: "sc-
|
|
7200
|
+
componentId: "sc-phlfmf-1"
|
|
7197
7201
|
})(({ $scheme }) => css`cursor:pointer;@media (hover:hover) and (pointer:fine){&:hover{background:${getSchemeColor($scheme, "bg2")};}}`), StyledWarningIcon = /* @__PURE__ */ styled(WarningFilledIcon).withConfig({
|
|
7198
7202
|
displayName: "StyledWarningIcon",
|
|
7199
|
-
componentId: "sc-
|
|
7203
|
+
componentId: "sc-phlfmf-2"
|
|
7200
7204
|
})(({ theme }) => ({ color: theme.sanity.color.spot.red })), TableRowAsset = (props) => {
|
|
7201
7205
|
let $ = c(150), { id, selected } = props, scheme = useColorSchemeValue(), shiftPressed = useKeyPress("shift"), [referenceCountVisible, setReferenceCountVisible] = useState(!1), refCountVisibleTimeout = useRef(null), dispatch = useDispatch(), lastPicked = useTypedSelector(_temp$6), t0;
|
|
7202
7206
|
$[0] === id ? t0 = $[1] : (t0 = (state_0) => selectAssetById(state_0, id), $[0] = id, $[1] = t0);
|
|
@@ -7235,8 +7239,8 @@ const ContainerGrid$1 = /* @__PURE__ */ styled(Grid).withConfig({
|
|
|
7235
7239
|
}), t4 = [], $[20] = t3, $[21] = t4) : (t3 = $[20], t4 = $[21]), useEffect(t3, t4), !asset) return null;
|
|
7236
7240
|
let t5 = selected ? void 0 : handleClick, t6 = mediaIndex < 3 ? 0 : "16px", t7 = mediaIndex < 3 ? GRID_TEMPLATE_COLUMNS.SMALL : GRID_TEMPLATE_COLUMNS.LARGE, t8 = mediaIndex < 3 ? "auto" : "1fr", t9;
|
|
7237
7241
|
$[22] !== t6 || $[23] !== t7 || $[24] !== t8 ? (t9 = {
|
|
7238
|
-
|
|
7239
|
-
|
|
7242
|
+
columnGap: t6,
|
|
7243
|
+
rowGap: 0,
|
|
7240
7244
|
gridTemplateColumns: t7,
|
|
7241
7245
|
gridTemplateRows: t8
|
|
7242
7246
|
}, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25];
|
|
@@ -7561,10 +7565,10 @@ function _temp2$4(t0) {
|
|
|
7561
7565
|
}
|
|
7562
7566
|
const ContainerGrid = /* @__PURE__ */ styled(Grid).withConfig({
|
|
7563
7567
|
displayName: "ContainerGrid",
|
|
7564
|
-
componentId: "sc-
|
|
7568
|
+
componentId: "sc-j0br29-0"
|
|
7565
7569
|
})(({ theme }) => css`align-items:center;cursor:pointer;height:100%;user-select:none;white-space:nowrap;@media (hover:hover) and (pointer:fine){&:hover{background:${theme.sanity.color.card.enabled.bg};}}`), FolderBadge = /* @__PURE__ */ styled(Box).withConfig({
|
|
7566
7570
|
displayName: "FolderBadge",
|
|
7567
|
-
componentId: "sc-
|
|
7571
|
+
componentId: "sc-j0br29-1"
|
|
7568
7572
|
})(({ theme }) => css`background:${theme.sanity.color.spot.yellow};border-radius:6px;height:42px;position:relative;width:52px;&::before{background:${theme.sanity.color.spot.yellow};border-radius:6px 6px 0 0;content:'';height:12px;left:0;position:absolute;top:-6px;width:18px;}`), TableRowFolder = (t0) => {
|
|
7569
7573
|
let $ = c(45), { folderId, name, totalCount } = t0, dispatch = useDispatch(), mediaIndex = useMediaIndex(), scheme = useColorSchemeValue(), t1;
|
|
7570
7574
|
$[0] !== dispatch || $[1] !== folderId ? (t1 = () => dispatch(foldersActions.currentFolderSet({ folderId })), $[0] = dispatch, $[1] = folderId, $[2] = t1) : t1 = $[2];
|
|
@@ -7696,8 +7700,8 @@ const ContainerGrid = /* @__PURE__ */ styled(Grid).withConfig({
|
|
|
7696
7700
|
$[9] !== t3 || $[10] !== t4 || $[11] !== t5 || $[12] !== t6 ? (t7 = {
|
|
7697
7701
|
alignItems: "center",
|
|
7698
7702
|
background: t3,
|
|
7699
|
-
|
|
7700
|
-
|
|
7703
|
+
columnGap: t4,
|
|
7704
|
+
rowGap: 0,
|
|
7701
7705
|
gridTemplateColumns: t5,
|
|
7702
7706
|
gridTemplateRows: t6,
|
|
7703
7707
|
height: "100%",
|