sanity-plugin-media
6.0.16.0.2
dist/index.js~
dist/index.jsModified+54−87
Index: package/dist/index.js
===================================================================
--- package/dist/index.js
+++ package/dist/index.js
@@ -1288,9 +1288,9 @@
return of(dialogSlice.actions.inlineTagRemove({ tagIds }));
})), dialogActions = { ...dialogSlice.actions };
var dialog_default = dialogSlice.reducer;
const ButtonViewGroup = () => {
- let $ = c(16), dispatch = useDispatch(), view = useTypedSelector(_temp$28), t0;
+ let $ = c(16), dispatch = useDispatch(), view = useTypedSelector(_temp$27), t0;
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { whiteSpace: "nowrap" }, $[0] = t0) : t0 = $[0];
let t1 = view === "grid" ? "default" : "ghost", t2;
$[1] === dispatch ? t2 = $[2] : (t2 = () => dispatch(assetsActions.viewSet({ view: "grid" })), $[1] = dispatch, $[2] = t2);
let t3;
@@ -1327,9 +1327,9 @@
style: t0,
children: [t4, t8]
}), $[13] = t4, $[14] = t8, $[15] = t9) : t9 = $[15], t9;
};
-function _temp$28(state) {
+function _temp$27(state) {
return state.assets.view;
}
function usePortalPopoverProps() {
let $ = c(2), portal = usePortal(), t0;
@@ -1341,9 +1341,9 @@
referenceBoundary: portal.element
}, $[0] = portal.element, $[1] = t0), t0;
}
const OrderSelect = () => {
- let $ = c(15), dispatch = useDispatch(), order = useTypedSelector(_temp$27), popoverProps = usePortalPopoverProps(), t0;
+ let $ = c(15), dispatch = useDispatch(), order = useTypedSelector(_temp$26), popoverProps = usePortalPopoverProps(), t0;
$[0] !== order.direction || $[1] !== order.field ? (t0 = getOrderTitle(order.field, order.direction), $[0] = order.direction, $[1] = order.field, $[2] = t0) : t0 = $[2];
let t1;
$[3] === t0 ? t1 = $[4] : (t1 = /* @__PURE__ */ jsx(Button, {
fontSize: 1,
@@ -1382,9 +1382,9 @@
menu: t3,
popover: popoverProps
}), $[11] = popoverProps, $[12] = t1, $[13] = t3, $[14] = t4) : t4 = $[14], t4;
};
-function _temp$27(state) {
+function _temp$26(state) {
return state.assets.order;
}
const Progress = (props) => {
let $ = c(11), { loading } = props, t0;
@@ -1913,9 +1913,9 @@
children: t0
}), $[2] = props, $[3] = t0, $[4] = t1) : t1 = $[4], t1;
}
}, SearchFacetTags = (t0) => {
- let $ = c(24), { facet } = t0, scheme = useColorSchemeValue(), dispatch = useDispatch(), tags = useTypedSelector(_temp$26), tagsFetching = useTypedSelector(_temp2$18), t1;
+ let $ = c(24), { facet } = t0, scheme = useColorSchemeValue(), dispatch = useDispatch(), tags = useTypedSelector(_temp$25), tagsFetching = useTypedSelector(_temp2$17), t1;
$[0] === tags ? t1 = $[1] : (t1 = getTagSelectOptions(tags), $[0] = tags, $[1] = t1);
let allTagOptions = t1, popoverProps = usePortalPopoverProps(), t2;
$[2] !== dispatch || $[3] !== facet.id ? (t2 = (option) => {
dispatch(searchActions.facetsUpdateById({
@@ -1974,12 +1974,12 @@
facet,
children: [t4, t5]
}), $[20] = facet, $[21] = t4, $[22] = t5, $[23] = t6) : t6 = $[23], t6;
};
-function _temp$26(state) {
+function _temp$25(state) {
return selectTags(state);
}
-function _temp2$18(state_0) {
+function _temp2$17(state_0) {
return state_0.tags.fetching;
}
function _temp3$8() {
return "No tags";
@@ -1987,10 +1987,10 @@
const StackContainer = /* @__PURE__ */ styled(Flex).withConfig({
displayName: "StackContainer",
componentId: "sc-aa4qqn-0"
})(({ theme }) => css`> *{margin-bottom:${rem(theme.sanity.space[2])};}`), SearchFacets = (props) => {
- let $ = c(6), { layout: t0 } = props, layout = t0 === void 0 ? "inline" : t0, searchFacets = useTypedSelector(_temp$25), t1;
- $[0] === searchFacets ? t1 = $[1] : (t1 = searchFacets.map(_temp2$17), $[0] = searchFacets, $[1] = t1);
+ let $ = c(6), { layout: t0 } = props, layout = t0 === void 0 ? "inline" : t0, searchFacets = useTypedSelector(_temp$24), t1;
+ $[0] === searchFacets ? t1 = $[1] : (t1 = searchFacets.map(_temp2$16), $[0] = searchFacets, $[1] = t1);
let Items = t1;
if (layout === "inline") {
if (searchFacets.length === 0) return null;
let t2;
@@ -2011,12 +2011,12 @@
}), $[4] = Items, $[5] = t2), t2;
}
throw Error("Invalid layout");
};
-function _temp$25(state) {
+function _temp$24(state) {
return state.search.facets;
}
-function _temp2$17(facet) {
+function _temp2$16(facet) {
let key = facet.id;
return facet.type === "number" ? /* @__PURE__ */ jsx(SearchFacetNumber, { facet }, key) : facet.type === "searchable" ? /* @__PURE__ */ jsx(SearchFacetTags, { facet }, key) : facet.type === "select" ? /* @__PURE__ */ jsx(SearchFacetSelect, { facet }, key) : facet.type === "string" ? /* @__PURE__ */ jsx(SearchFacetString, { facet }, key) : null;
}
const ToolOptionsContext = createContext(null), ToolOptionsProvider = ({ options, children }) => {
@@ -2050,9 +2050,9 @@
let context = useContext(ToolOptionsContext);
if (!context) throw Error("useToolOptions must be used within an ToolOptionsProvider");
return context;
}, SearchFacetsControl = () => {
- let $ = c(35), dispatch = useDispatch(), assetTypes = useTypedSelector(_temp$24), searchFacets = useTypedSelector(_temp2$16), selectedDocument = useTypedSelector(_temp3$7), popoverProps = usePortalPopoverProps(), { creditLine } = useToolOptions(), isTool = !selectedDocument, T0, T1, T2, t0, t1, t2;
+ let $ = c(35), dispatch = useDispatch(), assetTypes = useTypedSelector(_temp$23), searchFacets = useTypedSelector(_temp2$15), selectedDocument = useTypedSelector(_temp3$7), popoverProps = usePortalPopoverProps(), { creditLine } = useToolOptions(), isTool = !selectedDocument, T0, T1, T2, t0, t1, t2;
if ($[0] !== assetTypes || $[1] !== creditLine?.enabled || $[2] !== dispatch || $[3] !== isTool || $[4] !== searchFacets) {
let t3;
$[11] !== assetTypes || $[12] !== creditLine?.enabled || $[13] !== isTool ? (t3 = (facet) => !creditLine?.enabled && facet?.type === "string" && facet?.name === "creditLine" ? !1 : facet.type === "group" || facet.type === "divider" ? !0 : isTool ? !facet?.selectOnly : facet.assetTypes.filter((assetType) => assetTypes.includes(assetType)).length > 0, $[11] = assetTypes, $[12] = creditLine?.enabled, $[13] = isTool, $[14] = t3) : t3 = $[14];
let filteredFacets = FACETS.filter(t3).filter(_temp4$4), hasSearchFacets = filteredFacets.length > 0, renderMenuFacets = (facets_0, t4) => {
@@ -2104,12 +2104,12 @@
}), $[28] = dispatch, $[29] = searchFacets.length, $[30] = t6) : t6 = $[30];
let t7;
return $[31] !== T2 || $[32] !== t5 || $[33] !== t6 ? (t7 = /* @__PURE__ */ jsxs(T2, { children: [t5, t6] }), $[31] = T2, $[32] = t5, $[33] = t6, $[34] = t7) : t7 = $[34], t7;
};
-function _temp$24(state) {
+function _temp$23(state) {
return state.assets.assetTypes;
}
-function _temp2$16(state_0) {
+function _temp2$15(state_0) {
return state_0.search.facets;
}
function _temp3$7(state_1) {
return state_1.selected.document;
@@ -2136,9 +2136,9 @@
strokeWidth: "32"
}), /* @__PURE__ */ jsx("path", { d: "M384 160a32 32 0 1132-32 32 32 0 01-32 32z" })]
}), $[0] = t0) : t0 = $[0], t0;
}, TextInputSearch = () => {
- let $ = c(14), searchQuery = useTypedSelector(_temp$23), dispatch = useDispatch(), t0;
+ let $ = c(14), searchQuery = useTypedSelector(_temp$22), dispatch = useDispatch(), t0;
$[0] === dispatch ? t0 = $[1] : (t0 = (e) => {
dispatch(searchActions.querySet({ searchQuery: e.currentTarget.value }));
}, $[0] = dispatch, $[1] = t0);
let handleChange = t0, t1;
@@ -2178,13 +2178,13 @@
style: t2,
children: [t3, t4]
}), $[11] = t3, $[12] = t4, $[13] = t5) : t5 = $[13], t5;
};
-function _temp$23(state) {
+function _temp$22(state) {
return state.search.query;
}
const Controls = () => {
- let $ = c(42), dispatch = useDispatch(), fetching = useTypedSelector(_temp$22), pageIndex = useTypedSelector(_temp2$15), searchFacets = useTypedSelector(_temp3$6), tagsPanelVisible = useTypedSelector(_temp4$3), mediaIndex = useMediaIndex(), t0;
+ let $ = c(42), dispatch = useDispatch(), fetching = useTypedSelector(_temp$21), pageIndex = useTypedSelector(_temp2$14), searchFacets = useTypedSelector(_temp3$6), tagsPanelVisible = useTypedSelector(_temp4$3), mediaIndex = useMediaIndex(), t0;
$[0] === dispatch ? t0 = $[1] : (t0 = () => {
dispatch(dialogActions.showSearchFacets());
}, $[0] = dispatch, $[1] = t0);
let handleShowSearchFacetDialog = t0, t1;
@@ -2335,12 +2335,12 @@
t24
]
}), $[38] = t15, $[39] = t23, $[40] = t24, $[41] = t25) : t25 = $[41], t25;
};
-function _temp$22(state) {
+function _temp$21(state) {
return state.assets.fetching;
}
-function _temp2$15(state_0) {
+function _temp2$14(state_0) {
return state_0.assets.pageIndex;
}
function _temp3$6(state_1) {
return state_1.search.facets;
@@ -2364,9 +2364,9 @@
}
}), debugActions = { ...debugSlice.actions };
var debug_default = debugSlice.reducer;
const DebugControls = () => {
- let $ = c(16), dispatch = useDispatch(), badConnection = useTypedSelector(_temp$21), debugEnabled = useTypedSelector(_temp2$14), t0;
+ let $ = c(16), dispatch = useDispatch(), badConnection = useTypedSelector(_temp$20), debugEnabled = useTypedSelector(_temp2$13), t0;
$[0] === dispatch ? t0 = $[1] : (t0 = (e) => {
let checked = e.target.checked;
dispatch(debugActions.setBadConnection(checked));
}, $[0] = dispatch, $[1] = t0);
@@ -2426,12 +2426,12 @@
})]
})
}), $[13] = t5, $[14] = t8, $[15] = t9) : t9 = $[15], t9;
};
-function _temp$21(state) {
+function _temp$20(state) {
return state.debug.badConnection;
}
-function _temp2$14(state_0) {
+function _temp2$13(state_0) {
return state_0.debug.enabled;
}
function localizedStringSchema(locales) {
if (!locales || locales.length === 0) return z.string().trim().optional();
@@ -3046,9 +3046,9 @@
}), $[8] = description, $[9] = name, $[10] = t3) : t3 = $[10];
let t4;
return $[11] !== t2 || $[12] !== t3 ? (t4 = /* @__PURE__ */ jsxs(Fragment, { children: [t2, t3] }), $[11] = t2, $[12] = t3, $[13] = t4) : t4 = $[13], t4;
}, FormFieldInputTags = (props) => {
- let $ = c(23), { control, description, disabled, error, label, name, onCreateTag, options, placeholder, value } = props, scheme = useColorSchemeValue(), creating = useTypedSelector(_temp$20), tagsFetching = useTypedSelector(_temp2$13), t0;
+ let $ = c(23), { control, description, disabled, error, label, name, onCreateTag, options, placeholder, value } = props, scheme = useColorSchemeValue(), creating = useTypedSelector(_temp$19), tagsFetching = useTypedSelector(_temp2$12), t0;
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { zIndex: 2 }, $[0] = t0) : t0 = $[0];
let t1;
$[1] !== description || $[2] !== error || $[3] !== label || $[4] !== name ? (t1 = /* @__PURE__ */ jsx(FormFieldInputLabel, {
description,
@@ -3089,12 +3089,12 @@
style: t0,
children: [t1, t3]
}), $[20] = t1, $[21] = t3, $[22] = t4) : t4 = $[22], t4;
};
-function _temp$20(state) {
+function _temp$19(state) {
return state.tags.creating;
}
-function _temp2$13(state_0) {
+function _temp2$12(state_0) {
return state_0.tags.fetching;
}
function _temp3$5() {
return "No tags";
@@ -3309,9 +3309,9 @@
opt: { media: { tags: assetTagOptions } },
title: makeLocaleObj(asset?.title)
};
}
- let flattenField = _temp2$12;
+ let flattenField = _temp2$11;
return {
altText: flattenField(asset?.altText),
creditLine: flattenField(asset?.creditLine),
description: flattenField(asset?.description),
@@ -3658,13 +3658,13 @@
width: 3,
children: [t42, children]
}), $[119] = children, $[120] = handleClose, $[121] = id, $[122] = t31, $[123] = t42, $[124] = t43) : t43 = $[124], t43;
};
-function _temp$19(v) {
+function _temp$18(v) {
return v;
}
-function _temp2$12(field_0) {
- return typeof field_0 == "string" ? field_0 : typeof field_0 == "object" && field_0 && Object.values(field_0).find(_temp$19) || "";
+function _temp2$11(field_0) {
+ return typeof field_0 == "string" ? field_0 : typeof field_0 == "object" && field_0 && Object.values(field_0).find(_temp$18) || "";
}
function _temp3$4(v_0) {
return typeof v_0 == "object" && !!v_0 && !Array.isArray(v_0);
}
@@ -3775,9 +3775,9 @@
width: 1,
children: [t2, children]
}), $[3] = children, $[4] = handleClose, $[5] = id, $[6] = t3) : t3 = $[6], t3;
}, DialogTagCreate = (props) => {
- let $ = c(37), { children, dialog: t0 } = props, { id } = t0, dispatch = useDispatch(), creating = useTypedSelector(_temp$18), creatingError = useTypedSelector(_temp2$11), t1;
+ let $ = c(37), { children, dialog: t0 } = props, { id } = t0, dispatch = useDispatch(), creating = useTypedSelector(_temp$17), creatingError = useTypedSelector(_temp2$10), t1;
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = { name: "" }, $[0] = t1) : t1 = $[0];
let t2;
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {
defaultValues: t1,
@@ -3846,18 +3846,18 @@
width: 1,
children: [t15, children]
}), $[31] = children, $[32] = handleClose, $[33] = id, $[34] = t15, $[35] = t9, $[36] = t16) : t16 = $[36], t16;
};
-function _temp$18(state) {
+function _temp$17(state) {
return state.tags.creating;
}
-function _temp2$11(state_0) {
+function _temp2$10(state_0) {
return state_0.tags.creatingError;
}
const DialogTagEdit = (props) => {
let $ = c(64), { children, dialog: t0 } = props, { id, tagId } = t0, client = useVersionedClient(), dispatch = useDispatch(), t1;
$[0] === tagId ? t1 = $[1] : (t1 = (state) => selectTagById(state, String(tagId)), $[0] = tagId, $[1] = t1);
- let tagItem = useTypedSelector(t1), [tagSnapshot, setTagSnapshot] = useState(tagItem?.tag), currentTag = tagItem ? tagItem?.tag : tagSnapshot, generateDefaultValues = _temp$17, t2 = tagItem?.tag, t3;
+ let tagItem = useTypedSelector(t1), [tagSnapshot, setTagSnapshot] = useState(tagItem?.tag), currentTag = tagItem ? tagItem?.tag : tagSnapshot, generateDefaultValues = _temp$16, t2 = tagItem?.tag, t3;
$[2] === t2 ? t3 = $[3] : (t3 = generateDefaultValues(t2), $[2] = t2, $[3] = t3);
let t4;
$[4] === Symbol.for("react.memo_cache_sentinel") ? (t4 = zodFormResolver(tagFormSchema), $[4] = t4) : t4 = $[4];
let t5;
@@ -3990,9 +3990,9 @@
width: 1,
children: [t25, children]
}), $[58] = children, $[59] = handleClose, $[60] = id, $[61] = t18, $[62] = t25, $[63] = t26) : t26 = $[63], t26;
};
-function _temp$17(tag) {
+function _temp$16(tag) {
return { name: tag?.name?.current || "" };
}
const TagContainer = styled(Flex).withConfig({
displayName: "TagContainer",
@@ -4177,9 +4177,9 @@
}, t2), $[6] = item, $[7] = t1, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
}), TagsVirtualized = () => {
let $ = c(15), assetsPicked = useTypedSelector(selectAssetsPicked), tags = useTypedSelector(selectTags), [isScrolling, setIsScrolling] = useState(!1), items;
if ($[0] !== assetsPicked || $[1] !== tags) {
- let pickedTagIds = assetsPicked?.reduce(_temp2$10, []), pickedTagIdsUnique = [...new Set(pickedTagIds)], t0;
+ let pickedTagIds = assetsPicked?.reduce(_temp2$9, []), pickedTagIdsUnique = [...new Set(pickedTagIds)], t0;
$[3] === assetsPicked ? t0 = $[4] : (t0 = (acc_0, tagId) => (assetsPicked.every((assetItem) => (assetItem.asset.opt?.media?.tags?.findIndex((tag_0) => tag_0._ref === tagId) ?? -1) >= 0) ? acc_0.appliedToAll.push(tagId) : acc_0.appliedToSome.push(tagId), acc_0), $[3] = assetsPicked, $[4] = t0);
let tagIdsSegmented = pickedTagIdsUnique.reduce(t0, {
appliedToAll: [],
appliedToSome: []
@@ -4222,13 +4222,13 @@
style: t2,
totalCount: items.length
}), $[11] = items.length, $[12] = t0, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
};
-function _temp$16(tag) {
+function _temp$15(tag) {
return tag._ref;
}
-function _temp2$10(acc, val) {
- let assetTagIds = val?.asset?.opt?.media?.tags?.map(_temp$16) || [];
+function _temp2$9(acc, val) {
+ let assetTagIds = val?.asset?.opt?.media?.tags?.map(_temp$15) || [];
return acc = acc.concat(assetTagIds), acc;
}
function _temp3$3(tagItem) {
return {
@@ -4274,9 +4274,9 @@
]
};
}
const TagViewHeader = (t0) => {
- let $ = c(22), { allowCreate, light, title } = t0, scheme = useColorSchemeValue(), dispatch = useDispatch(), tagsCreating = useTypedSelector(_temp$15), tagsFetching = useTypedSelector(_temp2$9), t1;
+ let $ = c(22), { allowCreate, light, title } = t0, scheme = useColorSchemeValue(), dispatch = useDispatch(), tagsCreating = useTypedSelector(_temp$14), tagsFetching = useTypedSelector(_temp2$8), t1;
$[0] === dispatch ? t1 = $[1] : (t1 = () => {
dispatch(DIALOG_ACTIONS.showTagCreate());
}, $[0] = dispatch, $[1] = t1);
let handleTagCreate = t1, t2;
@@ -4327,16 +4327,16 @@
style: t3,
children: [t6, t7]
}) }), $[18] = t3, $[19] = t6, $[20] = t7, $[21] = t8) : t8 = $[21], t8;
};
-function _temp$15(state) {
+function _temp$14(state) {
return state.tags.creating;
}
-function _temp2$9(state_0) {
+function _temp2$8(state_0) {
return state_0.tags.fetching;
}
const TagView = () => {
- let $ = c(12), numPickedAssets = useTypedSelector(selectAssetsPickedLength), tags = useTypedSelector(selectTags), fetching = useTypedSelector(_temp$14), fetchComplete = useTypedSelector(_temp2$8) !== -1, hasTags = !fetching && tags?.length > 0, hasPicked = numPickedAssets > 0, t0 = hasPicked ? "Tags (in selection)" : "Tags", t1;
+ let $ = c(12), numPickedAssets = useTypedSelector(selectAssetsPickedLength), tags = useTypedSelector(selectTags), fetching = useTypedSelector(_temp$13), fetchComplete = useTypedSelector(_temp2$7) !== -1, hasTags = !fetching && tags?.length > 0, hasPicked = numPickedAssets > 0, t0 = hasPicked ? "Tags (in selection)" : "Tags", t1;
$[0] !== hasPicked || $[1] !== t0 ? (t1 = /* @__PURE__ */ jsx(TagViewHeader, {
allowCreate: !0,
light: hasPicked,
title: t0
@@ -4363,12 +4363,12 @@
t3
]
}), $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4) : t4 = $[11], t4;
};
-function _temp$14(state) {
+function _temp$13(state) {
return state.tags.fetching;
}
-function _temp2$8(state_0) {
+function _temp2$7(state_0) {
return state_0.tags.fetchCount;
}
const DialogTags = (props) => {
let $ = c(7), { children, dialog: t0 } = props, { id } = t0, dispatch = useDispatch(), t1;
@@ -4392,9 +4392,9 @@
width: 1,
children: [t2, children]
}), $[3] = children, $[4] = handleClose, $[5] = id, $[6] = t3) : t3 = $[6], t3;
}, Dialogs = () => {
- let $ = c(2), currentDialogs = useTypedSelector(_temp$13), t0;
+ let $ = c(2), currentDialogs = useTypedSelector(_temp$12), t0;
if ($[0] !== currentDialogs) {
let renderDialogs = (dialogs, index) => {
if (dialogs.length === 0 || index >= dialogs.length) return null;
let dialog = dialogs[index], childDialogs = renderDialogs(dialogs, index + 1);
@@ -4421,9 +4421,9 @@
t0 = renderDialogs(currentDialogs, 0), $[0] = currentDialogs, $[1] = t0;
} else t0 = $[1];
return t0;
};
-function _temp$13(state) {
+function _temp$12(state) {
return state.dialog.items;
}
const DropzoneDispatchContext = createContext(void 0), DropzoneDispatchProvider = (props) => {
let $ = c(5), { children, open } = props, t0;
@@ -4437,9 +4437,9 @@
let context = useContext(DropzoneDispatchContext);
if (context === void 0) throw Error("useDropzoneActions must be used within an DropzoneDispatchProvider");
return context;
}, Header = (props) => {
- let $ = c(23), { onClose } = props, { open } = useDropzoneActions(), { onSelect } = useAssetSourceActions(), assetTypes = useTypedSelector(_temp$12), selectedDocument = useTypedSelector(_temp2$7), { directUploads } = useToolOptions(), t0;
+ let $ = c(23), { onClose } = props, { open } = useDropzoneActions(), { onSelect } = useAssetSourceActions(), assetTypes = useTypedSelector(_temp$11), selectedDocument = useTypedSelector(_temp2$6), { directUploads } = useToolOptions(), t0;
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { whiteSpace: "nowrap" }, $[0] = t0) : t0 = $[0];
let t1;
$[1] !== assetTypes || $[2] !== onSelect ? (t1 = onSelect ? `Insert ${assetTypes.join(" or ")}` : "Browse Assets", $[1] = assetTypes, $[2] = onSelect, $[3] = t1) : t1 = $[3];
let t2;
@@ -4505,47 +4505,14 @@
children: [t4, t7]
})
}), $[20] = t4, $[21] = t7, $[22] = t8) : t8 = $[22], t8;
};
-function _temp$12(state) {
+function _temp$11(state) {
return state.assets.assetTypes;
}
-function _temp2$7(state_0) {
+function _temp2$6(state_0) {
return state_0.selected.document;
}
-const useBreakpointIndex = () => {
- let $ = c(6), getBreakpointIndex, mediaQueryLists, t0, t1;
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (mediaQueryLists = studioTheme?.container?.map(_temp$11), getBreakpointIndex = () => mediaQueryLists.findIndex(_temp2$6), t0 = useState, t1 = getBreakpointIndex(), $[0] = getBreakpointIndex, $[1] = mediaQueryLists, $[2] = t0, $[3] = t1) : (getBreakpointIndex = $[0], mediaQueryLists = $[1], t0 = $[2], t1 = $[3]);
- let [value, setValue] = t0(t1), t2, t3;
- return $[4] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => {
- let handleBreakpoint = () => {
- setValue(getBreakpointIndex);
- };
- return mediaQueryLists.forEach((mql_0) => {
- try {
- mql_0.addEventListener("change", handleBreakpoint);
- } catch {
- try {
- mql_0.addListener(handleBreakpoint);
- } catch {}
- }
- }), () => {
- try {
- mediaQueryLists.forEach((mql_2) => mql_2.removeEventListener("change", handleBreakpoint));
- } catch {
- try {
- mediaQueryLists.forEach((mql_1) => mql_1.removeListener(handleBreakpoint));
- } catch {}
- }
- };
- }, t3 = [], $[4] = t2, $[5] = t3) : (t2 = $[4], t3 = $[5]), useEffect(t2, t3), value;
-};
-function _temp$11(width) {
- return window.matchMedia(`(max-width: ${width}px)`);
-}
-function _temp2$6(mql) {
- return mql.matches;
-}
const selectCombinedItems = createSelector([(state) => state.assets.allIds, (state) => state.uploads.allIds], (assetIds, uploadIds) => {
let assetItems = assetIds.map((id) => ({
id,
type: "asset"
@@ -5841,20 +5808,20 @@
function _temp3$2() {
return /* @__PURE__ */ jsx(TableHeader, {});
}
const Items = () => {
- let $ = c(14), dispatch = useDispatch(), fetchCount = useTypedSelector(_temp$4), fetching = useTypedSelector(_temp2$2), tagsPanelVisible = useTypedSelector(_temp3$1), view = useTypedSelector(_temp4), combinedItems = useTypedSelector(selectCombinedItems), breakpointIndex = useBreakpointIndex(), hasFetchedOnce = fetchCount >= 0, hasItems = combinedItems.length > 0, t0;
+ let $ = c(14), dispatch = useDispatch(), fetchCount = useTypedSelector(_temp$4), fetching = useTypedSelector(_temp2$2), tagsPanelVisible = useTypedSelector(_temp3$1), view = useTypedSelector(_temp4), combinedItems = useTypedSelector(selectCombinedItems), mediaIndex = useMediaIndex(), hasFetchedOnce = fetchCount >= 0, hasItems = combinedItems.length > 0, t0;
$[0] !== dispatch || $[1] !== fetching ? (t0 = () => {
fetching || dispatch(assetsActions.loadNextPage());
}, $[0] = dispatch, $[1] = fetching, $[2] = t0) : t0 = $[2];
let handleLoadMoreItems = t0, t1, t2;
- $[3] !== breakpointIndex || $[4] !== dispatch || $[5] !== tagsPanelVisible ? (t1 = () => {
- breakpointIndex <= 1 && tagsPanelVisible && dispatch(tagsActions.panelVisibleSet({ panelVisible: !1 }));
+ $[3] !== dispatch || $[4] !== mediaIndex || $[5] !== tagsPanelVisible ? (t1 = () => {
+ mediaIndex <= 1 && tagsPanelVisible && dispatch(tagsActions.panelVisibleSet({ panelVisible: !1 }));
}, t2 = [
- breakpointIndex,
dispatch,
+ mediaIndex,
tagsPanelVisible
- ], $[3] = breakpointIndex, $[4] = dispatch, $[5] = tagsPanelVisible, $[6] = t1, $[7] = t2) : (t1 = $[6], t2 = $[7]), useEffect(t1, t2);
+ ], $[3] = dispatch, $[4] = mediaIndex, $[5] = tagsPanelVisible, $[6] = t1, $[7] = t2) : (t1 = $[6], t2 = $[7]), useEffect(t1, t2);
let isEmpty = !hasItems && hasFetchedOnce && !fetching, t3;
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t3 = { width: "100%" }, $[8] = t3) : t3 = $[8];
let t4;
return $[9] !== combinedItems || $[10] !== handleLoadMoreItems || $[11] !== isEmpty || $[12] !== view ? (t4 = /* @__PURE__ */ jsx(Box, {