@uniformdev/mesh-sdk-react 19.79.0 → 19.79.1-alpha.7

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.mjs CHANGED
@@ -2654,13 +2654,14 @@ function useConnectedDataAsVariables(connectedData) {
2654
2654
  }
2655
2655
 
2656
2656
  // src/hooks/useDynamicInputsAsVariables.tsx
2657
+ import { LOCALE_DYNAMIC_INPUT_NAME } from "@uniformdev/canvas";
2657
2658
  import { useMemo as useMemo4 } from "react";
2658
2659
  import { Fragment as Fragment4, jsx as jsx26 } from "@emotion/react/jsx-runtime";
2659
2660
  function useDynamicInputsAsVariables(dynamicInputs) {
2660
2661
  return useMemo4(() => {
2661
2662
  const result = Object.entries(dynamicInputs).reduce(
2662
2663
  (acc, [name, input3]) => {
2663
- const source = `from ${input3.type === "path" ? "URL path" : "query string"}`;
2664
+ const source = `from ${name === LOCALE_DYNAMIC_INPUT_NAME ? "current locale" : input3.type === "path" ? "URL path" : "query string"}`;
2664
2665
  acc[name] = {
2665
2666
  readOnly: true,
2666
2667
  type: input3.type,
@@ -2944,6 +2945,7 @@ function VariableChip({
2944
2945
  tooltip,
2945
2946
  reference,
2946
2947
  onClick,
2948
+ clickToEdit,
2947
2949
  isFresh,
2948
2950
  selected,
2949
2951
  disabled
@@ -2951,7 +2953,7 @@ function VariableChip({
2951
2953
  const hasClickEvent = !!onClick;
2952
2954
  const referenceIsValidFr = isFresh ? true : referenceIsValid;
2953
2955
  const Wrapper = referenceIsValidFr === "info" ? InfoVariableReference : referenceIsValidFr ? Fragment5 : UndefinedVariableReference;
2954
- const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent ? "Click to edit" : void 0;
2956
+ const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent && clickToEdit ? "Click to edit" : void 0;
2955
2957
  return /* @__PURE__ */ jsx29(
2956
2958
  MultilineChip,
2957
2959
  {
@@ -3968,6 +3970,7 @@ function VariableNodeComponent({
3968
3970
  displayName: state.isLoading ? /* @__PURE__ */ jsx33(LoadingIndicator2, { size: "sm" }) : state.displayName,
3969
3971
  selected: isSelected,
3970
3972
  disabled: readOnly,
3973
+ clickToEdit: state.hasClickEvent,
3971
3974
  onClick: state.hasClickEvent ? () => {
3972
3975
  setSelected(!isSelected);
3973
3976
  editor.dispatchCommand(EDIT_VARIABLE_COMMAND, {
@@ -4083,6 +4086,10 @@ var inputCompact = css21`
4083
4086
  padding-block: var(--spacing-sm);
4084
4087
  font-size: var(--fs-sm);
4085
4088
  `;
4089
+ var inputDisabled = css21`
4090
+ cursor: not-allowed;
4091
+ opacity: var(--opacity-50);
4092
+ `;
4086
4093
  var placeholderCaption = css21`
4087
4094
  position: absolute;
4088
4095
  color: var(--gray-400);
@@ -4348,8 +4355,8 @@ function VariableField({
4348
4355
  buttonProps: isActive ? { "aria-pressed": "true" } : void 0
4349
4356
  }
4350
4357
  ) : null;
4351
- return /* @__PURE__ */ jsxs20("div", { children: [
4352
- /* @__PURE__ */ jsxs20("label", { htmlFor: id, css: labelText, children: [
4358
+ return /* @__PURE__ */ jsxs20("div", { "data-testid": "variable-field", children: [
4359
+ /* @__PURE__ */ jsxs20("label", { htmlFor: id, css: labelText, "data-testid": "field-name", children: [
4353
4360
  variableSelector,
4354
4361
  /* @__PURE__ */ jsx36("span", { children: label })
4355
4362
  ] }),
@@ -4455,6 +4462,7 @@ function VariablesComposer(props) {
4455
4462
  /* @__PURE__ */ jsx37(
4456
4463
  OnChangePlugin,
4457
4464
  {
4465
+ ignoreSelectionChange: true,
4458
4466
  onChange: (state) => {
4459
4467
  editorState.current = state;
4460
4468
  if (updateTimeout.current) {
@@ -4638,6 +4646,7 @@ function InputVariables(props) {
4638
4646
  dispatch({ type: "cancelEdit" });
4639
4647
  }
4640
4648
  },
4649
+ css: disabled ? inputDisabled : "",
4641
4650
  children: [
4642
4651
  useInputWithNoVariables ? inputWhenNoVariables : /* @__PURE__ */ jsx39(
4643
4652
  InputVariablesOverlayMenu,
@@ -5131,7 +5140,6 @@ var tableCellDragIcon = css25`
5131
5140
  `;
5132
5141
  var variableName = css25`
5133
5142
  border: none;
5134
- color: var(--brand-secondary-5);
5135
5143
  font-weight: var(--fw-medium);
5136
5144
  padding: 0;
5137
5145
  background: none;
@@ -5150,7 +5158,7 @@ var variableValue = css25`
5150
5158
  // src/components/Variables/VariablesList.tsx
5151
5159
  import { Fragment as Fragment11, jsx as jsx43, jsxs as jsxs27 } from "@emotion/react/jsx-runtime";
5152
5160
  function VariablesList() {
5153
- const { variables, dispatch } = useVariables();
5161
+ const { variables, dispatch, readOnly } = useVariables();
5154
5162
  const sorted = variablesToList(variables).filter((variable) => !variable.system);
5155
5163
  const onDragEnd = (res) => {
5156
5164
  var _a, _b;
@@ -5177,7 +5185,7 @@ function VariablesList() {
5177
5185
  /* @__PURE__ */ jsx43(TableCellHead, {})
5178
5186
  ] }) }),
5179
5187
  /* @__PURE__ */ jsxs27(TableBody, { children: [
5180
- sorted.map(({ name, displayName, default: defaultValue, readOnly }, index) => {
5188
+ sorted.map(({ name, displayName, default: defaultValue }, index) => {
5181
5189
  const text = displayName != null ? displayName : name;
5182
5190
  const textValue = variableDefaultTextValue(defaultValue);
5183
5191
  return /* @__PURE__ */ jsx43(
@@ -5196,7 +5204,7 @@ function VariablesList() {
5196
5204
  css: tableRow(snapshot.isDragging),
5197
5205
  "data-dragging": snapshot.isDragging,
5198
5206
  children: [
5199
- /* @__PURE__ */ jsx43(TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: /* @__PURE__ */ jsx43(
5207
+ /* @__PURE__ */ jsx43(TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: readOnly ? /* @__PURE__ */ jsx43("span", { css: variableName, children: text }) : /* @__PURE__ */ jsx43(
5200
5208
  "button",
5201
5209
  {
5202
5210
  css: variableName,
@@ -5236,12 +5244,12 @@ function VariablesList() {
5236
5244
  provided.placeholder
5237
5245
  ] })
5238
5246
  ] }) }) }),
5239
- /* @__PURE__ */ jsx43(
5247
+ !readOnly && /* @__PURE__ */ jsx43(
5240
5248
  AddListButton,
5241
5249
  {
5242
5250
  onButtonClick: () => dispatch({ type: "edit", variable: "" }),
5243
5251
  "aria-label": "Add variable",
5244
- buttonText: "add variable",
5252
+ buttonText: "Add variable",
5245
5253
  icon: "math-plus",
5246
5254
  css: { marginLeft: "var(--spacing-md)" }
5247
5255
  }
@@ -6136,9 +6144,9 @@ var DataRefreshButton = ({
6136
6144
  };
6137
6145
 
6138
6146
  // src/components/ObjectSearch/ObjectSearchContainer.tsx
6139
- import { css as css31 } from "@emotion/react";
6147
+ import { css as css32 } from "@emotion/react";
6140
6148
  import { bindVariables } from "@uniformdev/canvas";
6141
- import { Container, IconsProvider, ScrollableList, VerticalRhythm as VerticalRhythm2 } from "@uniformdev/design-system";
6149
+ import { Callout as Callout5, Container, IconsProvider, ScrollableList, VerticalRhythm as VerticalRhythm2 } from "@uniformdev/design-system";
6142
6150
 
6143
6151
  // src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
6144
6152
  import { bindVariablesToObject as bindVariablesToObject2 } from "@uniformdev/canvas";
@@ -6163,12 +6171,19 @@ var ObjectSearchContext = createContext5({
6163
6171
  },
6164
6172
  selectedListItems: [],
6165
6173
  onRemoveAllSelectedItems: () => {
6166
- }
6174
+ },
6175
+ isMulti: false
6167
6176
  });
6168
- var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
6177
+ var ObjectSearchProvider = ({
6178
+ currentlySelectedItems,
6179
+ isMulti = false,
6180
+ children,
6181
+ defaultQuery
6182
+ }) => {
6169
6183
  const [query, setQuery] = useState15({
6170
6184
  contentType: "",
6171
- keyword: ""
6185
+ keyword: "",
6186
+ ...defaultQuery
6172
6187
  });
6173
6188
  const { flatVariables } = useVariables(true);
6174
6189
  const querySearchDeferred = useDeferredValue(query);
@@ -6219,6 +6234,7 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
6219
6234
  selectedListItems: selectedItems,
6220
6235
  onRemoveAllSelectedItems,
6221
6236
  list,
6237
+ isMulti,
6222
6238
  onSetList
6223
6239
  }),
6224
6240
  [
@@ -6229,6 +6245,7 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
6229
6245
  selectedItems,
6230
6246
  onRemoveAllSelectedItems,
6231
6247
  list,
6248
+ isMulti,
6232
6249
  onSetList
6233
6250
  ]
6234
6251
  );
@@ -6249,8 +6266,148 @@ function bindQuery(query, inputs) {
6249
6266
  return result;
6250
6267
  }
6251
6268
 
6252
- // src/components/ObjectSearch/ObjectSearchContainer.tsx
6269
+ // src/components/ObjectSearch/ObjectSearchListItem.tsx
6270
+ import { Chip, Popover } from "@uniformdev/design-system";
6271
+
6272
+ // src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
6273
+ import { css as css31 } from "@emotion/react";
6274
+ import { skeletonLoading } from "@uniformdev/design-system";
6275
+ var ObjectListItemContainer = css31`
6276
+ align-items: center;
6277
+ border: 1px solid var(--gray-300);
6278
+ border-radius: var(--rounded-base);
6279
+ background: var(--white);
6280
+ display: grid;
6281
+ grid-template-columns: 1fr auto;
6282
+ padding: var(--spacing-sm);
6283
+ `;
6284
+ var ObjectListItemContainerDisabled = css31`
6285
+ opacity: var(--opacity-50);
6286
+ pointer-events: none;
6287
+ `;
6288
+ var ObjectListItemLoading = css31`
6289
+ animation: ${skeletonLoading} 1s linear infinite alternate;
6290
+ border-color: transparent;
6291
+ min-height: 42px;
6292
+ position: relative;
6293
+
6294
+ &:before,
6295
+ &:after {
6296
+ background: var(--gray-200);
6297
+ content: '';
6298
+ display: block;
6299
+ height: 1rem;
6300
+ }
6301
+
6302
+ &:before {
6303
+ border-radius: var(--rounded-base);
6304
+ width: 10rem;
6305
+ }
6306
+
6307
+ &:after {
6308
+ border-radius: var(--rounded-full);
6309
+ width: 1rem;
6310
+ }
6311
+ `;
6312
+ var ObjectListItemHeadingGroup = css31`
6313
+ align-items: center;
6314
+ display: grid;
6315
+ `;
6316
+ var ObjectListItemThumbnail = css31`
6317
+ width: 30px;
6318
+ object-fit: contain;
6319
+ `;
6320
+ var ObjectListItemTitle = css31`
6321
+ color: var(--brand-secondary-1);
6322
+ display: block;
6323
+ font-size: var(--fs-sm);
6324
+ `;
6325
+ var ObjectListItemSubtitle = css31`
6326
+ color: var(--gray-500);
6327
+ display: block;
6328
+ font-size: var(--fs-xs);
6329
+ line-height: 1;
6330
+ `;
6331
+ var ObjectListItemInfoContainer = css31`
6332
+ align-items: center;
6333
+ display: flex;
6334
+ gap: var(--spacing-sm);
6335
+ justify-content: center;
6336
+ `;
6337
+ var ObjectListItemControlledContent = css31`
6338
+ display: flex;
6339
+ gap: var(--spacing-sm);
6340
+ `;
6341
+ var ObjectListItemUnControlledContent = css31`
6342
+ margin-top: var(--spacing-sm);
6343
+ grid-column: 1 / -1;
6344
+ `;
6345
+
6346
+ // src/components/ObjectSearch/ObjectSearchListItem.tsx
6253
6347
  import { jsx as jsx59, jsxs as jsxs34 } from "@emotion/react/jsx-runtime";
6348
+ var ObjectSearchListItem = ({
6349
+ id,
6350
+ title,
6351
+ contentType,
6352
+ image,
6353
+ imageUrl,
6354
+ popoverData,
6355
+ onSelect,
6356
+ isMulti,
6357
+ disabled,
6358
+ children
6359
+ }) => {
6360
+ const { onSelectItem, selectedListItems, isMulti: globalIsMulti } = useObjectSearchContext();
6361
+ const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
6362
+ const handleSelectItem = () => {
6363
+ var _a;
6364
+ const extraData = (_a = onSelect == null ? void 0 : onSelect()) != null ? _a : {};
6365
+ const selectedItem = { id, title, contentType, imageUrl, image, popoverData, ...extraData };
6366
+ if (isMulti === true || globalIsMulti) {
6367
+ return onSelectItem(selectedItem);
6368
+ }
6369
+ return onSelectItem([selectedItem]);
6370
+ };
6371
+ const selected = selectedListItems.some((item) => item.id === id);
6372
+ return /* @__PURE__ */ jsxs34(
6373
+ "div",
6374
+ {
6375
+ role: "listitem",
6376
+ css: [ObjectListItemContainer, disabled ? ObjectListItemContainerDisabled : void 0],
6377
+ "data-testid": "list-item",
6378
+ children: [
6379
+ /* @__PURE__ */ jsxs34(
6380
+ "div",
6381
+ {
6382
+ role: "button",
6383
+ onClick: handleSelectItem,
6384
+ css: ObjectListItemControlledContent,
6385
+ "aria-disabled": disabled,
6386
+ children: [
6387
+ !imageUrl ? null : /* @__PURE__ */ jsx59("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectListItemThumbnail }),
6388
+ !image || imageUrl ? null : /* @__PURE__ */ jsx59("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
6389
+ /* @__PURE__ */ jsxs34("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
6390
+ !contentType ? null : /* @__PURE__ */ jsx59("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
6391
+ /* @__PURE__ */ jsx59("span", { css: ObjectListItemTitle, "data-testid": "title", children: title })
6392
+ ] })
6393
+ ]
6394
+ }
6395
+ ),
6396
+ /* @__PURE__ */ jsxs34("div", { css: ObjectListItemInfoContainer, children: [
6397
+ selected ? /* @__PURE__ */ jsx59(Chip, { text: "selected", size: "xs" }) : null,
6398
+ !popoverData ? null : /* @__PURE__ */ jsx59(Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, iconColor: "default", children: popoverData })
6399
+ ] }),
6400
+ !children ? null : /* @__PURE__ */ jsx59("div", { css: ObjectListItemUnControlledContent, children })
6401
+ ]
6402
+ }
6403
+ );
6404
+ };
6405
+ var ObjectSearchListItemLoadingSkeleton = () => {
6406
+ return /* @__PURE__ */ jsx59("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
6407
+ };
6408
+
6409
+ // src/components/ObjectSearch/ObjectSearchContainer.tsx
6410
+ import { jsx as jsx60, jsxs as jsxs35 } from "@emotion/react/jsx-runtime";
6254
6411
  var ObjectSearchContainer = ({
6255
6412
  label,
6256
6413
  enableDynamicInputToResultId,
@@ -6262,21 +6419,22 @@ var ObjectSearchContainer = ({
6262
6419
  const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
6263
6420
  const { flatVariables } = useVariables(true);
6264
6421
  const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
6265
- const body = /* @__PURE__ */ jsxs34(VerticalRhythm2, { children: [
6422
+ const listItems = resultList != null ? resultList : /* @__PURE__ */ jsx60(
6423
+ ScrollableList,
6424
+ {
6425
+ role: "list",
6426
+ css: css32`
6427
+ > div {
6428
+ transition: max-height var(--duration-slow) var(--timing-ease-out);
6429
+ max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
6430
+ }
6431
+ `,
6432
+ children: /* @__PURE__ */ jsx60(DefaultResultList, {})
6433
+ }
6434
+ );
6435
+ const body = /* @__PURE__ */ jsxs35(VerticalRhythm2, { children: [
6266
6436
  searchFilters,
6267
- !resultList ? null : /* @__PURE__ */ jsx59(
6268
- ScrollableList,
6269
- {
6270
- role: "list",
6271
- css: css31`
6272
- > div {
6273
- transition: max-height var(--duration-slow) var(--timing-ease-out);
6274
- max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
6275
- }
6276
- `,
6277
- children: resultList
6278
- }
6279
- )
6437
+ listItems
6280
6438
  ] });
6281
6439
  const handleSelectedVariableChange = (selectedValue) => {
6282
6440
  var _a2;
@@ -6305,8 +6463,8 @@ var ObjectSearchContainer = ({
6305
6463
  }
6306
6464
  ]);
6307
6465
  };
6308
- return /* @__PURE__ */ jsx59(IconsProvider, { children: /* @__PURE__ */ jsxs34(VerticalRhythm2, { children: [
6309
- /* @__PURE__ */ jsx59(Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: label ? /* @__PURE__ */ jsx59(
6466
+ return /* @__PURE__ */ jsx60(IconsProvider, { children: /* @__PURE__ */ jsxs35(VerticalRhythm2, { children: [
6467
+ /* @__PURE__ */ jsx60(Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: label ? /* @__PURE__ */ jsx60(
6310
6468
  InputVariables,
6311
6469
  {
6312
6470
  label,
@@ -6324,14 +6482,25 @@ var ObjectSearchContainer = ({
6324
6482
  children
6325
6483
  ] }) });
6326
6484
  };
6485
+ var DefaultResultList = () => {
6486
+ var _a;
6487
+ const { list } = useObjectSearchContext();
6488
+ if (!list.items) {
6489
+ return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ jsx60(ObjectSearchListItemLoadingSkeleton, {}, i));
6490
+ }
6491
+ if (list.items.length === 0) {
6492
+ return /* @__PURE__ */ jsx60(Callout5, { type: "info", children: "No results were found" });
6493
+ }
6494
+ return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ jsx60(ObjectSearchListItem, { ...item }, item.id));
6495
+ };
6327
6496
 
6328
6497
  // src/components/ObjectSearch/ObjectSearchFilter.tsx
6329
6498
  import { InputKeywordSearch as InputKeywordSearch2, InputSelect as InputSelect6 } from "@uniformdev/design-system";
6330
6499
  import { useMemo as useMemo15, useState as useState16 } from "react";
6331
6500
 
6332
6501
  // src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
6333
- import { css as css32 } from "@emotion/react";
6334
- var ObjectSearchFilterContainerLabel = css32`
6502
+ import { css as css33 } from "@emotion/react";
6503
+ var ObjectSearchFilterContainerLabel = css33`
6335
6504
  align-items: center;
6336
6505
  display: flex;
6337
6506
  font-size: var(--fs-sm);
@@ -6339,18 +6508,18 @@ var ObjectSearchFilterContainerLabel = css32`
6339
6508
  line-height: 1rem;
6340
6509
  margin-bottom: var(--spacing-sm);
6341
6510
  `;
6342
- var ObjectSearchFilterContainer = css32`
6511
+ var ObjectSearchFilterContainer = css33`
6343
6512
  display: grid;
6344
6513
  gap: var(--spacing-base);
6345
6514
  `;
6346
- var ObjectSearchFilterGrid = (gridColumns) => css32`
6515
+ var ObjectSearchFilterGrid = (gridColumns) => css33`
6347
6516
  display: grid;
6348
6517
  grid-template-columns: ${gridColumns};
6349
6518
  gap: var(--spacing-base);
6350
6519
  `;
6351
6520
 
6352
6521
  // src/components/ObjectSearch/ObjectSearchFilter.tsx
6353
- import { jsx as jsx60, jsxs as jsxs35 } from "@emotion/react/jsx-runtime";
6522
+ import { jsx as jsx61, jsxs as jsxs36 } from "@emotion/react/jsx-runtime";
6354
6523
  var ObjectSearchFilter = ({
6355
6524
  requireContentType,
6356
6525
  typeSelectorAllTypesOptionText = "All content types",
@@ -6359,10 +6528,11 @@ var ObjectSearchFilter = ({
6359
6528
  selectLabel = "Content Type Select",
6360
6529
  selectOptions
6361
6530
  }) => {
6531
+ var _a, _b;
6362
6532
  const { query, onSetQuery } = useObjectSearchContext();
6363
6533
  const [searchState, setSearchState] = useState16({
6364
- contentType: "",
6365
- keyword: ""
6534
+ contentType: (_a = query.contentType) != null ? _a : "",
6535
+ keyword: (_b = query.keyword) != null ? _b : ""
6366
6536
  });
6367
6537
  const handleFilterChange = (value) => {
6368
6538
  setSearchState((prev) => {
@@ -6377,13 +6547,13 @@ var ObjectSearchFilter = ({
6377
6547
  return [
6378
6548
  ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
6379
6549
  ...selectOptions ? selectOptions.map((option) => {
6380
- var _a;
6381
- return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
6550
+ var _a2;
6551
+ return { name: option == null ? void 0 : option.name, label: (_a2 = option.label) != null ? _a2 : option == null ? void 0 : option.name, id: option.id };
6382
6552
  }) : []
6383
6553
  ];
6384
6554
  }, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
6385
6555
  const shouldRenderSelect = memoizedSelectOptions.length > 0;
6386
- return /* @__PURE__ */ jsxs35(
6556
+ return /* @__PURE__ */ jsxs36(
6387
6557
  "fieldset",
6388
6558
  {
6389
6559
  css: [
@@ -6391,7 +6561,7 @@ var ObjectSearchFilter = ({
6391
6561
  ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
6392
6562
  ],
6393
6563
  children: [
6394
- memoizedSelectOptions.length ? /* @__PURE__ */ jsx60(
6564
+ memoizedSelectOptions.length ? /* @__PURE__ */ jsx61(
6395
6565
  InputSelect6,
6396
6566
  {
6397
6567
  label: selectLabel,
@@ -6401,7 +6571,7 @@ var ObjectSearchFilter = ({
6401
6571
  value: query.contentType
6402
6572
  }
6403
6573
  ) : null,
6404
- /* @__PURE__ */ jsx60(
6574
+ /* @__PURE__ */ jsx61(
6405
6575
  InputKeywordSearch2,
6406
6576
  {
6407
6577
  inputFieldName: searchInputName,
@@ -6418,154 +6588,14 @@ var ObjectSearchFilter = ({
6418
6588
  };
6419
6589
 
6420
6590
  // src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
6421
- import { jsx as jsx61, jsxs as jsxs36 } from "@emotion/react/jsx-runtime";
6591
+ import { jsx as jsx62, jsxs as jsxs37 } from "@emotion/react/jsx-runtime";
6422
6592
  var ObjectSearchFilterContainer2 = ({ label, children }) => {
6423
- return /* @__PURE__ */ jsxs36("div", { children: [
6424
- label ? /* @__PURE__ */ jsx61("span", { css: ObjectSearchFilterContainerLabel, children: label }) : null,
6425
- /* @__PURE__ */ jsx61("div", { css: ObjectSearchFilterContainer, children })
6593
+ return /* @__PURE__ */ jsxs37("div", { children: [
6594
+ label ? /* @__PURE__ */ jsx62("span", { css: ObjectSearchFilterContainerLabel, children: label }) : null,
6595
+ /* @__PURE__ */ jsx62("div", { css: ObjectSearchFilterContainer, children })
6426
6596
  ] });
6427
6597
  };
6428
6598
 
6429
- // src/components/ObjectSearch/ObjectSearchListItem.tsx
6430
- import { Chip, Popover } from "@uniformdev/design-system";
6431
-
6432
- // src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
6433
- import { css as css33 } from "@emotion/react";
6434
- import { skeletonLoading } from "@uniformdev/design-system";
6435
- var ObjectListItemContainer = css33`
6436
- align-items: center;
6437
- border: 1px solid var(--gray-300);
6438
- border-radius: var(--rounded-base);
6439
- background: var(--white);
6440
- display: grid;
6441
- grid-template-columns: 1fr auto;
6442
- padding: var(--spacing-sm);
6443
- `;
6444
- var ObjectListItemContainerDisabled = css33`
6445
- opacity: var(--opacity-50);
6446
- pointer-events: none;
6447
- `;
6448
- var ObjectListItemLoading = css33`
6449
- animation: ${skeletonLoading} 1s linear infinite alternate;
6450
- border-color: transparent;
6451
- min-height: 42px;
6452
- position: relative;
6453
-
6454
- &:before,
6455
- &:after {
6456
- background: var(--gray-200);
6457
- content: '';
6458
- display: block;
6459
- height: 1rem;
6460
- }
6461
-
6462
- &:before {
6463
- border-radius: var(--rounded-base);
6464
- width: 10rem;
6465
- }
6466
-
6467
- &:after {
6468
- border-radius: var(--rounded-full);
6469
- width: 1rem;
6470
- }
6471
- `;
6472
- var ObjectListItemHeadingGroup = css33`
6473
- align-items: center;
6474
- display: grid;
6475
- `;
6476
- var ObjectListItemThumbnail = css33`
6477
- width: 30px;
6478
- object-fit: contain;
6479
- `;
6480
- var ObjectListItemTitle = css33`
6481
- color: var(--brand-secondary-1);
6482
- display: block;
6483
- font-size: var(--fs-sm);
6484
- `;
6485
- var ObjectListItemSubtitle = css33`
6486
- color: var(--gray-500);
6487
- display: block;
6488
- font-size: var(--fs-xs);
6489
- line-height: 1;
6490
- `;
6491
- var ObjectListItemInfoContainer = css33`
6492
- align-items: center;
6493
- display: flex;
6494
- gap: var(--spacing-sm);
6495
- justify-content: center;
6496
- `;
6497
- var ObjectListItemControlledContent = css33`
6498
- display: flex;
6499
- gap: var(--spacing-sm);
6500
- `;
6501
- var ObjectListItemUnControlledContent = css33`
6502
- margin-top: var(--spacing-sm);
6503
- grid-column: 1 / -1;
6504
- `;
6505
-
6506
- // src/components/ObjectSearch/ObjectSearchListItem.tsx
6507
- import { jsx as jsx62, jsxs as jsxs37 } from "@emotion/react/jsx-runtime";
6508
- var ObjectSearchListItem = ({
6509
- id,
6510
- title,
6511
- contentType,
6512
- image,
6513
- imageUrl,
6514
- popoverData,
6515
- onSelect,
6516
- isMulti = false,
6517
- disabled,
6518
- children
6519
- }) => {
6520
- const { onSelectItem, selectedListItems } = useObjectSearchContext();
6521
- const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
6522
- const handleSelectItem = () => {
6523
- var _a;
6524
- const extraData = (_a = onSelect == null ? void 0 : onSelect()) != null ? _a : {};
6525
- const selectedItem = { id, title, contentType, imageUrl, image, popoverData, ...extraData };
6526
- if (isMulti) {
6527
- return onSelectItem(selectedItem);
6528
- }
6529
- return onSelectItem([selectedItem]);
6530
- };
6531
- const selected = selectedListItems.some((item) => item.id === id);
6532
- return /* @__PURE__ */ jsxs37(
6533
- "div",
6534
- {
6535
- role: "listitem",
6536
- css: [ObjectListItemContainer, disabled ? ObjectListItemContainerDisabled : void 0],
6537
- "data-testid": "list-item",
6538
- children: [
6539
- /* @__PURE__ */ jsxs37(
6540
- "div",
6541
- {
6542
- role: "button",
6543
- onClick: handleSelectItem,
6544
- css: ObjectListItemControlledContent,
6545
- "aria-disabled": disabled,
6546
- children: [
6547
- !imageUrl ? null : /* @__PURE__ */ jsx62("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectListItemThumbnail }),
6548
- !image || imageUrl ? null : /* @__PURE__ */ jsx62("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
6549
- /* @__PURE__ */ jsxs37("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
6550
- !contentType ? null : /* @__PURE__ */ jsx62("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
6551
- /* @__PURE__ */ jsx62("span", { css: ObjectListItemTitle, "data-testid": "title", children: title })
6552
- ] })
6553
- ]
6554
- }
6555
- ),
6556
- /* @__PURE__ */ jsxs37("div", { css: ObjectListItemInfoContainer, children: [
6557
- selected ? /* @__PURE__ */ jsx62(Chip, { text: "selected", size: "xs" }) : null,
6558
- !popoverData ? null : /* @__PURE__ */ jsx62(Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, iconColor: "default", children: popoverData })
6559
- ] }),
6560
- !children ? null : /* @__PURE__ */ jsx62("div", { css: ObjectListItemUnControlledContent, children })
6561
- ]
6562
- }
6563
- );
6564
- };
6565
- var ObjectSearchListItemLoadingSkeleton = () => {
6566
- return /* @__PURE__ */ jsx62("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
6567
- };
6568
-
6569
6599
  // src/components/ObjectSearch/ObjectSearchResultItem.tsx
6570
6600
  import { Badge, Button as Button4, Popover as Popover2 } from "@uniformdev/design-system";
6571
6601
  import { format as timeagoFormat } from "timeago.js";
@@ -6713,13 +6743,13 @@ var ObjectSearchResultItem = ({
6713
6743
  onSelectItem({ id, title: id });
6714
6744
  onRemove == null ? void 0 : onRemove();
6715
6745
  };
6716
- return /* @__PURE__ */ jsxs39("div", { css: ObjectSearchResultItemContainer, children: [
6746
+ return /* @__PURE__ */ jsxs39("div", { css: ObjectSearchResultItemContainer, "data-testid": "search-result-item", children: [
6717
6747
  disableDnD ? null : /* @__PURE__ */ jsx64("div", { role: "presentation", className: "drag-handle", css: ObjectSearchDragHandle }),
6718
6748
  /* @__PURE__ */ jsx64("div", { children: /* @__PURE__ */ jsxs39("div", { css: ObjectSearchContentContainer, children: [
6719
6749
  !imageUrl ? null : /* @__PURE__ */ jsx64("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectSearchImage }),
6720
6750
  /* @__PURE__ */ jsxs39("div", { children: [
6721
- /* @__PURE__ */ jsx64("span", { css: ObjectSearchResultItemSubtitle, children: formatedContentType }),
6722
- /* @__PURE__ */ jsxs39("span", { role: "heading", css: ObjectSearchResultItemTitle, children: [
6751
+ /* @__PURE__ */ jsx64("span", { css: ObjectSearchResultItemSubtitle, "data-testid": "sub-title", children: formatedContentType }),
6752
+ /* @__PURE__ */ jsxs39("span", { role: "heading", css: ObjectSearchResultItemTitle, "data-testid": "title", children: [
6723
6753
  title != null ? title : name,
6724
6754
  !popoverData ? null : /* @__PURE__ */ jsx64(Popover2, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
6725
6755
  ] }),
@@ -6889,14 +6919,14 @@ var QueryFilter = ({
6889
6919
  ],
6890
6920
  children
6891
6921
  }) => {
6892
- var _a, _b, _c, _d;
6922
+ var _a, _b, _c, _d, _e, _f;
6893
6923
  const { query, onSetQuery } = useObjectSearchContext();
6894
6924
  const [queryState, setQueryState] = useState17({
6895
- contentType: "",
6896
- keyword: "",
6925
+ contentType: (_a = query.contentType) != null ? _a : "",
6926
+ keyword: (_b = query.contentType) != null ? _b : "",
6897
6927
  count: countValue != null ? countValue : 5,
6898
- sortBy: (_a = sortOptions[0].id) != null ? _a : "",
6899
- sortOrder: (_b = sortOrderOptions[0].id) != null ? _b : ""
6928
+ sortBy: (_c = sortOptions[0].id) != null ? _c : "",
6929
+ sortOrder: (_d = sortOrderOptions[0].id) != null ? _d : ""
6900
6930
  });
6901
6931
  const handleFilterChange = (value) => {
6902
6932
  setQueryState((prev) => ({ ...prev, ...value }));
@@ -6912,7 +6942,7 @@ var QueryFilter = ({
6912
6942
  InputVariables,
6913
6943
  {
6914
6944
  label: searchInputLabel,
6915
- value: (_c = queryState.keyword) != null ? _c : "",
6945
+ value: (_e = queryState.keyword) != null ? _e : "",
6916
6946
  onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
6917
6947
  disableInlineMenu: true,
6918
6948
  id: "qf_searchText",
@@ -6936,7 +6966,7 @@ var QueryFilter = ({
6936
6966
  {
6937
6967
  label: contentTypeLabel,
6938
6968
  id: "qf_contentType",
6939
- value: (_d = queryState.contentType) != null ? _d : "",
6969
+ value: (_f = queryState.contentType) != null ? _f : "",
6940
6970
  onChange: (newType) => handleFilterChange({ contentType: newType }),
6941
6971
  disableInlineMenu: true,
6942
6972
  inputWhenNoVariables: /* @__PURE__ */ jsx66(
@@ -7109,7 +7139,7 @@ function createLocationValidator(setValue, validate) {
7109
7139
  import {
7110
7140
  AddListButton as AddListButton2,
7111
7141
  Button as Button6,
7112
- Callout as Callout5,
7142
+ Callout as Callout6,
7113
7143
  DrawerContent,
7114
7144
  Heading,
7115
7145
  Input as Input6,
@@ -7148,7 +7178,7 @@ export {
7148
7178
  $isVariableNode,
7149
7179
  AddListButton2 as AddListButton,
7150
7180
  Button6 as Button,
7151
- Callout5 as Callout,
7181
+ Callout6 as Callout,
7152
7182
  ControlledValuePlugin,
7153
7183
  DISCONNECT_VARIABLE_COMMAND,
7154
7184
  DamSelectedItem,