@uniformdev/mesh-sdk-react 19.47.0 → 19.47.1-alpha.11

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
@@ -5,7 +5,7 @@ import { TDate } from 'timeago.js';
5
5
  import * as _emotion_react from '@emotion/react';
6
6
  import { Interpolation, Theme } from '@emotion/react';
7
7
  import * as _uniformdev_mesh_sdk from '@uniformdev/mesh-sdk';
8
- import { DynamicInput, MeshLocation, SetValueOptions, DynamicInputs, DataSourceLocationValue, DataTypeLocationValue, BindableTypes } from '@uniformdev/mesh-sdk';
8
+ import { DynamicInput, MeshLocation, SetValueOptions, EditConnectedDataResponseCancellationContext, DynamicInputs, DataSourceLocationValue, DataTypeLocationValue, BindableTypes } from '@uniformdev/mesh-sdk';
9
9
  export * from '@uniformdev/mesh-sdk';
10
10
  import { DataVariableDefinition, DataResourceVariables, DataType } from '@uniformdev/canvas';
11
11
  import { Emitter } from 'mitt';
@@ -637,8 +637,12 @@ type EditVariableCommandArguments = {
637
637
  /** The variable reference to edit */
638
638
  reference: string;
639
639
  };
640
+ type DisconnectVariableCommandArguments = {
641
+ /** Lexical node key of the variable node to disconnect */
642
+ sourceKey: string;
643
+ };
640
644
  type InsertVariableCommandArguments = {
641
- reference: string;
645
+ variable: string;
642
646
  /**
643
647
  * Optionally pass in display name if you have it
644
648
  * avoids a flash of the reference name
@@ -662,6 +666,8 @@ type InsertVariableCommandArguments = {
662
666
  declare const OPEN_INSERT_VARIABLE_COMMAND: lexical.LexicalCommand<unknown>;
663
667
  /** Opens the variable editor for an existing variable node */
664
668
  declare const EDIT_VARIABLE_COMMAND: lexical.LexicalCommand<EditVariableCommandArguments>;
669
+ /** Disconnects a variable node from its binding, leaving the current value of the binding behind */
670
+ declare const DISCONNECT_VARIABLE_COMMAND: lexical.LexicalCommand<DisconnectVariableCommandArguments>;
665
671
  /** Inserts a new variable node at the current selection, or replacing a specific node key */
666
672
  declare const INSERT_VARIABLE_COMMAND: lexical.LexicalCommand<InsertVariableCommandArguments>;
667
673
  type VariablesPluginProps<TEditorContext = unknown> = {
@@ -832,6 +838,7 @@ type ParameterOrSingleVariableProps<TEditorContext = unknown> = {
832
838
  * such as imperatively inserting a new variable using OPEN_INSERT_VARIABLE_COMMAND.
833
839
  */
834
840
  editorRef?: MutableRefObject<LexicalEditor | null>;
841
+ onDisconnect?: (variable: DataVariableDefinitionWithName) => void;
835
842
  } & Omit<UseInputVariablesStateProps<TEditorContext>, 'inputWhenNoVariables'>;
836
843
  /**
837
844
  * A parameter which can be one of a custom parameter editor (`inputWhenNoVariables`),
@@ -870,17 +877,18 @@ type ParameterVariablesProps<TEditorContext = unknown> = {
870
877
  */
871
878
  declare function ParameterVariables<TEditorContext = unknown>(props: ParameterVariablesProps<TEditorContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
872
879
 
873
- type VariableEditorProps<TEditorContext = unknown> = {
880
+ type VariableEditorProps<TEditorContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown> = {
874
881
  variable: string;
875
- onSubmit: (values: DataVariableDefinitionWithName) => void | Promise<void>;
882
+ onSubmit: (values: DataVariableDefinitionWithName, context: TEditVariableCompletedContext) => void | Promise<void>;
876
883
  /** Disables the tip about Mesh integrations. Intended for use when this is placed on a custom Mesh integration to edit variables. */
877
884
  disableMeshTip?: boolean;
878
- onCancel: () => void;
885
+ onCancel: (context: TEditVariableCancelledContext) => void;
879
886
  context: TEditorContext | undefined;
887
+ disableAutoFocusOnMount?: boolean;
880
888
  };
881
- declare function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip }: VariableEditorProps<any>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
889
+ declare function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip, }: VariableEditorProps<any, unknown, EditConnectedDataResponseCancellationContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
882
890
 
883
- type VariablesProviderProps<TEditVariableContext = unknown> = React.PropsWithChildren<{
891
+ type VariablesProviderProps<TEditVariableContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown> = React.PropsWithChildren<{
884
892
  /**
885
893
  * Signals that components in this variables context are not intended to allow mutation
886
894
  * of the variable values (i.e. editing, adding, or deleting variable definitions).
@@ -903,7 +911,7 @@ type VariablesProviderProps<TEditVariableContext = unknown> = React.PropsWithChi
903
911
  * Provide a component to handle editing a variable definition (e.g. a modal wrapper)
904
912
  * If not passed, the editor will be rendered inline, with potentially strange results.
905
913
  */
906
- editVariableComponent?: React.ComponentType<VariableEditorProps<TEditVariableContext>>;
914
+ editVariableComponent?: React.ComponentType<VariableEditorProps<TEditVariableContext, TEditVariableCompletedContext, TEditVariableCancelledContext>>;
907
915
  /**
908
916
  * Signals to the provider that the variables value is in the process of being loaded.
909
917
  * Variables editors may use this to avoid showing invalid variable states while loading,
@@ -931,14 +939,31 @@ type VariablesAction<TEditVariableContext> = {
931
939
  } | {
932
940
  type: 'cancelEdit';
933
941
  };
934
- type VariablesUpdateEvent = {
935
- name: string;
936
- latestValue: Record<string, MeshDataVariableDefinition>;
942
+ /** Response from parent when creating a dynamic token expression */
943
+ type VariableEditorCompleteEvent<TEditVariableCompletedContext, TEditVariableCancelledContext> = {
944
+ canceled: false;
945
+ /** Selected variable */
946
+ selectedVariable: DataVariableDefinitionWithName;
947
+ /**
948
+ * Arbitrary object that was returned by the variables editor component's onSubmit
949
+ * Can be used to convey context data about the submit from custom editor components
950
+ * to their consumers. Always `null` using the default variables editor.
951
+ */
952
+ editorCompletedContext: TEditVariableCompletedContext;
953
+ } | {
954
+ /** User cancelled selecting variable token */
955
+ canceled: true;
956
+ /**
957
+ * Arbitrary object that was returned by the variables editor component's onCancel
958
+ * Can be used to convey context data about the submit from custom editor components
959
+ * to their consumers. Always `null` using the default variables editor.
960
+ */
961
+ editorCancelledContext: TEditVariableCancelledContext;
937
962
  };
938
- type VariablesEvents = {
939
- update: VariablesUpdateEvent;
963
+ type VariablesEvents<TEditVariableCompletedContext, TEditVariableCancelledContext> = {
964
+ editCompleted: VariableEditorCompleteEvent<TEditVariableCompletedContext, TEditVariableCancelledContext>;
940
965
  };
941
- type VariablesContext<TEditVariableContext> = {
966
+ type VariablesContext<TEditVariableContext, TEditVariableCompletedContext, TEditVariableCancelledContext> = {
942
967
  /**
943
968
  * Signals that components in this variables context are not intended to allow mutation
944
969
  * of the variable values (i.e. editing, adding, or deleting variable definitions).
@@ -958,7 +983,7 @@ type VariablesContext<TEditVariableContext> = {
958
983
  /** Whether the context is editing a variable value currently */
959
984
  isEditing: boolean;
960
985
  /** Add event handles (don't forget to unhook) */
961
- events: Emitter<VariablesEvents>;
986
+ events: Emitter<VariablesEvents<TEditVariableCompletedContext, TEditVariableCancelledContext>>;
962
987
  /** Whether the context is backed by a provider, or is just a readonly fake */
963
988
  canDispatch: boolean;
964
989
  /**
@@ -973,10 +998,12 @@ type VariablesContext<TEditVariableContext> = {
973
998
  */
974
999
  isLoading: boolean;
975
1000
  };
976
- declare function VariablesProvider<TEditComponentContext = never>({ value, onChange, editVariableComponent, readOnly, isLoading, children, knownUndefinedValues, }: VariablesProviderProps<TEditComponentContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
977
- declare function useVariables<TEditComponentContext = unknown>(returnEmptyWithoutProvider?: boolean): VariablesContext<TEditComponentContext>;
1001
+ declare function VariablesProvider<TEditComponentContext = never, TEditVariableCompletedContext = never, TEditVariableCancelledContext = never>({ value, onChange, editVariableComponent, readOnly, isLoading, children, knownUndefinedValues, }: VariablesProviderProps<TEditComponentContext, TEditVariableCompletedContext, TEditVariableCancelledContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1002
+ declare function useVariables<TEditComponentContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown>(returnEmptyWithoutProvider?: boolean): VariablesContext<TEditComponentContext, TEditVariableCompletedContext, TEditVariableCancelledContext>;
978
1003
 
979
- declare function useOnVariableUpdated(fn: (event: VariablesUpdateEvent) => void, disabled?: boolean): void;
1004
+ declare function useVariableEditor<TEditorContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown>(): {
1005
+ editVariable(variable: string, context?: TEditorContext): Promise<VariableEditorCompleteEvent<TEditVariableCompletedContext, TEditVariableCancelledContext>>;
1006
+ };
980
1007
 
981
1008
  /** Converts a connected data map entry to a VariablesProvider-format variable */
982
1009
  declare function convertConnectedDataToVariable(bindExpression: string, value: unknown): MeshDataVariableDefinition;
@@ -1619,4 +1646,4 @@ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
1619
1646
  */
1620
1647
  declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
1621
1648
 
1622
- export { $createVariableNode, $isVariableNode, BaseRequestData, Brand, ControlledValuePlugin, DamItem, DamSelectedItem, DamSelectedItemProps, DataRefreshButton, DataRefreshButtonProps, DataResourceDynamicInputProvider, DataResourceDynamicInputProviderProps, DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListExplicit, DataResourceVariablesListProps, DataSourceEditor, DataSourceEditorProps, DataTypeEditor, DataTypeEditorProps, DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, DispatchResult, EDIT_VARIABLE_COMMAND, EditVariableCommandArguments, EntrySearch, EntrySearchContentType, EntrySearchProps, EntrySearchQueryOptions, EntrySearchResult, EntrySearchRowProps, EntrySearchSelectedItemProps, GetProductOptions, GetProductsOptions, INSERT_VARIABLE_COMMAND, index as Icons, InputVariables, InputVariablesProps, InsertVariableCommandArguments, ItemListProps, KnownUndefinedVariableInfo, LinkButton, MeshApp, MeshAppProps, MeshDataVariableDefinition, MinimalDynamicInput, MinimalDynamicInputs, NoResultsProps, OPEN_INSERT_VARIABLE_COMMAND, ObjectSearchContainer, ObjectSearchContainerProps, ObjectSearchContextProps, ObjectSearchFilter, ObjectSearchFilterContainer, ObjectSearchFilterContainerProps, ObjectSearchFilterProps, ObjectSearchListItem, ObjectSearchListItemLoadingSkeleton, ObjectSearchListItemProps, ObjectSearchProvider, ObjectSearchProviderProps, ObjectSearchResultItem, ObjectSearchResultItemButton, ObjectSearchResultItemButtonProps, ObjectSearchResultItemProps, ObjectSearchResultList, ObjectSearchResultListProps, ParamTypeDynamicDataProvider, ParamTypeDynamicDataProviderProps, ParameterConnectOptions, ParameterConnectionIndicator, ParameterConnectionIndicatorProps, ParameterOrSingleVariable, ParameterOrSingleVariableProps, ParameterVariables, ParameterVariablesProps, 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, SerializedVariableNode, SetLocationValueDispatch, SetLocationValueFunction, TextVariableRenderer, UseVariablesMenu, UseVariablesMenuInput, VariableEditor, VariableEditorProps, VariableNode, VariableNodeState, VariableSourceGroup, VariablesAction, VariablesContext, VariablesEvents, VariablesList, VariablesPlugin, VariablesPluginProps, VariablesProvider, VariablesProviderProps, VariablesUpdateEvent, badgeIcon, convertConnectedDataToVariable, 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, hasReferencedVariables, prettifyBindExpression, 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, serializeVariablesEditorState, setVariablesEditorValue, urlEncodeRequestParameter, urlEncodeRequestUrl, useConnectedDataAsVariables, useDynamicInputsAsVariables, useMeshLocation, useObjectSearchContext, useOnVariableUpdated, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshSdk, useVariables, useVariablesMenu, variableDefaultTextValue, variablePrefix, variableSuffix, variablesToGroupedList, variablesToList };
1649
+ export { $createVariableNode, $isVariableNode, BaseRequestData, Brand, ControlledValuePlugin, DISCONNECT_VARIABLE_COMMAND, DamItem, DamSelectedItem, DamSelectedItemProps, DataRefreshButton, DataRefreshButtonProps, DataResourceDynamicInputProvider, DataResourceDynamicInputProviderProps, DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListExplicit, DataResourceVariablesListProps, DataSourceEditor, DataSourceEditorProps, DataTypeEditor, DataTypeEditorProps, DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, DisconnectVariableCommandArguments, DispatchResult, EDIT_VARIABLE_COMMAND, EditVariableCommandArguments, EntrySearch, EntrySearchContentType, EntrySearchProps, EntrySearchQueryOptions, EntrySearchResult, EntrySearchRowProps, EntrySearchSelectedItemProps, GetProductOptions, GetProductsOptions, INSERT_VARIABLE_COMMAND, index as Icons, InputVariables, InputVariablesProps, InsertVariableCommandArguments, ItemListProps, KnownUndefinedVariableInfo, LinkButton, MeshApp, MeshAppProps, MeshDataVariableDefinition, MinimalDynamicInput, MinimalDynamicInputs, NoResultsProps, OPEN_INSERT_VARIABLE_COMMAND, ObjectSearchContainer, ObjectSearchContainerProps, ObjectSearchContextProps, ObjectSearchFilter, ObjectSearchFilterContainer, ObjectSearchFilterContainerProps, ObjectSearchFilterProps, ObjectSearchListItem, ObjectSearchListItemLoadingSkeleton, ObjectSearchListItemProps, ObjectSearchProvider, ObjectSearchProviderProps, ObjectSearchResultItem, ObjectSearchResultItemButton, ObjectSearchResultItemButtonProps, ObjectSearchResultItemProps, ObjectSearchResultList, ObjectSearchResultListProps, ParamTypeDynamicDataProvider, ParamTypeDynamicDataProviderProps, ParameterConnectOptions, ParameterConnectionIndicator, ParameterConnectionIndicatorProps, ParameterOrSingleVariable, ParameterOrSingleVariableProps, ParameterVariables, ParameterVariablesProps, 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, SerializedVariableNode, SetLocationValueDispatch, SetLocationValueFunction, TextVariableRenderer, UseVariablesMenu, UseVariablesMenuInput, VariableEditor, VariableEditorCompleteEvent, VariableEditorProps, VariableNode, VariableNodeState, VariableSourceGroup, VariablesAction, VariablesContext, VariablesEvents, VariablesList, VariablesPlugin, VariablesPluginProps, VariablesProvider, VariablesProviderProps, badgeIcon, convertConnectedDataToVariable, 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, hasReferencedVariables, prettifyBindExpression, 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, serializeVariablesEditorState, setVariablesEditorValue, urlEncodeRequestParameter, urlEncodeRequestUrl, useConnectedDataAsVariables, useDynamicInputsAsVariables, useMeshLocation, useObjectSearchContext, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshSdk, useVariableEditor, useVariables, useVariablesMenu, variableDefaultTextValue, variablePrefix, variableSuffix, variablesToGroupedList, variablesToList };
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import { TDate } from 'timeago.js';
5
5
  import * as _emotion_react from '@emotion/react';
6
6
  import { Interpolation, Theme } from '@emotion/react';
7
7
  import * as _uniformdev_mesh_sdk from '@uniformdev/mesh-sdk';
8
- import { DynamicInput, MeshLocation, SetValueOptions, DynamicInputs, DataSourceLocationValue, DataTypeLocationValue, BindableTypes } from '@uniformdev/mesh-sdk';
8
+ import { DynamicInput, MeshLocation, SetValueOptions, EditConnectedDataResponseCancellationContext, DynamicInputs, DataSourceLocationValue, DataTypeLocationValue, BindableTypes } from '@uniformdev/mesh-sdk';
9
9
  export * from '@uniformdev/mesh-sdk';
10
10
  import { DataVariableDefinition, DataResourceVariables, DataType } from '@uniformdev/canvas';
11
11
  import { Emitter } from 'mitt';
@@ -637,8 +637,12 @@ type EditVariableCommandArguments = {
637
637
  /** The variable reference to edit */
638
638
  reference: string;
639
639
  };
640
+ type DisconnectVariableCommandArguments = {
641
+ /** Lexical node key of the variable node to disconnect */
642
+ sourceKey: string;
643
+ };
640
644
  type InsertVariableCommandArguments = {
641
- reference: string;
645
+ variable: string;
642
646
  /**
643
647
  * Optionally pass in display name if you have it
644
648
  * avoids a flash of the reference name
@@ -662,6 +666,8 @@ type InsertVariableCommandArguments = {
662
666
  declare const OPEN_INSERT_VARIABLE_COMMAND: lexical.LexicalCommand<unknown>;
663
667
  /** Opens the variable editor for an existing variable node */
664
668
  declare const EDIT_VARIABLE_COMMAND: lexical.LexicalCommand<EditVariableCommandArguments>;
669
+ /** Disconnects a variable node from its binding, leaving the current value of the binding behind */
670
+ declare const DISCONNECT_VARIABLE_COMMAND: lexical.LexicalCommand<DisconnectVariableCommandArguments>;
665
671
  /** Inserts a new variable node at the current selection, or replacing a specific node key */
666
672
  declare const INSERT_VARIABLE_COMMAND: lexical.LexicalCommand<InsertVariableCommandArguments>;
667
673
  type VariablesPluginProps<TEditorContext = unknown> = {
@@ -832,6 +838,7 @@ type ParameterOrSingleVariableProps<TEditorContext = unknown> = {
832
838
  * such as imperatively inserting a new variable using OPEN_INSERT_VARIABLE_COMMAND.
833
839
  */
834
840
  editorRef?: MutableRefObject<LexicalEditor | null>;
841
+ onDisconnect?: (variable: DataVariableDefinitionWithName) => void;
835
842
  } & Omit<UseInputVariablesStateProps<TEditorContext>, 'inputWhenNoVariables'>;
836
843
  /**
837
844
  * A parameter which can be one of a custom parameter editor (`inputWhenNoVariables`),
@@ -870,17 +877,18 @@ type ParameterVariablesProps<TEditorContext = unknown> = {
870
877
  */
871
878
  declare function ParameterVariables<TEditorContext = unknown>(props: ParameterVariablesProps<TEditorContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
872
879
 
873
- type VariableEditorProps<TEditorContext = unknown> = {
880
+ type VariableEditorProps<TEditorContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown> = {
874
881
  variable: string;
875
- onSubmit: (values: DataVariableDefinitionWithName) => void | Promise<void>;
882
+ onSubmit: (values: DataVariableDefinitionWithName, context: TEditVariableCompletedContext) => void | Promise<void>;
876
883
  /** Disables the tip about Mesh integrations. Intended for use when this is placed on a custom Mesh integration to edit variables. */
877
884
  disableMeshTip?: boolean;
878
- onCancel: () => void;
885
+ onCancel: (context: TEditVariableCancelledContext) => void;
879
886
  context: TEditorContext | undefined;
887
+ disableAutoFocusOnMount?: boolean;
880
888
  };
881
- declare function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip }: VariableEditorProps<any>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
889
+ declare function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip, }: VariableEditorProps<any, unknown, EditConnectedDataResponseCancellationContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
882
890
 
883
- type VariablesProviderProps<TEditVariableContext = unknown> = React.PropsWithChildren<{
891
+ type VariablesProviderProps<TEditVariableContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown> = React.PropsWithChildren<{
884
892
  /**
885
893
  * Signals that components in this variables context are not intended to allow mutation
886
894
  * of the variable values (i.e. editing, adding, or deleting variable definitions).
@@ -903,7 +911,7 @@ type VariablesProviderProps<TEditVariableContext = unknown> = React.PropsWithChi
903
911
  * Provide a component to handle editing a variable definition (e.g. a modal wrapper)
904
912
  * If not passed, the editor will be rendered inline, with potentially strange results.
905
913
  */
906
- editVariableComponent?: React.ComponentType<VariableEditorProps<TEditVariableContext>>;
914
+ editVariableComponent?: React.ComponentType<VariableEditorProps<TEditVariableContext, TEditVariableCompletedContext, TEditVariableCancelledContext>>;
907
915
  /**
908
916
  * Signals to the provider that the variables value is in the process of being loaded.
909
917
  * Variables editors may use this to avoid showing invalid variable states while loading,
@@ -931,14 +939,31 @@ type VariablesAction<TEditVariableContext> = {
931
939
  } | {
932
940
  type: 'cancelEdit';
933
941
  };
934
- type VariablesUpdateEvent = {
935
- name: string;
936
- latestValue: Record<string, MeshDataVariableDefinition>;
942
+ /** Response from parent when creating a dynamic token expression */
943
+ type VariableEditorCompleteEvent<TEditVariableCompletedContext, TEditVariableCancelledContext> = {
944
+ canceled: false;
945
+ /** Selected variable */
946
+ selectedVariable: DataVariableDefinitionWithName;
947
+ /**
948
+ * Arbitrary object that was returned by the variables editor component's onSubmit
949
+ * Can be used to convey context data about the submit from custom editor components
950
+ * to their consumers. Always `null` using the default variables editor.
951
+ */
952
+ editorCompletedContext: TEditVariableCompletedContext;
953
+ } | {
954
+ /** User cancelled selecting variable token */
955
+ canceled: true;
956
+ /**
957
+ * Arbitrary object that was returned by the variables editor component's onCancel
958
+ * Can be used to convey context data about the submit from custom editor components
959
+ * to their consumers. Always `null` using the default variables editor.
960
+ */
961
+ editorCancelledContext: TEditVariableCancelledContext;
937
962
  };
938
- type VariablesEvents = {
939
- update: VariablesUpdateEvent;
963
+ type VariablesEvents<TEditVariableCompletedContext, TEditVariableCancelledContext> = {
964
+ editCompleted: VariableEditorCompleteEvent<TEditVariableCompletedContext, TEditVariableCancelledContext>;
940
965
  };
941
- type VariablesContext<TEditVariableContext> = {
966
+ type VariablesContext<TEditVariableContext, TEditVariableCompletedContext, TEditVariableCancelledContext> = {
942
967
  /**
943
968
  * Signals that components in this variables context are not intended to allow mutation
944
969
  * of the variable values (i.e. editing, adding, or deleting variable definitions).
@@ -958,7 +983,7 @@ type VariablesContext<TEditVariableContext> = {
958
983
  /** Whether the context is editing a variable value currently */
959
984
  isEditing: boolean;
960
985
  /** Add event handles (don't forget to unhook) */
961
- events: Emitter<VariablesEvents>;
986
+ events: Emitter<VariablesEvents<TEditVariableCompletedContext, TEditVariableCancelledContext>>;
962
987
  /** Whether the context is backed by a provider, or is just a readonly fake */
963
988
  canDispatch: boolean;
964
989
  /**
@@ -973,10 +998,12 @@ type VariablesContext<TEditVariableContext> = {
973
998
  */
974
999
  isLoading: boolean;
975
1000
  };
976
- declare function VariablesProvider<TEditComponentContext = never>({ value, onChange, editVariableComponent, readOnly, isLoading, children, knownUndefinedValues, }: VariablesProviderProps<TEditComponentContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
977
- declare function useVariables<TEditComponentContext = unknown>(returnEmptyWithoutProvider?: boolean): VariablesContext<TEditComponentContext>;
1001
+ declare function VariablesProvider<TEditComponentContext = never, TEditVariableCompletedContext = never, TEditVariableCancelledContext = never>({ value, onChange, editVariableComponent, readOnly, isLoading, children, knownUndefinedValues, }: VariablesProviderProps<TEditComponentContext, TEditVariableCompletedContext, TEditVariableCancelledContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1002
+ declare function useVariables<TEditComponentContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown>(returnEmptyWithoutProvider?: boolean): VariablesContext<TEditComponentContext, TEditVariableCompletedContext, TEditVariableCancelledContext>;
978
1003
 
979
- declare function useOnVariableUpdated(fn: (event: VariablesUpdateEvent) => void, disabled?: boolean): void;
1004
+ declare function useVariableEditor<TEditorContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown>(): {
1005
+ editVariable(variable: string, context?: TEditorContext): Promise<VariableEditorCompleteEvent<TEditVariableCompletedContext, TEditVariableCancelledContext>>;
1006
+ };
980
1007
 
981
1008
  /** Converts a connected data map entry to a VariablesProvider-format variable */
982
1009
  declare function convertConnectedDataToVariable(bindExpression: string, value: unknown): MeshDataVariableDefinition;
@@ -1619,4 +1646,4 @@ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
1619
1646
  */
1620
1647
  declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
1621
1648
 
1622
- export { $createVariableNode, $isVariableNode, BaseRequestData, Brand, ControlledValuePlugin, DamItem, DamSelectedItem, DamSelectedItemProps, DataRefreshButton, DataRefreshButtonProps, DataResourceDynamicInputProvider, DataResourceDynamicInputProviderProps, DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListExplicit, DataResourceVariablesListProps, DataSourceEditor, DataSourceEditorProps, DataTypeEditor, DataTypeEditorProps, DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, DispatchResult, EDIT_VARIABLE_COMMAND, EditVariableCommandArguments, EntrySearch, EntrySearchContentType, EntrySearchProps, EntrySearchQueryOptions, EntrySearchResult, EntrySearchRowProps, EntrySearchSelectedItemProps, GetProductOptions, GetProductsOptions, INSERT_VARIABLE_COMMAND, index as Icons, InputVariables, InputVariablesProps, InsertVariableCommandArguments, ItemListProps, KnownUndefinedVariableInfo, LinkButton, MeshApp, MeshAppProps, MeshDataVariableDefinition, MinimalDynamicInput, MinimalDynamicInputs, NoResultsProps, OPEN_INSERT_VARIABLE_COMMAND, ObjectSearchContainer, ObjectSearchContainerProps, ObjectSearchContextProps, ObjectSearchFilter, ObjectSearchFilterContainer, ObjectSearchFilterContainerProps, ObjectSearchFilterProps, ObjectSearchListItem, ObjectSearchListItemLoadingSkeleton, ObjectSearchListItemProps, ObjectSearchProvider, ObjectSearchProviderProps, ObjectSearchResultItem, ObjectSearchResultItemButton, ObjectSearchResultItemButtonProps, ObjectSearchResultItemProps, ObjectSearchResultList, ObjectSearchResultListProps, ParamTypeDynamicDataProvider, ParamTypeDynamicDataProviderProps, ParameterConnectOptions, ParameterConnectionIndicator, ParameterConnectionIndicatorProps, ParameterOrSingleVariable, ParameterOrSingleVariableProps, ParameterVariables, ParameterVariablesProps, 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, SerializedVariableNode, SetLocationValueDispatch, SetLocationValueFunction, TextVariableRenderer, UseVariablesMenu, UseVariablesMenuInput, VariableEditor, VariableEditorProps, VariableNode, VariableNodeState, VariableSourceGroup, VariablesAction, VariablesContext, VariablesEvents, VariablesList, VariablesPlugin, VariablesPluginProps, VariablesProvider, VariablesProviderProps, VariablesUpdateEvent, badgeIcon, convertConnectedDataToVariable, 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, hasReferencedVariables, prettifyBindExpression, 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, serializeVariablesEditorState, setVariablesEditorValue, urlEncodeRequestParameter, urlEncodeRequestUrl, useConnectedDataAsVariables, useDynamicInputsAsVariables, useMeshLocation, useObjectSearchContext, useOnVariableUpdated, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshSdk, useVariables, useVariablesMenu, variableDefaultTextValue, variablePrefix, variableSuffix, variablesToGroupedList, variablesToList };
1649
+ export { $createVariableNode, $isVariableNode, BaseRequestData, Brand, ControlledValuePlugin, DISCONNECT_VARIABLE_COMMAND, DamItem, DamSelectedItem, DamSelectedItemProps, DataRefreshButton, DataRefreshButtonProps, DataResourceDynamicInputProvider, DataResourceDynamicInputProviderProps, DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListExplicit, DataResourceVariablesListProps, DataSourceEditor, DataSourceEditorProps, DataTypeEditor, DataTypeEditorProps, DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, DisconnectVariableCommandArguments, DispatchResult, EDIT_VARIABLE_COMMAND, EditVariableCommandArguments, EntrySearch, EntrySearchContentType, EntrySearchProps, EntrySearchQueryOptions, EntrySearchResult, EntrySearchRowProps, EntrySearchSelectedItemProps, GetProductOptions, GetProductsOptions, INSERT_VARIABLE_COMMAND, index as Icons, InputVariables, InputVariablesProps, InsertVariableCommandArguments, ItemListProps, KnownUndefinedVariableInfo, LinkButton, MeshApp, MeshAppProps, MeshDataVariableDefinition, MinimalDynamicInput, MinimalDynamicInputs, NoResultsProps, OPEN_INSERT_VARIABLE_COMMAND, ObjectSearchContainer, ObjectSearchContainerProps, ObjectSearchContextProps, ObjectSearchFilter, ObjectSearchFilterContainer, ObjectSearchFilterContainerProps, ObjectSearchFilterProps, ObjectSearchListItem, ObjectSearchListItemLoadingSkeleton, ObjectSearchListItemProps, ObjectSearchProvider, ObjectSearchProviderProps, ObjectSearchResultItem, ObjectSearchResultItemButton, ObjectSearchResultItemButtonProps, ObjectSearchResultItemProps, ObjectSearchResultList, ObjectSearchResultListProps, ParamTypeDynamicDataProvider, ParamTypeDynamicDataProviderProps, ParameterConnectOptions, ParameterConnectionIndicator, ParameterConnectionIndicatorProps, ParameterOrSingleVariable, ParameterOrSingleVariableProps, ParameterVariables, ParameterVariablesProps, 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, SerializedVariableNode, SetLocationValueDispatch, SetLocationValueFunction, TextVariableRenderer, UseVariablesMenu, UseVariablesMenuInput, VariableEditor, VariableEditorCompleteEvent, VariableEditorProps, VariableNode, VariableNodeState, VariableSourceGroup, VariablesAction, VariablesContext, VariablesEvents, VariablesList, VariablesPlugin, VariablesPluginProps, VariablesProvider, VariablesProviderProps, badgeIcon, convertConnectedDataToVariable, 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, hasReferencedVariables, prettifyBindExpression, 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, serializeVariablesEditorState, setVariablesEditorValue, urlEncodeRequestParameter, urlEncodeRequestUrl, useConnectedDataAsVariables, useDynamicInputsAsVariables, useMeshLocation, useObjectSearchContext, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshSdk, useVariableEditor, useVariables, useVariablesMenu, variableDefaultTextValue, variablePrefix, variableSuffix, variablesToGroupedList, variablesToList };