sanity-plugin-media 2.3.1 → 2.3.2

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
@@ -4186,6 +4186,16 @@ const inputs = {
4186
4186
  type: "string",
4187
4187
  value: ""
4188
4188
  },
4189
+ creditLine: {
4190
+ assetTypes: ["file", "image"],
4191
+ field: "creditLine",
4192
+ name: "creditLine",
4193
+ operatorType: "empty",
4194
+ operatorTypes: ["empty", "notEmpty", null, "includes", "doesNotInclude"],
4195
+ title: "Credit",
4196
+ type: "string",
4197
+ value: ""
4198
+ },
4189
4199
  description: {
4190
4200
  assetTypes: ["file", "image"],
4191
4201
  field: "description",
@@ -4454,7 +4464,7 @@ null, {
4454
4464
  direction: "asc",
4455
4465
  field: "size"
4456
4466
  }];
4457
- const FACETS = [inputs.tag, divider, inputs.inUse, inputs.inCurrentDocument, divider, inputs.title, inputs.altText, inputs.description, divider, inputs.isOpaque, divider, inputs.fileName, inputs.size, inputs.type, divider, inputs.orientation, inputs.width, inputs.height];
4467
+ const FACETS = [inputs.tag, divider, inputs.inUse, inputs.inCurrentDocument, divider, inputs.title, inputs.altText, inputs.creditLine, inputs.description, divider, inputs.isOpaque, divider, inputs.fileName, inputs.size, inputs.type, divider, inputs.orientation, inputs.width, inputs.height];
4458
4468
  const GRID_TEMPLATE_COLUMNS = {
4459
4469
  SMALL: "3rem 100px auto 1.5rem",
4460
4470
  LARGE: "3rem 100px auto 5.5rem 5.5rem 3.5rem 8.5rem 4.75rem 2rem"
@@ -4603,7 +4613,7 @@ const constructFilter = _ref => {
4603
4613
  // NOTE: Currently this only searches direct fields on sanity.fileAsset/sanity.imageAsset and NOT referenced tags
4604
4614
  // It's possible to add this by adding the following line to the searchQuery, but it's quite slow
4605
4615
  // references(*[_type == "media.tag" && name.current == "${searchQuery.trim()}"]._id)
4606
- ...(searchQuery ? [groq__default.default(_b$a || (_b$a = __template$j(["[_id, altText, assetId, description, originalFilename, title, url] match '*", "*'"])), searchQuery.trim())] : []),
4616
+ ...(searchQuery ? [groq__default.default(_b$a || (_b$a = __template$j(["[_id, altText, assetId, creditLine, description, originalFilename, title, url] match '*", "*'"])), searchQuery.trim())] : []),
4607
4617
  // Search facets
4608
4618
  ...searchFacetFragments].join(" && ");
4609
4619
  return constructedQuery;
@@ -5425,7 +5435,7 @@ const assetsSlice = toolkit.createSlice({
5425
5435
  sort = groq__default.default(_a$g || (_a$g = __template$g(["order(_updatedAt desc)"])))
5426
5436
  } = _ref19;
5427
5437
  const pipe = sort || selector ? "|" : "";
5428
- const query = groq__default.default(_b$8 || (_b$8 = __template$g(['\n {\n "items": *[', "] {\n _id,\n _type,\n _createdAt,\n _updatedAt,\n altText,\n description,\n extension,\n metadata {\n dimensions,\n exif,\n isOpaque,\n },\n mimeType,\n opt {\n media\n },\n originalFilename,\n size,\n title,\n url\n } ", " ", " ", ",\n }\n "])), queryFilter, pipe, sort, selector);
5438
+ const query = groq__default.default(_b$8 || (_b$8 = __template$g(['\n {\n "items": *[', "] {\n _id,\n _type,\n _createdAt,\n _updatedAt,\n altText,\n creditLine,\n description,\n extension,\n metadata {\n dimensions,\n exif,\n isOpaque,\n },\n mimeType,\n opt {\n media\n },\n originalFilename,\n size,\n source {\n name\n },\n title,\n url\n } ", " ", " ", ",\n }\n "])), queryFilter, pipe, sort, selector);
5429
5439
  return {
5430
5440
  payload: {
5431
5441
  params,
@@ -7267,14 +7277,55 @@ const SearchFacets = props => {
7267
7277
  }
7268
7278
  throw Error("Invalid layout");
7269
7279
  };
7280
+ const ToolOptionsContext = react.createContext(null);
7281
+ const ToolOptionsProvider = _ref43 => {
7282
+ let {
7283
+ options,
7284
+ children
7285
+ } = _ref43;
7286
+ var _a, _b;
7287
+ const value = react.useMemo(() => {
7288
+ var _a2, _b2, _c, _d;
7289
+ let creditLineExcludeSources;
7290
+ if ((_a2 = options == null ? void 0 : options.creditLine) == null ? void 0 : _a2.excludeSources) {
7291
+ creditLineExcludeSources = Array.isArray((_b2 = options == null ? void 0 : options.creditLine) == null ? void 0 : _b2.excludeSources) ? options.creditLine.excludeSources : [(_c = options == null ? void 0 : options.creditLine) == null ? void 0 : _c.excludeSources];
7292
+ }
7293
+ return {
7294
+ dropzone: {
7295
+ maxSize: options == null ? void 0 : options.maximumUploadSize
7296
+ },
7297
+ creditLine: {
7298
+ enabled: ((_d = options == null ? void 0 : options.creditLine) == null ? void 0 : _d.enabled) || false,
7299
+ excludeSources: creditLineExcludeSources
7300
+ }
7301
+ };
7302
+ }, [(_a = options == null ? void 0 : options.creditLine) == null ? void 0 : _a.enabled, (_b = options == null ? void 0 : options.creditLine) == null ? void 0 : _b.excludeSources, options == null ? void 0 : options.maximumUploadSize]);
7303
+ return /* @__PURE__ */jsxRuntime.jsx(ToolOptionsContext.Provider, {
7304
+ value,
7305
+ children
7306
+ });
7307
+ };
7308
+ const useToolOptions = () => {
7309
+ const context = react.useContext(ToolOptionsContext);
7310
+ if (!context) {
7311
+ throw new Error("useToolOptions must be used within an ToolOptionsProvider");
7312
+ }
7313
+ return context;
7314
+ };
7270
7315
  const SearchFacetsControl = () => {
7271
7316
  const dispatch = reactRedux.useDispatch();
7272
7317
  const assetTypes = useTypedSelector(state => state.assets.assetTypes);
7273
7318
  const searchFacets = useTypedSelector(state => state.search.facets);
7274
7319
  const selectedDocument = useTypedSelector(state => state.selected.document);
7275
7320
  const popoverProps = usePortalPopoverProps();
7321
+ const {
7322
+ creditLine
7323
+ } = useToolOptions();
7276
7324
  const isTool = !selectedDocument;
7277
7325
  const filteredFacets = FACETS.filter(facet => {
7326
+ if (!(creditLine == null ? void 0 : creditLine.enabled) && (facet == null ? void 0 : facet.type) === "string" && (facet == null ? void 0 : facet.name) === "creditLine") {
7327
+ return false;
7328
+ }
7278
7329
  if (facet.type === "group" || facet.type === "divider") {
7279
7330
  return true;
7280
7331
  }
@@ -7603,6 +7654,7 @@ const tagOptionSchema = z__namespace.object({
7603
7654
  });
7604
7655
  const assetFormSchema = z__namespace.object({
7605
7656
  altText: z__namespace.string().trim().optional(),
7657
+ creditLine: z__namespace.string().trim().optional(),
7606
7658
  description: z__namespace.string().trim().optional(),
7607
7659
  opt: z__namespace.object({
7608
7660
  media: z__namespace.object({
@@ -7660,11 +7712,11 @@ const isImageAsset = asset => {
7660
7712
  const getAssetResolution = asset => {
7661
7713
  return "".concat(asset.metadata.dimensions.width, "x").concat(asset.metadata.dimensions.height, "px");
7662
7714
  };
7663
- const ButtonAssetCopy = _ref43 => {
7715
+ const ButtonAssetCopy = _ref44 => {
7664
7716
  let {
7665
7717
  disabled,
7666
7718
  url
7667
- } = _ref43;
7719
+ } = _ref44;
7668
7720
  const popoverProps = usePortalPopoverProps();
7669
7721
  const refPopoverTimeout = react.useRef();
7670
7722
  const [popoverVisible, setPopoverVisible] = react.useState(false);
@@ -7706,11 +7758,11 @@ const ButtonAssetCopy = _ref43 => {
7706
7758
  })
7707
7759
  });
7708
7760
  };
7709
- const Row = _ref44 => {
7761
+ const Row = _ref45 => {
7710
7762
  let {
7711
7763
  label,
7712
7764
  value
7713
- } = _ref44;
7765
+ } = _ref45;
7714
7766
  return /* @__PURE__ */jsxRuntime.jsxs(ui.Flex, {
7715
7767
  justify: "space-between",
7716
7768
  children: [/* @__PURE__ */jsxRuntime.jsx(ui.Text, {
@@ -7821,11 +7873,11 @@ const Dialog = props => {
7821
7873
  }
7822
7874
  });
7823
7875
  };
7824
- const DocumentList = _ref45 => {
7876
+ const DocumentList = _ref46 => {
7825
7877
  let {
7826
7878
  documents,
7827
7879
  isLoading
7828
- } = _ref45;
7880
+ } = _ref46;
7829
7881
  const schema = sanity.useSchema();
7830
7882
  if (isLoading) {
7831
7883
  return /* @__PURE__ */jsxRuntime.jsx(ui.Text, {
@@ -7897,10 +7949,10 @@ var __template$c = (cooked, raw) => __freeze$c(__defProp$d(cooked, "raw", {
7897
7949
  value: __freeze$c(raw || cooked.slice())
7898
7950
  }));
7899
7951
  var _a$c;
7900
- const Container = styled__default.default(ui.Box)(_ref46 => {
7952
+ const Container = styled__default.default(ui.Box)(_ref47 => {
7901
7953
  let {
7902
7954
  theme
7903
- } = _ref46;
7955
+ } = _ref47;
7904
7956
  return styled.css(_a$c || (_a$c = __template$c(["\n text {\n font-family: ", " !important;\n font-size: 8px !important;\n font-weight: 500 !important;\n }\n "])), theme.sanity.fonts.text.family);
7905
7957
  });
7906
7958
  const FileIcon = props => {
@@ -7968,10 +8020,10 @@ const {
7968
8020
  } = ui.studioTheme;
7969
8021
  const reactSelectStyles = scheme => {
7970
8022
  return {
7971
- control: (styles, _ref47) => {
8023
+ control: (styles, _ref48) => {
7972
8024
  let {
7973
8025
  isFocused
7974
- } = _ref47;
8026
+ } = _ref48;
7975
8027
  let boxShadow = "inset 0 0 0 1px var(--card-border-color)";
7976
8028
  if (isFocused) {
7977
8029
  boxShadow = "inset 0 0 0 1px ".concat(getSchemeColor(scheme, "inputEnabledBorder"), ",\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color) !important");
@@ -7993,10 +8045,10 @@ const reactSelectStyles = scheme => {
7993
8045
  }
7994
8046
  };
7995
8047
  },
7996
- indicatorsContainer: (styles, _ref48) => {
8048
+ indicatorsContainer: (styles, _ref49) => {
7997
8049
  let {
7998
8050
  isDisabled
7999
- } = _ref48;
8051
+ } = _ref49;
8000
8052
  return {
8001
8053
  ...styles,
8002
8054
  opacity: isDisabled ? 0.25 : 1
@@ -8011,10 +8063,10 @@ const reactSelectStyles = scheme => {
8011
8063
  menuList: styles => ({
8012
8064
  ...styles
8013
8065
  }),
8014
- multiValue: (styles, _ref49) => {
8066
+ multiValue: (styles, _ref50) => {
8015
8067
  let {
8016
8068
  isDisabled
8017
- } = _ref49;
8069
+ } = _ref50;
8018
8070
  return {
8019
8071
  ...styles,
8020
8072
  backgroundColor: getSchemeColor(scheme, "mutedHoveredBg"),
@@ -8043,10 +8095,10 @@ const reactSelectStyles = scheme => {
8043
8095
  fontFamily: ui.studioTheme.fonts.text.family,
8044
8096
  lineHeight: "1em"
8045
8097
  }),
8046
- option: (styles, _ref50) => {
8098
+ option: (styles, _ref51) => {
8047
8099
  let {
8048
8100
  isFocused
8049
- } = _ref50;
8101
+ } = _ref51;
8050
8102
  return {
8051
8103
  ...styles,
8052
8104
  backgroundColor: isFocused ? getSchemeColor(scheme, "spotBlue") : "transparent",
@@ -8166,10 +8218,10 @@ const reactSelectComponents = {
8166
8218
  MultiValueRemove,
8167
8219
  Option
8168
8220
  };
8169
- const StyledErrorOutlineIcon = styled__default.default(ErrorOutlineIcon)(_ref51 => {
8221
+ const StyledErrorOutlineIcon = styled__default.default(ErrorOutlineIcon)(_ref52 => {
8170
8222
  let {
8171
8223
  theme
8172
- } = _ref51;
8224
+ } = _ref52;
8173
8225
  return {
8174
8226
  color: theme.sanity.color.spot.red
8175
8227
  };
@@ -8256,10 +8308,10 @@ const FormFieldInputTags = props => {
8256
8308
  control,
8257
8309
  defaultValue: value,
8258
8310
  name,
8259
- render: _ref52 => {
8311
+ render: _ref53 => {
8260
8312
  let {
8261
8313
  field
8262
- } = _ref52;
8314
+ } = _ref53;
8263
8315
  const {
8264
8316
  onBlur,
8265
8317
  onChange,
@@ -8430,9 +8482,13 @@ const DialogAssetEdit = props => {
8430
8482
  const currentAsset = assetItem ? assetItem == null ? void 0 : assetItem.asset : assetSnapshot;
8431
8483
  const allTagOptions = getTagSelectOptions(tags);
8432
8484
  const assetTagOptions = useTypedSelector(selectTagSelectOptions(currentAsset));
8485
+ const {
8486
+ creditLine
8487
+ } = useToolOptions();
8433
8488
  const generateDefaultValues = react.useCallback(asset => {
8434
8489
  return {
8435
8490
  altText: (asset == null ? void 0 : asset.altText) || "",
8491
+ creditLine: (asset == null ? void 0 : asset.creditLine) || "",
8436
8492
  description: (asset == null ? void 0 : asset.description) || "",
8437
8493
  originalFilename: (asset == null ? void 0 : asset.originalFilename) || "",
8438
8494
  opt: {
@@ -8590,12 +8646,12 @@ const DialogAssetEdit = props => {
8590
8646
  children: /* @__PURE__ */jsxRuntime.jsx(sanity.WithReferringDocuments, {
8591
8647
  documentStore,
8592
8648
  id: currentAsset._id,
8593
- children: _ref53 => {
8649
+ children: _ref54 => {
8594
8650
  let {
8595
8651
  isLoading,
8596
8652
  referringDocuments
8597
- } = _ref53;
8598
- var _a3, _b, _c, _d, _e, _f, _g;
8653
+ } = _ref54;
8654
+ var _a3, _b, _c, _d, _e, _f, _g, _h, _i, _j;
8599
8655
  const uniqueReferringDocuments = getUniqueDocuments(referringDocuments);
8600
8656
  return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, {
8601
8657
  children: [/* @__PURE__ */jsxRuntime.jsxs(ui.TabList, {
@@ -8682,6 +8738,13 @@ const DialogAssetEdit = props => {
8682
8738
  name: "description",
8683
8739
  rows: 5,
8684
8740
  value: currentAsset == null ? void 0 : currentAsset.description
8741
+ }), (creditLine == null ? void 0 : creditLine.enabled) && /* @__PURE__ */jsxRuntime.jsx(FormFieldInputText, {
8742
+ ...register("creditLine"),
8743
+ error: (_h = errors == null ? void 0 : errors.creditLine) == null ? void 0 : _h.message,
8744
+ label: "Credit",
8745
+ name: "creditLine",
8746
+ value: currentAsset == null ? void 0 : currentAsset.creditLine,
8747
+ disabled: formUpdating || ((_j = creditLine == null ? void 0 : creditLine.excludeSources) == null ? void 0 : _j.includes((_i = currentAsset == null ? void 0 : currentAsset.source) == null ? void 0 : _i.name))
8685
8748
  })]
8686
8749
  })
8687
8750
  }), /* @__PURE__ */jsxRuntime.jsx(ui.TabPanel, {
@@ -9230,11 +9293,11 @@ const Tag = props => {
9230
9293
  })]
9231
9294
  });
9232
9295
  };
9233
- const VirtualRow$1 = react.memo(_ref54 => {
9296
+ const VirtualRow$1 = react.memo(_ref55 => {
9234
9297
  let {
9235
9298
  isScrolling,
9236
9299
  item
9237
- } = _ref54;
9300
+ } = _ref55;
9238
9301
  var _a;
9239
9302
  if (typeof item === "string") {
9240
9303
  return /* @__PURE__ */jsxRuntime.jsx(ui.Flex, {
@@ -9340,12 +9403,12 @@ const TagsVirtualized = () => {
9340
9403
  totalCount: items.length
9341
9404
  });
9342
9405
  };
9343
- const TagViewHeader = _ref55 => {
9406
+ const TagViewHeader = _ref56 => {
9344
9407
  let {
9345
9408
  allowCreate,
9346
9409
  light,
9347
9410
  title
9348
- } = _ref55;
9411
+ } = _ref56;
9349
9412
  const {
9350
9413
  scheme
9351
9414
  } = sanity.useColorScheme();
@@ -9642,24 +9705,24 @@ var __template$7 = (cooked, raw) => __freeze$7(__defProp$8(cooked, "raw", {
9642
9705
  }));
9643
9706
  var _a$7, _b$4, _c$1, _d;
9644
9707
  const CardWrapper$1 = styled__default.default(ui.Flex)(_a$7 || (_a$7 = __template$7(["\n box-sizing: border-box;\n height: 100%;\n overflow: hidden;\n position: relative;\n width: 100%;\n"])));
9645
- const CardContainer = styled__default.default(ui.Flex)(_ref56 => {
9708
+ const CardContainer = styled__default.default(ui.Flex)(_ref57 => {
9646
9709
  let {
9647
9710
  picked,
9648
9711
  theme,
9649
9712
  updating
9650
- } = _ref56;
9713
+ } = _ref57;
9651
9714
  return styled.css(_c$1 || (_c$1 = __template$7(["\n border: 1px solid transparent;\n height: 100%;\n pointer-events: ", ";\n position: relative;\n transition: all 300ms;\n user-select: none;\n width: 100%;\n\n border: ", ";\n\n ", "\n "])), updating ? "none" : "auto", picked ? "1px solid ".concat(theme.sanity.color.spot.orange, " !important") : "1px solid inherit", !updating && styled.css(_b$4 || (_b$4 = __template$7(["\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n border: 1px solid var(--card-border-color);\n }\n }\n "]))));
9652
9715
  });
9653
- const ContextActionContainer$2 = styled__default.default(ui.Flex)(_ref57 => {
9716
+ const ContextActionContainer$2 = styled__default.default(ui.Flex)(_ref58 => {
9654
9717
  let {
9655
9718
  scheme
9656
- } = _ref57;
9719
+ } = _ref58;
9657
9720
  return styled.css(_d || (_d = __template$7(["\n cursor: pointer;\n height: ", "px;\n transition: all 300ms;\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n background: ", ";\n }\n }\n "])), PANEL_HEIGHT, getSchemeColor(scheme, "bg"));
9658
9721
  });
9659
- const StyledWarningOutlineIcon = styled__default.default(WarningFilledIcon)(_ref58 => {
9722
+ const StyledWarningOutlineIcon = styled__default.default(WarningFilledIcon)(_ref59 => {
9660
9723
  let {
9661
9724
  theme
9662
- } = _ref58;
9725
+ } = _ref59;
9663
9726
  return {
9664
9727
  color: theme.sanity.color.spot.red
9665
9728
  };
@@ -10090,10 +10153,10 @@ const uploadsSlice = toolkit.createSlice({
10090
10153
  }
10091
10154
  }
10092
10155
  });
10093
- const uploadsAssetStartEpic = (action$, _state$, _ref59) => {
10156
+ const uploadsAssetStartEpic = (action$, _state$, _ref60) => {
10094
10157
  let {
10095
10158
  client
10096
- } = _ref59;
10159
+ } = _ref60;
10097
10160
  return action$.pipe(operators$1.filter(uploadsActions.uploadStart.match), operators$1.mergeMap(action => {
10098
10161
  const {
10099
10162
  file,
@@ -10132,8 +10195,8 @@ const uploadsAssetStartEpic = (action$, _state$, _ref59) => {
10132
10195
  })))));
10133
10196
  }));
10134
10197
  };
10135
- const uploadsAssetUploadEpic = (action$, state$) => action$.pipe(operators$1.filter(uploadsActions.uploadRequest.match), operators$1.withLatestFrom(state$), operators$1.mergeMap(_ref60 => {
10136
- let [action, state] = _ref60;
10198
+ const uploadsAssetUploadEpic = (action$, state$) => action$.pipe(operators$1.filter(uploadsActions.uploadRequest.match), operators$1.withLatestFrom(state$), operators$1.mergeMap(_ref61 => {
10199
+ let [action, state] = _ref61;
10137
10200
  const {
10138
10201
  file,
10139
10202
  forceAsAssetType
@@ -10169,12 +10232,12 @@ const uploadsCompleteQueueEpic = action$ => action$.pipe(operators$1.filter(UPLO
10169
10232
  assets: [action.payload.asset]
10170
10233
  }));
10171
10234
  }));
10172
- const uploadsCheckRequestEpic = (action$, state$, _ref61) => {
10235
+ const uploadsCheckRequestEpic = (action$, state$, _ref62) => {
10173
10236
  let {
10174
10237
  client
10175
- } = _ref61;
10176
- return action$.pipe(operators$1.filter(uploadsActions.checkRequest.match), operators$1.withLatestFrom(state$), operators$1.mergeMap(_ref62 => {
10177
- let [action, state] = _ref62;
10238
+ } = _ref62;
10239
+ return action$.pipe(operators$1.filter(uploadsActions.checkRequest.match), operators$1.withLatestFrom(state$), operators$1.mergeMap(_ref63 => {
10240
+ let [action, state] = _ref63;
10178
10241
  const {
10179
10242
  assets
10180
10243
  } = action.payload;
@@ -10354,11 +10417,11 @@ var __template$4 = (cooked, raw) => __freeze$4(__defProp$5(cooked, "raw", {
10354
10417
  var _a$4, _b$3;
10355
10418
  const CARD_HEIGHT = 220;
10356
10419
  const CARD_WIDTH = 240;
10357
- const VirtualCell = react.memo(_ref63 => {
10420
+ const VirtualCell = react.memo(_ref64 => {
10358
10421
  let {
10359
10422
  item,
10360
10423
  selected
10361
- } = _ref63;
10424
+ } = _ref64;
10362
10425
  if ((item == null ? void 0 : item.type) === "asset") {
10363
10426
  return /* @__PURE__ */jsxRuntime.jsx(CardAsset$1, {
10364
10427
  id: item.id,
@@ -10466,10 +10529,10 @@ var __template$3 = (cooked, raw) => __freeze$3(__defProp$4(cooked, "raw", {
10466
10529
  value: __freeze$3(raw || cooked.slice())
10467
10530
  }));
10468
10531
  var _a$3;
10469
- const ContextActionContainer$1 = styled__default.default(ui.Flex)(_ref64 => {
10532
+ const ContextActionContainer$1 = styled__default.default(ui.Flex)(_ref65 => {
10470
10533
  let {
10471
10534
  scheme
10472
- } = _ref64;
10535
+ } = _ref65;
10473
10536
  return styled.css(_a$3 || (_a$3 = __template$3(["\n cursor: pointer;\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n background: ", ";\n }\n }\n "])), getSchemeColor(scheme, "bg"));
10474
10537
  });
10475
10538
  const TableHeader = () => {
@@ -10555,24 +10618,24 @@ var __template$2 = (cooked, raw) => __freeze$2(__defProp$3(cooked, "raw", {
10555
10618
  }));
10556
10619
  var _a$2, _b$2, _c;
10557
10620
  const REFERENCE_COUNT_VISIBILITY_DELAY = 750;
10558
- const ContainerGrid = styled__default.default(ui.Grid)(_ref65 => {
10621
+ const ContainerGrid = styled__default.default(ui.Grid)(_ref66 => {
10559
10622
  let {
10560
10623
  scheme,
10561
10624
  selected,
10562
10625
  updating
10563
- } = _ref65;
10626
+ } = _ref66;
10564
10627
  return styled.css(_b$2 || (_b$2 = __template$2(["\n align-items: center;\n cursor: ", ";\n height: 100%;\n pointer-events: ", ";\n user-select: none;\n white-space: nowrap;\n\n ", "\n "])), selected ? "default" : "pointer", updating ? "none" : "auto", !updating && styled.css(_a$2 || (_a$2 = __template$2(["\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n background: ", ";\n }\n }\n "])), getSchemeColor(scheme, "bg")));
10565
10628
  });
10566
- const ContextActionContainer = styled__default.default(ui.Flex)(_ref66 => {
10629
+ const ContextActionContainer = styled__default.default(ui.Flex)(_ref67 => {
10567
10630
  let {
10568
10631
  scheme
10569
- } = _ref66;
10632
+ } = _ref67;
10570
10633
  return styled.css(_c || (_c = __template$2(["\n cursor: pointer;\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n background: ", ";\n }\n }\n "])), getSchemeColor(scheme, "bg2"));
10571
10634
  });
10572
- const StyledWarningIcon = styled__default.default(WarningFilledIcon)(_ref67 => {
10635
+ const StyledWarningIcon = styled__default.default(WarningFilledIcon)(_ref68 => {
10573
10636
  let {
10574
10637
  theme
10575
- } = _ref67;
10638
+ } = _ref68;
10576
10639
  return {
10577
10640
  color: theme.sanity.color.spot.red
10578
10641
  };
@@ -10856,11 +10919,11 @@ const TableRowAsset = props => {
10856
10919
  textOverflow: "ellipsis",
10857
10920
  children: referenceCountVisible ? /* @__PURE__ */jsxRuntime.jsx(sanity.WithReferringDocuments, {
10858
10921
  id,
10859
- children: _ref68 => {
10922
+ children: _ref69 => {
10860
10923
  let {
10861
10924
  isLoading,
10862
10925
  referringDocuments
10863
- } = _ref68;
10926
+ } = _ref69;
10864
10927
  const uniqueDocuments = getUniqueDocuments(referringDocuments);
10865
10928
  return isLoading ? /* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment, {
10866
10929
  children: "-"
@@ -11040,11 +11103,11 @@ const TableRowUpload = props => {
11040
11103
  })]
11041
11104
  });
11042
11105
  };
11043
- const VirtualRow = react.memo(_ref69 => {
11106
+ const VirtualRow = react.memo(_ref70 => {
11044
11107
  let {
11045
11108
  item,
11046
11109
  selected
11047
- } = _ref69;
11110
+ } = _ref70;
11048
11111
  if ((item == null ? void 0 : item.type) === "asset") {
11049
11112
  return /* @__PURE__ */jsxRuntime.jsx(ui.Box, {
11050
11113
  style: {
@@ -11451,29 +11514,6 @@ const TagsPanel = () => {
11451
11514
  })
11452
11515
  });
11453
11516
  };
11454
- const ToolOptionsContext = react.createContext(null);
11455
- const ToolOptionsProvider = _ref70 => {
11456
- let {
11457
- options,
11458
- children
11459
- } = _ref70;
11460
- const value = react.useMemo(() => ({
11461
- dropzone: {
11462
- maxSize: options == null ? void 0 : options.maximumUploadSize
11463
- }
11464
- }), [options == null ? void 0 : options.maximumUploadSize]);
11465
- return /* @__PURE__ */jsxRuntime.jsx(ToolOptionsContext.Provider, {
11466
- value,
11467
- children
11468
- });
11469
- };
11470
- const useToolOptions = () => {
11471
- const context = react.useContext(ToolOptionsContext);
11472
- if (!context) {
11473
- throw new Error("useToolOptions must be used within an ToolOptionsProvider");
11474
- }
11475
- return context;
11476
- };
11477
11517
  var __freeze$1 = Object.freeze;
11478
11518
  var __defProp$1 = Object.defineProperty;
11479
11519
  var __template$1 = (cooked, raw) => __freeze$1(__defProp$1(cooked, "raw", {