sanity-plugin-media 6.4.0 → 6.5.0
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 +183 -157
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -378,9 +378,20 @@ const useTypedSelector = useSelector, useVersionedClient = () => {
|
|
|
378
378
|
type: "number",
|
|
379
379
|
value: 400
|
|
380
380
|
}
|
|
381
|
-
}
|
|
381
|
+
};
|
|
382
|
+
/**
|
|
383
|
+
* Wildcard `match` pattern for text the user typed.
|
|
384
|
+
*
|
|
385
|
+
* `JSON.stringify` produces a GROQ string literal, the same way folder ids are
|
|
386
|
+
* embedded. Interpolating into `'*...*'` lets `'` or `\` end or rewrite the
|
|
387
|
+
* literal, so the query no longer parses.
|
|
388
|
+
*/
|
|
389
|
+
function groqWildcardMatch(term) {
|
|
390
|
+
return JSON.stringify(`*${term}*`);
|
|
391
|
+
}
|
|
392
|
+
const operators = {
|
|
382
393
|
doesNotInclude: {
|
|
383
|
-
fn: (value, field) => value ? `!(${field} match
|
|
394
|
+
fn: (value, field) => value ? `!(${field} match ${groqWildcardMatch(String(value))})` : void 0,
|
|
384
395
|
label: "does not include"
|
|
385
396
|
},
|
|
386
397
|
doesNotReference: {
|
|
@@ -405,7 +416,7 @@ const useTypedSelector = useSelector, useVersionedClient = () => {
|
|
|
405
416
|
label: "is greater than or equal to"
|
|
406
417
|
},
|
|
407
418
|
includes: {
|
|
408
|
-
fn: (value, field) => value ? `${field} match
|
|
419
|
+
fn: (value, field) => value ? `${field} match ${groqWildcardMatch(String(value))}` : void 0,
|
|
409
420
|
label: "includes"
|
|
410
421
|
},
|
|
411
422
|
is: {
|
|
@@ -527,7 +538,7 @@ const useTypedSelector = useSelector, useVersionedClient = () => {
|
|
|
527
538
|
baseFilter,
|
|
528
539
|
...excludeMediaLibraryFragment ? [excludeMediaLibraryFragment] : [],
|
|
529
540
|
...excludeTagsFragment ? [excludeTagsFragment] : [],
|
|
530
|
-
...searchQuery ? [groq`[_id, altText, assetId, creditLine, description, originalFilename, title, url] match
|
|
541
|
+
...searchQuery ? [groq`[_id, altText, assetId, creditLine, description, originalFilename, title, url] match ${groqWildcardMatch(searchQuery.trim())}`] : [],
|
|
531
542
|
...folderFilter ? [folderFilter] : [],
|
|
532
543
|
...searchFacetFragments
|
|
533
544
|
].join(" && ");
|
|
@@ -1910,38 +1921,42 @@ const ButtonAssetCopy = (t0) => {
|
|
|
1910
1921
|
children: t5
|
|
1911
1922
|
}), $[8] = popoverProps, $[9] = popoverVisible, $[10] = t5, $[11] = t6) : t6 = $[11], t6;
|
|
1912
1923
|
}, Row = (t0) => {
|
|
1913
|
-
let $ = c(
|
|
1914
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
1924
|
+
let $ = c(15), { label, value, wrap: t1 } = t0, wrap = t1 !== void 0 && t1, t2 = wrap ? "flex-start" : "center", t3;
|
|
1925
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
|
|
1915
1926
|
opacity: .8,
|
|
1916
1927
|
width: "40%"
|
|
1917
|
-
}, $[0] =
|
|
1918
|
-
let
|
|
1919
|
-
$[1] === label ?
|
|
1928
|
+
}, $[0] = t3) : t3 = $[0];
|
|
1929
|
+
let t4;
|
|
1930
|
+
$[1] === label ? t4 = $[2] : (t4 = /* @__PURE__ */ jsx(Text, {
|
|
1920
1931
|
size: 1,
|
|
1921
|
-
style:
|
|
1932
|
+
style: t3,
|
|
1922
1933
|
textOverflow: "ellipsis",
|
|
1923
1934
|
children: label
|
|
1924
|
-
}), $[1] = label, $[2] =
|
|
1925
|
-
let
|
|
1926
|
-
$[3]
|
|
1935
|
+
}), $[1] = label, $[2] = t4);
|
|
1936
|
+
let t5 = wrap ? "anywhere" : void 0, t6 = wrap ? "all" : void 0, t7;
|
|
1937
|
+
$[3] !== t5 || $[4] !== t6 ? (t7 = {
|
|
1927
1938
|
opacity: .4,
|
|
1939
|
+
overflowWrap: t5,
|
|
1928
1940
|
textAlign: "right",
|
|
1941
|
+
userSelect: t6,
|
|
1929
1942
|
width: "60%"
|
|
1930
|
-
}, $[3] =
|
|
1931
|
-
let
|
|
1932
|
-
$[
|
|
1943
|
+
}, $[3] = t5, $[4] = t6, $[5] = t7) : t7 = $[5];
|
|
1944
|
+
let t8 = wrap ? void 0 : "ellipsis", t9 = typeof value == "string" ? value : void 0, t10;
|
|
1945
|
+
$[6] !== t7 || $[7] !== t8 || $[8] !== t9 || $[9] !== value ? (t10 = /* @__PURE__ */ jsx(Text, {
|
|
1933
1946
|
size: 1,
|
|
1934
|
-
style:
|
|
1935
|
-
textOverflow:
|
|
1947
|
+
style: t7,
|
|
1948
|
+
textOverflow: t8,
|
|
1949
|
+
title: t9,
|
|
1936
1950
|
children: value
|
|
1937
|
-
}), $[
|
|
1938
|
-
let
|
|
1939
|
-
return $[
|
|
1951
|
+
}), $[6] = t7, $[7] = t8, $[8] = t9, $[9] = value, $[10] = t10) : t10 = $[10];
|
|
1952
|
+
let t11;
|
|
1953
|
+
return $[11] !== t10 || $[12] !== t2 || $[13] !== t4 ? (t11 = /* @__PURE__ */ jsxs(Flex, {
|
|
1954
|
+
align: t2,
|
|
1940
1955
|
justify: "space-between",
|
|
1941
|
-
children: [
|
|
1942
|
-
}), $[
|
|
1956
|
+
children: [t4, t10]
|
|
1957
|
+
}), $[11] = t10, $[12] = t2, $[13] = t4, $[14] = t11) : t11 = $[14], t11;
|
|
1943
1958
|
}, AssetMetadata = (props) => {
|
|
1944
|
-
let $ = c(
|
|
1959
|
+
let $ = c(43), { asset, item } = props, exif = asset?.metadata?.exif, t0;
|
|
1945
1960
|
$[0] !== asset.originalFilename || $[1] !== asset.url ? (t0 = () => {
|
|
1946
1961
|
window.location.href = `${asset.url}?dl=${asset.originalFilename}`;
|
|
1947
1962
|
}, $[0] = asset.originalFilename, $[1] = asset.url, $[2] = t0) : t0 = $[2];
|
|
@@ -1980,18 +1995,25 @@ const ButtonAssetCopy = (t0) => {
|
|
|
1980
1995
|
value: t9
|
|
1981
1996
|
}), $[17] = t9, $[18] = t10);
|
|
1982
1997
|
let t11;
|
|
1983
|
-
$[19]
|
|
1998
|
+
$[19] === asset._id ? t11 = $[20] : (t11 = /* @__PURE__ */ jsx(Row, {
|
|
1999
|
+
label: "Asset ID",
|
|
2000
|
+
value: asset._id,
|
|
2001
|
+
wrap: !0
|
|
2002
|
+
}), $[19] = asset._id, $[20] = t11);
|
|
2003
|
+
let t12;
|
|
2004
|
+
$[21] !== t10 || $[22] !== t11 || $[23] !== t3 || $[24] !== t5 || $[25] !== t7 || $[26] !== t8 ? (t12 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Stack, {
|
|
1984
2005
|
gap: 3,
|
|
1985
2006
|
children: [
|
|
1986
2007
|
t3,
|
|
1987
2008
|
t5,
|
|
1988
2009
|
t7,
|
|
1989
2010
|
t8,
|
|
1990
|
-
t10
|
|
2011
|
+
t10,
|
|
2012
|
+
t11
|
|
1991
2013
|
]
|
|
1992
|
-
}) }), $[
|
|
1993
|
-
let
|
|
1994
|
-
$[
|
|
2014
|
+
}) }), $[21] = t10, $[22] = t11, $[23] = t3, $[24] = t5, $[25] = t7, $[26] = t8, $[27] = t12) : t12 = $[27];
|
|
2015
|
+
let t13;
|
|
2016
|
+
$[28] === exif ? t13 = $[29] : (t13 = exif && (exif.DateTimeOriginal || exif.FNumber || exif.FocalLength || exif.ExposureTime || exif.ISO) && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Box, {
|
|
1995
2017
|
marginY: 4,
|
|
1996
2018
|
style: {
|
|
1997
2019
|
background: "var(--card-border-color)",
|
|
@@ -2022,38 +2044,38 @@ const ButtonAssetCopy = (t0) => {
|
|
|
2022
2044
|
value: format(new Date(exif.DateTimeOriginal), "PPp")
|
|
2023
2045
|
})
|
|
2024
2046
|
]
|
|
2025
|
-
}) })] }), $[
|
|
2026
|
-
let
|
|
2027
|
-
$[
|
|
2028
|
-
disabled:
|
|
2047
|
+
}) })] }), $[28] = exif, $[29] = t13);
|
|
2048
|
+
let t14 = !item || item?.updating, t15;
|
|
2049
|
+
$[30] !== handleDownload || $[31] !== t14 ? (t15 = /* @__PURE__ */ jsx(Button, {
|
|
2050
|
+
disabled: t14,
|
|
2029
2051
|
fontSize: 1,
|
|
2030
2052
|
icon: DownloadIcon,
|
|
2031
2053
|
mode: "ghost",
|
|
2032
2054
|
onClick: handleDownload,
|
|
2033
2055
|
text: "Download"
|
|
2034
|
-
}), $[
|
|
2035
|
-
let
|
|
2036
|
-
$[
|
|
2037
|
-
disabled:
|
|
2056
|
+
}), $[30] = handleDownload, $[31] = t14, $[32] = t15) : t15 = $[32];
|
|
2057
|
+
let t16 = !item || item?.updating, t17;
|
|
2058
|
+
$[33] !== asset.url || $[34] !== t16 ? (t17 = /* @__PURE__ */ jsx(ButtonAssetCopy, {
|
|
2059
|
+
disabled: t16,
|
|
2038
2060
|
url: asset.url
|
|
2039
|
-
}), $[
|
|
2040
|
-
let
|
|
2041
|
-
$[
|
|
2061
|
+
}), $[33] = asset.url, $[34] = t16, $[35] = t17) : t17 = $[35];
|
|
2062
|
+
let t18;
|
|
2063
|
+
$[36] !== t15 || $[37] !== t17 ? (t18 = /* @__PURE__ */ jsx(Box, {
|
|
2042
2064
|
marginTop: 5,
|
|
2043
2065
|
children: /* @__PURE__ */ jsxs(Inline, {
|
|
2044
2066
|
gap: 2,
|
|
2045
|
-
children: [
|
|
2067
|
+
children: [t15, t17]
|
|
2046
2068
|
})
|
|
2047
|
-
}), $[
|
|
2048
|
-
let
|
|
2049
|
-
return $[
|
|
2069
|
+
}), $[36] = t15, $[37] = t17, $[38] = t18) : t18 = $[38];
|
|
2070
|
+
let t19;
|
|
2071
|
+
return $[39] !== t12 || $[40] !== t13 || $[41] !== t18 ? (t19 = /* @__PURE__ */ jsxs(Box, {
|
|
2050
2072
|
marginTop: 3,
|
|
2051
2073
|
children: [
|
|
2052
|
-
t11,
|
|
2053
2074
|
t12,
|
|
2054
|
-
|
|
2075
|
+
t13,
|
|
2076
|
+
t18
|
|
2055
2077
|
]
|
|
2056
|
-
}), $[
|
|
2078
|
+
}), $[39] = t12, $[40] = t13, $[41] = t18, $[42] = t19) : t19 = $[42], t19;
|
|
2057
2079
|
}, Dialog$1 = (props) => {
|
|
2058
2080
|
let $ = c(3), t0;
|
|
2059
2081
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { position: "fixed" }, $[0] = t0) : t0 = $[0];
|
|
@@ -4216,7 +4238,7 @@ const DialogAllAssets = (props) => {
|
|
|
4216
4238
|
children: [t8, children]
|
|
4217
4239
|
}), $[25] = children, $[26] = handleClose, $[27] = t4, $[28] = t5, $[29] = t8, $[30] = t9) : t9 = $[30], t9;
|
|
4218
4240
|
}, DialogFolderCreate = (props) => {
|
|
4219
|
-
let $ = c(
|
|
4241
|
+
let $ = c(42), { children, dialog: t0 } = props, { parentFolderId, id } = t0, dispatch = useDispatch(), creating = useTypedSelector(_temp$32), creatingError = useTypedSelector(_temp2$18), t1;
|
|
4220
4242
|
$[0] === parentFolderId ? t1 = $[1] : (t1 = (state_1) => selectFolderPathById(state_1, parentFolderId), $[0] = parentFolderId, $[1] = t1);
|
|
4221
4243
|
let parentPath = useTypedSelector(t1), t2;
|
|
4222
4244
|
$[2] === Symbol.for("react.memo_cache_sentinel") ? (t2 = { name: "" }, $[2] = t2) : t2 = $[2];
|
|
@@ -4242,68 +4264,68 @@ const DialogAllAssets = (props) => {
|
|
|
4242
4264
|
$[9] !== creatingError || $[10] !== setError ? (t7 = () => {
|
|
4243
4265
|
creatingError && setError("name", { message: creatingError.message });
|
|
4244
4266
|
}, t8 = [creatingError, setError], $[9] = creatingError, $[10] = setError, $[11] = t7, $[12] = t8) : (t7 = $[11], t8 = $[12]), useEffect(t7, t8);
|
|
4245
|
-
let t9;
|
|
4246
|
-
$[13] !==
|
|
4267
|
+
let t9 = creating || !isDirty || !isValid, t10;
|
|
4268
|
+
$[13] !== handleSubmit || $[14] !== onSubmit ? (t10 = handleSubmit(onSubmit), $[13] = handleSubmit, $[14] = onSubmit, $[15] = t10) : t10 = $[15];
|
|
4269
|
+
let t11;
|
|
4270
|
+
$[16] !== isValid || $[17] !== t10 || $[18] !== t9 ? (t11 = /* @__PURE__ */ jsx(Box, {
|
|
4247
4271
|
padding: 3,
|
|
4248
4272
|
children: /* @__PURE__ */ jsx(Flex, {
|
|
4249
4273
|
justify: "flex-end",
|
|
4250
4274
|
children: /* @__PURE__ */ jsx(FormSubmitButton, {
|
|
4251
|
-
disabled:
|
|
4275
|
+
disabled: t9,
|
|
4252
4276
|
isValid,
|
|
4253
|
-
onClick:
|
|
4277
|
+
onClick: t10
|
|
4254
4278
|
})
|
|
4255
4279
|
})
|
|
4256
|
-
}), $[
|
|
4257
|
-
let
|
|
4258
|
-
$[
|
|
4259
|
-
let
|
|
4260
|
-
$[
|
|
4261
|
-
let t12;
|
|
4262
|
-
$[24] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx("button", {
|
|
4280
|
+
}), $[16] = isValid, $[17] = t10, $[18] = t9, $[19] = t11) : t11 = $[19];
|
|
4281
|
+
let footer = t11, t12;
|
|
4282
|
+
$[20] !== handleSubmit || $[21] !== onSubmit ? (t12 = handleSubmit(onSubmit), $[20] = handleSubmit, $[21] = onSubmit, $[22] = t12) : t12 = $[22];
|
|
4283
|
+
let t13;
|
|
4284
|
+
$[23] === Symbol.for("react.memo_cache_sentinel") ? (t13 = /* @__PURE__ */ jsx("button", {
|
|
4263
4285
|
style: { display: "none" },
|
|
4264
4286
|
tabIndex: -1,
|
|
4265
4287
|
type: "submit"
|
|
4266
|
-
}), $[
|
|
4267
|
-
let
|
|
4268
|
-
$[
|
|
4288
|
+
}), $[23] = t13) : t13 = $[23];
|
|
4289
|
+
let t14;
|
|
4290
|
+
$[24] === parentPath ? t14 = $[25] : (t14 = parentPath && /* @__PURE__ */ jsx(Box, {
|
|
4269
4291
|
marginBottom: 3,
|
|
4270
4292
|
children: /* @__PURE__ */ jsxs(Text, {
|
|
4271
4293
|
muted: !0,
|
|
4272
4294
|
size: 1,
|
|
4273
4295
|
children: ["Creating inside ", parentPath]
|
|
4274
4296
|
})
|
|
4275
|
-
}), $[
|
|
4276
|
-
let
|
|
4277
|
-
$[
|
|
4278
|
-
let
|
|
4279
|
-
$[
|
|
4280
|
-
...
|
|
4297
|
+
}), $[24] = parentPath, $[25] = t14);
|
|
4298
|
+
let t15;
|
|
4299
|
+
$[26] === register ? t15 = $[27] : (t15 = register("name"), $[26] = register, $[27] = t15);
|
|
4300
|
+
let t16 = errors?.name?.message, t17;
|
|
4301
|
+
$[28] !== creating || $[29] !== t15 || $[30] !== t16 ? (t17 = /* @__PURE__ */ jsx(FormFieldInputText, {
|
|
4302
|
+
...t15,
|
|
4281
4303
|
disabled: creating,
|
|
4282
|
-
error:
|
|
4304
|
+
error: t16,
|
|
4283
4305
|
label: "Folder name",
|
|
4284
4306
|
name: "name"
|
|
4285
|
-
}), $[
|
|
4286
|
-
let
|
|
4287
|
-
$[
|
|
4307
|
+
}), $[28] = creating, $[29] = t15, $[30] = t16, $[31] = t17) : t17 = $[31];
|
|
4308
|
+
let t18;
|
|
4309
|
+
$[32] !== t12 || $[33] !== t14 || $[34] !== t17 ? (t18 = /* @__PURE__ */ jsxs(Box, {
|
|
4288
4310
|
as: "form",
|
|
4289
4311
|
padding: 4,
|
|
4290
|
-
onSubmit:
|
|
4312
|
+
onSubmit: t12,
|
|
4291
4313
|
children: [
|
|
4292
|
-
t12,
|
|
4293
4314
|
t13,
|
|
4294
|
-
|
|
4315
|
+
t14,
|
|
4316
|
+
t17
|
|
4295
4317
|
]
|
|
4296
|
-
}), $[
|
|
4297
|
-
let
|
|
4298
|
-
return $[
|
|
4318
|
+
}), $[32] = t12, $[33] = t14, $[34] = t17, $[35] = t18) : t18 = $[35];
|
|
4319
|
+
let t19;
|
|
4320
|
+
return $[36] !== children || $[37] !== footer || $[38] !== handleClose || $[39] !== id || $[40] !== t18 ? (t19 = /* @__PURE__ */ jsxs(Dialog$1, {
|
|
4299
4321
|
animate: !0,
|
|
4300
|
-
footer
|
|
4322
|
+
footer,
|
|
4301
4323
|
header: "Create Folder",
|
|
4302
4324
|
id,
|
|
4303
4325
|
onClose: handleClose,
|
|
4304
4326
|
width: 1,
|
|
4305
|
-
children: [
|
|
4306
|
-
}), $[
|
|
4327
|
+
children: [t18, children]
|
|
4328
|
+
}), $[36] = children, $[37] = footer, $[38] = handleClose, $[39] = id, $[40] = t18, $[41] = t19) : t19 = $[41], t19;
|
|
4307
4329
|
};
|
|
4308
4330
|
function _temp$32(state) {
|
|
4309
4331
|
return state.folders.creating;
|
|
@@ -5596,7 +5618,7 @@ const DialogSearchFacets = (props) => {
|
|
|
5596
5618
|
children: [t2, children]
|
|
5597
5619
|
}), $[3] = children, $[4] = handleClose, $[5] = id, $[6] = t3) : t3 = $[6], t3;
|
|
5598
5620
|
}, DialogTagCreate = (props) => {
|
|
5599
|
-
let $ = c(
|
|
5621
|
+
let $ = c(36), { children, dialog: t0 } = props, { id } = t0, dispatch = useDispatch(), creating = useTypedSelector(_temp$25), creatingError = useTypedSelector(_temp2$12), t1;
|
|
5600
5622
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = { name: "" }, $[0] = t1) : t1 = $[0];
|
|
5601
5623
|
let t2;
|
|
5602
5624
|
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {
|
|
@@ -5617,55 +5639,55 @@ const DialogSearchFacets = (props) => {
|
|
|
5617
5639
|
$[6] !== creatingError || $[7] !== setError ? (t6 = () => {
|
|
5618
5640
|
creatingError && setError("name", { message: creatingError?.message });
|
|
5619
5641
|
}, t7 = [creatingError, setError], $[6] = creatingError, $[7] = setError, $[8] = t6, $[9] = t7) : (t6 = $[8], t7 = $[9]), useEffect(t6, t7);
|
|
5620
|
-
let t8;
|
|
5621
|
-
$[10] !==
|
|
5642
|
+
let t8 = formUpdating || !isDirty || !isValid, t9;
|
|
5643
|
+
$[10] !== handleSubmit || $[11] !== onSubmit ? (t9 = handleSubmit(onSubmit), $[10] = handleSubmit, $[11] = onSubmit, $[12] = t9) : t9 = $[12];
|
|
5644
|
+
let t10;
|
|
5645
|
+
$[13] !== isValid || $[14] !== t8 || $[15] !== t9 ? (t10 = /* @__PURE__ */ jsx(Box, {
|
|
5622
5646
|
padding: 3,
|
|
5623
5647
|
children: /* @__PURE__ */ jsx(Flex, {
|
|
5624
5648
|
justify: "flex-end",
|
|
5625
5649
|
children: /* @__PURE__ */ jsx(FormSubmitButton, {
|
|
5626
|
-
disabled:
|
|
5650
|
+
disabled: t8,
|
|
5627
5651
|
isValid,
|
|
5628
|
-
onClick:
|
|
5652
|
+
onClick: t9
|
|
5629
5653
|
})
|
|
5630
5654
|
})
|
|
5631
|
-
}), $[
|
|
5632
|
-
let
|
|
5633
|
-
$[
|
|
5634
|
-
let
|
|
5635
|
-
$[
|
|
5636
|
-
let t11;
|
|
5637
|
-
$[21] === Symbol.for("react.memo_cache_sentinel") ? (t11 = /* @__PURE__ */ jsx("button", {
|
|
5655
|
+
}), $[13] = isValid, $[14] = t8, $[15] = t9, $[16] = t10) : t10 = $[16];
|
|
5656
|
+
let footer = t10, t11;
|
|
5657
|
+
$[17] !== handleSubmit || $[18] !== onSubmit ? (t11 = handleSubmit(onSubmit), $[17] = handleSubmit, $[18] = onSubmit, $[19] = t11) : t11 = $[19];
|
|
5658
|
+
let t12;
|
|
5659
|
+
$[20] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx("button", {
|
|
5638
5660
|
style: { display: "none" },
|
|
5639
5661
|
tabIndex: -1,
|
|
5640
5662
|
type: "submit"
|
|
5641
|
-
}), $[
|
|
5642
|
-
let
|
|
5643
|
-
$[
|
|
5644
|
-
let
|
|
5645
|
-
$[
|
|
5646
|
-
...
|
|
5663
|
+
}), $[20] = t12) : t12 = $[20];
|
|
5664
|
+
let t13;
|
|
5665
|
+
$[21] === register ? t13 = $[22] : (t13 = register("name"), $[21] = register, $[22] = t13);
|
|
5666
|
+
let t14 = errors?.name?.message, t15;
|
|
5667
|
+
$[23] !== formUpdating || $[24] !== t13 || $[25] !== t14 ? (t15 = /* @__PURE__ */ jsx(FormFieldInputText, {
|
|
5668
|
+
...t13,
|
|
5647
5669
|
disabled: formUpdating,
|
|
5648
|
-
error:
|
|
5670
|
+
error: t14,
|
|
5649
5671
|
label: "Name",
|
|
5650
5672
|
name: "name"
|
|
5651
|
-
}), $[
|
|
5652
|
-
let
|
|
5653
|
-
$[
|
|
5673
|
+
}), $[23] = formUpdating, $[24] = t13, $[25] = t14, $[26] = t15) : t15 = $[26];
|
|
5674
|
+
let t16;
|
|
5675
|
+
$[27] !== t11 || $[28] !== t15 ? (t16 = /* @__PURE__ */ jsxs(Box, {
|
|
5654
5676
|
as: "form",
|
|
5655
5677
|
padding: 4,
|
|
5656
|
-
onSubmit:
|
|
5657
|
-
children: [
|
|
5658
|
-
}), $[
|
|
5659
|
-
let
|
|
5660
|
-
return $[
|
|
5678
|
+
onSubmit: t11,
|
|
5679
|
+
children: [t12, t15]
|
|
5680
|
+
}), $[27] = t11, $[28] = t15, $[29] = t16) : t16 = $[29];
|
|
5681
|
+
let t17;
|
|
5682
|
+
return $[30] !== children || $[31] !== footer || $[32] !== handleClose || $[33] !== id || $[34] !== t16 ? (t17 = /* @__PURE__ */ jsxs(Dialog$1, {
|
|
5661
5683
|
animate: !0,
|
|
5662
|
-
footer
|
|
5684
|
+
footer,
|
|
5663
5685
|
header: "Create Tag",
|
|
5664
5686
|
id,
|
|
5665
5687
|
onClose: handleClose,
|
|
5666
5688
|
width: 1,
|
|
5667
|
-
children: [
|
|
5668
|
-
}), $[
|
|
5689
|
+
children: [t16, children]
|
|
5690
|
+
}), $[30] = children, $[31] = footer, $[32] = handleClose, $[33] = id, $[34] = t16, $[35] = t17) : t17 = $[35], t17;
|
|
5669
5691
|
};
|
|
5670
5692
|
function _temp$25(state) {
|
|
5671
5693
|
return state.tags.creating;
|
|
@@ -5674,7 +5696,7 @@ function _temp2$12(state_0) {
|
|
|
5674
5696
|
return state_0.tags.creatingError;
|
|
5675
5697
|
}
|
|
5676
5698
|
const DialogTagEdit = (props) => {
|
|
5677
|
-
let $ = c(
|
|
5699
|
+
let $ = c(68), { children, dialog: t0 } = props, { id, tagId } = t0, client = useVersionedClient(), dispatch = useDispatch(), t1;
|
|
5678
5700
|
$[0] === tagId ? t1 = $[1] : (t1 = (state) => selectTagById(state, String(tagId)), $[0] = tagId, $[1] = t1);
|
|
5679
5701
|
let tagItem = useTypedSelector(t1), [tagSnapshot, setTagSnapshot] = useState(tagItem?.tag), currentTag = tagItem ? tagItem?.tag : tagSnapshot, generateDefaultValues = _temp$24, t2 = tagItem?.tag, t3;
|
|
5680
5702
|
$[2] === t2 ? t3 = $[3] : (t3 = generateDefaultValues(t2), $[2] = t2, $[3] = t3);
|
|
@@ -5736,33 +5758,37 @@ const DialogTagEdit = (props) => {
|
|
|
5736
5758
|
t15
|
|
5737
5759
|
], $[28] = client, $[29] = handleTagUpdate, $[30] = t15, $[31] = t16) : t16 = $[31], useEffect(t14, t16);
|
|
5738
5760
|
let t17;
|
|
5739
|
-
$[32] !== formUpdating || $[33] !== handleDelete
|
|
5761
|
+
$[32] !== formUpdating || $[33] !== handleDelete ? (t17 = /* @__PURE__ */ jsx(Button, {
|
|
5762
|
+
disabled: formUpdating,
|
|
5763
|
+
fontSize: 1,
|
|
5764
|
+
mode: "bleed",
|
|
5765
|
+
onClick: handleDelete,
|
|
5766
|
+
text: "Delete",
|
|
5767
|
+
tone: "critical"
|
|
5768
|
+
}), $[32] = formUpdating, $[33] = handleDelete, $[34] = t17) : t17 = $[34];
|
|
5769
|
+
let t18 = formUpdating || !isDirty || !isValid, t19 = tagItem?.tag?._updatedAt, t20;
|
|
5770
|
+
$[35] !== handleSubmit || $[36] !== onSubmit ? (t20 = handleSubmit(onSubmit), $[35] = handleSubmit, $[36] = onSubmit, $[37] = t20) : t20 = $[37];
|
|
5771
|
+
let t21;
|
|
5772
|
+
$[38] !== isValid || $[39] !== t18 || $[40] !== t19 || $[41] !== t20 ? (t21 = /* @__PURE__ */ jsx(FormSubmitButton, {
|
|
5773
|
+
disabled: t18,
|
|
5774
|
+
isValid,
|
|
5775
|
+
lastUpdated: t19,
|
|
5776
|
+
onClick: t20
|
|
5777
|
+
}), $[38] = isValid, $[39] = t18, $[40] = t19, $[41] = t20, $[42] = t21) : t21 = $[42];
|
|
5778
|
+
let t22;
|
|
5779
|
+
$[43] !== t17 || $[44] !== t21 ? (t22 = /* @__PURE__ */ jsx(Box, {
|
|
5740
5780
|
padding: 3,
|
|
5741
5781
|
children: /* @__PURE__ */ jsxs(Flex, {
|
|
5742
5782
|
justify: "space-between",
|
|
5743
|
-
children: [
|
|
5744
|
-
disabled: formUpdating,
|
|
5745
|
-
fontSize: 1,
|
|
5746
|
-
mode: "bleed",
|
|
5747
|
-
onClick: handleDelete,
|
|
5748
|
-
text: "Delete",
|
|
5749
|
-
tone: "critical"
|
|
5750
|
-
}), /* @__PURE__ */ jsx(FormSubmitButton, {
|
|
5751
|
-
disabled: formUpdating || !isDirty || !isValid,
|
|
5752
|
-
isValid,
|
|
5753
|
-
lastUpdated: tagItem?.tag?._updatedAt,
|
|
5754
|
-
onClick: handleSubmit(onSubmit)
|
|
5755
|
-
})]
|
|
5783
|
+
children: [t17, t21]
|
|
5756
5784
|
})
|
|
5757
|
-
}), $[
|
|
5758
|
-
let
|
|
5785
|
+
}), $[43] = t17, $[44] = t21, $[45] = t22) : t22 = $[45];
|
|
5786
|
+
let footer = t22;
|
|
5759
5787
|
if (!currentTag) return null;
|
|
5760
|
-
let
|
|
5761
|
-
$[
|
|
5762
|
-
let
|
|
5763
|
-
$[
|
|
5764
|
-
let t20;
|
|
5765
|
-
$[45] === tagItem ? t20 = $[46] : (t20 = !tagItem && /* @__PURE__ */ jsx(Card, {
|
|
5788
|
+
let t23;
|
|
5789
|
+
$[46] !== handleSubmit || $[47] !== onSubmit ? (t23 = handleSubmit(onSubmit), $[46] = handleSubmit, $[47] = onSubmit, $[48] = t23) : t23 = $[48];
|
|
5790
|
+
let t24;
|
|
5791
|
+
$[49] === tagItem ? t24 = $[50] : (t24 = !tagItem && /* @__PURE__ */ jsx(Card, {
|
|
5766
5792
|
marginBottom: 3,
|
|
5767
5793
|
padding: 3,
|
|
5768
5794
|
radius: 2,
|
|
@@ -5772,44 +5798,44 @@ const DialogTagEdit = (props) => {
|
|
|
5772
5798
|
size: 1,
|
|
5773
5799
|
children: "This tag cannot be found – it may have been deleted."
|
|
5774
5800
|
})
|
|
5775
|
-
}), $[
|
|
5776
|
-
let
|
|
5777
|
-
$[
|
|
5801
|
+
}), $[49] = tagItem, $[50] = t24);
|
|
5802
|
+
let t25;
|
|
5803
|
+
$[51] === Symbol.for("react.memo_cache_sentinel") ? (t25 = /* @__PURE__ */ jsx("button", {
|
|
5778
5804
|
style: { display: "none" },
|
|
5779
5805
|
tabIndex: -1,
|
|
5780
5806
|
type: "submit"
|
|
5781
|
-
}), $[
|
|
5782
|
-
let
|
|
5783
|
-
$[
|
|
5784
|
-
let
|
|
5785
|
-
$[
|
|
5786
|
-
...
|
|
5807
|
+
}), $[51] = t25) : t25 = $[51];
|
|
5808
|
+
let t26;
|
|
5809
|
+
$[52] === register ? t26 = $[53] : (t26 = register("name"), $[52] = register, $[53] = t26);
|
|
5810
|
+
let t27 = errors?.name?.message, t28;
|
|
5811
|
+
$[54] !== formUpdating || $[55] !== t26 || $[56] !== t27 ? (t28 = /* @__PURE__ */ jsx(FormFieldInputText, {
|
|
5812
|
+
...t26,
|
|
5787
5813
|
disabled: formUpdating,
|
|
5788
|
-
error:
|
|
5814
|
+
error: t27,
|
|
5789
5815
|
label: "Name",
|
|
5790
5816
|
name: "name"
|
|
5791
|
-
}), $[
|
|
5792
|
-
let
|
|
5793
|
-
$[
|
|
5817
|
+
}), $[54] = formUpdating, $[55] = t26, $[56] = t27, $[57] = t28) : t28 = $[57];
|
|
5818
|
+
let t29;
|
|
5819
|
+
$[58] !== t23 || $[59] !== t24 || $[60] !== t28 ? (t29 = /* @__PURE__ */ jsxs(Box, {
|
|
5794
5820
|
as: "form",
|
|
5795
5821
|
padding: 4,
|
|
5796
|
-
onSubmit:
|
|
5822
|
+
onSubmit: t23,
|
|
5797
5823
|
children: [
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5824
|
+
t24,
|
|
5825
|
+
t25,
|
|
5826
|
+
t28
|
|
5801
5827
|
]
|
|
5802
|
-
}), $[
|
|
5803
|
-
let
|
|
5804
|
-
return $[
|
|
5828
|
+
}), $[58] = t23, $[59] = t24, $[60] = t28, $[61] = t29) : t29 = $[61];
|
|
5829
|
+
let t30;
|
|
5830
|
+
return $[62] !== children || $[63] !== footer || $[64] !== handleClose || $[65] !== id || $[66] !== t29 ? (t30 = /* @__PURE__ */ jsxs(Dialog$1, {
|
|
5805
5831
|
animate: !0,
|
|
5806
|
-
footer
|
|
5832
|
+
footer,
|
|
5807
5833
|
header: "Edit Tag",
|
|
5808
5834
|
id,
|
|
5809
5835
|
onClose: handleClose,
|
|
5810
5836
|
width: 1,
|
|
5811
|
-
children: [
|
|
5812
|
-
}), $[
|
|
5837
|
+
children: [t29, children]
|
|
5838
|
+
}), $[62] = children, $[63] = footer, $[64] = handleClose, $[65] = id, $[66] = t29, $[67] = t30) : t30 = $[67], t30;
|
|
5813
5839
|
};
|
|
5814
5840
|
function _temp$24(tag) {
|
|
5815
5841
|
return { name: tag?.name?.current || "" };
|