@uniformdev/mesh-sdk-react 19.49.1 → 19.49.4-alpha.67

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.d.mts CHANGED
@@ -441,6 +441,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
441
441
  type: TLocationType;
442
442
  }> | Extract<_uniformdev_mesh_sdk.SettingsLocation<TLocationValue>, {
443
443
  type: TLocationType;
444
+ }> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
445
+ type: TLocationType;
444
446
  }>, "setValue"> & {
445
447
  setValue: SetLocationValueDispatch<(Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
446
448
  type: TLocationType;
@@ -454,6 +456,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
454
456
  type: TLocationType;
455
457
  }> | Extract<_uniformdev_mesh_sdk.SettingsLocation<TLocationValue>, {
456
458
  type: TLocationType;
459
+ }> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
460
+ type: TLocationType;
457
461
  }>)["value"], Parameters<(Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
458
462
  type: TLocationType;
459
463
  }> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
@@ -466,6 +470,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
466
470
  type: TLocationType;
467
471
  }> | Extract<_uniformdev_mesh_sdk.SettingsLocation<TLocationValue>, {
468
472
  type: TLocationType;
473
+ }> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
474
+ type: TLocationType;
469
475
  }>)["setValue"]>[0]>;
470
476
  };
471
477
  type SetLocationValueDispatch<TValue, TSetValue = TValue> = (dispatch: SetLocationValueFunction<TValue, TSetValue>) => Promise<void> | void;
@@ -772,7 +778,7 @@ type InputVariablesProps<TEditorContext = unknown> = {
772
778
  /** Enables mutliple lines in the input (\n in the value) */
773
779
  multiLine?: boolean;
774
780
  /** Disables the inline variable selection menu when rendering a variables input */
775
- disableInlineMenu?: boolean;
781
+ disableInlineMenu?: boolean | 'by-label' | 'by-input';
776
782
  /**
777
783
  * Enables clicking a variable reference to edit the variable
778
784
  * Note: automatically disabled if `disabled` or `disableVariables` is set
@@ -803,6 +809,8 @@ type InputVariablesProps<TEditorContext = unknown> = {
803
809
  * * Performing other custom mutations to the variables editor, such as inserting text from a button click.
804
810
  */
805
811
  editorRef?: MutableRefObject<LexicalEditor | null>;
812
+ /** The compact style is similar to the parameters panel */
813
+ styleVariant?: 'default' | 'compact';
806
814
  } & PasteTransformerPluginProps & UseInputVariablesStateProps<TEditorContext>;
807
815
  /**
808
816
  * An input box that enables insertion of 'variables', provided by VariablesProvider,
@@ -1178,8 +1186,8 @@ type ObjectSearchFilterProps = {
1178
1186
  * @default 'Content Type Select'
1179
1187
  */
1180
1188
  selectLabel?: string;
