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 CHANGED
@@ -378,9 +378,20 @@ const useTypedSelector = useSelector, useVersionedClient = () => {
378
378
  type: "number",
379
379
  value: 400
380
380
  }
381
- }, operators = {
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 '*${value}*')` : void 0,
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 '*${value}*'` : void 0,
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 '*${searchQuery.trim()}*'`] : [],
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(9), { label, value } = t0, t1;
1914
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = {
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] = t1) : t1 = $[0];
1918
- let t2;
1919
- $[1] === label ? t2 = $[2] : (t2 = /* @__PURE__ */ jsx(Text, {
1928
+ }, $[0] = t3) : t3 = $[0];
1929
+ let t4;
1930
+ $[1] === label ? t4 = $[2] : (t4 = /* @__PURE__ */ jsx(Text, {
1920
1931
  size: 1,
1921
- style: t1,
1932
+ style: t3,
1922
1933
  textOverflow: "ellipsis",
1923
1934
  children: label
1924
- }), $[1] = label, $[2] = t2);
1925
- let t3;
1926
- $[3] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
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] = t3) : t3 = $[3];
1931
- let t4;
1932
- $[4] === value ? t4 = $[5] : (t4 = /* @__PURE__ */ jsx(Text, {
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: t3,
1935
- textOverflow: "ellipsis",
1947
+ style: t7,
1948
+ textOverflow: t8,
1949
+ title: t9,
1936
1950
  children: value
1937
- }), $[4] = value, $[5] = t4);
1938
- let t5;
1939
- return $[6] !== t2 || $[7] !== t4 ? (t5 = /* @__PURE__ */ jsxs(Flex, {
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: [t2, t4]
1942
- }), $[6] = t2, $[7] = t4, $[8] = t5) : t5 = $[8], t5;
1956
+ children: [t4, t10]
1957
+ }), $[11] = t10, $[12] = t2, $[13] = t4, $[14] = t11) : t11 = $[14], t11;
1943
1958
  }, AssetMetadata = (props) => {
1944
- let $ = c(40), { asset, item } = props, exif = asset?.metadata?.exif, t0;
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] !== t10 || $[20] !== t3 || $[21] !== t5 || $[22] !== t7 || $[23] !== t8 ? (t11 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Stack, {
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
- }) }), $[19] = t10, $[20] = t3, $[21] = t5, $[22] = t7, $[23] = t8, $[24] = t11) : t11 = $[24];
1993
- let t12;
1994
- $[25] === exif ? t12 = $[26] : (t12 = exif && (exif.DateTimeOriginal || exif.FNumber || exif.FocalLength || exif.ExposureTime || exif.ISO) && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Box, {
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
- }) })] }), $[25] = exif, $[26] = t12);
2026
- let t13 = !item || item?.updating, t14;
2027
- $[27] !== handleDownload || $[28] !== t13 ? (t14 = /* @__PURE__ */ jsx(Button, {
2028
- disabled: t13,
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
- }), $[27] = handleDownload, $[28] = t13, $[29] = t14) : t14 = $[29];
2035
- let t15 = !item || item?.updating, t16;
2036
- $[30] !== asset.url || $[31] !== t15 ? (t16 = /* @__PURE__ */ jsx(ButtonAssetCopy, {
2037
- disabled: t15,
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
- }), $[30] = asset.url, $[31] = t15, $[32] = t16) : t16 = $[32];
2040
- let t17;
2041
- $[33] !== t14 || $[34] !== t16 ? (t17 = /* @__PURE__ */ jsx(Box, {
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: [t14, t16]
2067
+ children: [t15, t17]
2046
2068
  })
2047
- }), $[33] = t14, $[34] = t16, $[35] = t17) : t17 = $[35];
2048
- let t18;
2049
- return $[36] !== t11 || $[37] !== t12 || $[38] !== t17 ? (t18 = /* @__PURE__ */ jsxs(Box, {
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
- t17
2075
+ t13,
2076
+ t18
2055
2077
  ]
2056
- }), $[36] = t11, $[37] = t12, $[38] = t17, $[39] = t18) : t18 = $[39], t18;
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(43), { children, dialog: t0 } = props, { parentFolderId, id } = t0, dispatch = useDispatch(), creating = useTypedSelector(_temp$32), creatingError = useTypedSelector(_temp2$18), t1;
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] !== creating || $[14] !== handleSubmit || $[15] !== isDirty || $[16] !== isValid || $[17] !== onSubmit ? (t9 = () => /* @__PURE__ */ jsx(Box, {
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: creating || !isDirty || !isValid,
4275
+ disabled: t9,
4252
4276
  isValid,
4253
- onClick: handleSubmit(onSubmit)
4277
+ onClick: t10
4254
4278
  })
4255
4279
  })
4256
- }), $[13] = creating, $[14] = handleSubmit, $[15] = isDirty, $[16] = isValid, $[17] = onSubmit, $[18] = t9) : t9 = $[18];
4257
- let Footer = t9, t10;
4258
- $[19] === Footer ? t10 = $[20] : (t10 = /* @__PURE__ */ jsx(Footer, {}), $[19] = Footer, $[20] = t10);
4259
- let t11;
4260
- $[21] !== handleSubmit || $[22] !== onSubmit ? (t11 = handleSubmit(onSubmit), $[21] = handleSubmit, $[22] = onSubmit, $[23] = t11) : t11 = $[23];
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
- }), $[24] = t12) : t12 = $[24];
4267
- let t13;
4268
- $[25] === parentPath ? t13 = $[26] : (t13 = parentPath && /* @__PURE__ */ jsx(Box, {
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
- }), $[25] = parentPath, $[26] = t13);
4276
- let t14;
4277
- $[27] === register ? t14 = $[28] : (t14 = register("name"), $[27] = register, $[28] = t14);
4278
- let t15 = errors?.name?.message, t16;
4279
- $[29] !== creating || $[30] !== t14 || $[31] !== t15 ? (t16 = /* @__PURE__ */ jsx(FormFieldInputText, {
4280
- ...t14,
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: t15,
4304
+ error: t16,
4283
4305
  label: "Folder name",
4284
4306
  name: "name"
4285
- }), $[29] = creating, $[30] = t14, $[31] = t15, $[32] = t16) : t16 = $[32];
4286
- let t17;
4287
- $[33] !== t11 || $[34] !== t13 || $[35] !== t16 ? (t17 = /* @__PURE__ */ jsxs(Box, {
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: t11,
4312
+ onSubmit: t12,
4291
4313
  children: [
4292
- t12,
4293
4314
  t13,
4294
- t16
4315
+ t14,
4316
+ t17
4295
4317
  ]
4296
- }), $[33] = t11, $[34] = t13, $[35] = t16, $[36] = t17) : t17 = $[36];
4297
- let t18;
4298
- return $[37] !== children || $[38] !== handleClose || $[39] !== id || $[40] !== t10 || $[41] !== t17 ? (t18 = /* @__PURE__ */ jsxs(Dialog$1, {
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: t10,
4322
+ footer,
4301
4323
  header: "Create Folder",
4302
4324
  id,
4303
4325
  onClose: handleClose,
4304
4326
  width: 1,
4305
- children: [t17, children]
4306
- }), $[37] = children, $[38] = handleClose, $[39] = id, $[40] = t10, $[41] = t17, $[42] = t18) : t18 = $[42], t18;
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(37), { children, dialog: t0 } = props, { id } = t0, dispatch = useDispatch(), creating = useTypedSelector(_temp$25), creatingError = useTypedSelector(_temp2$12), t1;
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] !== formUpdating || $[11] !== handleSubmit || $[12] !== isDirty || $[13] !== isValid || $[14] !== onSubmit ? (t8 = () => /* @__PURE__ */ jsx(Box, {
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: formUpdating || !isDirty || !isValid,
5650
+ disabled: t8,
5627
5651
  isValid,
5628
- onClick: handleSubmit(onSubmit)
5652
+ onClick: t9
5629
5653
  })
5630
5654
  })
5631
- }), $[10] = formUpdating, $[11] = handleSubmit, $[12] = isDirty, $[13] = isValid, $[14] = onSubmit, $[15] = t8) : t8 = $[15];
5632
- let Footer = t8, t9;
5633
- $[16] === Footer ? t9 = $[17] : (t9 = /* @__PURE__ */ jsx(Footer, {}), $[16] = Footer, $[17] = t9);
5634
- let t10;
5635
- $[18] !== handleSubmit || $[19] !== onSubmit ? (t10 = handleSubmit(onSubmit), $[18] = handleSubmit, $[19] = onSubmit, $[20] = t10) : t10 = $[20];
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
- }), $[21] = t11) : t11 = $[21];
5642
- let t12;
5643
- $[22] === register ? t12 = $[23] : (t12 = register("name"), $[22] = register, $[23] = t12);
5644
- let t13 = errors?.name?.message, t14;
5645
- $[24] !== formUpdating || $[25] !== t12 || $[26] !== t13 ? (t14 = /* @__PURE__ */ jsx(FormFieldInputText, {
5646
- ...t12,
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: t13,
5670
+ error: t14,
5649
5671
  label: "Name",
5650
5672
  name: "name"
5651
- }), $[24] = formUpdating, $[25] = t12, $[26] = t13, $[27] = t14) : t14 = $[27];
5652
- let t15;
5653
- $[28] !== t10 || $[29] !== t14 ? (t15 = /* @__PURE__ */ jsxs(Box, {
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: t10,
5657
- children: [t11, t14]
5658
- }), $[28] = t10, $[29] = t14, $[30] = t15) : t15 = $[30];
5659
- let t16;
5660
- return $[31] !== children || $[32] !== handleClose || $[33] !== id || $[34] !== t15 || $[35] !== t9 ? (t16 = /* @__PURE__ */ jsxs(Dialog$1, {
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: t9,
5684
+ footer,
5663
5685
  header: "Create Tag",
5664
5686
  id,
5665
5687
  onClose: handleClose,
5666
5688
  width: 1,
5667
- children: [t15, children]
5668
- }), $[31] = children, $[32] = handleClose, $[33] = id, $[34] = t15, $[35] = t9, $[36] = t16) : t16 = $[36], t16;
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(64), { children, dialog: t0 } = props, { id, tagId } = t0, client = useVersionedClient(), dispatch = useDispatch(), t1;
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 || $[34] !== handleSubmit || $[35] !== isDirty || $[36] !== isValid || $[37] !== onSubmit || $[38] !== tagItem?.tag?._updatedAt ? (t17 = () => /* @__PURE__ */ jsx(Box, {
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: [/* @__PURE__ */ jsx(Button, {
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
- }), $[32] = formUpdating, $[33] = handleDelete, $[34] = handleSubmit, $[35] = isDirty, $[36] = isValid, $[37] = onSubmit, $[38] = tagItem?.tag?._updatedAt, $[39] = t17) : t17 = $[39];
5758
- let Footer = t17;
5785
+ }), $[43] = t17, $[44] = t21, $[45] = t22) : t22 = $[45];
5786
+ let footer = t22;
5759
5787
  if (!currentTag) return null;
5760
- let t18;
5761
- $[40] === Footer ? t18 = $[41] : (t18 = /* @__PURE__ */ jsx(Footer, {}), $[40] = Footer, $[41] = t18);
5762
- let t19;
5763
- $[42] !== handleSubmit || $[43] !== onSubmit ? (t19 = handleSubmit(onSubmit), $[42] = handleSubmit, $[43] = onSubmit, $[44] = t19) : t19 = $[44];
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
- }), $[45] = tagItem, $[46] = t20);
5776
- let t21;
5777
- $[47] === Symbol.for("react.memo_cache_sentinel") ? (t21 = /* @__PURE__ */ jsx("button", {
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
- }), $[47] = t21) : t21 = $[47];
5782
- let t22;
5783
- $[48] === register ? t22 = $[49] : (t22 = register("name"), $[48] = register, $[49] = t22);
5784
- let t23 = errors?.name?.message, t24;
5785
- $[50] !== formUpdating || $[51] !== t22 || $[52] !== t23 ? (t24 = /* @__PURE__ */ jsx(FormFieldInputText, {
5786
- ...t22,
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: t23,
5814
+ error: t27,
5789
5815
  label: "Name",
5790
5816
  name: "name"
5791
- }), $[50] = formUpdating, $[51] = t22, $[52] = t23, $[53] = t24) : t24 = $[53];
5792
- let t25;
5793
- $[54] !== t19 || $[55] !== t20 || $[56] !== t24 ? (t25 = /* @__PURE__ */ jsxs(Box, {
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: t19,
5822
+ onSubmit: t23,
5797
5823
  children: [
5798
- t20,
5799
- t21,
5800
- t24
5824
+ t24,
5825
+ t25,
5826
+ t28
5801
5827
  ]
5802
- }), $[54] = t19, $[55] = t20, $[56] = t24, $[57] = t25) : t25 = $[57];
5803
- let t26;
5804
- return $[58] !== children || $[59] !== handleClose || $[60] !== id || $[61] !== t18 || $[62] !== t25 ? (t26 = /* @__PURE__ */ jsxs(Dialog$1, {
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: t18,
5832
+ footer,
5807
5833
  header: "Edit Tag",
5808
5834
  id,
5809
5835
  onClose: handleClose,
5810
5836
  width: 1,
5811
- children: [t25, children]
5812
- }), $[58] = children, $[59] = handleClose, $[60] = id, $[61] = t18, $[62] = t25, $[63] = t26) : t26 = $[63], t26;
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 || "" };