sanity-plugin-media 6.3.5 → 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(35), { 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];
@@ -1973,17 +1988,32 @@ const ButtonAssetCopy = (t0) => {
1973
1988
  value: getAssetResolution(asset)
1974
1989
  }), $[13] = asset, $[14] = t8);
1975
1990
  let t9;
1976
- $[15] !== t3 || $[16] !== t5 || $[17] !== t7 || $[18] !== t8 ? (t9 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Stack, {
1991
+ $[15] === asset._createdAt ? t9 = $[16] : (t9 = format(new Date(asset._createdAt), "PPp"), $[15] = asset._createdAt, $[16] = t9);
1992
+ let t10;
1993
+ $[17] === t9 ? t10 = $[18] : (t10 = /* @__PURE__ */ jsx(Row, {
1994
+ label: "Uploaded",
1995
+ value: t9
1996
+ }), $[17] = t9, $[18] = t10);
1997
+ let t11;
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, {
1977
2005
  gap: 3,
1978
2006
  children: [
1979
2007
  t3,
1980
2008
  t5,
1981
2009
  t7,
1982
- t8
2010
+ t8,
2011
+ t10,
2012
+ t11
1983
2013
  ]
1984
- }) }), $[15] = t3, $[16] = t5, $[17] = t7, $[18] = t8, $[19] = t9) : t9 = $[19];
1985
- let t10;
1986
- $[20] === exif ? t10 = $[21] : (t10 = 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, {
1987
2017
  marginY: 4,
1988
2018
  style: {
1989
2019
  background: "var(--card-border-color)",
@@ -2014,38 +2044,38 @@ const ButtonAssetCopy = (t0) => {
2014
2044
  value: format(new Date(exif.DateTimeOriginal), "PPp")
2015
2045
  })
2016
2046
  ]
2017
- }) })] }), $[20] = exif, $[21] = t10);
2018
- let t11 = !item || item?.updating, t12;
2019
- $[22] !== handleDownload || $[23] !== t11 ? (t12 = /* @__PURE__ */ jsx(Button, {
2020
- disabled: t11,
2047
+ }) })] }), $[28] = exif, $[29] = t13);
2048
+ let t14 = !item || item?.updating, t15;
2049
+ $[30] !== handleDownload || $[31] !== t14 ? (t15 = /* @__PURE__ */ jsx(Button, {
2050
+ disabled: t14,
2021
2051
  fontSize: 1,
2022
2052
  icon: DownloadIcon,
2023
2053
  mode: "ghost",
2024
2054
  onClick: handleDownload,
2025
2055
  text: "Download"
2026
- }), $[22] = handleDownload, $[23] = t11, $[24] = t12) : t12 = $[24];
2027
- let t13 = !item || item?.updating, t14;
2028
- $[25] !== asset.url || $[26] !== t13 ? (t14 = /* @__PURE__ */ jsx(ButtonAssetCopy, {
2029
- disabled: t13,
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,
2030
2060
  url: asset.url
2031
- }), $[25] = asset.url, $[26] = t13, $[27] = t14) : t14 = $[27];
2032
- let t15;
2033
- $[28] !== t12 || $[29] !== t14 ? (t15 = /* @__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, {
2034
2064
  marginTop: 5,
2035
2065
  children: /* @__PURE__ */ jsxs(Inline, {
2036
2066
  gap: 2,
2037
- children: [t12, t14]
2067
+ children: [t15, t17]
2038
2068
  })
2039
- }), $[28] = t12, $[29] = t14, $[30] = t15) : t15 = $[30];
2040
- let t16;
2041
- return $[31] !== t10 || $[32] !== t15 || $[33] !== t9 ? (t16 = /* @__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, {
2042
2072
  marginTop: 3,
2043
2073
  children: [
2044
- t9,
2045
- t10,
2046
- t15
2074
+ t12,
2075
+ t13,
2076
+ t18
2047
2077
  ]
2048
- }), $[31] = t10, $[32] = t15, $[33] = t9, $[34] = t16) : t16 = $[34], t16;
2078
+ }), $[39] = t12, $[40] = t13, $[41] = t18, $[42] = t19) : t19 = $[42], t19;
2049
2079
  }, Dialog$1 = (props) => {
2050
2080
  let $ = c(3), t0;
2051
2081
  $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { position: "fixed" }, $[0] = t0) : t0 = $[0];
@@ -3926,7 +3956,7 @@ const CardWrapper = styled(Flex).withConfig({
3926
3956
  return null;
3927
3957
  }), StyledItemContainer = styled.div.withConfig({
3928
3958
  displayName: "StyledItemContainer",
3929
- componentId: "sc-2rsg9t-0"
3959
+ componentId: "sc-fjxrlv-0"
3930
3960
  })`height:${220}px;width:${240}px;`, ItemContainer = (props) => {
3931
3961
  let $ = c(6), ref, rest;
3932
3962
  if ($[0] !== props) {
@@ -3940,7 +3970,7 @@ const CardWrapper = styled(Flex).withConfig({
3940
3970
  }), $[3] = ref, $[4] = rest, $[5] = t0) : t0 = $[5], t0;
3941
3971
  }, StyledListContainer = styled.div.withConfig({
3942
3972
  displayName: "StyledListContainer",
3943
- componentId: "sc-2rsg9t-1"
3973
+ componentId: "sc-fjxrlv-1"
3944
3974
  })`display:grid;grid-template-columns:repeat(auto-fill,${240}px);grid-template-rows:repeat(auto-fill,${220}px);justify-content:center;margin:0 auto;`, ListContainer = (props) => {
3945
3975
  let $ = c(6), ref, rest;
3946
3976
  if ($[0] !== props) {
@@ -3975,6 +4005,7 @@ const CardWrapper = styled(Flex).withConfig({
3975
4005
  }, $[5] = items, $[6] = selectedIds, $[7] = source, $[8] = t3) : t3 = $[8];
3976
4006
  let t4;
3977
4007
  $[9] === Symbol.for("react.memo_cache_sentinel") ? (t4 = {
4008
+ overflowAnchor: "none",
3978
4009
  overflowX: "hidden",
3979
4010
  overflowY: "scroll"
3980
4011
  }, $[9] = t4) : t4 = $[9];
@@ -4207,7 +4238,7 @@ const DialogAllAssets = (props) => {
4207
4238
  children: [t8, children]
4208
4239
  }), $[25] = children, $[26] = handleClose, $[27] = t4, $[28] = t5, $[29] = t8, $[30] = t9) : t9 = $[30], t9;
4209
4240
  }, DialogFolderCreate = (props) => {
4210
- 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;
4211
4242
  $[0] === parentFolderId ? t1 = $[1] : (t1 = (state_1) => selectFolderPathById(state_1, parentFolderId), $[0] = parentFolderId, $[1] = t1);
4212
4243
  let parentPath = useTypedSelector(t1), t2;
4213
4244
  $[2] === Symbol.for("react.memo_cache_sentinel") ? (t2 = { name: "" }, $[2] = t2) : t2 = $[2];
@@ -4233,68 +4264,68 @@ const DialogAllAssets = (props) => {
4233
4264
  $[9] !== creatingError || $[10] !== setError ? (t7 = () => {
4234
4265
  creatingError && setError("name", { message: creatingError.message });
4235
4266
  }, t8 = [creatingError, setError], $[9] = creatingError, $[10] = setError, $[11] = t7, $[12] = t8) : (t7 = $[11], t8 = $[12]), useEffect(t7, t8);
4236
- let t9;
4237
- $[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, {
4238
4271
  padding: 3,
4239
4272
  children: /* @__PURE__ */ jsx(Flex, {
4240
4273
  justify: "flex-end",
4241
4274
  children: /* @__PURE__ */ jsx(FormSubmitButton, {
4242
- disabled: creating || !isDirty || !isValid,
4275
+ disabled: t9,
4243
4276
  isValid,
4244
- onClick: handleSubmit(onSubmit)
4277
+ onClick: t10
4245
4278
  })
4246
4279
  })
4247
- }), $[13] = creating, $[14] = handleSubmit, $[15] = isDirty, $[16] = isValid, $[17] = onSubmit, $[18] = t9) : t9 = $[18];
4248
- let Footer = t9, t10;
4249
- $[19] === Footer ? t10 = $[20] : (t10 = /* @__PURE__ */ jsx(Footer, {}), $[19] = Footer, $[20] = t10);
4250
- let t11;
4251
- $[21] !== handleSubmit || $[22] !== onSubmit ? (t11 = handleSubmit(onSubmit), $[21] = handleSubmit, $[22] = onSubmit, $[23] = t11) : t11 = $[23];
4252
- let t12;
4253
- $[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", {
4254
4285
  style: { display: "none" },
4255
4286
  tabIndex: -1,
4256
4287
  type: "submit"
4257
- }), $[24] = t12) : t12 = $[24];
4258
- let t13;
4259
- $[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, {
4260
4291
  marginBottom: 3,
4261
4292
  children: /* @__PURE__ */ jsxs(Text, {
4262
4293
  muted: !0,
4263
4294
  size: 1,
4264
4295
  children: ["Creating inside ", parentPath]
4265
4296
  })
4266
- }), $[25] = parentPath, $[26] = t13);
4267
- let t14;
4268
- $[27] === register ? t14 = $[28] : (t14 = register("name"), $[27] = register, $[28] = t14);
4269
- let t15 = errors?.name?.message, t16;
4270
- $[29] !== creating || $[30] !== t14 || $[31] !== t15 ? (t16 = /* @__PURE__ */ jsx(FormFieldInputText, {
4271
- ...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,
4272
4303
  disabled: creating,
4273
- error: t15,
4304
+ error: t16,
4274
4305
  label: "Folder name",
4275
4306
  name: "name"
4276
- }), $[29] = creating, $[30] = t14, $[31] = t15, $[32] = t16) : t16 = $[32];
4277
- let t17;
4278
- $[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, {
4279
4310
  as: "form",
4280
4311
  padding: 4,
4281
- onSubmit: t11,
4312
+ onSubmit: t12,
4282
4313
  children: [
4283
- t12,
4284
4314
  t13,
4285
- t16
4315
+ t14,
4316
+ t17
4286
4317
  ]
4287
- }), $[33] = t11, $[34] = t13, $[35] = t16, $[36] = t17) : t17 = $[36];
4288
- let t18;
4289
- 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, {
4290
4321
  animate: !0,
4291
- footer: t10,
4322
+ footer,
4292
4323
  header: "Create Folder",
4293
4324
  id,
4294
4325
  onClose: handleClose,
4295
4326
  width: 1,
4296
- children: [t17, children]
4297
- }), $[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;
4298
4329
  };