1181
- /** sets the select input options */
1182
- selectOptions: Array<{
1189
+ /** sets the select input options, if empty - only keyword search field will be rendered */
1190
+ selectOptions?: Array<{
1183
1191
  id: string;
1184
1192
  name?: string;
1185
1193
  label: string;
@@ -1195,7 +1203,7 @@ type ObjectSearchFilterProps = {
1195
1203
  };
1196
1204
  /**
1197
1205
  * @description Object search filter is an opinionated filter that has pre-defined query and setQuery functions
1198
- * that can be extended with custom fuctions
1206
+ * that can be extended with custom functions
1199
1207
  * @example <ObjectSearchFilter selectOptions={[{ id: 'id value', name: 'name value'}]} /> */
1200
1208
  declare const ObjectSearchFilter: ({ requireContentType, typeSelectorAllTypesOptionText, searchInputName, searchInputPlaceholderText, selectLabel, selectOptions, }: ObjectSearchFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1201
1209
 
@@ -1300,7 +1308,8 @@ declare function useObjectSearchContext<TExtraSearchFilters = unknown, TExtraIte
1300
1308
  type ObjectSearchListItemProps = SelectedItemProps & {
1301
1309
  /** sets the content type value, this is normally used for subtitles e.g. Kitchens */
1302
1310
  contentType?: string | string[];
1303
- /** sets image parameters */
1311
+ /** sets image parameters
1312
+ * @deprecated Please use imageUrl to make it compatible with */
1304
1313
  image?: {
1305
1314
  /** sets the src valuue */
1306
1315
  src: string;
@@ -1315,6 +1324,7 @@ type ObjectSearchListItemProps = SelectedItemProps & {
1315
1324
  */
1316
1325
  height?: number;
1317
1326
  };
1327
+ imageUrl?: string;
1318
1328
  /** sets the function call on the role="button" wrapping element */
1319
1329
  onSelect?: (data?: Record<string, unknown>) => void;
1320
1330
  /** allows child components within the popover data */
@@ -1331,7 +1341,7 @@ type ObjectSearchListItemProps = SelectedItemProps & {
1331
1341
  /**
1332
1342
  * @description entry search list item is an opinionated UI component best used for initial retrieved results
1333
1343
  * @example <ObjectSearchListItem id="my-result-item" title="title" popoverData={<p>some data info</p>}><div>example of uncontrolled content</div></ObjectSearchListItem> */
1334
- declare const ObjectSearchListItem: ({ id, title, contentType, image, popoverData, onSelect, isMulti, disabled, children, }: ObjectSearchListItemProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1344
+ declare const ObjectSearchListItem: ({ id, title, contentType, image, imageUrl, popoverData, onSelect, isMulti, disabled, children, }: ObjectSearchListItemProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1335
1345
  /**
1336
1346
  * An opinionated loading skeleton component best used with ObjectSearchListItem
1337
1347
  * @example <ObjectSearchListItemLoadingSkeleton />
package/dist/index.d.ts CHANGED
@@ -441,6 +441,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
441
441
  type: TLocationType;
442
442
  }> | Extract<_uniformdev_mesh_sdk.SettingsLocation<TLocationValue>, {
443
443
  type: TLocationType;
444
+ }> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
445
+ type: TLocationType;
444
446
  }>, "setValue"> & {
445
447
  setValue: SetLocationValueDispatch<(Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
446
448
  type: TLocationType;
@@ -454,6 +456,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
454
456
  type: TLocationType;
455
457
  }> | Extract<_uniformdev_mesh_sdk.SettingsLocation<TLocationValue>, {
456
458
  type: TLocationType;
459
+ }> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
460
+ type: TLocationType;
457
461
  }>)["value"], Parameters<(Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
458
462
  type: TLocationType;
459
463
  }> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
@@ -466,6 +470,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
466
470
  type: TLocationType;
467
471
  }> | Extract<_uniformdev_mesh_sdk.SettingsLocation<TLocationValue>, {
468
472
  type: TLocationType;
473
+ }> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
474
+ type: TLocationType;
469
475
  }>)["setValue"]>[0]>;
470
476
  };
471
477
  type SetLocationValueDispatch<TValue, TSetValue = TValue> = (dispatch: SetLocationValueFunction<TValue, TSetValue>) => Promise<void> | void;
@@ -772,7 +778,7 @@ type InputVariablesProps<TEditorContext = unknown> = {
772
778
  /** Enables mutliple lines in the input (\n in the value) */
773
779
  multiLine?: boolean;
774
780
  /** Disables the inline variable selection menu when rendering a variables input */
775
- disableInlineMenu?: boolean;
781
+ disableInlineMenu?: boolean | 'by-label' | 'by-input';
776
782
  /**
777
783
  * Enables clicking a variable reference to edit the variable
778
784
  * Note: automatically disabled if `disabled` or `disableVariables` is set
@@ -803,6 +809,8 @@ type InputVariablesProps<TEditorContext = unknown> = {
803
809
  * * Performing other custom mutations to the variables editor, such as inserting text from a button click.
804
810
  */
805
811
  editorRef?: MutableRefObject<LexicalEditor | null>;
812
+ /** The compact style is similar to the parameters panel */
813
+ styleVariant?: 'default' | 'compact';
806
814
  } & PasteTransformerPluginProps & UseInputVariablesStateProps<TEditorContext>;
807
815
  /**
808
816
  * An input box that enables insertion of 'variables', provided by VariablesProvider,
@@ -1178,8 +1186,8 @@ type ObjectSearchFilterProps = {
1178
1186
  * @default 'Content Type Select'
1179
1187
  */
1180
1188
  selectLabel?: string;
1181
- /** sets the select input options */
1182
- selectOptions: Array<{
1189
+ /** sets the select input options, if empty - only keyword search field will be rendered */
1190
+ selectOptions?: Array<{
1183
1191
  id: string;
1184
1192
  name?: string;
1185
1193
  label: string;
@@ -1195,7 +1203,7 @@ type ObjectSearchFilterProps = {
1195
1203
  };
1196
1204
  /**
1197
1205
  * @description Object search filter is an opinionated filter that has pre-defined query and setQuery functions
1198
- * that can be extended with custom fuctions
1206
+ * that can be extended with custom functions
1199
1207
  * @example <ObjectSearchFilter selectOptions={[{ id: 'id value', name: 'name value'}]} /> */
1200
1208
  declare const ObjectSearchFilter: ({ requireContentType, typeSelectorAllTypesOptionText, searchInputName, searchInputPlaceholderText, selectLabel, selectOptions, }: ObjectSearchFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1201
1209
 
@@ -1300,7 +1308,8 @@ declare function useObjectSearchContext<TExtraSearchFilters = unknown, TExtraIte
1300
1308
  type ObjectSearchListItemProps = SelectedItemProps & {
1301
1309
  /** sets the content type value, this is normally used for subtitles e.g. Kitchens */
1302
1310
  contentType?: string | string[];
1303
- /** sets image parameters */
1311
+ /** sets image parameters
1312
+ * @deprecated Please use imageUrl to make it compatible with */
1304
1313
  image?: {
1305
1314
  /** sets the src valuue */
1306
1315
  src: string;
@@ -1315,6 +1324,7 @@ type ObjectSearchListItemProps = SelectedItemProps & {
1315
1324
  */
1316
1325
  height?: number;
1317
1326
  };
1327
+ imageUrl?: string;
1318
1328
  /** sets the function call on the role="button" wrapping element */
1319
1329
  onSelect?: (data?: Record<string, unknown>) => void;
1320
1330
  /** allows child components within the popover data */
@@ -1331,7 +1341,7 @@ type ObjectSearchListItemProps = SelectedItemProps & {
1331
1341
  /**
1332
1342
  * @description entry search list item is an opinionated UI component best used for initial retrieved results
1333
1343
  * @example <ObjectSearchListItem id="my-result-item" title="title" popoverData={<p>some data info</p>}><div>example of uncontrolled content</div></ObjectSearchListItem> */
1334
- declare const ObjectSearchListItem: ({ id, title, contentType, image, popoverData, onSelect, isMulti, disabled, children, }: ObjectSearchListItemProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1344
+ declare const ObjectSearchListItem: ({ id, title, contentType, image, imageUrl, popoverData, onSelect, isMulti, disabled, children, }: ObjectSearchListItemProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1335
1345
  /**
1336
1346
  * An opinionated loading skeleton component best used with ObjectSearchListItem
1337
1347
  * @example <ObjectSearchListItemLoadingSkeleton />
package/dist/index.esm.js CHANGED
@@ -4075,6 +4075,11 @@ var input = css21`
4075
4075
  margin: 0;
4076
4076
  }
4077
4077
  `;
4078
+ var inputCompact = css21`
4079
+ border: 1px solid var(--white);
4080
+ padding-block: var(--spacing-sm);
4081
+ font-size: var(--fs-sm);
4082
+ `;
4078
4083
 
4079
4084
  // src/components/Variables/toolbox/InputVariablesProvider.tsx
4080
4085
  import * as React10 from "react";
@@ -4598,12 +4603,12 @@ function InputVariables(props) {
4598
4603
  getEditorContext,
4599
4604
  disabled,
4600
4605
  editorRef,
4601
- filterVariable
4606
+ filterVariable,
4607
+ styleVariant = "default"
4602
4608
  } = props;
4603
4609
  const [finalId] = useState12(id != null ? id : () => v42());
4604
4610
  const { dispatch, canDispatch, isEditing } = useVariables(true);
4605
4611
  const { disableVariablesForReals, hadVariablesInValue, sharedMenuProps } = useInputVariablesState(props);
4606
- const disableInlineVariablesForReals = disableVariablesForReals || disableInlineMenu;
4607
4612
  const useInputWithNoVariables = Boolean(inputWhenNoVariables && !hadVariablesInValue);
4608
4613
  const input3 = /* @__PURE__ */ jsxs23(
4609
4614
  "div",
@@ -4618,7 +4623,7 @@ function InputVariables(props) {
4618
4623
  InputVariablesOverlayMenu,
4619
4624
  {
4620
4625
  ...sharedMenuProps,
4621
- disabled: disableInlineVariablesForReals,
4626
+ disabled: disableVariablesForReals || disableInlineMenu === true || disableInlineMenu === "by-input",
4622
4627
  replaceValueOnVariableInsert: useInputWithNoVariables,
4623
4628
  useInputWhenNoVariables: useInputWithNoVariables,
4624
4629
  children: /* @__PURE__ */ jsx39(
@@ -4628,7 +4633,7 @@ function InputVariables(props) {
4628
4633
  "aria-label": ariaLabel,
4629
4634
  "data-testid": dataTestId ? dataTestId : "input-container",
4630
4635
  "data-text-value": value,
4631
- css: input
4636
+ css: [input, styleVariant === "compact" ? inputCompact : null]
4632
4637
  }
4633
4638
  )
4634
4639
  }
@@ -4652,7 +4657,7 @@ function InputVariables(props) {
4652
4657
  },
4653
4658
  id: finalId,
4654
4659
  isActive: hadVariablesInValue,
4655
- disableVariables: disableVariablesForReals,
4660
+ disableVariables: disableVariablesForReals || disableInlineMenu === "by-label",
4656
4661
  children: input3
4657
4662
  }
4658
4663
  );
@@ -6287,7 +6292,7 @@ var ObjectSearchContainer = ({
6287
6292
 
6288
6293
  // src/components/ObjectSearch/ObjectSearchFilter.tsx
6289
6294
  import { InputKeywordSearch as InputKeywordSearch2, InputSelect as InputSelect6 } from "@uniformdev/design-system";
6290
- import { useState as useState16 } from "react";
6295
+ import { useMemo as useMemo15, useState as useState16 } from "react";
6291
6296
 
6292
6297
  // src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
6293
6298
  import { css as css32 } from "@emotion/react";
@@ -6303,9 +6308,6 @@ var ObjectSearchFilterContainer = css32`
6303
6308
  display: grid;
6304
6309
  gap: var(--spacing-base);
6305
6310
  `;
6306
- var ObjectSearchFilterDropdownAndTextSearch = css32`
6307
- grid-template-columns: 0.5fr 1fr;
6308
- `;
6309
6311
  var ObjectSearchFilterGrid = (gridColumns) => css32`
6310
6312
  display: grid;
6311
6313
  grid-template-columns: ${gridColumns};
@@ -6333,35 +6335,51 @@ var ObjectSearchFilter = ({
6333
6335
  });
6334
6336
  onSetQuery({ ...query, ...value });
6335
6337
  };
6336
- return /* @__PURE__ */ jsxs35("fieldset", { css: [ObjectSearchFilterContainer, ObjectSearchFilterDropdownAndTextSearch], children: [
6337
- /* @__PURE__ */ jsx60(
6338
- InputSelect6,
6339
- {
6340
- label: selectLabel,
6341
- showLabel: false,
6342
- onChange: (e) => handleFilterChange({ contentType: e.target.value }),
6343
- options: [
6344
- ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
6345
- ...selectOptions ? selectOptions.map((option) => {
6346
- var _a;
6347
- return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
6348
- }) : []
6349
- ],
6350
- value: query.contentType
6351
- }
6352
- ),
6353
- /* @__PURE__ */ jsx60(
6354
- InputKeywordSearch2,
6355
- {
6356
- inputFieldName: searchInputName,
6357
- placeholder: searchInputPlaceholderText,
6358
- onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
6359
- disabledFieldSubmission: true,
6360
- onClear: () => handleFilterChange({ keyword: "" }),
6361
- value: searchState.keyword
6362
- }
6363
- )
6364
- ] });
6338
+ const memoizedSelectOptions = useMemo15(() => {
6339
+ if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
6340
+ return [];
6341
+ }
6342
+ return [
6343
+ ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
6344
+ ...selectOptions ? selectOptions.map((option) => {
6345
+ var _a;
6346
+ return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
6347
+ }) : []
6348
+ ];
6349
+ }, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
6350
+ const shouldRenderSelect = memoizedSelectOptions.length > 0;
6351
+ return /* @__PURE__ */ jsxs35(
6352
+ "fieldset",
6353
+ {
6354
+ css: [
6355
+ ObjectSearchFilterContainer,
6356
+ ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
6357
+ ],
6358
+ children: [
6359
+ memoizedSelectOptions.length ? /* @__PURE__ */ jsx60(
6360
+ InputSelect6,
6361
+ {
6362
+ label: selectLabel,
6363
+ showLabel: false,
6364
+ onChange: (e) => handleFilterChange({ contentType: e.target.value }),
6365
+ options: memoizedSelectOptions,
6366
+ value: query.contentType
6367
+ }
6368
+ ) : null,
6369
+ /* @__PURE__ */ jsx60(
6370
+ InputKeywordSearch2,
6371
+ {
6372
+ inputFieldName: searchInputName,
6373
+ placeholder: searchInputPlaceholderText,
6374
+ onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
6375
+ disabledFieldSubmission: true,
6376
+ onClear: () => handleFilterChange({ keyword: "" }),
6377
+ value: searchState.keyword
6378
+ }
6379
+ )
6380
+ ]
6381
+ }
6382
+ );
6365
6383
  };
6366
6384
 
6367
6385
  // src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
@@ -6420,6 +6438,10 @@ var ObjectListItemHeadingGroup = css33`
6420
6438
  align-items: center;
6421
6439
  display: grid;
6422
6440
  `;
6441
+ var ObjectListItemThumbnail = css33`
6442
+ width: 30px;
6443
+ object-fit: contain;
6444
+ `;
6423
6445
  var ObjectListItemTitle = css33`
6424
6446
  color: var(--brand-secondary-1);
6425
6447
  display: block;
@@ -6453,6 +6475,7 @@ var ObjectSearchListItem = ({
6453
6475
  title,
6454
6476
  contentType,
6455
6477
  image,
6478
+ imageUrl,
6456
6479
  popoverData,
6457
6480
  onSelect,
6458
6481
  isMulti = false,
@@ -6464,7 +6487,7 @@ var ObjectSearchListItem = ({
6464
6487
  const handleSelectItem = () => {
6465
6488
  var _a;
6466
6489
  const extraData = (_a = onSelect == null ? void 0 : onSelect()) != null ? _a : {};
6467
- const selectedItem = { id, title, contentType, image, popoverData, ...extraData };
6490
+ const selectedItem = { id, title, contentType, imageUrl, image, popoverData, ...extraData };
6468
6491
  if (isMulti) {
6469
6492
  return onSelectItem(selectedItem);
6470
6493
  }
@@ -6485,7 +6508,8 @@ var ObjectSearchListItem = ({
6485
6508
  css: ObjectListItemControlledContent,
6486
6509
  "aria-disabled": disabled,
6487
6510
  children: [
6488
- !image ? null : /* @__PURE__ */ jsx62("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
6511
+ !imageUrl ? null : /* @__PURE__ */ jsx62("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectListItemThumbnail }),
6512
+ !image || imageUrl ? null : /* @__PURE__ */ jsx62("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
6489
6513
  /* @__PURE__ */ jsxs37("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
6490
6514
  !contentType ? null : /* @__PURE__ */ jsx62("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
6491
6515
  /* @__PURE__ */ jsx62("span", { css: ObjectListItemTitle, children: title })
@@ -6985,7 +7009,7 @@ var QueryFilter = ({
6985
7009
  };
6986
7010
 
6987
7011
  // src/components/ParamTypeDynamicDataProvider.tsx
6988
- import { useEffect as useEffect17, useMemo as useMemo15, useRef as useRef15 } from "react";
7012
+ import { useEffect as useEffect17, useMemo as useMemo16, useRef as useRef15 } from "react";
6989
7013
  import { jsx as jsx67 } from "@emotion/react/jsx-runtime";
6990
7014
  function ParamTypeDynamicDataProvider(props) {
6991
7015
  const { children } = props;
@@ -6994,7 +7018,7 @@ function ParamTypeDynamicDataProvider(props) {
6994
7018
  } = useMeshLocation("paramType");
6995
7019
  const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
6996
7020
  const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
6997
- const variables = useMemo15(
7021
+ const variables = useMemo16(
6998
7022
  () => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
6999
7023
  [dynamicInputsAsVariables, connectedDataAsVariables]
7000
7024
  );
package/dist/index.js CHANGED
@@ -4253,6 +4253,11 @@ var input = import_react41.css`
4253
4253
  margin: 0;
4254
4254
  }
4255
4255
  `;
4256
+ var inputCompact = import_react41.css`
4257
+ border: 1px solid var(--white);
4258
+ padding-block: var(--spacing-sm);
4259
+ font-size: var(--fs-sm);
4260
+ `;
4256
4261
 
4257
4262
  // src/components/Variables/toolbox/InputVariablesProvider.tsx
4258
4263
  var React10 = __toESM(require("react"));
@@ -4764,12 +4769,12 @@ function InputVariables(props) {
4764
4769
  getEditorContext,
4765
4770
  disabled,
4766
4771
  editorRef,
4767
- filterVariable
4772
+ filterVariable,
4773
+ styleVariant = "default"
4768
4774
  } = props;
4769
4775
  const [finalId] = (0, import_react49.useState)(id != null ? id : () => (0, import_uuid2.v4)());
4770
4776
  const { dispatch, canDispatch, isEditing } = useVariables(true);
4771
4777
  const { disableVariablesForReals, hadVariablesInValue, sharedMenuProps } = useInputVariablesState(props);
4772
- const disableInlineVariablesForReals = disableVariablesForReals || disableInlineMenu;
4773
4778
  const useInputWithNoVariables = Boolean(inputWhenNoVariables && !hadVariablesInValue);
4774
4779
  const input3 = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
4775
4780
  "div",
@@ -4784,7 +4789,7 @@ function InputVariables(props) {
4784
4789
  InputVariablesOverlayMenu,
4785
4790
  {
4786
4791
  ...sharedMenuProps,
4787
- disabled: disableInlineVariablesForReals,
4792
+ disabled: disableVariablesForReals || disableInlineMenu === true || disableInlineMenu === "by-input",
4788
4793
  replaceValueOnVariableInsert: useInputWithNoVariables,
4789
4794
  useInputWhenNoVariables: useInputWithNoVariables,
4790
4795
  children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
@@ -4794,7 +4799,7 @@ function InputVariables(props) {
4794
4799
  "aria-label": ariaLabel,
4795
4800
  "data-testid": dataTestId ? dataTestId : "input-container",
4796
4801
  "data-text-value": value,
4797
- css: input
4802
+ css: [input, styleVariant === "compact" ? inputCompact : null]
4798
4803
  }
4799
4804
  )
4800
4805
  }
@@ -4818,7 +4823,7 @@ function InputVariables(props) {
4818
4823
  },
4819
4824
  id: finalId,
4820
4825
  isActive: hadVariablesInValue,
4821
- disableVariables: disableVariablesForReals,
4826
+ disableVariables: disableVariablesForReals || disableInlineMenu === "by-label",
4822
4827
  children: input3
4823
4828
  }
4824
4829
  );
@@ -6434,9 +6439,6 @@ var ObjectSearchFilterContainer = import_react66.css`
6434
6439
  display: grid;
6435
6440
  gap: var(--spacing-base);
6436
6441
  `;
6437
- var ObjectSearchFilterDropdownAndTextSearch = import_react66.css`
6438
- grid-template-columns: 0.5fr 1fr;
6439
- `;
6440
6442
  var ObjectSearchFilterGrid = (gridColumns) => import_react66.css`
6441
6443
  display: grid;
6442
6444
  grid-template-columns: ${gridColumns};
@@ -6464,35 +6466,51 @@ var ObjectSearchFilter = ({
6464
6466
  });
6465
6467
  onSetQuery({ ...query, ...value });
6466
6468
  };
6467
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("fieldset", { css: [ObjectSearchFilterContainer, ObjectSearchFilterDropdownAndTextSearch], children: [
6468
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6469
- import_design_system33.InputSelect,
6470
- {
6471
- label: selectLabel,
6472
- showLabel: false,
6473
- onChange: (e) => handleFilterChange({ contentType: e.target.value }),
6474
- options: [
6475
- ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
6476
- ...selectOptions ? selectOptions.map((option) => {
6477
- var _a;
6478
- return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
6479
- }) : []
6480
- ],
6481
- value: query.contentType
6482
- }
6483
- ),
6484
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6485
- import_design_system33.InputKeywordSearch,
6486
- {
6487
- inputFieldName: searchInputName,
6488
- placeholder: searchInputPlaceholderText,
6489
- onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
6490
- disabledFieldSubmission: true,
6491
- onClear: () => handleFilterChange({ keyword: "" }),
6492
- value: searchState.keyword
6493
- }
6494
- )
6495
- ] });
6469
+ const memoizedSelectOptions = (0, import_react67.useMemo)(() => {
6470
+ if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
6471
+ return [];
6472
+ }
6473
+ return [
6474
+ ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
6475
+ ...selectOptions ? selectOptions.map((option) => {
6476
+ var _a;
6477
+ return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
6478
+ }) : []
6479
+ ];
6480
+ }, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
6481
+ const shouldRenderSelect = memoizedSelectOptions.length > 0;
6482
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
6483
+ "fieldset",
6484
+ {
6485
+ css: [
6486
+ ObjectSearchFilterContainer,
6487
+ ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
6488
+ ],
6489
+ children: [
6490
+ memoizedSelectOptions.length ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6491
+ import_design_system33.InputSelect,
6492
+ {
6493
+ label: selectLabel,
6494
+ showLabel: false,
6495
+ onChange: (e) => handleFilterChange({ contentType: e.target.value }),
6496
+ options: memoizedSelectOptions,
6497
+ value: query.contentType
6498
+ }
6499
+ ) : null,
6500
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6501
+ import_design_system33.InputKeywordSearch,
6502
+ {
6503
+ inputFieldName: searchInputName,
6504
+ placeholder: searchInputPlaceholderText,
6505
+ onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
6506
+ disabledFieldSubmission: true,
6507
+ onClear: () => handleFilterChange({ keyword: "" }),
6508
+ value: searchState.keyword
6509
+ }
6510
+ )
6511
+ ]
6512
+ }
6513
+ );
6496
6514
  };
6497
6515
 
6498
6516
  // src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
@@ -6551,6 +6569,10 @@ var ObjectListItemHeadingGroup = import_react68.css`
6551
6569
  align-items: center;
6552
6570
  display: grid;
6553
6571
  `;
6572
+ var ObjectListItemThumbnail = import_react68.css`
6573
+ width: 30px;
6574
+ object-fit: contain;
6575
+ `;
6554
6576
  var ObjectListItemTitle = import_react68.css`
6555
6577
  color: var(--brand-secondary-1);
6556
6578
  display: block;
@@ -6584,6 +6606,7 @@ var ObjectSearchListItem = ({
6584
6606
  title,
6585
6607
  contentType,
6586
6608
  image,
6609
+ imageUrl,
6587
6610
  popoverData,
6588
6611
  onSelect,
6589
6612
  isMulti = false,
@@ -6595,7 +6618,7 @@ var ObjectSearchListItem = ({
6595
6618
  const handleSelectItem = () => {
6596
6619
  var _a;
6597
6620
  const extraData = (_a = onSelect == null ? void 0 : onSelect()) != null ? _a : {};
6598
- const selectedItem = { id, title, contentType, image, popoverData, ...extraData };
6621
+ const selectedItem = { id, title, contentType, imageUrl, image, popoverData, ...extraData };
6599
6622
  if (isMulti) {
6600
6623
  return onSelectItem(selectedItem);
6601
6624
  }
@@ -6616,7 +6639,8 @@ var ObjectSearchListItem = ({
6616
6639
  css: ObjectListItemControlledContent,
6617
6640
  "aria-disabled": disabled,
6618
6641
  children: [
6619
- !image ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
6642
+ !imageUrl ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectListItemThumbnail }),
6643
+ !image || imageUrl ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
6620
6644
  /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
6621
6645
  !contentType ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
6622
6646
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { css: ObjectListItemTitle, children: title })
package/dist/index.mjs CHANGED
@@ -4075,6 +4075,11 @@ var input = css21`
4075
4075
  margin: 0;
4076
4076
  }
4077
4077
  `;
4078
+ var inputCompact = css21`
4079
+ border: 1px solid var(--white);
4080
+ padding-block: var(--spacing-sm);
4081
+ font-size: var(--fs-sm);
4082
+ `;
4078
4083
 
4079
4084
  // src/components/Variables/toolbox/InputVariablesProvider.tsx
4080
4085
  import * as React10 from "react";
@@ -4598,12 +4603,12 @@ function InputVariables(props) {
4598
4603
  getEditorContext,
4599
4604
  disabled,
4600
4605
  editorRef,
4601
- filterVariable
4606
+ filterVariable,
4607
+ styleVariant = "default"
4602
4608
  } = props;
4603
4609
  const [finalId] = useState12(id != null ? id : () => v42());
4604
4610
  const { dispatch, canDispatch, isEditing } = useVariables(true);
4605
4611
  const { disableVariablesForReals, hadVariablesInValue, sharedMenuProps } = useInputVariablesState(props);
4606
- const disableInlineVariablesForReals = disableVariablesForReals || disableInlineMenu;
4607
4612
  const useInputWithNoVariables = Boolean(inputWhenNoVariables && !hadVariablesInValue);
4608
4613
  const input3 = /* @__PURE__ */ jsxs23(
4609
4614
  "div",
@@ -4618,7 +4623,7 @@ function InputVariables(props) {
4618
4623
  InputVariablesOverlayMenu,
4619
4624
  {
4620
4625
  ...sharedMenuProps,
4621
- disabled: disableInlineVariablesForReals,
4626
+ disabled: disableVariablesForReals || disableInlineMenu === true || disableInlineMenu === "by-input",
4622
4627
  replaceValueOnVariableInsert: useInputWithNoVariables,
4623
4628
  useInputWhenNoVariables: useInputWithNoVariables,
4624
4629
  children: /* @__PURE__ */ jsx39(
@@ -4628,7 +4633,7 @@ function InputVariables(props) {
4628
4633
  "aria-label": ariaLabel,
4629
4634
  "data-testid": dataTestId ? dataTestId : "input-container",
4630
4635
  "data-text-value": value,
4631
- css: input
4636
+ css: [input, styleVariant === "compact" ? inputCompact : null]
4632
4637
  }
4633
4638
  )
4634
4639
  }
@@ -4652,7 +4657,7 @@ function InputVariables(props) {
4652
4657
  },
4653
4658
  id: finalId,
4654
4659
  isActive: hadVariablesInValue,
4655
- disableVariables: disableVariablesForReals,
4660
+ disableVariables: disableVariablesForReals || disableInlineMenu === "by-label",
4656
4661
  children: input3
4657
4662
  }
4658
4663
  );
@@ -6287,7 +6292,7 @@ var ObjectSearchContainer = ({
6287
6292
 
6288
6293
  // src/components/ObjectSearch/ObjectSearchFilter.tsx
6289
6294
  import { InputKeywordSearch as InputKeywordSearch2, InputSelect as InputSelect6 } from "@uniformdev/design-system";
6290
- import { useState as useState16 } from "react";
6295
+ import { useMemo as useMemo15, useState as useState16 } from "react";
6291
6296
 
6292
6297
  // src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
6293
6298
  import { css as css32 } from "@emotion/react";
@@ -6303,9 +6308,6 @@ var ObjectSearchFilterContainer = css32`
6303
6308
  display: grid;
6304
6309
  gap: var(--spacing-base);
6305
6310
  `;
6306
- var ObjectSearchFilterDropdownAndTextSearch = css32`
6307
- grid-template-columns: 0.5fr 1fr;
6308
- `;
6309
6311
  var ObjectSearchFilterGrid = (gridColumns) => css32`
6310
6312
  display: grid;
6311
6313
  grid-template-columns: ${gridColumns};
@@ -6333,35 +6335,51 @@ var ObjectSearchFilter = ({
6333
6335
  });
6334
6336
  onSetQuery({ ...query, ...value });
6335
6337
  };
6336
- return /* @__PURE__ */ jsxs35("fieldset", { css: [ObjectSearchFilterContainer, ObjectSearchFilterDropdownAndTextSearch], children: [
6337
- /* @__PURE__ */ jsx60(
6338
- InputSelect6,
6339
- {
6340
- label: selectLabel,
6341
- showLabel: false,
6342
- onChange: (e) => handleFilterChange({ contentType: e.target.value }),
6343
- options: [
6344
- ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
6345
- ...selectOptions ? selectOptions.map((option) => {
6346
- var _a;
6347
- return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
6348
- }) : []
6349
- ],
6350
- value: query.contentType
6351
- }
6352
- ),
6353
- /* @__PURE__ */ jsx60(
6354
- InputKeywordSearch2,
6355
- {
6356
- inputFieldName: searchInputName,
6357
- placeholder: searchInputPlaceholderText,
6358
- onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
6359
- disabledFieldSubmission: true,
6360
- onClear: () => handleFilterChange({ keyword: "" }),
6361
- value: searchState.keyword
6362
- }
6363
- )
6364
- ] });
6338
+ const memoizedSelectOptions = useMemo15(() => {
6339
+ if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
6340
+ return [];
6341
+ }
6342
+ return [
6343
+ ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
6344
+ ...selectOptions ? selectOptions.map((option) => {
6345
+ var _a;
6346
+ return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
6347
+ }) : []
6348
+ ];
6349
+ }, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
6350
+ const shouldRenderSelect = memoizedSelectOptions.length > 0;
6351
+ return /* @__PURE__ */ jsxs35(
6352
+ "fieldset",
6353
+ {
6354
+ css: [
6355
+ ObjectSearchFilterContainer,
6356
+ ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
6357
+ ],
6358
+ children: [
6359
+ memoizedSelectOptions.length ? /* @__PURE__ */ jsx60(
6360
+ InputSelect6,
6361
+ {
6362
+ label: selectLabel,
6363
+ showLabel: false,
6364
+ onChange: (e) => handleFilterChange({ contentType: e.target.value }),
6365
+ options: memoizedSelectOptions,
6366
+ value: query.contentType
6367
+ }
6368
+ ) : null,
6369
+ /* @__PURE__ */ jsx60(
6370
+ InputKeywordSearch2,
6371
+ {
6372
+ inputFieldName: searchInputName,
6373
+ placeholder: searchInputPlaceholderText,
6374
+ onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
6375
+ disabledFieldSubmission: true,
6376
+ onClear: () => handleFilterChange({ keyword: "" }),
6377
+ value: searchState.keyword
6378
+ }
6379
+ )
6380
+ ]
6381
+ }
6382
+ );
6365
6383
  };
6366
6384
 
6367
6385
  // src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
@@ -6420,6 +6438,10 @@ var ObjectListItemHeadingGroup = css33`
6420
6438
  align-items: center;
6421
6439
  display: grid;
6422
6440
  `;
6441
+ var ObjectListItemThumbnail = css33`
6442
+ width: 30px;
6443
+ object-fit: contain;
6444
+ `;
6423
6445
  var ObjectListItemTitle = css33`
6424
6446
  color: var(--brand-secondary-1);
6425
6447
  display: block;
@@ -6453,6 +6475,7 @@ var ObjectSearchListItem = ({
6453
6475
  title,
6454
6476
  contentType,
6455
6477
  image,
6478
+ imageUrl,
6456
6479
  popoverData,
6457
6480
  onSelect,
6458
6481
  isMulti = false,
@@ -6464,7 +6487,7 @@ var ObjectSearchListItem = ({
6464
6487
  const handleSelectItem = () => {
6465
6488
  var _a;
6466
6489
  const extraData = (_a = onSelect == null ? void 0 : onSelect()) != null ? _a : {};
6467
- const selectedItem = { id, title, contentType, image, popoverData, ...extraData };
6490
+ const selectedItem = { id, title, contentType, imageUrl, image, popoverData, ...extraData };
6468
6491
  if (isMulti) {
6469
6492
  return onSelectItem(selectedItem);
6470
6493
  }
@@ -6485,7 +6508,8 @@ var ObjectSearchListItem = ({
6485
6508
  css: ObjectListItemControlledContent,
6486
6509
  "aria-disabled": disabled,
6487
6510
  children: [
6488
- !image ? null : /* @__PURE__ */ jsx62("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
6511
+ !imageUrl ? null : /* @__PURE__ */ jsx62("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectListItemThumbnail }),
6512
+ !image || imageUrl ? null : /* @__PURE__ */ jsx62("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
6489
6513
  /* @__PURE__ */ jsxs37("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
6490
6514
  !contentType ? null : /* @__PURE__ */ jsx62("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
6491
6515
  /* @__PURE__ */ jsx62("span", { css: ObjectListItemTitle, children: title })
@@ -6985,7 +7009,7 @@ var QueryFilter = ({
6985
7009
  };
6986
7010
 
6987
7011
  // src/components/ParamTypeDynamicDataProvider.tsx
6988
- import { useEffect as useEffect17, useMemo as useMemo15, useRef as useRef15 } from "react";
7012
+ import { useEffect as useEffect17, useMemo as useMemo16, useRef as useRef15 } from "react";
6989
7013
  import { jsx as jsx67 } from "@emotion/react/jsx-runtime";
6990
7014
  function ParamTypeDynamicDataProvider(props) {
6991
7015
  const { children } = props;
@@ -6994,7 +7018,7 @@ function ParamTypeDynamicDataProvider(props) {
6994
7018
  } = useMeshLocation("paramType");
6995
7019
  const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
6996
7020
  const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
6997
- const variables = useMemo15(
7021
+ const variables = useMemo16(
6998
7022
  () => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
6999
7023
  [dynamicInputsAsVariables, connectedDataAsVariables]
7000
7024
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk-react",
3
- "version": "19.49.1",
3
+ "version": "19.49.4-alpha.67+9773e3b65",
4
4
  "description": "Uniform Mesh Framework SDK for React",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -50,9 +50,9 @@
50
50
  "@lexical/selection": "^0.12.0",
51
51
  "@lexical/utils": "^0.12.0",
52
52
  "@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v4.10.1/react-icons-all-files-4.10.1.tgz",
53
- "@uniformdev/canvas": "19.49.1",
54
- "@uniformdev/design-system": "19.49.1",
55
- "@uniformdev/mesh-sdk": "19.49.1",
53
+ "@uniformdev/canvas": "19.49.4-alpha.67+9773e3b65",
54
+ "@uniformdev/design-system": "19.49.4-alpha.67+9773e3b65",
55
+ "@uniformdev/mesh-sdk": "19.49.4-alpha.67+9773e3b65",
56
56
  "dequal": "^2.0.3",
57
57
  "lexical": "^0.12.0",
58
58
  "mitt": "^3.0.0",
@@ -73,10 +73,10 @@
73
73
  "@emotion/react": "11.11.1",
74
74
  "@storybook/react": "6.5.16",
75
75
  "@svgr/cli": "6.5.1",
76
- "@types/react": "18.2.20",
76
+ "@types/react": "18.2.21",
77
77
  "@types/react-beautiful-dnd": "13.1.4",
78
78
  "@types/react-dom": "18.2.7",
79
- "@types/uuid": "9.0.2",
79
+ "@types/uuid": "9.0.3",
80
80
  "react": "18.2.0",
81
81
  "react-dom": "18.2.0"
82
82
  },
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "a14b97601fb78b44be7f0849841b9828dec0ea96"
89
+ "gitHead": "9773e3b65168255768f5cbecf2536988fa0e03af"
90
90
  }