@uniformdev/mesh-sdk-react 19.23.1-alpha.13 → 19.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -441,14 +441,6 @@ type DispatchResult<TSetValue> = {
441
441
  newValue: TSetValue;
442
442
  };
443
443
 
444
- type PasteTransformerPluginProps = {
445
- /**
446
- * Transforms pasted contents before inserting them.
447
- * Return undefined to execute default paste behaviour, or a string to set the paste's contents.
448
- */
449
- transformPaste?: (pastedText: string) => string | undefined;
450
- };
451
-
452
444
  type InputToken = {
453
445
  name: string;
454
446
  value: string;
@@ -464,6 +456,11 @@ type InputVariablesProps = {
464
456
  value: string;
465
457
  /** sets the passed down function call */
466
458
  onChange: (newValue: string) => void;
459
+ /**
460
+ * Called when the field is pasted into
461
+ * Note that this will auto-cancel onChange after the paste when defined.
462
+ */
463
+ onPaste?: (newValue: string) => void;
467
464
  /** Disables using variables in the input */
468
465
  disableVariables?: boolean;
469
466
  /** Turns off the 'Reset' menu option that is added by default when variables are bound to */
@@ -472,8 +469,6 @@ type InputVariablesProps = {
472
469
  showAddVariableMenuOption?: boolean;
473
470
  /** Disables the inline variable selection menu when rendering a variables input */
474
471
  disableInlineMenu?: boolean;
475
- /** Enables clicking a variable reference to edit the variable */
476
- enableEditingVariables?: boolean;
477
472
  /**
478
473
  * When no variables are referenced in the value, and this prop is provided,
479
474
  * the variables-injection input will be replaced with this component.
@@ -487,23 +482,20 @@ type InputVariablesProps = {
487
482
  infoMessage?: string;
488
483
  /** (optional) sets caption text value */
489
484
  caption?: string;
490
- /** Sets the test ID of the input */
491
- 'data-test-id'?: string;
492
- } & PasteTransformerPluginProps;
493
- declare function InputVariables({ id, 'aria-label': ariaLabel, label, value, disableVariables, disableReset, enableEditingVariables, disableInlineMenu, onChange, transformPaste, showAddVariableMenuOption, inputWhenNoVariables, caption, errorMessage, warningMessage, infoMessage, 'data-test-id': dataTestId, }: InputVariablesProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
485
+ };
486
+ declare function InputVariables({ id, 'aria-label': ariaLabel, label, value, disableVariables, disableReset, disableInlineMenu, onChange, onPaste, showAddVariableMenuOption, inputWhenNoVariables, caption, errorMessage, warningMessage, infoMessage, ...inputProps }: InputVariablesProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
494
487
 
495
- /** Expected prefix for variable expressions */
488
+ /**
489
+ * A regular expression that matches Uniform variable expressions
490
+ * in the form of ${variableName}.
491
+ */
492
+ declare const variableExpression: RegExp;
496
493
  declare const variablePrefix = "${";
497
- /** Expected suffix for variable expressions */
498
494
  declare const variableSuffix = "}";
499
495
 
500
496
  type DataVariableDefinitionWithName = {
501
497
  name: string;
502
498
  } & DataVariableDefinition;
503
- /**
504
- * Converts variable definitions stored in a map into a flat list,
505
- * respecting their `order` property if set, and sorting by display name otherwise.
506
- */
507
499
  declare function variablesToList(variables: Record<string, DataVariableDefinition> | undefined): Array<DataVariableDefinitionWithName>;
508
500
 
509
501
  type VariableEditorProps = {
@@ -518,21 +510,8 @@ declare function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip }
518
510
  declare function VariablesList(): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
519
511
 
520
512
  type VariablesProviderProps = React$1.PropsWithChildren<{
521
- /**
522
- * Signals that components in this variables context are not intended to allow mutation
523
- * of the variable values (i.e. editing, adding, or deleting variable definitions).
524
- *
525
- * Dispatching updates is still accepted, but will be ignored.
526
- */
527
- readOnly?: boolean;
528
- /** Variable values to load into the context */
529
513
  value: Record<string, DataVariableDefinition>;
530
- /** Function to handle mutations to the variable values (optional when readOnly is true) */
531
- onChange?: (newValue: Record<string, DataVariableDefinition>) => void;
532
- /**
533
- * Provide a component to handle editing a variable definition (e.g. a modal wrapper)
534
- * If not passed, the editor will be rendered inline, with potentially strange results.
535
- */
514
+ onChange: (newValue: Record<string, DataVariableDefinition>) => void;
536
515
  editVariableComponent?: React$1.ComponentType<VariableEditorProps>;
537
516
  }>;
538
517
  type VariablesAction = {
@@ -553,13 +532,6 @@ type VariablesEvents = {
553
532
  update: string;
554
533
  };
555
534
  type VariablesContext = {
556
- /**
557
- * Signals that components in this variables context are not intended to allow mutation
558
- * of the variable values (i.e. editing, adding, or deleting variable definitions).
559
- *
560
- * Dispatching updates is still accepted, but will be ignored.
561
- */
562
- readOnly?: boolean;
563
535
  /** Dispatch update events to the variables */
564
536
  dispatch: (event: VariablesAction) => void;
565
537
  /** The current variables value */
@@ -576,7 +548,7 @@ type VariablesContext = {
576
548
  */
577
549
  flatVariables: Readonly<Record<string, string>>;
578
550
  };
579
- declare function VariablesProvider({ value, onChange, editVariableComponent, readOnly, children, }: VariablesProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
551
+ declare function VariablesProvider({ value, onChange, editVariableComponent, children, }: VariablesProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
580
552
  declare function useVariables(returnEmptyWithoutProvider?: boolean): VariablesContext;
581
553
 
582
554
  type DataResourceVariablesListProps = {
@@ -1148,4 +1120,4 @@ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
1148
1120
  */
1149
1121
  declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
1150
1122
 
1151
- export { BaseRequestData, Brand, DamItem, DamSelectedItem, DamSelectedItemProps, DataRefreshButton, DataRefreshButtonProps, DataResourceDynamicInputProvider, DataResourceDynamicInputProviderProps, DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListExplicit, DataResourceVariablesListProps, DataSourceEditor, DataSourceEditorProps, DataTypeEditor, DataTypeEditorProps, DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, DispatchResult, EntrySearch, EntrySearchContentType, EntrySearchProps, EntrySearchQueryOptions, EntrySearchResult, EntrySearchRowProps, EntrySearchSelectedItemProps, GetProductOptions, GetProductsOptions, index as Icons, InputToken, InputVariables, InputVariablesProps, ItemListProps, LinkButton, MeshApp, MeshAppProps, MinimalDynamicInput, MinimalDynamicInputs, NoResultsProps, ObjectSearchContainer, ObjectSearchContainerProps, ObjectSearchContextProps, ObjectSearchFilter, ObjectSearchFilterContainer, ObjectSearchFilterContainerProps, ObjectSearchFilterProps, ObjectSearchListItem, ObjectSearchListItemLoadingSkeleton, ObjectSearchListItemProps, ObjectSearchProvider, ObjectSearchProviderProps, ObjectSearchResultItem, ObjectSearchResultItemButton, ObjectSearchResultItemButtonProps, ObjectSearchResultItemProps, ObjectSearchResultList, ObjectSearchResultListProps, ProductCategory, ProductDynamicSelectorValue, ProductPreviewList, ProductQuery, ProductQueryCategory, ProductQueryContext, ProductQueryContextValue, ProductQueryProps, ProductSearch, ProductSearchContext, ProductSearchContextValue, ProductSearchProps, ProductSearchResult, ProductSearchResults, ProductSearchRow, ProductSelectedItem, QueryFilter, QueryFilterProps, QueryFilterSearchProps, RequestAction, RequestBody, RequestContext, RequestData, RequestHeaders, RequestMethodSelect, RequestParameter, RequestParameters, RequestParametersProps, RequestProvider, RequestProviderProps, RequestTypeContainer, RequestTypeContainerProps, RequestUrl, RequestUrlInput, ResolvableLoadingValue, SearchQueryProps, SelectedItemProps, SelectionField, SelectionFieldValue, SetLocationValueDispatch, SetLocationValueFunction, TextVariableRenderer, VariableEditor, VariableEditorProps, VariablesAction, VariablesContext, VariablesEvents, VariablesList, VariablesProvider, VariablesProviderProps, badgeIcon, createLocationValidator, damSelectItemImage, damSelectedItemContainer, damSelectedItemCopy, damSelectedItemDetails, damSelectedItemIcon, damSelectedItemInfoBtn, damSelectedItemInner, damSelectedItemLinkBtn, damSelectedItemLinkContainer, damSelectedItemMediaContainer, damSelectedItemPopover, damSelectedItemPopoverLabel, damSelectedItemSmallText, damSelectedItemTitle, draggableContainer, draggableIcon, draggableIconOffset, draggableIconWrapper, entrySearchBtn, entrySearchConfig, entrySearchConfigHidden, entrySearchLoadMoreBtn, entrySearchResultList, entrySearchSelectIcon, entrySearchSelectImg, entrySearchSelectInput, entrySearchSelectOption, entrySearchWrapper, productSearchRowActiveIcon, productSearchRowCategory, productSearchRowContainer, productSearchRowContent, productSearchRowContentActive, productSearchRowDetails, productSearchRowTitle, productSelectedItemContainer, productSelectedItemContent, productSelectedItemDetails, productSelectedItemIcon, productSelectedItemImage, productSelectedItemLinkContainer, productedSelectedItemLinkBtn, productedSelectedItemSmallText, searchRowBtn, searchRowContainer, searchRowContainerActive, searchRowContainerWithPopover, searchRowPopover, searchRowText, searchRowTextSmall, selectItemLinkBtn, selectItemLinkContainer, selectItemPopover, selectItemPopoverLabel, selectItemSmallText, selectedItemContainer, selectedItemCopy, selectedItemDetails, selectedItemIcon, selectedItemInner, selectedItemTitle, urlEncodeRequestParameter, urlEncodeRequestUrl, useMeshLocation, useObjectSearchContext, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshSdk, useVariables, variablePrefix, variableSuffix, variablesToList };
1123
+ export { BaseRequestData, Brand, DamItem, DamSelectedItem, DamSelectedItemProps, DataRefreshButton, DataRefreshButtonProps, DataResourceDynamicInputProvider, DataResourceDynamicInputProviderProps, DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListExplicit, DataResourceVariablesListProps, DataSourceEditor, DataSourceEditorProps, DataTypeEditor, DataTypeEditorProps, DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, DispatchResult, EntrySearch, EntrySearchContentType, EntrySearchProps, EntrySearchQueryOptions, EntrySearchResult, EntrySearchRowProps, EntrySearchSelectedItemProps, GetProductOptions, GetProductsOptions, index as Icons, InputToken, InputVariables, InputVariablesProps, ItemListProps, LinkButton, MeshApp, MeshAppProps, MinimalDynamicInput, MinimalDynamicInputs, NoResultsProps, ObjectSearchContainer, ObjectSearchContainerProps, ObjectSearchContextProps, ObjectSearchFilter, ObjectSearchFilterContainer, ObjectSearchFilterContainerProps, ObjectSearchFilterProps, ObjectSearchListItem, ObjectSearchListItemLoadingSkeleton, ObjectSearchListItemProps, ObjectSearchProvider, ObjectSearchProviderProps, ObjectSearchResultItem, ObjectSearchResultItemButton, ObjectSearchResultItemButtonProps, ObjectSearchResultItemProps, ObjectSearchResultList, ObjectSearchResultListProps, ProductCategory, ProductDynamicSelectorValue, ProductPreviewList, ProductQuery, ProductQueryCategory, ProductQueryContext, ProductQueryContextValue, ProductQueryProps, ProductSearch, ProductSearchContext, ProductSearchContextValue, ProductSearchProps, ProductSearchResult, ProductSearchResults, ProductSearchRow, ProductSelectedItem, QueryFilter, QueryFilterProps, QueryFilterSearchProps, RequestAction, RequestBody, RequestContext, RequestData, RequestHeaders, RequestMethodSelect, RequestParameter, RequestParameters, RequestParametersProps, RequestProvider, RequestProviderProps, RequestTypeContainer, RequestTypeContainerProps, RequestUrl, RequestUrlInput, ResolvableLoadingValue, SearchQueryProps, SelectedItemProps, SelectionField, SelectionFieldValue, SetLocationValueDispatch, SetLocationValueFunction, TextVariableRenderer, VariableEditor, VariableEditorProps, VariablesAction, VariablesContext, VariablesEvents, VariablesList, VariablesProvider, VariablesProviderProps, badgeIcon, createLocationValidator, damSelectItemImage, damSelectedItemContainer, damSelectedItemCopy, damSelectedItemDetails, damSelectedItemIcon, damSelectedItemInfoBtn, damSelectedItemInner, damSelectedItemLinkBtn, damSelectedItemLinkContainer, damSelectedItemMediaContainer, damSelectedItemPopover, damSelectedItemPopoverLabel, damSelectedItemSmallText, damSelectedItemTitle, draggableContainer, draggableIcon, draggableIconOffset, draggableIconWrapper, entrySearchBtn, entrySearchConfig, entrySearchConfigHidden, entrySearchLoadMoreBtn, entrySearchResultList, entrySearchSelectIcon, entrySearchSelectImg, entrySearchSelectInput, entrySearchSelectOption, entrySearchWrapper, productSearchRowActiveIcon, productSearchRowCategory, productSearchRowContainer, productSearchRowContent, productSearchRowContentActive, productSearchRowDetails, productSearchRowTitle, productSelectedItemContainer, productSelectedItemContent, productSelectedItemDetails, productSelectedItemIcon, productSelectedItemImage, productSelectedItemLinkContainer, productedSelectedItemLinkBtn, productedSelectedItemSmallText, searchRowBtn, searchRowContainer, searchRowContainerActive, searchRowContainerWithPopover, searchRowPopover, searchRowText, searchRowTextSmall, selectItemLinkBtn, selectItemLinkContainer, selectItemPopover, selectItemPopoverLabel, selectItemSmallText, selectedItemContainer, selectedItemCopy, selectedItemDetails, selectedItemIcon, selectedItemInner, selectedItemTitle, urlEncodeRequestParameter, urlEncodeRequestUrl, useMeshLocation, useObjectSearchContext, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshSdk, useVariables, variableExpression, variablePrefix, variableSuffix, variablesToList };