4299
4330
  function _temp$32(state) {
4300
4331
  return state.folders.creating;
@@ -5587,7 +5618,7 @@ const DialogSearchFacets = (props) => {
5587
5618
  children: [t2, children]
5588
5619
  }), $[3] = children, $[4] = handleClose, $[5] = id, $[6] = t3) : t3 = $[6], t3;
5589
5620
  }, DialogTagCreate = (props) => {
5590
- 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;
5591
5622
  $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = { name: "" }, $[0] = t1) : t1 = $[0];
5592
5623
  let t2;
5593
5624
  $[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {
@@ -5608,55 +5639,55 @@ const DialogSearchFacets = (props) => {
5608
5639
  $[6] !== creatingError || $[7] !== setError ? (t6 = () => {
5609
5640
  creatingError && setError("name", { message: creatingError?.message });
5610
5641
  }, t7 = [creatingError, setError], $[6] = creatingError, $[7] = setError, $[8] = t6, $[9] = t7) : (t6 = $[8], t7 = $[9]), useEffect(t6, t7);
5611
- let t8;
5612
- $[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, {
5613
5646
  padding: 3,
5614
5647
  children: /* @__PURE__ */ jsx(Flex, {
5615
5648
  justify: "flex-end",
5616
5649
  children: /* @__PURE__ */ jsx(FormSubmitButton, {
5617
- disabled: formUpdating || !isDirty || !isValid,
5650
+ disabled: t8,
5618
5651
  isValid,
5619
- onClick: handleSubmit(onSubmit)
5652
+ onClick: t9
5620
5653
  })
5621
5654
  })
5622
- }), $[10] = formUpdating, $[11] = handleSubmit, $[12] = isDirty, $[13] = isValid, $[14] = onSubmit, $[15] = t8) : t8 = $[15];
5623
- let Footer = t8, t9;
5624
- $[16] === Footer ? t9 = $[17] : (t9 = /* @__PURE__ */ jsx(Footer, {}), $[16] = Footer, $[17] = t9);
5625
- let t10;
5626
- $[18] !== handleSubmit || $[19] !== onSubmit ? (t10 = handleSubmit(onSubmit), $[18] = handleSubmit, $[19] = onSubmit, $[20] = t10) : t10 = $[20];
5627
- let t11;
5628
- $[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", {
5629
5660
  style: { display: "none" },
5630
5661
  tabIndex: -1,
5631
5662
  type: "submit"
5632
- }), $[21] = t11) : t11 = $[21];
5633
- let t12;
5634
- $[22] === register ? t12 = $[23] : (t12 = register("name"), $[22] = register, $[23] = t12);
5635
- let t13 = errors?.name?.message, t14;
5636
- $[24] !== formUpdating || $[25] !== t12 || $[26] !== t13 ? (t14 = /* @__PURE__ */ jsx(FormFieldInputText, {
5637
- ...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,
5638
5669
  disabled: formUpdating,
5639
- error: t13,
5670
+ error: t14,
5640
5671
  label: "Name",
5641
5672
  name: "name"
5642
- }), $[24] = formUpdating, $[25] = t12, $[26] = t13, $[27] = t14) : t14 = $[27];
5643
- let t15;
5644
- $[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, {
5645
5676
  as: "form",
5646
5677
  padding: 4,
5647
- onSubmit: t10,
5648
- children: [t11, t14]
5649
- }), $[28] = t10, $[29] = t14, $[30] = t15) : t15 = $[30];
5650
- let t16;
5651
- 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, {
5652
5683
  animate: !0,
5653
- footer: t9,
5684
+ footer,
5654
5685
  header: "Create Tag",
5655
5686
  id,
5656
5687
  onClose: handleClose,
5657
5688
  width: 1,
5658
- children: [t15, children]
5659
- }), $[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;
5660
5691
  };
