@uniformdev/mesh-sdk-react 18.34.1-alpha.57 → 18.35.1-alpha.26

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
@@ -5,10 +5,11 @@ import { TDate } from 'timeago.js';
5
5
  import * as _emotion_react from '@emotion/react';
6
6
  import { DataVariableDefinition, DataResourceVariables } from '@uniformdev/canvas';
7
7
  import * as _uniformdev_mesh_sdk from '@uniformdev/mesh-sdk';
8
- import { MeshLocation, SetValueOptions, DataSourceLocationValue, DataTypeLocationValue, UniformMeshSDK, MeshLocationCore } from '@uniformdev/mesh-sdk';
8
+ import { MeshLocation, SetValueOptions, DataSourceLocationValue, DataTypeLocationValue } from '@uniformdev/mesh-sdk';
9
9
  export * from '@uniformdev/mesh-sdk';
10
+ import { Emitter } from 'mitt';
10
11
  import { BadgeThemeProps, InputSelectProps } from '@uniformdev/design-system';
11
- export { AddListButton, AddListButtonProps, Button, ButtonProps, Callout, CalloutProps, Heading, HeadingProps, Input, InputComboBox, InputComboBoxProps, InputKeywordSearch, InputProps, InputSelect, InputToggle, InputToggleProps, InputKeywordSearch as KeywordSearchInput, Label, LabelProps, LoadingIndicator, LoadingOverlay, Menu, MenuItem, MenuItemProps, MenuProps, ParameterGroup, ParameterGroupProps, ParameterImage, ParameterImageInner, ParameterImageProps, ParameterInput, ParameterInputInner, ParameterInputProps, ParameterLabel, ParameterLabelProps, ParameterMenuButton, ParameterMenuButtonProps, ParameterSelect, ParameterSelectInner, ParameterSelectProps, ParameterShell, ParameterShellContext, ParameterShellProps, ParameterTextarea, ParameterTextareaInner, ParameterTextareaProps, ParameterToggle, ParameterToggleInner, ParameterToggleProps, ScrollableList, ScrollableListItem, ScrollableListItemProps, ScrollableListProps, Switch, SwitchProps, Textarea, TextareaProps, Theme, ThemeProps, useParameterShell } from '@uniformdev/design-system';
12
+ export { AddListButton, AddListButtonProps, Button, ButtonProps, Callout, CalloutProps, Heading, HeadingProps, Input, InputComboBox, InputComboBoxProps, InputKeywordSearch, InputProps, InputSelect, InputToggle, InputToggleProps, Label, LabelProps, LoadingIndicator, LoadingOverlay, Menu, MenuItem, MenuItemProps, MenuProps, ParameterGroup, ParameterGroupProps, ParameterImage, ParameterImageInner, ParameterImageProps, ParameterInput, ParameterInputInner, ParameterInputProps, ParameterLabel, ParameterLabelProps, ParameterMenuButton, ParameterMenuButtonProps, ParameterSelect, ParameterSelectInner, ParameterSelectProps, ParameterShell, ParameterShellContext, ParameterShellProps, ParameterTextarea, ParameterTextareaInner, ParameterTextareaProps, ParameterToggle, ParameterToggleInner, ParameterToggleProps, ScrollableList, ScrollableListItem, ScrollableListItemProps, ScrollableListProps, Switch, SwitchProps, Textarea, TextareaProps, Theme, ThemeProps, useParameterShell } from '@uniformdev/design-system';
12
13
 
13
14
  declare const SvgCaution: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
14
15
 
@@ -182,10 +183,6 @@ type ProductSearchResult = EntrySearchResult & {
182
183
  id: string;
183
184
  name: string;
184
185
  }>;
185
- /** @deprecated Use `editLink` instead. */
186
- url?: string;
187
- /** @deprecated Use `title` instead. */
188
- name?: string;
189
186
  };
190
187
  interface ProductSearchResults {
191
188
  total: number;
@@ -389,8 +386,6 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
389
386
  type: TLocationType;
390
387
  }> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
391
388
  type: TLocationType;
