@uniformdev/mesh-sdk-react 18.35.1-alpha.18 → 18.35.1-alpha.22
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 +24 -67
- package/dist/index.esm.js +257 -175
- package/dist/index.js +310 -236
- package/dist/index.mjs +257 -175
- package/package.json +10 -7
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
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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;
|
|
@@ -464,9 +460,11 @@ declare function variablesToList(variables: Record<string, DataVariableDefinitio
|
|
|
464
460
|
type VariableEditorProps = {
|
|
465
461
|
variable: string;
|
|
466
462
|
onSubmit: (values: DataVariableDefinitionWithName) => void | Promise<void>;
|
|
463
|
+
/** Disables the tip about Mesh integrations. Intended for use when this is placed on a custom Mesh integration to edit variables. */
|
|
464
|
+
disableMeshTip?: boolean;
|
|
467
465
|
onCancel: () => void;
|
|
468
466
|
};
|
|
469
|
-
declare function VariableEditor({ variable, onSubmit, onCancel }: VariableEditorProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
467
|
+
declare function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip }: VariableEditorProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
470
468
|
|
|
471
469
|
declare function VariablesList(): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
472
470
|
|
|
@@ -489,9 +487,18 @@ type VariablesAction = {
|
|
|
489
487
|
type: 'reorder';
|
|
490
488
|
result: Record<string, DataVariableDefinitionWithName>;
|
|
491
489
|
};
|
|
490
|
+
type VariablesEvents = {
|
|
491
|
+
update: string;
|
|
492
|
+
};
|
|
492
493
|
type VariablesContext = {
|
|
494
|
+
/** Dispatch update events to the variables */
|
|
493
495
|
dispatch: (event: VariablesAction) => void;
|
|
496
|
+
/** The current variables value */
|
|
494
497
|
variables: Readonly<Record<string, DataVariableDefinition>>;
|
|
498
|
+
/** Whether the context is editing a variable value currently */
|
|
499
|
+
isEditing: boolean;
|
|
500
|
+
/** Add event handles (don't forget to unhook) */
|
|
501
|
+
events: Emitter<VariablesEvents>;
|
|
495
502
|
};
|
|
496
503
|
declare function VariablesProvider({ value, onChange, editVariableComponent, children, }: VariablesProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
497
504
|
declare function useVariables(): VariablesContext;
|
|
@@ -992,7 +999,7 @@ declare function RequestUrl(): _emotion_react_types_jsx_namespace.EmotionJSX.Ele
|
|
|
992
999
|
* Editor to modify the current URL of the request
|
|
993
1000
|
* Note: entering query string parameters automatically converts them and syncs the request state with them
|
|
994
1001
|
*/
|
|
995
|
-
declare function RequestUrlInput(props: Omit<InputVariablesProps, 'value' | 'onChange'
|
|
1002
|
+
declare function RequestUrlInput(props: Omit<InputVariablesProps, 'value' | 'onChange'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
996
1003
|
|
|
997
1004
|
declare function urlEncodeRequestUrl(url: string, varValues?: Record<string, DataVariableDefinition>): string;
|
|
998
1005
|
declare function urlEncodeRequestParameter(parameter: RequestParameter, varValues?: Record<string, DataVariableDefinition>): RequestParameter;
|
|
@@ -1021,56 +1028,6 @@ declare function useRequestParameter(paramName: string): {
|
|
|
1021
1028
|
update: (value: string) => void;
|
|
1022
1029
|
};
|
|
1023
1030
|
|
|
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
1031
|
/**
|
|
1075
1032
|
* Provides convenient access to the current Uniform Mesh SDK instance via React hook.
|
|
1076
1033
|
* Intended to be used within <MeshApp />.
|
|
@@ -1086,4 +1043,4 @@ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
|
|
|
1086
1043
|
*/
|
|
1087
1044
|
declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
|
|
1088
1045
|
|
|
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,
|
|
1046
|
+
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 };
|