5661
5692
  function _temp$25(state) {
5662
5693
  return state.tags.creating;
@@ -5665,7 +5696,7 @@ function _temp2$12(state_0) {
5665
5696
  return state_0.tags.creatingError;
5666
5697
  }
5667
5698
  const DialogTagEdit = (props) => {
5668
- 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;
5669
5700
  $[0] === tagId ? t1 = $[1] : (t1 = (state) => selectTagById(state, String(tagId)), $[0] = tagId, $[1] = t1);
5670
5701
  let tagItem = useTypedSelector(t1), [tagSnapshot, setTagSnapshot] = useState(tagItem?.tag), currentTag = tagItem ? tagItem?.tag : tagSnapshot, generateDefaultValues = _temp$24, t2 = tagItem?.tag, t3;
5671
5702
  $[2] === t2 ? t3 = $[3] : (t3 = generateDefaultValues(t2), $[2] = t2, $[3] = t3);
@@ -5727,33 +5758,37 @@ const DialogTagEdit = (props) => {
5727
5758
  t15
5728
5759
  ], $[28] = client, $[29] = handleTagUpdate, $[30] = t15, $[31] = t16) : t16 = $[31], useEffect(t14, t16);
5729
5760
  let t17;
5730
- $[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, {
5731
5780
  padding: 3,
5732
5781
  children: /* @__PURE__ */ jsxs(Flex, {
5733
5782
  justify: "space-between",
5734
- children: [/* @__PURE__ */ jsx(Button, {
5735
- disabled: formUpdating,
5736
- fontSize: 1,
5737
- mode: "bleed",
5738
- onClick: handleDelete,
5739
- text: "Delete",
5740
- tone: "critical"
5741
- }), /* @__PURE__ */ jsx(FormSubmitButton, {
5742
- disabled: formUpdating || !isDirty || !isValid,
5743
- isValid,
5744
- lastUpdated: tagItem?.tag?._updatedAt,
5745
- onClick: handleSubmit(onSubmit)
5746
- })]
5783
+ children: [t17, t21]
5747
5784
  })
5748
- }), $[32] = formUpdating, $[33] = handleDelete, $[34] = handleSubmit, $[35] = isDirty, $[36] = isValid, $[37] = onSubmit, $[38] = tagItem?.tag?._updatedAt, $[39] = t17) : t17 = $[39];
5749
- let Footer = t17;
5785
+ }), $[43] = t17, $[44] = t21, $[45] = t22) : t22 = $[45];
5786
+ let footer = t22;
5750
5787
  if (!currentTag) return null;