392
- }> | Extract<_uniformdev_mesh_sdk.DataTypeInstanceLocation, {
393
- type: TLocationType;
394
389
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
395
390
  type: TLocationType;
396
391
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
@@ -404,8 +399,6 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
404
399
  type: TLocationType;
405
400
  }> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
406
401
  type: TLocationType;
407
- }> | Extract<_uniformdev_mesh_sdk.DataTypeInstanceLocation, {
408
- type: TLocationType;
409
402
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
410
403
  type: TLocationType;
411
404
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
@@ -418,8 +411,6 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
418
411
  type: TLocationType;
419
412
  }> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
420
413
  type: TLocationType;
421
- }> | Extract<_uniformdev_mesh_sdk.DataTypeInstanceLocation, {
422
- type: TLocationType;
423
414
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
424
415
  type: TLocationType;
425
416
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
@@ -450,11 +441,16 @@ type InputVariablesProps = {
450
441
  onChange: (newValue: string) => void;
451
442
  /** called when the field is pasted into */
452
443
  onPaste?: (newValue: string) => void;
444
+ /** Disables using variables in the input */
453
445
  disableVariables?: boolean;
454
- onVariableClick: (selectedVariable: string) => void;
446
+ /** Enables adding variables from the menu */
455
447
  showAddVariableMenuOption?: boolean;
448
+ /** Value prefix to trigger variable menu */
449
+ variablePrefix?: string;
450
+ /** Value suffix to use for variable values */
451
+ variableSuffix?: string;
456
452
  };
457
- declare function InputVariables({ 'aria-label': ariaLabel, value, onChange, onPaste, onVariableClick, showAddVariableMenuOption, ...inputProps }: InputVariablesProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
453
+ declare function InputVariables({ 'aria-label': ariaLabel, value, disableVariables, onChange, onPaste, showAddVariableMenuOption, variablePrefix, variableSuffix, ...inputProps }: InputVariablesProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
458
454
 
459
455
  type DataVariableDefinitionWithName = {
460
456
  name: string;
@@ -489,9 +485,18 @@ type VariablesAction = {
489
485
  type: 'reorder';
490
486
  result: Record<string, DataVariableDefinitionWithName>;
491
487
  };
488
+ type VariablesEvents = {
489
+ update: string;
490
+ };
492
491
  type VariablesContext = {
492
+ /** Dispatch update events to the variables */
493
493
  dispatch: (event: VariablesAction) => void;
494
+ /** The current variables value */
494
495
  variables: Readonly<Record<string, DataVariableDefinition>>;
496
+ /** Whether the context is editing a variable value currently */
497
+ isEditing: boolean;
498
+ /** Add event handles (don't forget to unhook) */
499
+ events: Emitter<VariablesEvents>;
495
500
  };
496
501
  declare function VariablesProvider({ value, onChange, editVariableComponent, children, }: VariablesProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
497
502
  declare function useVariables(): VariablesContext;
@@ -992,7 +997,7 @@ declare function RequestUrl(): _emotion_react_types_jsx_namespace.EmotionJSX.Ele
992
997
  * Editor to modify the current URL of the request
993
998
  * Note: entering query string parameters automatically converts them and syncs the request state with them
994
999
  */
995
- declare function RequestUrlInput(props: Omit<InputVariablesProps, 'value' | 'onChange' | 'onVariableClick'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1000
+ declare function RequestUrlInput(props: Omit<InputVariablesProps, 'value' | 'onChange'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
996
1001
 
997
1002
  declare function urlEncodeRequestUrl(url: string, varValues?: Record<string, DataVariableDefinition>): string;
998
1003
  declare function urlEncodeRequestParameter(parameter: RequestParameter, varValues?: Record<string, DataVariableDefinition>): RequestParameter;
@@ -1021,56 +1026,6 @@ declare function useRequestParameter(paramName: string): {
1021
1026
  update: (value: string) => void;
1022
1027
  };
1023
1028
 
1024
- /** @deprecated */
1025
- interface UniformMeshLocationContextValue<TLocationValue = unknown, TLocationSetValue = TLocationValue> {
1026
- location: MeshLocation<TLocationValue, TLocationSetValue>;
1027
- }
1028
- /** @deprecated not intended for public usage */
1029
- declare const UniformMeshLocationContext: React__default.Context<UniformMeshLocationContextValue<unknown, unknown> | undefined>;
1030
- /** @deprecated not intended for public usage. Use <MeshApp /> instead. */
1031
- declare const UniformMeshLocationContextProvider: React__default.FC<React__default.PropsWithChildren<unknown>>;
1032
- /**
1033
- * Provides access to the current UniformMeshLocationContext value.
1034
- * @deprecated Not intended for public use. Use `useUniformMeshLocation` instead.
1035
- */
1036
- declare const useUniformMeshLocationContext: <TLocationValue = unknown, TLocationSetValue = TLocationValue>() => UniformMeshLocationContextValue<TLocationValue, TLocationSetValue>;
1037
-
1038
- interface UniformMeshSdkContextValue {
1039
- sdk: UniformMeshSDK;
1040
- }
1041
- /** @deprecated not intended for public usage */
1042
- declare const UniformMeshSdkContext: React__default.Context<UniformMeshSdkContextValue | undefined>;
1043
- /** @deprecated not intended for public usage; use <MeshApp /> instead */
1044
- declare const UniformMeshSdkContextProvider: React__default.FC<React__default.PropsWithChildren<unknown>>;
1045
- /**
1046
- * Provides access to the current (initialized) Uniform Mesh SDK context value.
1047
- * @deprecated Not intended for public use. Use `useUniformMeshLocation` or `useUniformMeshSdk` instead.
1048
- */
1049
- declare const useUniformMeshSdkContext: () => UniformMeshSdkContextValue;
1050
-
1051
- interface UseUniformMeshSdkOptions {
1052
- autoResizingDisabled?: boolean;
1053
- }
1054
- /**
1055
- * Provides a React-hook wrapper around Uniform Mesh SDK initialization.
1056
- * NOTE: initialization is an async operation and should be handled as such.
1057
- *
1058
- * @deprecated prefer <MeshApp /> to initialize and provide in a single component
1059
- */
1060
- declare const useInitializeUniformMeshSdk: ({ autoResizingDisabled }?: UseUniformMeshSdkOptions) => {
1061
- initializing: boolean;
1062
- error: Error | undefined;
1063
- sdk: UniformMeshSDK | undefined;
1064
- };
1065
-
1066
- /**
1067
- * Provides convenient access to the current Uniform Mesh location via React hook.
1068
- * Intended to be used within <MeshApp />.
1069
- *
1070
- * @deprecated prefer useMeshLocation which has much more accurate type safety
1071
- */
1072
- declare function useUniformMeshLocation<TLocationValue = unknown, TLocationMetadata = never, TLocationSetValue = TLocationValue>(): MeshLocationCore<TLocationValue, TLocationMetadata, TLocationSetValue>;
1073
-
1074
1029
  /**
1075
1030
  * Provides convenient access to the current Uniform Mesh SDK instance via React hook.
1076
1031
  * Intended to be used within <MeshApp />.
@@ -1086,4 +1041,4 @@ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
1086
1041
  */
1087
1042
  declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
1088
1043
 
1089
- export { BaseRequestData, Brand, DamItem, DamSelectedItem, DamSelectedItemProps, DataRefreshButton, DataRefreshButtonProps, DataResourceVariableRendererProps, DataResourceVariablesList, 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, 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, UniformMeshLocationContext, UniformMeshLocationContextProvider, UniformMeshLocationContextValue, UniformMeshSdkContext, UniformMeshSdkContextProvider, UniformMeshSdkContextValue, UseUniformMeshSdkOptions, VariableEditor, VariableEditorProps, VariablesAction, VariablesContext, 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, useInitializeUniformMeshSdk, useMeshLocation, useObjectSearchContext, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshLocation, useUniformMeshLocationContext, useUniformMeshSdk, useUniformMeshSdkContext, useVariables, variablesToList };
1044
+ export { BaseRequestData, Brand, DamItem, DamSelectedItem, DamSelectedItemProps, DataRefreshButton, DataRefreshButtonProps, DataResourceVariableRendererProps, DataResourceVariablesList, 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, 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, variablesToList };