Home > @uniformdev/mesh-sdk-react

mesh-sdk-react package

Classes

ClassDescription
VariableNodeRenders a variable reference node within a Lexical editor

Functions

FunctionDescription
$createVariableNode(variableReference, state)
$isVariableNode(node)
ControlledValuePlugin({ enabled, value, extraDependencies, })<p>Updates the Lexical editor state automatically when a controlled value changes, effectively turning the Lexical editor into a controlled component.</p><p>DO NOT USE THIS when actually editing with Lexical as it will cause performance problems. This is intended to be used: * To simplify a read-only "preview" editor, where the user can't edit the value * To sync an external state with the Lexical editor state under certain conditions (i.e. composer mounted, but editor hidden)</p>
convertConnectedDataToVariable(bindExpression, value)Converts a connected data map entry to a VariablesProvider-format variable
createLocationValidator(setValue, validate)Creates a validation interceptor between useMeshLocation's setValue function and your code. You can use this utility to write cleaner validation logic for your Mesh Location UIs.
DataRefreshButton({ buttonText, isLoading, onRefreshData, ...props })The data refresh button is a UI component to indicate to users a request for data is taking place
DataResourceDynamicInputProvider(props)Wrapper for data resource locations. Provides read-only access to dynamic inputs as if they were variables, using variables-aware components (i.e. InputVariables). This simplifies building dynamic-input-aware editors, where a data resource variable could be a static value or bound to a dynamic input from the route (project map).
DataResourceVariablesList(props)Renders a list of Data Type-provided variables that can be set on a Data Resource. Intended to provide a solid base for data resource editors that need to edit a list of variables. Using the optional <code>type</code> attribute of variables, one can use custom components to render different variables using this component, enabling flexibility for more than just text inputs.
DataResourceVariablesListExplicit({ setVariables, noVariables: NoVariablesComponent, typeRenderers, dataType, dynamicInputs, value, })<p>Renders a list of Data Type-provided variables that can be set on a Data Resource.</p><p>This is a version of DataResourceVariablesList that does not use any Mesh context data. For most uses you will want to use DataResourceVariablesList instead.</p>
DataSourceEditor({ onChange, children, editVariableComponent })Wrapper for editing a data source using Uniform Mesh SDK components that rely on <code>useRequest()</code> or <code>useVariables()</code>, or custom components that use the same hooks.
DataTypeEditor({ onChange, children, editVariableComponent })Wrapper for editing a data type using Uniform Mesh SDK components that rely on <code>useRequest()</code> or <code>useVariables()</code>, or custom components that use the same hooks.
DateEditor({ onChange, ariaLabel, disabled, value, readOnly, valueTestId, })Renders a date input field for filtering
DateRangeEditor({ ariaLabel, onChange, disabled, value, readOnly, valueTestId, })Renders a date range input field for filtering
FilterButton({ text, icon, filterCount, hasSelectedValue, dataTestId, showDropdownIcon, ...props })A filter button component used to display filter menu options
FilterControls({ children, hideSearchInput, })Default filter controls for search and filter
FilterEditorRenderer({ editorType, ...props })Renders a filter editor component
FilterItem({ index, operatorOptions, valueOptions, onFilterOptionChange, onFilterDynamicChange, onOperatorChange, onValueChange, initialCriteriaTitle, criteriaGroupOperator, })A filter item component used to display filter options
FilterItems({ addButtonText, additionalFiltersContainer, filterTitle, resetButtonText, initialCriteriaTitle, criteriaGroupOperator, })A filter items component used to display filter options
FilterMenu({ id, filterTitle, menuControls, additionalFiltersContainer, children, dataTestId, resetButtonText, })A filter menu component used to display filter options
FilterMultiChoiceEditor({ value, options, disabled, readOnly, valueTestId, ...props })Multi select filter component
FilterSingleChoiceEditor({ options, value, disabled, readOnly, onChange, valueTestId, })Single select filter component
InputVariables(props)An input box that enables insertion of 'variables', provided by VariablesProvider, into its value.
LinkButton({ text, icon, ...props })An opinionated link component styled the same of the ObjectSearchResultItemButton component, that automatically sets the target and rel attributes. Best used within the ObjectSearchResultItem component
NumberEditor({ ariaLabel, onChange, disabled, value, readOnly, valueTestId, })Renders a number input field for filtering
NumberRangeEditor({ onChange, disabled, ariaLabel, value, readOnly, valueTestId, })Renders a number range input field for filtering
ObjectSearchContainer({ label, enableDynamicInputToResultId, searchFilters, resultList, children, })Object search container is an opinionated layout for search parameters and retrieved results
ObjectSearchFilter({ requireContentType, typeSelectorAllTypesOptionText, searchInputName, searchInputPlaceholderText, selectLabel, selectOptions, })Object search filter is an opinionated filter that has pre-defined query and setQuery functions that can be extended with custom functions
ObjectSearchFilterContainer({ children })an opinionated layout for search filters
ObjectSearchListItem({ id, title, contentType, imageUrl, popoverData, onSelect, isMulti, disabled, children, ...props })entry search list item is an opinionated UI component best used for initial retrieved results
ObjectSearchListItemLoadingSkeleton()An opinionated loading skeleton component best used with ObjectSearchListItem
ObjectSearchProvider({ currentlySelectedItems, isMulti, children, defaultQuery, })
ObjectSearchResultItem({ id, title, contentType, popoverData, publishStatus, editLinkIcon, editLink, imageUrl, onRemove, createdAt, publishedAt, hideRemoveButton, disableDnD, children, })An opinionated result item, best used for selected results
ObjectSearchResultItemButton({ text, icon, ...props })An opinionated button component best used within the ObjectSearchResultItem component
ObjectSearchResultList({ resultLabelText, removeButtonText, onRemoveAllSelected, hideRemoveButton, resultLabelOverride, additionalButtons, renderResultComponent, multiSelectId, disableDnD, getContainerForDnDReparenting, whenNothingSelected, })An opinionated result list UI component that has built in drag and drop functionality and removal of all selected items from context. The result item component defaults to <, however this can be overridden with any other UI component and still maintain drag and drop functionality
ParameterConnectionIndicator({ children, value, menuOptions, disabled, menuTooltip, overrideMenuButtonParentMargin, renderMenuInPortal, })An input box that enables insertion of 'variables', provided by VariablesProvider, into its value. Designed specifically for use in the Canvas Parameter Editor.
ParameterOrSingleVariable(props)A parameter which can be one of a custom parameter editor (<code>inputWhenNoVariables</code>), or one single variable value (not multiple). Use for parameters which can only have one variable value, possibly because they bind to objects or arrays. Designed visually for use in the Canvas Parameter Editor.
ParameterVariables(props)An input box that enables insertion of 'variables', provided by VariablesProvider, into its value. Designed visually for use in the Canvas Parameter Editor.
ParamTypeDynamicDataProvider(props)Wrapper for data resource locations. Provides read-only access to dynamic inputs as if they were variables, using variables-aware components (i.e. InputVariables). This simplifies building dynamic-input-aware editors, where a data resource variable could be a static value or bound to a dynamic input from the route (project map).
prettifyBindExpression(bindExpression)
QueryFilter({ requireContentType, queryFilterTitle, contentTypeLabel, typeSelectorAllTypesOptionText, contentTypeOptions, searchInputName, searchInputPlaceholderText, searchInputLabel, countLabel, sortLabel, sortOptions, sortOrderLabel, sortOrderOptions, children, })An opinionated multi query filter UI component, best used for querying product data or more complex scenarios
RequestBody()Editor component to let you write a request body for POST requests
RequestHeaders({ disableVariables, addOmitIfEmpty, })Editor component to manage HTTP headers on a request
RequestMethodSelect(props)Dropdown to pick a HTTP method for a request
RequestParameters({ disableVariables, addOmitIfEmpty, })Component to manage query parameters on a request
RequestProvider({ value, onChange, children })Provides a mutable HTTP request object context. Components such as RequestBody and RequestUrl use this context to render.
RequestTypeContainer({ bgColor, children, ...props })a container to layout content in a 2 column grid format = 12ch 1fr
RequestUrl()Displays the current full URL of the request, including the base URL if one is set
RequestUrlInput(props)Editor to modify the current URL of the request Note: entering query string parameters automatically converts them and syncs the request state with them
SearchAndFilter({ filters, filterOptions, filterVisible, filterControls, viewSwitchControls, resultsContainerView, filterMapper, additionalFiltersContainer, onChange, defaultSearchTerm, onSearchChange, totalResults, allowBindingSearchTerm, resetFilterValues, })Search and filter component
SearchAndFilterOptionsContainer({ buttonRow, additionalFiltersContainer, children, })A container component for search and filter options
SearchAndFilterProvider({ filters, filterOptions, filterVisible, alwaysVisible, defaultSearchTerm, onSearchChange, onChange, resetFilterValues, totalResults, filterMapper, children, allowBindingSearchTerm, })Search and filter provider
SearchAndFilterResultContainer({ buttonText, clearButtonLabel, calloutTitle, calloutText, onHandleClear, hideClearButton, })Search and filter results container
SearchOnlyFilter({ onSearchChange, maxWidth })
serializeVariablesEditorSerializedState(serializedEditorState)
serializeVariablesEditorState(editorState)Serializes a Lexical variables-editor state (as a Lexical AST) to a Uniform-variable-reference formatted string Note: if no content is in the editor state, undefined will be returned.
setVariablesEditorValue(editor, newValue, tag)<p>Programmatically sets the current value of a variables editor after it has already initialized and become an uncontrolled component. Passing the <code>editorRef</code> prop to the component will give a reference to <code>editor</code>, or use <code>ControlledValuePlugin</code> to manage this automatically.</p><p>If newValue is undefined, the editor will be set to an empty state. If newValue is a string, it will be treated as a variable-reference-containing string, and parsed to a Lexical AST If newValue is a serialized Lexical AST, it will be used as-is. If the AST is invalid, the editor will be set to an empty state.</p>
SortItems({ sortByLabel, localeLabel, sortOptions, sortByValue, onSortChange, localeValue, localeOptions, onLocaleChange, disableSortBinding, })Copy of Design System <SortItems > component with ability to bind variables to inputs.
StatusMultiEditor({ options, value, disabled, readOnly, onChange, valueTestId, })Status multi select filter component that renders a custom dropdown menu
StatusSingleEditor({ options, value, disabled, readOnly, onChange, valueTestId, })Status single select filter component that renders a custom dropdown menu
TextEditor({ onChange, ariaLabel, value, readOnly, valueTestId, })Renders a text input field for filtering
TextMultiChoiceEditor({ value, disabled, readOnly, valueTestId, ...props })Text value multi select filter component
TextVariableRenderer({ definition, value, setValue })Default data resource variable renderer, uses a text input that supports dynamic input binding
urlEncodeRequestParameter(parameter, varValues)
urlEncodeRequestUrl(url, varValues)
useConnectedDataAsVariables(connectedData)Converts connected data map into VariablesProvider-format variables
useContentDataResourceLocaleInfo({ locale, defaultLocale, setLocale, dynamicInputs, })
useDynamicInputsAsVariables(dynamicInputs)Converts dynamic inputs into VariablesProvider-format variables
useMeshLocation(expectedLocation)<p>Provides convenient access to the current Uniform Mesh location via React hook. Intended to be used within <MeshApp />.</p><p>There are three primary ways to invoke this hook: 1. Without any arguments, this hook will return the current location regardless of its type. The result will be a union of all possible locations you can discriminate between i.e. with an if statement on the <code>type</code> const location = useMeshLocation(); if (location.type === 'paramType') { // location is now known to be a paramType } 2. With a string argument, this hook will assert that the current location is the expected one and return the correct typings for that location. const location = useMeshLocation('settings'); 3. With an explicit generic to set the expected param type data or param type settings data. This is useful because (2) will return unknown as the value type for param types. const location = useMeshLocation();</p><p>You can also combine (2) and (3) to get both explicit value typing and assertion of the location.</p>
useObjectSearchContext()
useRequest()
useRequestHeader(headerName)<p>Hook to make it simple to read and write a specific request header by name, instead of supporting multiple values in an array like native dispatch.</p><p>NOTE: if multiple values are added for the named header, this hook will bind to the FIRST instance of the header and leave the other values alone.</p>
useRequestParameter(paramName)<p>Hook to make it simple to read and write a specific request query string parameter by name, instead of supporting multiple values in an array like native dispatch.</p><p>NOTE: if multiple values are added for the named parameter, this hook will bind to the FIRST instance of the parameter and leave the other values alone.</p>
useSearchAndFilter()Search and filter hook
useUniformMeshSdk()Provides convenient access to the current Uniform Mesh SDK instance via React hook. Intended to be used within <MeshApp />.
useVariableEditor()
useVariables(returnEmptyWithoutProvider)
useVariablesMenu({ showAddVariableMenuOption, enableEditingVariables, filterVariable, getEditorContext, })Hook to use the lexical variables typeahead/dropdown menu
VariableChip({ displayName, referenceIsValid, tooltip, reference, onClick, clickToEdit, isFresh, selected, disabled, errorMessage, })Chip to display a reference to a variable in a variables-supporting input or other reference display
variableDefaultTextValue(defaultValue)
VariableEditor({ variable, onSubmit, onCancel, showDisplayName, disableMeshTip, })
VariablesList()
VariablesPlugin({ disableVariables, showAddVariableMenuOption, enableEditingVariables, getEditorContext, replaceValueOnVariableInsert, filterVariable, })Enables variables auto-complete and reference management to a Lexical editor. Must also activate the VariableNode node to make this work.
VariablesProvider({ value, onChange, editVariableComponent, readOnly, isLoading, children, knownUndefinedValues, onChangeKnownUndefinedValue, })
variablesToGroupedList(variables, filterFn, context)Groups variable definitions by their <code>source</code> property, and sorts the groups using <code>variablesToList</code>. Returns a flat list of groups and variables. Groups are sorted alphabetically.
variablesToList(variables)Converts variable definitions stored in a map into a flat list, respecting their <code>order</code> property if set, and sorting by display name otherwise.

Namespaces

NamespaceDescription
Icons

Variables

VariableDescription
bindableFiltersMapper
CHECKBOX_OPERATORSuniform checkbox operators
DATE_OPERATORSuniform date operators
DATE_TIME_OPERATORSuniform system date operators
DISCONNECT_VARIABLE_COMMANDDisconnects a variable node from its binding, leaving the current value of the binding behind
EDIT_VARIABLE_COMMANDOpens the variable editor for an existing variable node
filterMapperA mapper for filter editor components
INSERT_VARIABLE_COMMANDInserts a new variable node at the current selection, or replacing a specific node key
MeshApp
MULTI_SELECT_OPERATORSuniform multi-select field operators
NUMBER_OPERATORSuniform number operators
OPEN_INSERT_VARIABLE_COMMANDOpens the variable editor and when a result is selected, inserts it at the current cursor location NOTE: differs from INSERT_VARIABLE_COMMAND because this opens a variable picker, and that command inserts a known variable reference with no picker.
OPTIONAL_SYSTEM_FIELD_OPERATORSuniform optional system field operators
PUBLISH_STATUS_FIELD_OPERATORSuniform publish status field operators
readOnlyAttributes
RICHTEXT_OPERATORSuniform rich text operators
SearchAndFilterContext
SearchOnlyContext
SELECT_OPERATORSuniform select field operators
SYSTEM_FIELD_OPERATORSuniform system field operators
TEXTBOX_OPERATORSuniform textbox operators
USER_OPERATORSuniform user operators
variablePrefixExpected prefix for variable expressions
variableSuffixExpected suffix for variable expressions

Type Aliases

Type AliasDescription
BadgeThemeProps
BaseRequestData
ContentDataResourceLocaleInfoProps
ContentDataResourceLocaleInfoResult
DataRefreshButtonProps
DataResourceDynamicInputProviderProps
DataResourceVariableRendererProps
DataResourceVariablesListProps
DataSourceEditorProps
DataTypeEditorProps
DataVariableDefinitionWithName
DisconnectVariableCommandArguments
DispatchResult
EditVariableCommandArguments
FilterFilter selected and query value props
FilterButtonProps
FilterEditorFilter editor component names
FilterEditorRendererProps
FilterItemProps
FilterItemsProps
FilterMapper
FilterOptionFilter option props
FilterOptionGroupFilter option props
FilterOptionLeftHandComponentPropsFilter option props
FiltersProps
InputOptionInput option props
InputOptionGroupInput option group props
InputOptionValueInput option props
InputVariablesProps
InsertVariableCommandArguments
ItemListProps
KnownUndefinedVariableInfo<p>Provides information for an undefined variable that might be referenced in data, but is undefined in the variables context due to some sort of error or informational message.</p><p>If an undefined variable matches one of these, the error or info message will be shown instead of the generic "undefined variable" message.</p>
KnownUndefinedVariableInfoWithName
MeshAppProps
MeshDataVariableDefinition
ObjectSearchContainerProps
ObjectSearchContextProps
ObjectSearchFilterContainerProps
ObjectSearchFilterProps
ObjectSearchListItemProps
ObjectSearchProviderProps
ObjectSearchResultItemButtonProps
ObjectSearchResultItemProps
ObjectSearchResultListProps
OperatorOperator option props
OperatorTypea list of possible operator types
OperatorValuea list of possible operator values that sync with uniform search api
OperatorValueType
ParameterConnectionIndicatorProps
ParameterConnectOptionsContext to tell the binding UI what types are allowed for the current binding expression
ParameterOrSingleVariableProps
ParameterVariablesProps
ParamTypeDynamicDataProviderProps
QueryFilterProps
QueryFilterSearchProps
RequestAction
RequestActionContext
RequestContext
RequestData
RequestParameter
RequestParametersProps
RequestProviderProps
RequestTypeContainerProps
SearchAndFilterContextProps
SearchAndFilterOptionsContainerProps
SearchAndFilterProps
SearchAndFilterProviderProps
SearchAndFilterResultContainerProps
SearchOnlyProviderProps
SearchQueryProps
SelectedItemProps
SerializedVariableNode
SetLocationValueDispatch
SetLocationValueFunction
SortItemsProps
UseVariablesMenu
UseVariablesMenuInput
VariableEditorCompleteEventResponse from parent when creating a dynamic token expression
VariableEditorProps
VariableNodeState
VariablesAction
VariablesContext
VariablesEvents
VariableSourceGroup
VariablesPluginProps
VariablesProviderProps