5751
- let t18;
5752
- $[40] === Footer ? t18 = $[41] : (t18 = /* @__PURE__ */ jsx(Footer, {}), $[40] = Footer, $[41] = t18);
5753
- let t19;
5754
- $[42] !== handleSubmit || $[43] !== onSubmit ? (t19 = handleSubmit(onSubmit), $[42] = handleSubmit, $[43] = onSubmit, $[44] = t19) : t19 = $[44];
5755
- let t20;
5756
- $[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, {
5757
5792
  marginBottom: 3,
5758
5793
  padding: 3,
5759
5794
  radius: 2,
@@ -5763,44 +5798,44 @@ const DialogTagEdit = (props) => {
5763
5798
  size: 1,
5764
5799
  children: "This tag cannot be found – it may have been deleted."
5765
5800
  })
5766
- }), $[45] = tagItem, $[46] = t20);
5767
- let t21;
5768
- $[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", {
5769
5804
  style: { display: "none" },
5770
5805
  tabIndex: -1,
5771
5806
  type: "submit"
5772
- }), $[47] = t21) : t21 = $[47];
5773
- let t22;
5774
- $[48] === register ? t22 = $[49] : (t22 = register("name"), $[48] = register, $[49] = t22);
5775
- let t23 = errors?.name?.message, t24;
5776
- $[50] !== formUpdating || $[51] !== t22 || $[52] !== t23 ? (t24 = /* @__PURE__ */ jsx(FormFieldInputText, {
5777
- ...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,
5778
5813
  disabled: formUpdating,
5779
- error: t23,
5814
+ error: t27,
5780
5815
  label: "Name",
5781
5816
  name: "name"
5782
- }), $[50] = formUpdating, $[51] = t22, $[52] = t23, $[53] = t24) : t24 = $[53];
5783
- let t25;
5784
- $[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, {
5785
5820
  as: "form",
5786
5821
  padding: 4,
5787
- onSubmit: t19,
5822
+ onSubmit: t23,
5788
5823
  children: [
5789
- t20,
5790
- t21,
5791
- t24
5824
+ t24,
5825
+ t25,
5826
+ t28
5792
5827
  ]
5793
- }), $[54] = t19, $[55] = t20, $[56] = t24, $[57] = t25) : t25 = $[57];
5794
- let t26;
5795
- 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, {
5796
5831
  animate: !0,
5797
- footer: t18,
5832
+ footer,
5798
5833
  header: "Edit Tag",
5799
5834
  id,
5800
5835
  onClose: handleClose,
5801
5836
  width: 1,
5802
- children: [t25, children]
5803
- }), $[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;
5804
5839
  };
5805
5840
  function _temp$24(tag) {
5806
5841
  return { name: tag?.name?.current || "" };