sanity-plugin-media 6.0.1 → 6.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/dist/index.js +55 -88
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -808,7 +808,7 @@ const searchSlice = createSlice({
|
|
|
808
808
|
state.facets = state.facets.filter((facet) => facet.name !== action.payload.facetName);
|
|
809
809
|
},
|
|
810
810
|
facetsRemoveByTag(state, action) {
|
|
811
|
-
state.facets = state.facets.filter((facet) =>
|
|
811
|
+
state.facets = state.facets.filter((facet) => facet.name !== "tag" || facet.type !== "searchable" || facet.operatorType !== "references" && facet.operatorType !== "doesNotReference" || facet.value?.value !== action.payload.tagId);
|
|
812
812
|
},
|
|
813
813
|
facetsRemoveById(state, action) {
|
|
814
814
|
state.facets = state.facets.filter((facet) => facet.id !== action.payload.facetId);
|
|
@@ -1289,7 +1289,7 @@ const dialogSlice = createSlice({
|
|
|
1289
1289
|
})), dialogActions = { ...dialogSlice.actions };
|
|
1290
1290
|
var dialog_default = dialogSlice.reducer;
|
|
1291
1291
|
const ButtonViewGroup = () => {
|
|
1292
|
-
let $ = c(16), dispatch = useDispatch(), view = useTypedSelector(_temp$
|
|
1292
|
+
let $ = c(16), dispatch = useDispatch(), view = useTypedSelector(_temp$27), t0;
|
|
1293
1293
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { whiteSpace: "nowrap" }, $[0] = t0) : t0 = $[0];
|
|
1294
1294
|
let t1 = view === "grid" ? "default" : "ghost", t2;
|
|
1295
1295
|
$[1] === dispatch ? t2 = $[2] : (t2 = () => dispatch(assetsActions.viewSet({ view: "grid" })), $[1] = dispatch, $[2] = t2);
|
|
@@ -1328,7 +1328,7 @@ const ButtonViewGroup = () => {
|
|
|
1328
1328
|
children: [t4, t8]
|
|
1329
1329
|
}), $[13] = t4, $[14] = t8, $[15] = t9) : t9 = $[15], t9;
|
|
1330
1330
|
};
|
|
1331
|
-
function _temp$
|
|
1331
|
+
function _temp$27(state) {
|
|
1332
1332
|
return state.assets.view;
|
|
1333
1333
|
}
|
|
1334
1334
|
function usePortalPopoverProps() {
|
|
@@ -1342,7 +1342,7 @@ function usePortalPopoverProps() {
|
|
|
1342
1342
|
}, $[0] = portal.element, $[1] = t0), t0;
|
|
1343
1343
|
}
|
|
1344
1344
|
const OrderSelect = () => {
|
|
1345
|
-
let $ = c(15), dispatch = useDispatch(), order = useTypedSelector(_temp$
|
|
1345
|
+
let $ = c(15), dispatch = useDispatch(), order = useTypedSelector(_temp$26), popoverProps = usePortalPopoverProps(), t0;
|
|
1346
1346
|
$[0] !== order.direction || $[1] !== order.field ? (t0 = getOrderTitle(order.field, order.direction), $[0] = order.direction, $[1] = order.field, $[2] = t0) : t0 = $[2];
|
|
1347
1347
|
let t1;
|
|
1348
1348
|
$[3] === t0 ? t1 = $[4] : (t1 = /* @__PURE__ */ jsx(Button, {
|
|
@@ -1383,7 +1383,7 @@ const OrderSelect = () => {
|
|
|
1383
1383
|
popover: popoverProps
|
|
1384
1384
|
}), $[11] = popoverProps, $[12] = t1, $[13] = t3, $[14] = t4) : t4 = $[14], t4;
|
|
1385
1385
|
};
|
|
1386
|
-
function _temp$
|
|
1386
|
+
function _temp$26(state) {
|
|
1387
1387
|
return state.assets.order;
|
|
1388
1388
|
}
|
|
1389
1389
|
const Progress = (props) => {
|
|
@@ -1914,7 +1914,7 @@ const Container$2 = /* @__PURE__ */ styled(Box).withConfig({
|
|
|
1914
1914
|
}), $[2] = props, $[3] = t0, $[4] = t1) : t1 = $[4], t1;
|
|
1915
1915
|
}
|
|
1916
1916
|
}, SearchFacetTags = (t0) => {
|
|
1917
|
-
let $ = c(24), { facet } = t0, scheme = useColorSchemeValue(), dispatch = useDispatch(), tags = useTypedSelector(_temp$
|
|
1917
|
+
let $ = c(24), { facet } = t0, scheme = useColorSchemeValue(), dispatch = useDispatch(), tags = useTypedSelector(_temp$25), tagsFetching = useTypedSelector(_temp2$17), t1;
|
|
1918
1918
|
$[0] === tags ? t1 = $[1] : (t1 = getTagSelectOptions(tags), $[0] = tags, $[1] = t1);
|
|
1919
1919
|
let allTagOptions = t1, popoverProps = usePortalPopoverProps(), t2;
|
|
1920
1920
|
$[2] !== dispatch || $[3] !== facet.id ? (t2 = (option) => {
|
|
@@ -1975,10 +1975,10 @@ const Container$2 = /* @__PURE__ */ styled(Box).withConfig({
|
|
|
1975
1975
|
children: [t4, t5]
|
|
1976
1976
|
}), $[20] = facet, $[21] = t4, $[22] = t5, $[23] = t6) : t6 = $[23], t6;
|
|
1977
1977
|
};
|
|
1978
|
-
function _temp$
|
|
1978
|
+
function _temp$25(state) {
|
|
1979
1979
|
return selectTags(state);
|
|
1980
1980
|
}
|
|
1981
|
-
function _temp2$
|
|
1981
|
+
function _temp2$17(state_0) {
|
|
1982
1982
|
return state_0.tags.fetching;
|
|
1983
1983
|
}
|
|
1984
1984
|
function _temp3$8() {
|
|
@@ -1988,8 +1988,8 @@ const StackContainer = /* @__PURE__ */ styled(Flex).withConfig({
|
|
|
1988
1988
|
displayName: "StackContainer",
|
|
1989
1989
|
componentId: "sc-aa4qqn-0"
|
|
1990
1990
|
})(({ theme }) => css`> *{margin-bottom:${rem(theme.sanity.space[2])};}`), SearchFacets = (props) => {
|
|
1991
|
-
let $ = c(6), { layout: t0 } = props, layout = t0 === void 0 ? "inline" : t0, searchFacets = useTypedSelector(_temp$
|
|
1992
|
-
$[0] === searchFacets ? t1 = $[1] : (t1 = searchFacets.map(_temp2$
|
|
1991
|
+
let $ = c(6), { layout: t0 } = props, layout = t0 === void 0 ? "inline" : t0, searchFacets = useTypedSelector(_temp$24), t1;
|
|
1992
|
+
$[0] === searchFacets ? t1 = $[1] : (t1 = searchFacets.map(_temp2$16), $[0] = searchFacets, $[1] = t1);
|
|
1993
1993
|
let Items = t1;
|
|
1994
1994
|
if (layout === "inline") {
|
|
1995
1995
|
if (searchFacets.length === 0) return null;
|
|
@@ -2012,10 +2012,10 @@ const StackContainer = /* @__PURE__ */ styled(Flex).withConfig({
|
|
|
2012
2012
|
}
|
|
2013
2013
|
throw Error("Invalid layout");
|
|
2014
2014
|
};
|
|
2015
|
-
function _temp$
|
|
2015
|
+
function _temp$24(state) {
|
|
2016
2016
|
return state.search.facets;
|
|
2017
2017
|
}
|
|
2018
|
-
function _temp2$
|
|
2018
|
+
function _temp2$16(facet) {
|
|
2019
2019
|
let key = facet.id;
|
|
2020
2020
|
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;
|
|
2021
2021
|
}
|
|
@@ -2051,7 +2051,7 @@ const ToolOptionsContext = createContext(null), ToolOptionsProvider = ({ options
|
|
|
2051
2051
|
if (!context) throw Error("useToolOptions must be used within an ToolOptionsProvider");
|
|
2052
2052
|
return context;
|
|
2053
2053
|
}, SearchFacetsControl = () => {
|
|
2054
|
-
let $ = c(35), dispatch = useDispatch(), assetTypes = useTypedSelector(_temp$
|
|
2054
|
+
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;
|
|
2055
2055
|
if ($[0] !== assetTypes || $[1] !== creditLine?.enabled || $[2] !== dispatch || $[3] !== isTool || $[4] !== searchFacets) {
|
|
2056
2056
|
let t3;
|
|
2057
2057
|
$[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];
|
|
@@ -2105,10 +2105,10 @@ const ToolOptionsContext = createContext(null), ToolOptionsProvider = ({ options
|
|
|
2105
2105
|
let t7;
|
|
2106
2106
|
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;
|
|
2107
2107
|
};
|
|
2108
|
-
function _temp$
|
|
2108
|
+
function _temp$23(state) {
|
|
2109
2109
|
return state.assets.assetTypes;
|
|
2110
2110
|
}
|
|
2111
|
-
function _temp2$
|
|
2111
|
+
function _temp2$15(state_0) {
|
|
2112
2112
|
return state_0.search.facets;
|
|
2113
2113
|
}
|
|
2114
2114
|
function _temp3$7(state_1) {
|
|
@@ -2137,7 +2137,7 @@ const TagIcon = () => {
|
|
|
2137
2137
|
}), /* @__PURE__ */ jsx("path", { d: "M384 160a32 32 0 1132-32 32 32 0 01-32 32z" })]
|
|
2138
2138
|
}), $[0] = t0) : t0 = $[0], t0;
|
|
2139
2139
|
}, TextInputSearch = () => {
|
|
2140
|
-
let $ = c(14), searchQuery = useTypedSelector(_temp$
|
|
2140
|
+
let $ = c(14), searchQuery = useTypedSelector(_temp$22), dispatch = useDispatch(), t0;
|
|
2141
2141
|
$[0] === dispatch ? t0 = $[1] : (t0 = (e) => {
|
|
2142
2142
|
dispatch(searchActions.querySet({ searchQuery: e.currentTarget.value }));
|
|
2143
2143
|
}, $[0] = dispatch, $[1] = t0);
|
|
@@ -2179,11 +2179,11 @@ const TagIcon = () => {
|
|
|
2179
2179
|
children: [t3, t4]
|
|
2180
2180
|
}), $[11] = t3, $[12] = t4, $[13] = t5) : t5 = $[13], t5;
|
|
2181
2181
|
};
|
|
2182
|
-
function _temp$
|
|
2182
|
+
function _temp$22(state) {
|
|
2183
2183
|
return state.search.query;
|
|
2184
2184
|
}
|
|
2185
2185
|
const Controls = () => {
|
|
2186
|
-
let $ = c(42), dispatch = useDispatch(), fetching = useTypedSelector(_temp$
|
|
2186
|
+
let $ = c(42), dispatch = useDispatch(), fetching = useTypedSelector(_temp$21), pageIndex = useTypedSelector(_temp2$14), searchFacets = useTypedSelector(_temp3$6), tagsPanelVisible = useTypedSelector(_temp4$3), mediaIndex = useMediaIndex(), t0;
|
|
2187
2187
|
$[0] === dispatch ? t0 = $[1] : (t0 = () => {
|
|
2188
2188
|
dispatch(dialogActions.showSearchFacets());
|
|
2189
2189
|
}, $[0] = dispatch, $[1] = t0);
|
|
@@ -2336,10 +2336,10 @@ const Controls = () => {
|
|
|
2336
2336
|
]
|
|
2337
2337
|
}), $[38] = t15, $[39] = t23, $[40] = t24, $[41] = t25) : t25 = $[41], t25;
|
|
2338
2338
|
};
|
|
2339
|
-
function _temp$
|
|
2339
|
+
function _temp$21(state) {
|
|
2340
2340
|
return state.assets.fetching;
|
|
2341
2341
|
}
|
|
2342
|
-
function _temp2$
|
|
2342
|
+
function _temp2$14(state_0) {
|
|
2343
2343
|
return state_0.assets.pageIndex;
|
|
2344
2344
|
}
|
|
2345
2345
|
function _temp3$6(state_1) {
|
|
@@ -2365,7 +2365,7 @@ const debugSlice = createSlice({
|
|
|
2365
2365
|
}), debugActions = { ...debugSlice.actions };
|
|
2366
2366
|
var debug_default = debugSlice.reducer;
|
|
2367
2367
|
const DebugControls = () => {
|
|
2368
|
-
let $ = c(16), dispatch = useDispatch(), badConnection = useTypedSelector(_temp$
|
|
2368
|
+
let $ = c(16), dispatch = useDispatch(), badConnection = useTypedSelector(_temp$20), debugEnabled = useTypedSelector(_temp2$13), t0;
|
|
2369
2369
|
$[0] === dispatch ? t0 = $[1] : (t0 = (e) => {
|
|
2370
2370
|
let checked = e.target.checked;
|
|
2371
2371
|
dispatch(debugActions.setBadConnection(checked));
|
|
@@ -2427,10 +2427,10 @@ const DebugControls = () => {
|
|
|
2427
2427
|
})
|
|
2428
2428
|
}), $[13] = t5, $[14] = t8, $[15] = t9) : t9 = $[15], t9;
|
|
2429
2429
|
};
|
|
2430
|
-
function _temp$
|
|
2430
|
+
function _temp$20(state) {
|
|
2431
2431
|
return state.debug.badConnection;
|
|
2432
2432
|
}
|
|
2433
|
-
function _temp2$
|
|
2433
|
+
function _temp2$13(state_0) {
|
|
2434
2434
|
return state_0.debug.enabled;
|
|
2435
2435
|
}
|
|
2436
2436
|
function localizedStringSchema(locales) {
|
|
@@ -3047,7 +3047,7 @@ const getAssetResolution = (asset) => `${asset.metadata.dimensions.width}x${asse
|
|
|
3047
3047
|
let t4;
|
|
3048
3048
|
return $[11] !== t2 || $[12] !== t3 ? (t4 = /* @__PURE__ */ jsxs(Fragment, { children: [t2, t3] }), $[11] = t2, $[12] = t3, $[13] = t4) : t4 = $[13], t4;
|
|
3049
3049
|
}, FormFieldInputTags = (props) => {
|
|
3050
|
-
let $ = c(23), { control, description, disabled, error, label, name, onCreateTag, options, placeholder, value } = props, scheme = useColorSchemeValue(), creating = useTypedSelector(_temp$
|
|
3050
|
+
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;
|
|
3051
3051
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { zIndex: 2 }, $[0] = t0) : t0 = $[0];
|
|
3052
3052
|
let t1;
|
|
3053
3053
|
$[1] !== description || $[2] !== error || $[3] !== label || $[4] !== name ? (t1 = /* @__PURE__ */ jsx(FormFieldInputLabel, {
|
|
@@ -3090,10 +3090,10 @@ const getAssetResolution = (asset) => `${asset.metadata.dimensions.width}x${asse
|
|
|
3090
3090
|
children: [t1, t3]
|
|
3091
3091
|
}), $[20] = t1, $[21] = t3, $[22] = t4) : t4 = $[22], t4;
|
|
3092
3092
|
};
|
|
3093
|
-
function _temp$
|
|
3093
|
+
function _temp$19(state) {
|
|
3094
3094
|
return state.tags.creating;
|
|
3095
3095
|
}
|
|
3096
|
-
function _temp2$
|
|
3096
|
+
function _temp2$12(state_0) {
|
|
3097
3097
|
return state_0.tags.fetching;
|
|
3098
3098
|
}
|
|
3099
3099
|
function _temp3$5() {
|
|
@@ -3310,7 +3310,7 @@ const DialogAssetEdit = (props) => {
|
|
|
3310
3310
|
title: makeLocaleObj(asset?.title)
|
|
3311
3311
|
};
|
|
3312
3312
|
}
|
|
3313
|
-
let flattenField = _temp2$
|
|
3313
|
+
let flattenField = _temp2$11;
|
|
3314
3314
|
return {
|
|
3315
3315
|
altText: flattenField(asset?.altText),
|
|
3316
3316
|
creditLine: flattenField(asset?.creditLine),
|
|
@@ -3659,11 +3659,11 @@ const DialogAssetEdit = (props) => {
|
|
|
3659
3659
|
children: [t42, children]
|
|
3660
3660
|
}), $[119] = children, $[120] = handleClose, $[121] = id, $[122] = t31, $[123] = t42, $[124] = t43) : t43 = $[124], t43;
|
|
3661
3661
|
};
|
|
3662
|
-
function _temp$
|
|
3662
|
+
function _temp$18(v) {
|
|
3663
3663
|
return v;
|
|
3664
3664
|
}
|
|
3665
|
-
function _temp2$
|
|
3666
|
-
return typeof field_0 == "string" ? field_0 : typeof field_0 == "object" && field_0 && Object.values(field_0).find(_temp$
|
|
3665
|
+
function _temp2$11(field_0) {
|
|
3666
|
+
return typeof field_0 == "string" ? field_0 : typeof field_0 == "object" && field_0 && Object.values(field_0).find(_temp$18) || "";
|
|
3667
3667
|
}
|
|
3668
3668
|
function _temp3$4(v_0) {
|
|
3669
3669
|
return typeof v_0 == "object" && !!v_0 && !Array.isArray(v_0);
|
|
@@ -3776,7 +3776,7 @@ const DialogConfirm = (props) => {
|
|
|
3776
3776
|
children: [t2, children]
|
|
3777
3777
|
}), $[3] = children, $[4] = handleClose, $[5] = id, $[6] = t3) : t3 = $[6], t3;
|
|
3778
3778
|
}, DialogTagCreate = (props) => {
|
|
3779
|
-
let $ = c(37), { children, dialog: t0 } = props, { id } = t0, dispatch = useDispatch(), creating = useTypedSelector(_temp$
|
|
3779
|
+
let $ = c(37), { children, dialog: t0 } = props, { id } = t0, dispatch = useDispatch(), creating = useTypedSelector(_temp$17), creatingError = useTypedSelector(_temp2$10), t1;
|
|
3780
3780
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = { name: "" }, $[0] = t1) : t1 = $[0];
|
|
3781
3781
|
let t2;
|
|
3782
3782
|
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {
|
|
@@ -3847,16 +3847,16 @@ const DialogConfirm = (props) => {
|
|
|
3847
3847
|
children: [t15, children]
|
|
3848
3848
|
}), $[31] = children, $[32] = handleClose, $[33] = id, $[34] = t15, $[35] = t9, $[36] = t16) : t16 = $[36], t16;
|
|
3849
3849
|
};
|
|
3850
|
-
function _temp$
|
|
3850
|
+
function _temp$17(state) {
|
|
3851
3851
|
return state.tags.creating;
|
|
3852
3852
|
}
|
|
3853
|
-
function _temp2$
|
|
3853
|
+
function _temp2$10(state_0) {
|
|
3854
3854
|
return state_0.tags.creatingError;
|
|
3855
3855
|
}
|
|
3856
3856
|
const DialogTagEdit = (props) => {
|
|
3857
3857
|
let $ = c(64), { children, dialog: t0 } = props, { id, tagId } = t0, client = useVersionedClient(), dispatch = useDispatch(), t1;
|
|
3858
3858
|
$[0] === tagId ? t1 = $[1] : (t1 = (state) => selectTagById(state, String(tagId)), $[0] = tagId, $[1] = t1);
|
|
3859
|
-
let tagItem = useTypedSelector(t1), [tagSnapshot, setTagSnapshot] = useState(tagItem?.tag), currentTag = tagItem ? tagItem?.tag : tagSnapshot, generateDefaultValues = _temp$
|
|
3859
|
+
let tagItem = useTypedSelector(t1), [tagSnapshot, setTagSnapshot] = useState(tagItem?.tag), currentTag = tagItem ? tagItem?.tag : tagSnapshot, generateDefaultValues = _temp$16, t2 = tagItem?.tag, t3;
|
|
3860
3860
|
$[2] === t2 ? t3 = $[3] : (t3 = generateDefaultValues(t2), $[2] = t2, $[3] = t3);
|
|
3861
3861
|
let t4;
|
|
3862
3862
|
$[4] === Symbol.for("react.memo_cache_sentinel") ? (t4 = zodFormResolver(tagFormSchema), $[4] = t4) : t4 = $[4];
|
|
@@ -3991,7 +3991,7 @@ const DialogTagEdit = (props) => {
|
|
|
3991
3991
|
children: [t25, children]
|
|
3992
3992
|
}), $[58] = children, $[59] = handleClose, $[60] = id, $[61] = t18, $[62] = t25, $[63] = t26) : t26 = $[63], t26;
|
|
3993
3993
|
};
|
|
3994
|
-
function _temp$
|
|
3994
|
+
function _temp$16(tag) {
|
|
3995
3995
|
return { name: tag?.name?.current || "" };
|
|
3996
3996
|
}
|
|
3997
3997
|
const TagContainer = styled(Flex).withConfig({
|
|
@@ -4178,7 +4178,7 @@ const TagContainer = styled(Flex).withConfig({
|
|
|
4178
4178
|
}), TagsVirtualized = () => {
|
|
4179
4179
|
let $ = c(15), assetsPicked = useTypedSelector(selectAssetsPicked), tags = useTypedSelector(selectTags), [isScrolling, setIsScrolling] = useState(!1), items;
|
|
4180
4180
|
if ($[0] !== assetsPicked || $[1] !== tags) {
|
|
4181
|
-
let pickedTagIds = assetsPicked?.reduce(_temp2$
|
|
4181
|
+
let pickedTagIds = assetsPicked?.reduce(_temp2$9, []), pickedTagIdsUnique = [...new Set(pickedTagIds)], t0;
|
|
4182
4182
|
$[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);
|
|
4183
4183
|
let tagIdsSegmented = pickedTagIdsUnique.reduce(t0, {
|
|
4184
4184
|
appliedToAll: [],
|
|
@@ -4223,11 +4223,11 @@ const TagContainer = styled(Flex).withConfig({
|
|
|
4223
4223
|
totalCount: items.length
|
|
4224
4224
|
}), $[11] = items.length, $[12] = t0, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
|
|
4225
4225
|
};
|
|
4226
|
-
function _temp$
|
|
4226
|
+
function _temp$15(tag) {
|
|
4227
4227
|
return tag._ref;
|
|
4228
4228
|
}
|
|
4229
|
-
function _temp2$
|
|
4230
|
-
let assetTagIds = val?.asset?.opt?.media?.tags?.map(_temp$
|
|
4229
|
+
function _temp2$9(acc, val) {
|
|
4230
|
+
let assetTagIds = val?.asset?.opt?.media?.tags?.map(_temp$15) || [];
|
|
4231
4231
|
return acc = acc.concat(assetTagIds), acc;
|
|
4232
4232
|
}
|
|
4233
4233
|
function _temp3$3(tagItem) {
|
|
@@ -4275,7 +4275,7 @@ function _temp6(tagItem_2) {
|
|
|
4275
4275
|
};
|
|
4276
4276
|
}
|
|
4277
4277
|
const TagViewHeader = (t0) => {
|
|
4278
|
-
let $ = c(22), { allowCreate, light, title } = t0, scheme = useColorSchemeValue(), dispatch = useDispatch(), tagsCreating = useTypedSelector(_temp$
|
|
4278
|
+
let $ = c(22), { allowCreate, light, title } = t0, scheme = useColorSchemeValue(), dispatch = useDispatch(), tagsCreating = useTypedSelector(_temp$14), tagsFetching = useTypedSelector(_temp2$8), t1;
|
|
4279
4279
|
$[0] === dispatch ? t1 = $[1] : (t1 = () => {
|
|
4280
4280
|
dispatch(DIALOG_ACTIONS.showTagCreate());
|
|
4281
4281
|
}, $[0] = dispatch, $[1] = t1);
|
|
@@ -4328,14 +4328,14 @@ const TagViewHeader = (t0) => {
|
|
|
4328
4328
|
children: [t6, t7]
|
|
4329
4329
|
}) }), $[18] = t3, $[19] = t6, $[20] = t7, $[21] = t8) : t8 = $[21], t8;
|
|
4330
4330
|
};
|
|
4331
|
-
function _temp$
|
|
4331
|
+
function _temp$14(state) {
|
|
4332
4332
|
return state.tags.creating;
|
|
4333
4333
|
}
|
|
4334
|
-
function _temp2$
|
|
4334
|
+
function _temp2$8(state_0) {
|
|
4335
4335
|
return state_0.tags.fetching;
|
|
4336
4336
|
}
|
|
4337
4337
|
const TagView = () => {
|
|
4338
|
-
let $ = c(12), numPickedAssets = useTypedSelector(selectAssetsPickedLength), tags = useTypedSelector(selectTags), fetching = useTypedSelector(_temp$
|
|
4338
|
+
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;
|
|
4339
4339
|
$[0] !== hasPicked || $[1] !== t0 ? (t1 = /* @__PURE__ */ jsx(TagViewHeader, {
|
|
4340
4340
|
allowCreate: !0,
|
|
4341
4341
|
light: hasPicked,
|
|
@@ -4364,10 +4364,10 @@ const TagView = () => {
|
|
|
4364
4364
|
]
|
|
4365
4365
|
}), $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4) : t4 = $[11], t4;
|
|
4366
4366
|
};
|
|
4367
|
-
function _temp$
|
|
4367
|
+
function _temp$13(state) {
|
|
4368
4368
|
return state.tags.fetching;
|
|
4369
4369
|
}
|
|
4370
|
-
function _temp2$
|
|
4370
|
+
function _temp2$7(state_0) {
|
|
4371
4371
|
return state_0.tags.fetchCount;
|
|
4372
4372
|
}
|
|
4373
4373
|
const DialogTags = (props) => {
|
|
@@ -4393,7 +4393,7 @@ const DialogTags = (props) => {
|
|
|
4393
4393
|
children: [t2, children]
|
|
4394
4394
|
}), $[3] = children, $[4] = handleClose, $[5] = id, $[6] = t3) : t3 = $[6], t3;
|
|
4395
4395
|
}, Dialogs = () => {
|
|
4396
|
-
let $ = c(2), currentDialogs = useTypedSelector(_temp$
|
|
4396
|
+
let $ = c(2), currentDialogs = useTypedSelector(_temp$12), t0;
|
|
4397
4397
|
if ($[0] !== currentDialogs) {
|
|
4398
4398
|
let renderDialogs = (dialogs, index) => {
|
|
4399
4399
|
if (dialogs.length === 0 || index >= dialogs.length) return null;
|
|
@@ -4422,7 +4422,7 @@ const DialogTags = (props) => {
|
|
|
4422
4422
|
} else t0 = $[1];
|
|
4423
4423
|
return t0;
|
|
4424
4424
|
};
|
|
4425
|
-
function _temp$
|
|
4425
|
+
function _temp$12(state) {
|
|
4426
4426
|
return state.dialog.items;
|
|
4427
4427
|
}
|
|
4428
4428
|
const DropzoneDispatchContext = createContext(void 0), DropzoneDispatchProvider = (props) => {
|
|
@@ -4438,7 +4438,7 @@ const DropzoneDispatchContext = createContext(void 0), DropzoneDispatchProvider
|
|
|
4438
4438
|
if (context === void 0) throw Error("useDropzoneActions must be used within an DropzoneDispatchProvider");
|
|
4439
4439
|
return context;
|
|
4440
4440
|
}, Header = (props) => {
|
|
4441
|
-
let $ = c(23), { onClose } = props, { open } = useDropzoneActions(), { onSelect } = useAssetSourceActions(), assetTypes = useTypedSelector(_temp$
|
|
4441
|
+
let $ = c(23), { onClose } = props, { open } = useDropzoneActions(), { onSelect } = useAssetSourceActions(), assetTypes = useTypedSelector(_temp$11), selectedDocument = useTypedSelector(_temp2$6), { directUploads } = useToolOptions(), t0;
|
|
4442
4442
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { whiteSpace: "nowrap" }, $[0] = t0) : t0 = $[0];
|
|
4443
4443
|
let t1;
|
|
4444
4444
|
$[1] !== assetTypes || $[2] !== onSelect ? (t1 = onSelect ? `Insert ${assetTypes.join(" or ")}` : "Browse Assets", $[1] = assetTypes, $[2] = onSelect, $[3] = t1) : t1 = $[3];
|
|
@@ -4506,45 +4506,12 @@ const DropzoneDispatchContext = createContext(void 0), DropzoneDispatchProvider
|
|
|
4506
4506
|
})
|
|
4507
4507
|
}), $[20] = t4, $[21] = t7, $[22] = t8) : t8 = $[22], t8;
|
|
4508
4508
|
};
|
|
4509
|
-
function _temp$
|
|
4509
|
+
function _temp$11(state) {
|
|
4510
4510
|
return state.assets.assetTypes;
|
|
4511
4511
|
}
|
|
4512
|
-
function _temp2$
|
|
4512
|
+
function _temp2$6(state_0) {
|
|
4513
4513
|
return state_0.selected.document;
|
|
4514
4514
|
}
|
|
4515
|
-
const useBreakpointIndex = () => {
|
|
4516
|
-
let $ = c(6), getBreakpointIndex, mediaQueryLists, t0, t1;
|
|
4517
|
-
$[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]);
|
|
4518
|
-
let [value, setValue] = t0(t1), t2, t3;
|
|
4519
|
-
return $[4] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => {
|
|
4520
|
-
let handleBreakpoint = () => {
|
|
4521
|
-
setValue(getBreakpointIndex);
|
|
4522
|
-
};
|
|
4523
|
-
return mediaQueryLists.forEach((mql_0) => {
|
|
4524
|
-
try {
|
|
4525
|
-
mql_0.addEventListener("change", handleBreakpoint);
|
|
4526
|
-
} catch {
|
|
4527
|
-
try {
|
|
4528
|
-
mql_0.addListener(handleBreakpoint);
|
|
4529
|
-
} catch {}
|
|
4530
|
-
}
|
|
4531
|
-
}), () => {
|
|
4532
|
-
try {
|
|
4533
|
-
mediaQueryLists.forEach((mql_2) => mql_2.removeEventListener("change", handleBreakpoint));
|
|
4534
|
-
} catch {
|
|
4535
|
-
try {
|
|
4536
|
-
mediaQueryLists.forEach((mql_1) => mql_1.removeListener(handleBreakpoint));
|
|
4537
|
-
} catch {}
|
|
4538
|
-
}
|
|
4539
|
-
};
|
|
4540
|
-
}, t3 = [], $[4] = t2, $[5] = t3) : (t2 = $[4], t3 = $[5]), useEffect(t2, t3), value;
|
|
4541
|
-
};
|
|
4542
|
-
function _temp$11(width) {
|
|
4543
|
-
return window.matchMedia(`(max-width: ${width}px)`);
|
|
4544
|
-
}
|
|
4545
|
-
function _temp2$6(mql) {
|
|
4546
|
-
return mql.matches;
|
|
4547
|
-
}
|
|
4548
4515
|
const selectCombinedItems = createSelector([(state) => state.assets.allIds, (state) => state.uploads.allIds], (assetIds, uploadIds) => {
|
|
4549
4516
|
let assetItems = assetIds.map((id) => ({
|
|
4550
4517
|
id,
|
|
@@ -5842,18 +5809,18 @@ function _temp3$2() {
|
|
|
5842
5809
|
return /* @__PURE__ */ jsx(TableHeader, {});
|
|
5843
5810
|
}
|
|
5844
5811
|
const Items = () => {
|
|
5845
|
-
let $ = c(14), dispatch = useDispatch(), fetchCount = useTypedSelector(_temp$4), fetching = useTypedSelector(_temp2$2), tagsPanelVisible = useTypedSelector(_temp3$1), view = useTypedSelector(_temp4), combinedItems = useTypedSelector(selectCombinedItems),
|
|
5812
|
+
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;
|
|
5846
5813
|
$[0] !== dispatch || $[1] !== fetching ? (t0 = () => {
|
|
5847
5814
|
fetching || dispatch(assetsActions.loadNextPage());
|
|
5848
5815
|
}, $[0] = dispatch, $[1] = fetching, $[2] = t0) : t0 = $[2];
|
|
5849
5816
|
let handleLoadMoreItems = t0, t1, t2;
|
|
5850
|
-
$[3] !==
|
|
5851
|
-
|
|
5817
|
+
$[3] !== dispatch || $[4] !== mediaIndex || $[5] !== tagsPanelVisible ? (t1 = () => {
|
|
5818
|
+
mediaIndex <= 1 && tagsPanelVisible && dispatch(tagsActions.panelVisibleSet({ panelVisible: !1 }));
|
|
5852
5819
|
}, t2 = [
|
|
5853
|
-
breakpointIndex,
|
|
5854
5820
|
dispatch,
|
|
5821
|
+
mediaIndex,
|
|
5855
5822
|
tagsPanelVisible
|
|
5856
|
-
], $[3] =
|
|
5823
|
+
], $[3] = dispatch, $[4] = mediaIndex, $[5] = tagsPanelVisible, $[6] = t1, $[7] = t2) : (t1 = $[6], t2 = $[7]), useEffect(t1, t2);
|
|
5857
5824
|
let isEmpty = !hasItems && hasFetchedOnce && !fetching, t3;
|
|
5858
5825
|
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t3 = { width: "100%" }, $[8] = t3) : t3 = $[8];
|
|
5859
5826
|
let t4;
|