@uniformdev/mesh-sdk-react 19.68.1-alpha.27 → 19.71.1-alpha.103
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 +20 -16
- package/dist/index.d.ts +20 -16
- package/dist/index.esm.js +64 -29
- package/dist/index.js +65 -30
- package/dist/index.mjs +64 -29
- package/package.json +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -42,21 +42,7 @@ declare const SvgMoreVerticalAlt: (props: SVGProps<SVGSVGElement>) => _emotion_r
|
|
|
42
42
|
declare const SvgPlus: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
43
43
|
|
|
44
44
|
declare namespace index {
|
|
45
|
-
export {
|
|
46
|
-
SvgCaution as Caution,
|
|
47
|
-
SvgCheckmark as Checkmark,
|
|
48
|
-
SvgChevronDown as ChevronDown,
|
|
49
|
-
SvgClose as Close,
|
|
50
|
-
SvgDanger as Danger,
|
|
51
|
-
SvgExclamationPoint as ExclamationPoint,
|
|
52
|
-
SvgInfo as Info,
|
|
53
|
-
SvgLightbulb as Lightbulb,
|
|
54
|
-
SvgMagnifyingGlass as MagnifyingGlass,
|
|
55
|
-
SvgMaximizeAlt as MaximizeAlt,
|
|
56
|
-
SvgMinus as Minus,
|
|
57
|
-
SvgMoreVerticalAlt as MoreVerticalAlt,
|
|
58
|
-
SvgPlus as Plus,
|
|
59
|
-
};
|
|
45
|
+
export { SvgCaution as Caution, SvgCheckmark as Checkmark, SvgChevronDown as ChevronDown, SvgClose as Close, SvgDanger as Danger, SvgExclamationPoint as ExclamationPoint, SvgInfo as Info, SvgLightbulb as Lightbulb, SvgMagnifyingGlass as MagnifyingGlass, SvgMaximizeAlt as MaximizeAlt, SvgMinus as Minus, SvgMoreVerticalAlt as MoreVerticalAlt, SvgPlus as Plus };
|
|
60
46
|
}
|
|
61
47
|
|
|
62
48
|
/** @deprecated please use ObjectSearchListItem - https://mesh-design-system.netlify.app/?path=/story/object-search--object-search-list-item */
|
|
@@ -431,12 +417,16 @@ declare function DataResourceDynamicInputProvider(props: DataResourceDynamicInpu
|
|
|
431
417
|
*/
|
|
432
418
|
declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLocationValue = unknown, TLocationSetValue = TLocationValue>(expectedLocation?: TLocationType): Omit<Extract<_uniformdev_mesh_sdk.AssetLibraryLocation, {
|
|
433
419
|
type: TLocationType;
|
|
420
|
+
}> | Extract<_uniformdev_mesh_sdk.AssetParameterLocation, {
|
|
421
|
+
type: TLocationType;
|
|
434
422
|
}> | Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
|
|
435
423
|
type: TLocationType;
|
|
436
424
|
}> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
|
|
437
425
|
type: TLocationType;
|
|
438
426
|
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
439
427
|
type: TLocationType;
|
|
428
|
+
}> | Extract<_uniformdev_mesh_sdk.AIPromptMetadataLocation, {
|
|
429
|
+
type: TLocationType;
|
|
440
430
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
441
431
|
type: TLocationType;
|
|
442
432
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
|
|
@@ -448,12 +438,16 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
448
438
|
}>, "setValue"> & {
|
|
449
439
|
setValue: SetLocationValueDispatch<(Extract<_uniformdev_mesh_sdk.AssetLibraryLocation, {
|
|
450
440
|
type: TLocationType;
|
|
441
|
+
}> | Extract<_uniformdev_mesh_sdk.AssetParameterLocation, {
|
|
442
|
+
type: TLocationType;
|
|
451
443
|
}> | Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
|
|
452
444
|
type: TLocationType;
|
|
453
445
|
}> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
|
|
454
446
|
type: TLocationType;
|
|
455
447
|
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
456
448
|
type: TLocationType;
|
|
449
|
+
}> | Extract<_uniformdev_mesh_sdk.AIPromptMetadataLocation, {
|
|
450
|
+
type: TLocationType;
|
|
457
451
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
458
452
|
type: TLocationType;
|
|
459
453
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
|
|
@@ -464,12 +458,16 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
464
458
|
type: TLocationType;
|
|
465
459
|
}>)["value"], Parameters<(Extract<_uniformdev_mesh_sdk.AssetLibraryLocation, {
|
|
466
460
|
type: TLocationType;
|
|
461
|
+
}> | Extract<_uniformdev_mesh_sdk.AssetParameterLocation, {
|
|
462
|
+
type: TLocationType;
|
|
467
463
|
}> | Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
|
|
468
464
|
type: TLocationType;
|
|
469
465
|
}> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
|
|
470
466
|
type: TLocationType;
|
|
471
467
|
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
472
468
|
type: TLocationType;
|
|
469
|
+
}> | Extract<_uniformdev_mesh_sdk.AIPromptMetadataLocation, {
|
|
470
|
+
type: TLocationType;
|
|
473
471
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
474
472
|
type: TLocationType;
|
|
475
473
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
|
|
@@ -592,6 +590,10 @@ type MeshDataVariableDefinition = Omit<DataVariableDefinition, 'default'> & {
|
|
|
592
590
|
* If not passed, defaults to helpText.
|
|
593
591
|
*/
|
|
594
592
|
tooltip?: string;
|
|
593
|
+
/**
|
|
594
|
+
If true the variable will be shown only in menus.
|
|
595
|
+
*/
|
|
596
|
+
system?: boolean;
|
|
595
597
|
};
|
|
596
598
|
/**
|
|
597
599
|
* Provides information for an undefined variable that might be referenced in data,
|
|
@@ -801,6 +803,8 @@ type InputVariablesProps<TEditorContext = unknown> = {
|
|
|
801
803
|
warningMessage?: string;
|
|
802
804
|
/** (optional) sets and shows the the info message value */
|
|
803
805
|
infoMessage?: string;
|
|
806
|
+
/** (optional) sets placeholder when there is no value */
|
|
807
|
+
placeholder?: string;
|
|
804
808
|
/** (optional) sets caption text value */
|
|
805
809
|
caption?: string;
|
|
806
810
|
/** Disables editing the value of the input, editing variables, and adding variables */
|
|
@@ -1664,4 +1668,4 @@ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
|
|
|
1664
1668
|
*/
|
|
1665
1669
|
declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
|
|
1666
1670
|
|
|
1667
|
-
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 };
|
|
1671
|
+
export { $createVariableNode, $isVariableNode, type BaseRequestData, type Brand, ControlledValuePlugin, DISCONNECT_VARIABLE_COMMAND, type DamItem, DamSelectedItem, type DamSelectedItemProps, DataRefreshButton, type DataRefreshButtonProps, DataResourceDynamicInputProvider, type DataResourceDynamicInputProviderProps, type DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListExplicit, type DataResourceVariablesListProps, DataSourceEditor, type DataSourceEditorProps, DataTypeEditor, type DataTypeEditorProps, type DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, type DisconnectVariableCommandArguments, type DispatchResult, EDIT_VARIABLE_COMMAND, type EditVariableCommandArguments, EntrySearch, type EntrySearchContentType, type EntrySearchProps, type EntrySearchQueryOptions, type EntrySearchResult, type EntrySearchRowProps, type EntrySearchSelectedItemProps, type GetProductOptions, type GetProductsOptions, INSERT_VARIABLE_COMMAND, index as Icons, InputVariables, type InputVariablesProps, type InsertVariableCommandArguments, type ItemListProps, type KnownUndefinedVariableInfo, LinkButton, MeshApp, type MeshAppProps, type MeshDataVariableDefinition, type MinimalDynamicInput, type MinimalDynamicInputs, type NoResultsProps, OPEN_INSERT_VARIABLE_COMMAND, ObjectSearchContainer, type ObjectSearchContainerProps, type ObjectSearchContextProps, ObjectSearchFilter, ObjectSearchFilterContainer, type ObjectSearchFilterContainerProps, type ObjectSearchFilterProps, ObjectSearchListItem, ObjectSearchListItemLoadingSkeleton, type ObjectSearchListItemProps, ObjectSearchProvider, type ObjectSearchProviderProps, ObjectSearchResultItem, ObjectSearchResultItemButton, type ObjectSearchResultItemButtonProps, type ObjectSearchResultItemProps, ObjectSearchResultList, type ObjectSearchResultListProps, ParamTypeDynamicDataProvider, type ParamTypeDynamicDataProviderProps, type ParameterConnectOptions, ParameterConnectionIndicator, type ParameterConnectionIndicatorProps, ParameterOrSingleVariable, type ParameterOrSingleVariableProps, ParameterVariables, type ParameterVariablesProps, type ProductCategory, type ProductDynamicSelectorValue, ProductPreviewList, ProductQuery, type ProductQueryCategory, ProductQueryContext, type ProductQueryContextValue, type ProductQueryProps, ProductSearch, ProductSearchContext, type ProductSearchContextValue, type ProductSearchProps, type ProductSearchResult, type ProductSearchResults, ProductSearchRow, ProductSelectedItem, QueryFilter, type QueryFilterProps, type QueryFilterSearchProps, type RequestAction, RequestBody, type RequestContext, type RequestData, RequestHeaders, RequestMethodSelect, type RequestParameter, RequestParameters, type RequestParametersProps, RequestProvider, type RequestProviderProps, RequestTypeContainer, type RequestTypeContainerProps, RequestUrl, RequestUrlInput, ResolvableLoadingValue, type SearchQueryProps, type SelectedItemProps, SelectionField, type SelectionFieldValue, type SerializedVariableNode, type SetLocationValueDispatch, type SetLocationValueFunction, TextVariableRenderer, type UseVariablesMenu, type UseVariablesMenuInput, VariableEditor, type VariableEditorCompleteEvent, type VariableEditorProps, VariableNode, type VariableNodeState, type VariableSourceGroup, type VariablesAction, type VariablesContext, type VariablesEvents, VariablesList, VariablesPlugin, type VariablesPluginProps, VariablesProvider, type 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
|
@@ -42,21 +42,7 @@ declare const SvgMoreVerticalAlt: (props: SVGProps<SVGSVGElement>) => _emotion_r
|
|
|
42
42
|
declare const SvgPlus: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
43
43
|
|
|
44
44
|
declare namespace index {
|
|
45
|
-
export {
|
|
46
|
-
SvgCaution as Caution,
|
|
47
|
-
SvgCheckmark as Checkmark,
|
|
48
|
-
SvgChevronDown as ChevronDown,
|
|
49
|
-
SvgClose as Close,
|
|
50
|
-
SvgDanger as Danger,
|
|
51
|
-
SvgExclamationPoint as ExclamationPoint,
|
|
52
|
-
SvgInfo as Info,
|
|
53
|
-
SvgLightbulb as Lightbulb,
|
|
54
|
-
SvgMagnifyingGlass as MagnifyingGlass,
|
|
55
|
-
SvgMaximizeAlt as MaximizeAlt,
|
|
56
|
-
SvgMinus as Minus,
|
|
57
|
-
SvgMoreVerticalAlt as MoreVerticalAlt,
|
|
58
|
-
SvgPlus as Plus,
|
|
59
|
-
};
|
|
45
|
+
export { SvgCaution as Caution, SvgCheckmark as Checkmark, SvgChevronDown as ChevronDown, SvgClose as Close, SvgDanger as Danger, SvgExclamationPoint as ExclamationPoint, SvgInfo as Info, SvgLightbulb as Lightbulb, SvgMagnifyingGlass as MagnifyingGlass, SvgMaximizeAlt as MaximizeAlt, SvgMinus as Minus, SvgMoreVerticalAlt as MoreVerticalAlt, SvgPlus as Plus };
|
|
60
46
|
}
|
|
61
47
|
|
|
62
48
|
/** @deprecated please use ObjectSearchListItem - https://mesh-design-system.netlify.app/?path=/story/object-search--object-search-list-item */
|
|
@@ -431,12 +417,16 @@ declare function DataResourceDynamicInputProvider(props: DataResourceDynamicInpu
|
|
|
431
417
|
*/
|
|
432
418
|
declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLocationValue = unknown, TLocationSetValue = TLocationValue>(expectedLocation?: TLocationType): Omit<Extract<_uniformdev_mesh_sdk.AssetLibraryLocation, {
|
|
433
419
|
type: TLocationType;
|
|
420
|
+
}> | Extract<_uniformdev_mesh_sdk.AssetParameterLocation, {
|
|
421
|
+
type: TLocationType;
|
|
434
422
|
}> | Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
|
|
435
423
|
type: TLocationType;
|
|
436
424
|
}> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
|
|
437
425
|
type: TLocationType;
|
|
438
426
|
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
439
427
|
type: TLocationType;
|
|
428
|
+
}> | Extract<_uniformdev_mesh_sdk.AIPromptMetadataLocation, {
|
|
429
|
+
type: TLocationType;
|
|
440
430
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
441
431
|
type: TLocationType;
|
|
442
432
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
|
|
@@ -448,12 +438,16 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
448
438
|
}>, "setValue"> & {
|
|
449
439
|
setValue: SetLocationValueDispatch<(Extract<_uniformdev_mesh_sdk.AssetLibraryLocation, {
|
|
450
440
|
type: TLocationType;
|
|
441
|
+
}> | Extract<_uniformdev_mesh_sdk.AssetParameterLocation, {
|
|
442
|
+
type: TLocationType;
|
|
451
443
|
}> | Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
|
|
452
444
|
type: TLocationType;
|
|
453
445
|
}> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
|
|
454
446
|
type: TLocationType;
|
|
455
447
|
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
456
448
|
type: TLocationType;
|
|
449
|
+
}> | Extract<_uniformdev_mesh_sdk.AIPromptMetadataLocation, {
|
|
450
|
+
type: TLocationType;
|
|
457
451
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
458
452
|
type: TLocationType;
|
|
459
453
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
|
|
@@ -464,12 +458,16 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
464
458
|
type: TLocationType;
|
|
465
459
|
}>)["value"], Parameters<(Extract<_uniformdev_mesh_sdk.AssetLibraryLocation, {
|
|
466
460
|
type: TLocationType;
|
|
461
|
+
}> | Extract<_uniformdev_mesh_sdk.AssetParameterLocation, {
|
|
462
|
+
type: TLocationType;
|
|
467
463
|
}> | Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
|
|
468
464
|
type: TLocationType;
|
|
469
465
|
}> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
|
|
470
466
|
type: TLocationType;
|
|
471
467
|
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
472
468
|
type: TLocationType;
|
|
469
|
+
}> | Extract<_uniformdev_mesh_sdk.AIPromptMetadataLocation, {
|
|
470
|
+
type: TLocationType;
|
|
473
471
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
474
472
|
type: TLocationType;
|
|
475
473
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
|
|
@@ -592,6 +590,10 @@ type MeshDataVariableDefinition = Omit<DataVariableDefinition, 'default'> & {
|
|
|
592
590
|
* If not passed, defaults to helpText.
|
|
593
591
|
*/
|
|
594
592
|
tooltip?: string;
|
|
593
|
+
/**
|
|
594
|
+
If true the variable will be shown only in menus.
|
|
595
|
+
*/
|
|
596
|
+
system?: boolean;
|
|
595
597
|
};
|
|
596
598
|
/**
|
|
597
599
|
* Provides information for an undefined variable that might be referenced in data,
|
|
@@ -801,6 +803,8 @@ type InputVariablesProps<TEditorContext = unknown> = {
|
|
|
801
803
|
warningMessage?: string;
|
|
802
804
|
/** (optional) sets and shows the the info message value */
|
|
803
805
|
infoMessage?: string;
|
|
806
|
+
/** (optional) sets placeholder when there is no value */
|
|
807
|
+
placeholder?: string;
|
|
804
808
|
/** (optional) sets caption text value */
|
|
805
809
|
caption?: string;
|
|
806
810
|
/** Disables editing the value of the input, editing variables, and adding variables */
|
|
@@ -1664,4 +1668,4 @@ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
|
|
|
1664
1668
|
*/
|
|
1665
1669
|
declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
|
|
1666
1670
|
|
|
1667
|
-
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 };
|
|
1671
|
+
export { $createVariableNode, $isVariableNode, type BaseRequestData, type Brand, ControlledValuePlugin, DISCONNECT_VARIABLE_COMMAND, type DamItem, DamSelectedItem, type DamSelectedItemProps, DataRefreshButton, type DataRefreshButtonProps, DataResourceDynamicInputProvider, type DataResourceDynamicInputProviderProps, type DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListExplicit, type DataResourceVariablesListProps, DataSourceEditor, type DataSourceEditorProps, DataTypeEditor, type DataTypeEditorProps, type DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, type DisconnectVariableCommandArguments, type DispatchResult, EDIT_VARIABLE_COMMAND, type EditVariableCommandArguments, EntrySearch, type EntrySearchContentType, type EntrySearchProps, type EntrySearchQueryOptions, type EntrySearchResult, type EntrySearchRowProps, type EntrySearchSelectedItemProps, type GetProductOptions, type GetProductsOptions, INSERT_VARIABLE_COMMAND, index as Icons, InputVariables, type InputVariablesProps, type InsertVariableCommandArguments, type ItemListProps, type KnownUndefinedVariableInfo, LinkButton, MeshApp, type MeshAppProps, type MeshDataVariableDefinition, type MinimalDynamicInput, type MinimalDynamicInputs, type NoResultsProps, OPEN_INSERT_VARIABLE_COMMAND, ObjectSearchContainer, type ObjectSearchContainerProps, type ObjectSearchContextProps, ObjectSearchFilter, ObjectSearchFilterContainer, type ObjectSearchFilterContainerProps, type ObjectSearchFilterProps, ObjectSearchListItem, ObjectSearchListItemLoadingSkeleton, type ObjectSearchListItemProps, ObjectSearchProvider, type ObjectSearchProviderProps, ObjectSearchResultItem, ObjectSearchResultItemButton, type ObjectSearchResultItemButtonProps, type ObjectSearchResultItemProps, ObjectSearchResultList, type ObjectSearchResultListProps, ParamTypeDynamicDataProvider, type ParamTypeDynamicDataProviderProps, type ParameterConnectOptions, ParameterConnectionIndicator, type ParameterConnectionIndicatorProps, ParameterOrSingleVariable, type ParameterOrSingleVariableProps, ParameterVariables, type ParameterVariablesProps, type ProductCategory, type ProductDynamicSelectorValue, ProductPreviewList, ProductQuery, type ProductQueryCategory, ProductQueryContext, type ProductQueryContextValue, type ProductQueryProps, ProductSearch, ProductSearchContext, type ProductSearchContextValue, type ProductSearchProps, type ProductSearchResult, type ProductSearchResults, ProductSearchRow, ProductSelectedItem, QueryFilter, type QueryFilterProps, type QueryFilterSearchProps, type RequestAction, RequestBody, type RequestContext, type RequestData, RequestHeaders, RequestMethodSelect, type RequestParameter, RequestParameters, type RequestParametersProps, RequestProvider, type RequestProviderProps, RequestTypeContainer, type RequestTypeContainerProps, RequestUrl, RequestUrlInput, ResolvableLoadingValue, type SearchQueryProps, type SelectedItemProps, SelectionField, type SelectionFieldValue, type SerializedVariableNode, type SetLocationValueDispatch, type SetLocationValueFunction, TextVariableRenderer, type UseVariablesMenu, type UseVariablesMenuInput, VariableEditor, type VariableEditorCompleteEvent, type VariableEditorProps, VariableNode, type VariableNodeState, type VariableSourceGroup, type VariablesAction, type VariablesContext, type VariablesEvents, VariablesList, VariablesPlugin, type VariablesPluginProps, VariablesProvider, type 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.esm.js
CHANGED
|
@@ -2654,13 +2654,14 @@ function useConnectedDataAsVariables(connectedData) {
|
|
|
2654
2654
|
}
|
|
2655
2655
|
|
|
2656
2656
|
// src/hooks/useDynamicInputsAsVariables.tsx
|
|
2657
|
+
import { LOCALE_DYNAMIC_INPUT_NAME } from "@uniformdev/canvas";
|
|
2657
2658
|
import { useMemo as useMemo4 } from "react";
|
|
2658
2659
|
import { Fragment as Fragment4, jsx as jsx26 } from "@emotion/react/jsx-runtime";
|
|
2659
2660
|
function useDynamicInputsAsVariables(dynamicInputs) {
|
|
2660
2661
|
return useMemo4(() => {
|
|
2661
2662
|
const result = Object.entries(dynamicInputs).reduce(
|
|
2662
2663
|
(acc, [name, input3]) => {
|
|
2663
|
-
const source = `from ${input3.type === "path" ? "URL path" : "query string"}`;
|
|
2664
|
+
const source = `from ${name === LOCALE_DYNAMIC_INPUT_NAME ? "current locale" : input3.type === "path" ? "URL path" : "query string"}`;
|
|
2664
2665
|
acc[name] = {
|
|
2665
2666
|
readOnly: true,
|
|
2666
2667
|
type: input3.type,
|
|
@@ -2944,6 +2945,7 @@ function VariableChip({
|
|
|
2944
2945
|
tooltip,
|
|
2945
2946
|
reference,
|
|
2946
2947
|
onClick,
|
|
2948
|
+
clickToEdit,
|
|
2947
2949
|
isFresh,
|
|
2948
2950
|
selected,
|
|
2949
2951
|
disabled
|
|
@@ -2951,7 +2953,7 @@ function VariableChip({
|
|
|
2951
2953
|
const hasClickEvent = !!onClick;
|
|
2952
2954
|
const referenceIsValidFr = isFresh ? true : referenceIsValid;
|
|
2953
2955
|
const Wrapper = referenceIsValidFr === "info" ? InfoVariableReference : referenceIsValidFr ? Fragment5 : UndefinedVariableReference;
|
|
2954
|
-
const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent ? "Click to edit" : void 0;
|
|
2956
|
+
const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent && clickToEdit ? "Click to edit" : void 0;
|
|
2955
2957
|
return /* @__PURE__ */ jsx29(
|
|
2956
2958
|
MultilineChip,
|
|
2957
2959
|
{
|
|
@@ -3002,7 +3004,7 @@ import {
|
|
|
3002
3004
|
import { mergeRegister } from "@lexical/utils";
|
|
3003
3005
|
import { AiFillPlusCircle } from "@react-icons/all-files/ai/AiFillPlusCircle";
|
|
3004
3006
|
import { createVariableReference } from "@uniformdev/canvas";
|
|
3005
|
-
import { HorizontalRhythm as HorizontalRhythm2, MenuGroup,
|
|
3007
|
+
import { HorizontalRhythm as HorizontalRhythm2, MenuGroup, MenuItemInner, MenuItemSeparator } from "@uniformdev/design-system";
|
|
3006
3008
|
import { dequal as dequal2 } from "dequal/lite";
|
|
3007
3009
|
import {
|
|
3008
3010
|
$createTextNode,
|
|
@@ -3766,7 +3768,7 @@ function VariablesPlugin({
|
|
|
3766
3768
|
currentCumulativeMenuIndex++;
|
|
3767
3769
|
const myCumulativeIndex = currentCumulativeMenuIndex;
|
|
3768
3770
|
return /* @__PURE__ */ jsx32(
|
|
3769
|
-
|
|
3771
|
+
MenuItemInner,
|
|
3770
3772
|
{
|
|
3771
3773
|
active: selectedIndex === myCumulativeIndex,
|
|
3772
3774
|
onClick: () => {
|
|
@@ -3968,6 +3970,7 @@ function VariableNodeComponent({
|
|
|
3968
3970
|
displayName: state.isLoading ? /* @__PURE__ */ jsx33(LoadingIndicator2, { size: "sm" }) : state.displayName,
|
|
3969
3971
|
selected: isSelected,
|
|
3970
3972
|
disabled: readOnly,
|
|
3973
|
+
clickToEdit: state.hasClickEvent,
|
|
3971
3974
|
onClick: state.hasClickEvent ? () => {
|
|
3972
3975
|
setSelected(!isSelected);
|
|
3973
3976
|
editor.dispatchCommand(EDIT_VARIABLE_COMMAND, {
|
|
@@ -4083,6 +4086,22 @@ var inputCompact = css21`
|
|
|
4083
4086
|
padding-block: var(--spacing-sm);
|
|
4084
4087
|
font-size: var(--fs-sm);
|
|
4085
4088
|
`;
|
|
4089
|
+
var inputDisabled = css21`
|
|
4090
|
+
cursor: not-allowed;
|
|
4091
|
+
opacity: var(--opacity-50);
|
|
4092
|
+
`;
|
|
4093
|
+
var placeholderCaption = css21`
|
|
4094
|
+
position: absolute;
|
|
4095
|
+
color: var(--gray-400);
|
|
4096
|
+
inset: var(--spacing-base) var(--spacing-lg) var(--spacing-base) var(--spacing-base);
|
|
4097
|
+
overflow: hidden;
|
|
4098
|
+
text-overflow: ellipsis;
|
|
4099
|
+
white-space: nowrap;
|
|
4100
|
+
pointer-events: none;
|
|
4101
|
+
`;
|
|
4102
|
+
var placeholderCompact = css21`
|
|
4103
|
+
inset: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
|
|
4104
|
+
`;
|
|
4086
4105
|
|
|
4087
4106
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
4088
4107
|
import * as React10 from "react";
|
|
@@ -4201,7 +4220,7 @@ import { CLEAR_EDITOR_COMMAND } from "lexical";
|
|
|
4201
4220
|
// src/components/Variables/toolbox/SelectVariableMenu.tsx
|
|
4202
4221
|
import { BsFillPlusCircleFill } from "@react-icons/all-files/bs/BsFillPlusCircleFill";
|
|
4203
4222
|
import { CgUsbC } from "@react-icons/all-files/cg/CgUsbC";
|
|
4204
|
-
import { HorizontalRhythm as HorizontalRhythm3, Menu as Menu2, MenuGroup as MenuGroup2, MenuItem as
|
|
4223
|
+
import { HorizontalRhythm as HorizontalRhythm3, Menu as Menu2, MenuGroup as MenuGroup2, MenuItem as MenuItem2, MenuItemSeparator as MenuItemSeparator2 } from "@uniformdev/design-system";
|
|
4205
4224
|
import { useRef as useRef11 } from "react";
|
|
4206
4225
|
import { Fragment as Fragment7, jsx as jsx34, jsxs as jsxs19 } from "@emotion/react/jsx-runtime";
|
|
4207
4226
|
function SelectVariableMenu({
|
|
@@ -4244,7 +4263,7 @@ function SelectVariableMenu({
|
|
|
4244
4263
|
menuLabel: menuTooltip,
|
|
4245
4264
|
children: [
|
|
4246
4265
|
showAddVariableMenuOptionForReals ? /* @__PURE__ */ jsx34(
|
|
4247
|
-
|
|
4266
|
+
MenuItem2,
|
|
4248
4267
|
{
|
|
4249
4268
|
onClick: async () => {
|
|
4250
4269
|
const result = await editVariable("", getEditorContext == null ? void 0 : getEditorContext());
|
|
@@ -4266,7 +4285,7 @@ function SelectVariableMenu({
|
|
|
4266
4285
|
return /* @__PURE__ */ jsx34(MenuGroup2, { title: (_a = group.name) != null ? _a : "", children: group.variables.map((variable) => {
|
|
4267
4286
|
const { name, displayName, helpText } = variable;
|
|
4268
4287
|
return /* @__PURE__ */ jsxs19(
|
|
4269
|
-
|
|
4288
|
+
MenuItem2,
|
|
4270
4289
|
{
|
|
4271
4290
|
id: name,
|
|
4272
4291
|
css: menuItemTextGroup,
|
|
@@ -4281,7 +4300,7 @@ function SelectVariableMenu({
|
|
|
4281
4300
|
}) }, group.name);
|
|
4282
4301
|
}),
|
|
4283
4302
|
menuHasVariableOptions && onResetVariables ? /* @__PURE__ */ jsx34(MenuItemSeparator2, {}) : null,
|
|
4284
|
-
onResetVariables ? /* @__PURE__ */ jsx34(
|
|
4303
|
+
onResetVariables ? /* @__PURE__ */ jsx34(MenuItem2, { onClick: onResetVariables, css: { color: "var(--brand-secondary-5)" }, children: "Reset" }) : null,
|
|
4285
4304
|
tip && (menuHasVariableOptions || onResetVariables) ? /* @__PURE__ */ jsx34(MenuItemSeparator2, {}) : null,
|
|
4286
4305
|
tip ? /* @__PURE__ */ jsx34("i", { css: variablesTipText, children: tip }) : null
|
|
4287
4306
|
]
|
|
@@ -4443,6 +4462,7 @@ function VariablesComposer(props) {
|
|
|
4443
4462
|
/* @__PURE__ */ jsx37(
|
|
4444
4463
|
OnChangePlugin,
|
|
4445
4464
|
{
|
|
4465
|
+
ignoreSelectionChange: true,
|
|
4446
4466
|
onChange: (state) => {
|
|
4447
4467
|
editorState.current = state;
|
|
4448
4468
|
if (updateTimeout.current) {
|
|
@@ -4491,14 +4511,18 @@ import {
|
|
|
4491
4511
|
PASTE_COMMAND as PASTE_COMMAND2
|
|
4492
4512
|
} from "lexical";
|
|
4493
4513
|
import { useEffect as useEffect13 } from "react";
|
|
4494
|
-
import { jsx as jsx38, jsxs as jsxs22 } from "@emotion/react/jsx-runtime";
|
|
4495
|
-
function VariablesComposerInput({
|
|
4514
|
+
import { Fragment as Fragment9, jsx as jsx38, jsxs as jsxs22 } from "@emotion/react/jsx-runtime";
|
|
4515
|
+
function VariablesComposerInput({
|
|
4516
|
+
css: css37,
|
|
4517
|
+
placeholder,
|
|
4518
|
+
...contentEditableProps
|
|
4519
|
+
}) {
|
|
4496
4520
|
return /* @__PURE__ */ jsxs22("div", { children: [
|
|
4497
4521
|
/* @__PURE__ */ jsx38(
|
|
4498
4522
|
PlainTextPlugin,
|
|
4499
4523
|
{
|
|
4500
4524
|
contentEditable: /* @__PURE__ */ jsx38(ContentEditable, { ...contentEditableProps }),
|
|
4501
|
-
placeholder: null,
|
|
4525
|
+
placeholder: placeholder ? /* @__PURE__ */ jsx38(Fragment9, { children: placeholder }) : null,
|
|
4502
4526
|
ErrorBoundary: LexicalErrorBoundary
|
|
4503
4527
|
}
|
|
4504
4528
|
),
|
|
@@ -4583,7 +4607,7 @@ function RichishCopyAndPastePlugin() {
|
|
|
4583
4607
|
}
|
|
4584
4608
|
|
|
4585
4609
|
// src/components/Variables/InputVariables.tsx
|
|
4586
|
-
import { Fragment as
|
|
4610
|
+
import { Fragment as Fragment10, jsx as jsx39, jsxs as jsxs23 } from "@emotion/react/jsx-runtime";
|
|
4587
4611
|
function InputVariables(props) {
|
|
4588
4612
|
const {
|
|
4589
4613
|
id,
|
|
@@ -4596,6 +4620,7 @@ function InputVariables(props) {
|
|
|
4596
4620
|
transformPaste,
|
|
4597
4621
|
showAddVariableMenuOption,
|
|
4598
4622
|
inputWhenNoVariables,
|
|
4623
|
+
placeholder,
|
|
4599
4624
|
caption,
|
|
4600
4625
|
errorMessage,
|
|
4601
4626
|
warningMessage,
|
|
@@ -4621,6 +4646,7 @@ function InputVariables(props) {
|
|
|
4621
4646
|
dispatch({ type: "cancelEdit" });
|
|
4622
4647
|
}
|
|
4623
4648
|
},
|
|
4649
|
+
css: disabled ? inputDisabled : "",
|
|
4624
4650
|
children: [
|
|
4625
4651
|
useInputWithNoVariables ? inputWhenNoVariables : /* @__PURE__ */ jsx39(
|
|
4626
4652
|
InputVariablesOverlayMenu,
|
|
@@ -4636,7 +4662,17 @@ function InputVariables(props) {
|
|
|
4636
4662
|
"aria-label": ariaLabel,
|
|
4637
4663
|
"data-testid": dataTestId ? dataTestId : "input-container",
|
|
4638
4664
|
"data-text-value": value,
|
|
4639
|
-
css: [input, styleVariant === "compact" ? inputCompact : null]
|
|
4665
|
+
css: [input, styleVariant === "compact" ? inputCompact : null],
|
|
4666
|
+
placeholder: placeholder ? /* @__PURE__ */ jsx39(
|
|
4667
|
+
Caption,
|
|
4668
|
+
{
|
|
4669
|
+
css: [
|
|
4670
|
+
placeholderCaption,
|
|
4671
|
+
styleVariant === "compact" ? placeholderCompact : null
|
|
4672
|
+
],
|
|
4673
|
+
children: placeholder
|
|
4674
|
+
}
|
|
4675
|
+
) : void 0
|
|
4640
4676
|
}
|
|
4641
4677
|
)
|
|
4642
4678
|
}
|
|
@@ -4695,7 +4731,7 @@ function InputVariablesOverlayMenu({
|
|
|
4695
4731
|
...props
|
|
4696
4732
|
}) {
|
|
4697
4733
|
if (disabled) {
|
|
4698
|
-
return /* @__PURE__ */ jsx39(
|
|
4734
|
+
return /* @__PURE__ */ jsx39(Fragment10, { children });
|
|
4699
4735
|
}
|
|
4700
4736
|
return /* @__PURE__ */ jsxs23("div", { css: menuContainer, children: [
|
|
4701
4737
|
children,
|
|
@@ -5104,7 +5140,6 @@ var tableCellDragIcon = css25`
|
|
|
5104
5140
|
`;
|
|
5105
5141
|
var variableName = css25`
|
|
5106
5142
|
border: none;
|
|
5107
|
-
color: var(--brand-secondary-5);
|
|
5108
5143
|
font-weight: var(--fw-medium);
|
|
5109
5144
|
padding: 0;
|
|
5110
5145
|
background: none;
|
|
@@ -5121,10 +5156,10 @@ var variableValue = css25`
|
|
|
5121
5156
|
`;
|
|
5122
5157
|
|
|
5123
5158
|
// src/components/Variables/VariablesList.tsx
|
|
5124
|
-
import { Fragment as
|
|
5159
|
+
import { Fragment as Fragment11, jsx as jsx43, jsxs as jsxs27 } from "@emotion/react/jsx-runtime";
|
|
5125
5160
|
function VariablesList() {
|
|
5126
|
-
const { variables, dispatch } = useVariables();
|
|
5127
|
-
const sorted = variablesToList(variables);
|
|
5161
|
+
const { variables, dispatch, readOnly } = useVariables();
|
|
5162
|
+
const sorted = variablesToList(variables).filter((variable) => !variable.system);
|
|
5128
5163
|
const onDragEnd = (res) => {
|
|
5129
5164
|
var _a, _b;
|
|
5130
5165
|
if (res.destination && res.source.droppableId === ((_a = res.destination) == null ? void 0 : _a.droppableId)) {
|
|
@@ -5142,7 +5177,7 @@ function VariablesList() {
|
|
|
5142
5177
|
return result;
|
|
5143
5178
|
}
|
|
5144
5179
|
};
|
|
5145
|
-
return /* @__PURE__ */ jsxs27(
|
|
5180
|
+
return /* @__PURE__ */ jsxs27(Fragment11, { children: [
|
|
5146
5181
|
/* @__PURE__ */ jsx43(DragDropContext2, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx43(Droppable2, { droppableId: "variables-table", children: (provided) => /* @__PURE__ */ jsxs27(Table, { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
5147
5182
|
/* @__PURE__ */ jsx43(TableHead, { children: /* @__PURE__ */ jsxs27(TableRow, { children: [
|
|
5148
5183
|
/* @__PURE__ */ jsx43(TableCellHead, { children: "Name" }),
|
|
@@ -5150,7 +5185,7 @@ function VariablesList() {
|
|
|
5150
5185
|
/* @__PURE__ */ jsx43(TableCellHead, {})
|
|
5151
5186
|
] }) }),
|
|
5152
5187
|
/* @__PURE__ */ jsxs27(TableBody, { children: [
|
|
5153
|
-
sorted.map(({ name, displayName, default: defaultValue
|
|
5188
|
+
sorted.map(({ name, displayName, default: defaultValue }, index) => {
|
|
5154
5189
|
const text = displayName != null ? displayName : name;
|
|
5155
5190
|
const textValue = variableDefaultTextValue(defaultValue);
|
|
5156
5191
|
return /* @__PURE__ */ jsx43(
|
|
@@ -5169,7 +5204,7 @@ function VariablesList() {
|
|
|
5169
5204
|
css: tableRow(snapshot.isDragging),
|
|
5170
5205
|
"data-dragging": snapshot.isDragging,
|
|
5171
5206
|
children: [
|
|
5172
|
-
/* @__PURE__ */ jsx43(TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: /* @__PURE__ */ jsx43(
|
|
5207
|
+
/* @__PURE__ */ jsx43(TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: readOnly ? /* @__PURE__ */ jsx43("span", { css: variableName, children: text }) : /* @__PURE__ */ jsx43(
|
|
5173
5208
|
"button",
|
|
5174
5209
|
{
|
|
5175
5210
|
css: variableName,
|
|
@@ -5209,12 +5244,12 @@ function VariablesList() {
|
|
|
5209
5244
|
provided.placeholder
|
|
5210
5245
|
] })
|
|
5211
5246
|
] }) }) }),
|
|
5212
|
-
/* @__PURE__ */ jsx43(
|
|
5247
|
+
!readOnly && /* @__PURE__ */ jsx43(
|
|
5213
5248
|
AddListButton,
|
|
5214
5249
|
{
|
|
5215
5250
|
onButtonClick: () => dispatch({ type: "edit", variable: "" }),
|
|
5216
5251
|
"aria-label": "Add variable",
|
|
5217
|
-
buttonText: "
|
|
5252
|
+
buttonText: "Add variable",
|
|
5218
5253
|
icon: "math-plus",
|
|
5219
5254
|
css: { marginLeft: "var(--spacing-md)" }
|
|
5220
5255
|
}
|
|
@@ -5770,7 +5805,7 @@ function decodeVariablesInUrlEncodedString(string, varValues) {
|
|
|
5770
5805
|
}
|
|
5771
5806
|
|
|
5772
5807
|
// src/components/Request/RequestUrl.tsx
|
|
5773
|
-
import { Fragment as
|
|
5808
|
+
import { Fragment as Fragment12, jsx as jsx52, jsxs as jsxs31 } from "@emotion/react/jsx-runtime";
|
|
5774
5809
|
function RequestUrl() {
|
|
5775
5810
|
var _a, _b;
|
|
5776
5811
|
const { variables } = useVariables();
|
|
@@ -5794,7 +5829,7 @@ function RequestUrl() {
|
|
|
5794
5829
|
request.baseRequest ? /* @__PURE__ */ jsx52("span", { children: (_b = request.baseRequest) == null ? void 0 : _b.baseUrl }) : null,
|
|
5795
5830
|
/* @__PURE__ */ jsxs31("span", { css: { fontWeight: request.baseRequest ? "bold" : "inherit" }, children: [
|
|
5796
5831
|
urlEncodeRequestUrl(request.relativeUrl, variables),
|
|
5797
|
-
mergedParameters.length > 0 ? /* @__PURE__ */ jsxs31(
|
|
5832
|
+
mergedParameters.length > 0 ? /* @__PURE__ */ jsxs31(Fragment12, { children: [
|
|
5798
5833
|
"?",
|
|
5799
5834
|
mergedParameters.map((param, index) => {
|
|
5800
5835
|
const encoded = urlEncodeRequestParameter(param, variables);
|
|
@@ -6749,7 +6784,7 @@ var ObjectSearchResultListTitle = css36`
|
|
|
6749
6784
|
`;
|
|
6750
6785
|
|
|
6751
6786
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
6752
|
-
import { Fragment as
|
|
6787
|
+
import { Fragment as Fragment13, jsx as jsx65, jsxs as jsxs40 } from "@emotion/react/jsx-runtime";
|
|
6753
6788
|
function ObjectSearchResultList({
|
|
6754
6789
|
resultLabelText = "Selected",
|
|
6755
6790
|
removeButtonText = "Remove all",
|
|
@@ -6776,7 +6811,7 @@ function ObjectSearchResultList({
|
|
|
6776
6811
|
return result;
|
|
6777
6812
|
}
|
|
6778
6813
|
};
|
|
6779
|
-
return /* @__PURE__ */ jsxs40(
|
|
6814
|
+
return /* @__PURE__ */ jsxs40(Fragment13, { children: [
|
|
6780
6815
|
/* @__PURE__ */ jsxs40("div", { role: "group", css: ObjectSearchResultListContainer, children: [
|
|
6781
6816
|
/* @__PURE__ */ jsxs40("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
|
|
6782
6817
|
/* @__PURE__ */ jsx65("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
|
|
@@ -7094,7 +7129,7 @@ import {
|
|
|
7094
7129
|
LoadingIndicator as LoadingIndicator5,
|
|
7095
7130
|
LoadingOverlay as LoadingOverlay2,
|
|
7096
7131
|
Menu as Menu4,
|
|
7097
|
-
MenuItem as
|
|
7132
|
+
MenuItem as MenuItem3,
|
|
7098
7133
|
ParameterGroup,
|
|
7099
7134
|
ParameterImage,
|
|
7100
7135
|
ParameterImageInner,
|
|
@@ -7150,7 +7185,7 @@ export {
|
|
|
7150
7185
|
LoadingIndicator5 as LoadingIndicator,
|
|
7151
7186
|
LoadingOverlay2 as LoadingOverlay,
|
|
7152
7187
|
Menu4 as Menu,
|
|
7153
|
-
|
|
7188
|
+
MenuItem3 as MenuItem,
|
|
7154
7189
|
MeshApp,
|
|
7155
7190
|
OPEN_INSERT_VARIABLE_COMMAND,
|
|
7156
7191
|
ObjectSearchContainer,
|
package/dist/index.js
CHANGED
|
@@ -2856,13 +2856,14 @@ function useConnectedDataAsVariables(connectedData) {
|
|
|
2856
2856
|
}
|
|
2857
2857
|
|
|
2858
2858
|
// src/hooks/useDynamicInputsAsVariables.tsx
|
|
2859
|
+
var import_canvas = require("@uniformdev/canvas");
|
|
2859
2860
|
var import_react26 = require("react");
|
|
2860
2861
|
var import_jsx_runtime26 = require("@emotion/react/jsx-runtime");
|
|
2861
2862
|
function useDynamicInputsAsVariables(dynamicInputs) {
|
|
2862
2863
|
return (0, import_react26.useMemo)(() => {
|
|
2863
2864
|
const result = Object.entries(dynamicInputs).reduce(
|
|
2864
2865
|
(acc, [name, input3]) => {
|
|
2865
|
-
const source = `from ${input3.type === "path" ? "URL path" : "query string"}`;
|
|
2866
|
+
const source = `from ${name === import_canvas.LOCALE_DYNAMIC_INPUT_NAME ? "current locale" : input3.type === "path" ? "URL path" : "query string"}`;
|
|
2866
2867
|
acc[name] = {
|
|
2867
2868
|
readOnly: true,
|
|
2868
2869
|
type: input3.type,
|
|
@@ -2981,11 +2982,11 @@ var import_lite = require("dequal/lite");
|
|
|
2981
2982
|
var import_react30 = require("react");
|
|
2982
2983
|
|
|
2983
2984
|
// src/components/Variables/util/deserializeVariablesEditorState.ts
|
|
2984
|
-
var
|
|
2985
|
+
var import_canvas2 = require("@uniformdev/canvas");
|
|
2985
2986
|
var import_lexical = require("lexical");
|
|
2986
2987
|
function deserializeVariablesEditorState(serialized) {
|
|
2987
2988
|
const result = [];
|
|
2988
|
-
(0,
|
|
2989
|
+
(0, import_canvas2.parseVariableExpression)(serialized != null ? serialized : "", (token, type) => {
|
|
2989
2990
|
if (type === "text") {
|
|
2990
2991
|
const node = {
|
|
2991
2992
|
type: import_lexical.TextNode.getType(),
|
|
@@ -3112,7 +3113,7 @@ var import_LexicalComposerContext3 = require("@lexical/react/LexicalComposerCont
|
|
|
3112
3113
|
var import_useLexicalNodeSelection = require("@lexical/react/useLexicalNodeSelection");
|
|
3113
3114
|
var import_selection = require("@lexical/selection");
|
|
3114
3115
|
var import_utils2 = require("@lexical/utils");
|
|
3115
|
-
var
|
|
3116
|
+
var import_canvas4 = require("@uniformdev/canvas");
|
|
3116
3117
|
var import_design_system18 = require("@uniformdev/design-system");
|
|
3117
3118
|
var import_lexical4 = require("lexical");
|
|
3118
3119
|
var import_react39 = require("react");
|
|
@@ -3132,6 +3133,7 @@ function VariableChip({
|
|
|
3132
3133
|
tooltip,
|
|
3133
3134
|
reference,
|
|
3134
3135
|
onClick,
|
|
3136
|
+
clickToEdit,
|
|
3135
3137
|
isFresh,
|
|
3136
3138
|
selected,
|
|
3137
3139
|
disabled
|
|
@@ -3139,7 +3141,7 @@ function VariableChip({
|
|
|
3139
3141
|
const hasClickEvent = !!onClick;
|
|
3140
3142
|
const referenceIsValidFr = isFresh ? true : referenceIsValid;
|
|
3141
3143
|
const Wrapper = referenceIsValidFr === "info" ? InfoVariableReference : referenceIsValidFr ? import_react31.Fragment : UndefinedVariableReference;
|
|
3142
|
-
const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent ? "Click to edit" : void 0;
|
|
3144
|
+
const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent && clickToEdit ? "Click to edit" : void 0;
|
|
3143
3145
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3144
3146
|
import_design_system15.MultilineChip,
|
|
3145
3147
|
{
|
|
@@ -3186,7 +3188,7 @@ var import_LexicalComposerContext2 = require("@lexical/react/LexicalComposerCont
|
|
|
3186
3188
|
var import_LexicalTypeaheadMenuPlugin = require("@lexical/react/LexicalTypeaheadMenuPlugin");
|
|
3187
3189
|
var import_utils = require("@lexical/utils");
|
|
3188
3190
|
var import_AiFillPlusCircle = require("@react-icons/all-files/ai/AiFillPlusCircle");
|
|
3189
|
-
var
|
|
3191
|
+
var import_canvas3 = require("@uniformdev/canvas");
|
|
3190
3192
|
var import_design_system17 = require("@uniformdev/design-system");
|
|
3191
3193
|
var import_lite2 = require("dequal/lite");
|
|
3192
3194
|
var import_lexical3 = require("lexical");
|
|
@@ -3660,7 +3662,7 @@ function useVariablesMenu({
|
|
|
3660
3662
|
var _a;
|
|
3661
3663
|
const targetVariable = variables[value];
|
|
3662
3664
|
if (overwriteExistingValue) {
|
|
3663
|
-
setVariablesEditorValue(editor, (0,
|
|
3665
|
+
setVariablesEditorValue(editor, (0, import_canvas3.createVariableReference)(value));
|
|
3664
3666
|
return true;
|
|
3665
3667
|
}
|
|
3666
3668
|
const variableNode = $createVariableNode(value, {
|
|
@@ -3830,7 +3832,7 @@ function VariablesPlugin({
|
|
|
3830
3832
|
if (!disableVariables) {
|
|
3831
3833
|
const targetVariable = variablesRef.current.variables[reference];
|
|
3832
3834
|
if (overwriteExistingValue) {
|
|
3833
|
-
setVariablesEditorValue(editor, (0,
|
|
3835
|
+
setVariablesEditorValue(editor, (0, import_canvas3.createVariableReference)(reference));
|
|
3834
3836
|
return true;
|
|
3835
3837
|
}
|
|
3836
3838
|
const variableNode = $createVariableNode(reference, {
|
|
@@ -3944,7 +3946,7 @@ function VariablesPlugin({
|
|
|
3944
3946
|
currentCumulativeMenuIndex++;
|
|
3945
3947
|
const myCumulativeIndex = currentCumulativeMenuIndex;
|
|
3946
3948
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3947
|
-
import_design_system17.
|
|
3949
|
+
import_design_system17.MenuItemInner,
|
|
3948
3950
|
{
|
|
3949
3951
|
active: selectedIndex === myCumulativeIndex,
|
|
3950
3952
|
onClick: () => {
|
|
@@ -4030,7 +4032,7 @@ var VariableNode = class _VariableNode extends import_lexical4.DecoratorNode {
|
|
|
4030
4032
|
* (albeit it won't get the fancy chip-node)
|
|
4031
4033
|
*/
|
|
4032
4034
|
getTextContent() {
|
|
4033
|
-
return (0,
|
|
4035
|
+
return (0, import_canvas4.createVariableReference)(this.reference);
|
|
4034
4036
|
}
|
|
4035
4037
|
/** Creates the DOM wrapper that hosts the node */
|
|
4036
4038
|
createDOM() {
|
|
@@ -4146,6 +4148,7 @@ function VariableNodeComponent({
|
|
|
4146
4148
|
displayName: state.isLoading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system18.LoadingIndicator, { size: "sm" }) : state.displayName,
|
|
4147
4149
|
selected: isSelected,
|
|
4148
4150
|
disabled: readOnly,
|
|
4151
|
+
clickToEdit: state.hasClickEvent,
|
|
4149
4152
|
onClick: state.hasClickEvent ? () => {
|
|
4150
4153
|
setSelected(!isSelected);
|
|
4151
4154
|
editor.dispatchCommand(EDIT_VARIABLE_COMMAND, {
|
|
@@ -4261,16 +4264,32 @@ var inputCompact = import_react41.css`
|
|
|
4261
4264
|
padding-block: var(--spacing-sm);
|
|
4262
4265
|
font-size: var(--fs-sm);
|
|
4263
4266
|
`;
|
|
4267
|
+
var inputDisabled = import_react41.css`
|
|
4268
|
+
cursor: not-allowed;
|
|
4269
|
+
opacity: var(--opacity-50);
|
|
4270
|
+
`;
|
|
4271
|
+
var placeholderCaption = import_react41.css`
|
|
4272
|
+
position: absolute;
|
|
4273
|
+
color: var(--gray-400);
|
|
4274
|
+
inset: var(--spacing-base) var(--spacing-lg) var(--spacing-base) var(--spacing-base);
|
|
4275
|
+
overflow: hidden;
|
|
4276
|
+
text-overflow: ellipsis;
|
|
4277
|
+
white-space: nowrap;
|
|
4278
|
+
pointer-events: none;
|
|
4279
|
+
`;
|
|
4280
|
+
var placeholderCompact = import_react41.css`
|
|
4281
|
+
inset: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
|
|
4282
|
+
`;
|
|
4264
4283
|
|
|
4265
4284
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
4266
4285
|
var React10 = __toESM(require("react"));
|
|
4267
4286
|
var import_react42 = require("react");
|
|
4268
4287
|
|
|
4269
4288
|
// src/components/Variables/util/hasReferencedVariables.ts
|
|
4270
|
-
var
|
|
4289
|
+
var import_canvas5 = require("@uniformdev/canvas");
|
|
4271
4290
|
function hasReferencedVariables(value) {
|
|
4272
4291
|
let result = false;
|
|
4273
|
-
(0,
|
|
4292
|
+
(0, import_canvas5.parseVariableExpression)(value, (token, type) => {
|
|
4274
4293
|
if (type === "variable") {
|
|
4275
4294
|
result = true;
|
|
4276
4295
|
return false;
|
|
@@ -4556,7 +4575,7 @@ function SingleLineTextPlugin() {
|
|
|
4556
4575
|
}
|
|
4557
4576
|
|
|
4558
4577
|
// src/components/Variables/util/serializeVariablesEditorState.ts
|
|
4559
|
-
var
|
|
4578
|
+
var import_canvas6 = require("@uniformdev/canvas");
|
|
4560
4579
|
var import_lexical8 = require("lexical");
|
|
4561
4580
|
|
|
4562
4581
|
// src/components/Variables/util/variableExpression.ts
|
|
@@ -4575,7 +4594,7 @@ function serializeRecursive(node, buffer) {
|
|
|
4575
4594
|
buffer.push(node.text.replace(variablePrefix, "\\${"));
|
|
4576
4595
|
}
|
|
4577
4596
|
if (node.type === VariableNode.getType()) {
|
|
4578
|
-
buffer.push((0,
|
|
4597
|
+
buffer.push((0, import_canvas6.createVariableReference)(node.reference));
|
|
4579
4598
|
}
|
|
4580
4599
|
if (node.type === import_lexical8.LineBreakNode.getType()) {
|
|
4581
4600
|
buffer.push("\n");
|
|
@@ -4621,6 +4640,7 @@ function VariablesComposer(props) {
|
|
|
4621
4640
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4622
4641
|
import_LexicalOnChangePlugin.OnChangePlugin,
|
|
4623
4642
|
{
|
|
4643
|
+
ignoreSelectionChange: true,
|
|
4624
4644
|
onChange: (state) => {
|
|
4625
4645
|
editorState.current = state;
|
|
4626
4646
|
if (updateTimeout.current) {
|
|
@@ -4658,13 +4678,17 @@ var import_utils4 = require("@lexical/utils");
|
|
|
4658
4678
|
var import_lexical9 = require("lexical");
|
|
4659
4679
|
var import_react48 = require("react");
|
|
4660
4680
|
var import_jsx_runtime38 = require("@emotion/react/jsx-runtime");
|
|
4661
|
-
function VariablesComposerInput({
|
|
4681
|
+
function VariablesComposerInput({
|
|
4682
|
+
css: css37,
|
|
4683
|
+
placeholder,
|
|
4684
|
+
...contentEditableProps
|
|
4685
|
+
}) {
|
|
4662
4686
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
4663
4687
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4664
4688
|
import_LexicalPlainTextPlugin.PlainTextPlugin,
|
|
4665
4689
|
{
|
|
4666
4690
|
contentEditable: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_LexicalContentEditable.ContentEditable, { ...contentEditableProps }),
|
|
4667
|
-
placeholder: null,
|
|
4691
|
+
placeholder: placeholder ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: placeholder }) : null,
|
|
4668
4692
|
ErrorBoundary: import_LexicalErrorBoundary.default
|
|
4669
4693
|
}
|
|
4670
4694
|
),
|
|
@@ -4762,6 +4786,7 @@ function InputVariables(props) {
|
|
|
4762
4786
|
transformPaste,
|
|
4763
4787
|
showAddVariableMenuOption,
|
|
4764
4788
|
inputWhenNoVariables,
|
|
4789
|
+
placeholder,
|
|
4765
4790
|
caption,
|
|
4766
4791
|
errorMessage,
|
|
4767
4792
|
warningMessage,
|
|
@@ -4787,6 +4812,7 @@ function InputVariables(props) {
|
|
|
4787
4812
|
dispatch({ type: "cancelEdit" });
|
|
4788
4813
|
}
|
|
4789
4814
|
},
|
|
4815
|
+
css: disabled ? inputDisabled : "",
|
|
4790
4816
|
children: [
|
|
4791
4817
|
useInputWithNoVariables ? inputWhenNoVariables : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4792
4818
|
InputVariablesOverlayMenu,
|
|
@@ -4802,7 +4828,17 @@ function InputVariables(props) {
|
|
|
4802
4828
|
"aria-label": ariaLabel,
|
|
4803
4829
|
"data-testid": dataTestId ? dataTestId : "input-container",
|
|
4804
4830
|
"data-text-value": value,
|
|
4805
|
-
css: [input, styleVariant === "compact" ? inputCompact : null]
|
|
4831
|
+
css: [input, styleVariant === "compact" ? inputCompact : null],
|
|
4832
|
+
placeholder: placeholder ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4833
|
+
import_design_system20.Caption,
|
|
4834
|
+
{
|
|
4835
|
+
css: [
|
|
4836
|
+
placeholderCaption,
|
|
4837
|
+
styleVariant === "compact" ? placeholderCompact : null
|
|
4838
|
+
],
|
|
4839
|
+
children: placeholder
|
|
4840
|
+
}
|
|
4841
|
+
) : void 0
|
|
4806
4842
|
}
|
|
4807
4843
|
)
|
|
4808
4844
|
}
|
|
@@ -4878,7 +4914,7 @@ function InputVariablesOverlayMenu({
|
|
|
4878
4914
|
|
|
4879
4915
|
// src/components/Variables/ParameterConnectionIndicator.tsx
|
|
4880
4916
|
var import_CgUsbC2 = require("@react-icons/all-files/cg/CgUsbC");
|
|
4881
|
-
var
|
|
4917
|
+
var import_canvas7 = require("@uniformdev/canvas");
|
|
4882
4918
|
var import_design_system22 = require("@uniformdev/design-system");
|
|
4883
4919
|
var import_react51 = require("react");
|
|
4884
4920
|
|
|
@@ -4983,7 +5019,7 @@ function ParameterConnectionIndicator({
|
|
|
4983
5019
|
}) {
|
|
4984
5020
|
const hasVariablesInValue = (0, import_react51.useMemo)(() => {
|
|
4985
5021
|
let result = false;
|
|
4986
|
-
(0,
|
|
5022
|
+
(0, import_canvas7.bindVariablesToObject)({
|
|
4987
5023
|
value,
|
|
4988
5024
|
variables: {},
|
|
4989
5025
|
handleBinding: () => {
|
|
@@ -5260,7 +5296,6 @@ var tableCellDragIcon = import_react55.css`
|
|
|
5260
5296
|
`;
|
|
5261
5297
|
var variableName = import_react55.css`
|
|
5262
5298
|
border: none;
|
|
5263
|
-
color: var(--brand-secondary-5);
|
|
5264
5299
|
font-weight: var(--fw-medium);
|
|
5265
5300
|
padding: 0;
|
|
5266
5301
|
background: none;
|
|
@@ -5279,8 +5314,8 @@ var variableValue = import_react55.css`
|
|
|
5279
5314
|
// src/components/Variables/VariablesList.tsx
|
|
5280
5315
|
var import_jsx_runtime43 = require("@emotion/react/jsx-runtime");
|
|
5281
5316
|
function VariablesList() {
|
|
5282
|
-
const { variables, dispatch } = useVariables();
|
|
5283
|
-
const sorted = variablesToList(variables);
|
|
5317
|
+
const { variables, dispatch, readOnly } = useVariables();
|
|
5318
|
+
const sorted = variablesToList(variables).filter((variable) => !variable.system);
|
|
5284
5319
|
const onDragEnd = (res) => {
|
|
5285
5320
|
var _a, _b;
|
|
5286
5321
|
if (res.destination && res.source.droppableId === ((_a = res.destination) == null ? void 0 : _a.droppableId)) {
|
|
@@ -5306,7 +5341,7 @@ function VariablesList() {
|
|
|
5306
5341
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system25.TableCellHead, {})
|
|
5307
5342
|
] }) }),
|
|
5308
5343
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_design_system25.TableBody, { children: [
|
|
5309
|
-
sorted.map(({ name, displayName, default: defaultValue
|
|
5344
|
+
sorted.map(({ name, displayName, default: defaultValue }, index) => {
|
|
5310
5345
|
const text = displayName != null ? displayName : name;
|
|
5311
5346
|
const textValue = variableDefaultTextValue(defaultValue);
|
|
5312
5347
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
@@ -5325,7 +5360,7 @@ function VariablesList() {
|
|
|
5325
5360
|
css: tableRow(snapshot.isDragging),
|
|
5326
5361
|
"data-dragging": snapshot.isDragging,
|
|
5327
5362
|
children: [
|
|
5328
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system25.TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5363
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system25.TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: readOnly ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { css: variableName, children: text }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5329
5364
|
"button",
|
|
5330
5365
|
{
|
|
5331
5366
|
css: variableName,
|
|
@@ -5365,12 +5400,12 @@ function VariablesList() {
|
|
|
5365
5400
|
provided.placeholder
|
|
5366
5401
|
] })
|
|
5367
5402
|
] }) }) }),
|
|
5368
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5403
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5369
5404
|
import_design_system25.AddListButton,
|
|
5370
5405
|
{
|
|
5371
5406
|
onButtonClick: () => dispatch({ type: "edit", variable: "" }),
|
|
5372
5407
|
"aria-label": "Add variable",
|
|
5373
|
-
buttonText: "
|
|
5408
|
+
buttonText: "Add variable",
|
|
5374
5409
|
icon: "math-plus",
|
|
5375
5410
|
css: { marginLeft: "var(--spacing-md)" }
|
|
5376
5411
|
}
|
|
@@ -6248,11 +6283,11 @@ var DataRefreshButton = ({
|
|
|
6248
6283
|
|
|
6249
6284
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
6250
6285
|
var import_react65 = require("@emotion/react");
|
|
6251
|
-
var
|
|
6286
|
+
var import_canvas9 = require("@uniformdev/canvas");
|
|
6252
6287
|
var import_design_system33 = require("@uniformdev/design-system");
|
|
6253
6288
|
|
|
6254
6289
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
6255
|
-
var
|
|
6290
|
+
var import_canvas8 = require("@uniformdev/canvas");
|
|
6256
6291
|
var import_react64 = require("react");
|
|
6257
6292
|
var import_jsx_runtime58 = require("@emotion/react/jsx-runtime");
|
|
6258
6293
|
var ObjectSearchContext = (0, import_react64.createContext)({
|
|
@@ -6342,7 +6377,7 @@ function useObjectSearchContext() {
|
|
|
6342
6377
|
return (0, import_react64.useContext)(ObjectSearchContext);
|
|
6343
6378
|
}
|
|
6344
6379
|
function bindQuery(query, inputs) {
|
|
6345
|
-
const { result, errors } = (0,
|
|
6380
|
+
const { result, errors } = (0, import_canvas8.bindVariablesToObject)({
|
|
6346
6381
|
value: query,
|
|
6347
6382
|
variables: inputs,
|
|
6348
6383
|
errorPrefix: "Dynamic input"
|
|
@@ -6388,7 +6423,7 @@ var ObjectSearchContainer = ({
|
|
|
6388
6423
|
onSelectItem([]);
|
|
6389
6424
|
return;
|
|
6390
6425
|
}
|
|
6391
|
-
const { result, errors } = (0,
|
|
6426
|
+
const { result, errors } = (0, import_canvas9.bindVariables)({
|
|
6392
6427
|
value: selectedValue,
|
|
6393
6428
|
variables: flatVariables,
|
|
6394
6429
|
errorPrefix: "Dynamic input"
|
package/dist/index.mjs
CHANGED
|
@@ -2654,13 +2654,14 @@ function useConnectedDataAsVariables(connectedData) {
|
|
|
2654
2654
|
}
|
|
2655
2655
|
|
|
2656
2656
|
// src/hooks/useDynamicInputsAsVariables.tsx
|
|
2657
|
+
import { LOCALE_DYNAMIC_INPUT_NAME } from "@uniformdev/canvas";
|
|
2657
2658
|
import { useMemo as useMemo4 } from "react";
|
|
2658
2659
|
import { Fragment as Fragment4, jsx as jsx26 } from "@emotion/react/jsx-runtime";
|
|
2659
2660
|
function useDynamicInputsAsVariables(dynamicInputs) {
|
|
2660
2661
|
return useMemo4(() => {
|
|
2661
2662
|
const result = Object.entries(dynamicInputs).reduce(
|
|
2662
2663
|
(acc, [name, input3]) => {
|
|
2663
|
-
const source = `from ${input3.type === "path" ? "URL path" : "query string"}`;
|
|
2664
|
+
const source = `from ${name === LOCALE_DYNAMIC_INPUT_NAME ? "current locale" : input3.type === "path" ? "URL path" : "query string"}`;
|
|
2664
2665
|
acc[name] = {
|
|
2665
2666
|
readOnly: true,
|
|
2666
2667
|
type: input3.type,
|
|
@@ -2944,6 +2945,7 @@ function VariableChip({
|
|
|
2944
2945
|
tooltip,
|
|
2945
2946
|
reference,
|
|
2946
2947
|
onClick,
|
|
2948
|
+
clickToEdit,
|
|
2947
2949
|
isFresh,
|
|
2948
2950
|
selected,
|
|
2949
2951
|
disabled
|
|
@@ -2951,7 +2953,7 @@ function VariableChip({
|
|
|
2951
2953
|
const hasClickEvent = !!onClick;
|
|
2952
2954
|
const referenceIsValidFr = isFresh ? true : referenceIsValid;
|
|
2953
2955
|
const Wrapper = referenceIsValidFr === "info" ? InfoVariableReference : referenceIsValidFr ? Fragment5 : UndefinedVariableReference;
|
|
2954
|
-
const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent ? "Click to edit" : void 0;
|
|
2956
|
+
const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent && clickToEdit ? "Click to edit" : void 0;
|
|
2955
2957
|
return /* @__PURE__ */ jsx29(
|
|
2956
2958
|
MultilineChip,
|
|
2957
2959
|
{
|
|
@@ -3002,7 +3004,7 @@ import {
|
|
|
3002
3004
|
import { mergeRegister } from "@lexical/utils";
|
|
3003
3005
|
import { AiFillPlusCircle } from "@react-icons/all-files/ai/AiFillPlusCircle";
|
|
3004
3006
|
import { createVariableReference } from "@uniformdev/canvas";
|
|
3005
|
-
import { HorizontalRhythm as HorizontalRhythm2, MenuGroup,
|
|
3007
|
+
import { HorizontalRhythm as HorizontalRhythm2, MenuGroup, MenuItemInner, MenuItemSeparator } from "@uniformdev/design-system";
|
|
3006
3008
|
import { dequal as dequal2 } from "dequal/lite";
|
|
3007
3009
|
import {
|
|
3008
3010
|
$createTextNode,
|
|
@@ -3766,7 +3768,7 @@ function VariablesPlugin({
|
|
|
3766
3768
|
currentCumulativeMenuIndex++;
|
|
3767
3769
|
const myCumulativeIndex = currentCumulativeMenuIndex;
|
|
3768
3770
|
return /* @__PURE__ */ jsx32(
|
|
3769
|
-
|
|
3771
|
+
MenuItemInner,
|
|
3770
3772
|
{
|
|
3771
3773
|
active: selectedIndex === myCumulativeIndex,
|
|
3772
3774
|
onClick: () => {
|
|
@@ -3968,6 +3970,7 @@ function VariableNodeComponent({
|
|
|
3968
3970
|
displayName: state.isLoading ? /* @__PURE__ */ jsx33(LoadingIndicator2, { size: "sm" }) : state.displayName,
|
|
3969
3971
|
selected: isSelected,
|
|
3970
3972
|
disabled: readOnly,
|
|
3973
|
+
clickToEdit: state.hasClickEvent,
|
|
3971
3974
|
onClick: state.hasClickEvent ? () => {
|
|
3972
3975
|
setSelected(!isSelected);
|
|
3973
3976
|
editor.dispatchCommand(EDIT_VARIABLE_COMMAND, {
|
|
@@ -4083,6 +4086,22 @@ var inputCompact = css21`
|
|
|
4083
4086
|
padding-block: var(--spacing-sm);
|
|
4084
4087
|
font-size: var(--fs-sm);
|
|
4085
4088
|
`;
|
|
4089
|
+
var inputDisabled = css21`
|
|
4090
|
+
cursor: not-allowed;
|
|
4091
|
+
opacity: var(--opacity-50);
|
|
4092
|
+
`;
|
|
4093
|
+
var placeholderCaption = css21`
|
|
4094
|
+
position: absolute;
|
|
4095
|
+
color: var(--gray-400);
|
|
4096
|
+
inset: var(--spacing-base) var(--spacing-lg) var(--spacing-base) var(--spacing-base);
|
|
4097
|
+
overflow: hidden;
|
|
4098
|
+
text-overflow: ellipsis;
|
|
4099
|
+
white-space: nowrap;
|
|
4100
|
+
pointer-events: none;
|
|
4101
|
+
`;
|
|
4102
|
+
var placeholderCompact = css21`
|
|
4103
|
+
inset: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
|
|
4104
|
+
`;
|
|
4086
4105
|
|
|
4087
4106
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
4088
4107
|
import * as React10 from "react";
|
|
@@ -4201,7 +4220,7 @@ import { CLEAR_EDITOR_COMMAND } from "lexical";
|
|
|
4201
4220
|
// src/components/Variables/toolbox/SelectVariableMenu.tsx
|
|
4202
4221
|
import { BsFillPlusCircleFill } from "@react-icons/all-files/bs/BsFillPlusCircleFill";
|
|
4203
4222
|
import { CgUsbC } from "@react-icons/all-files/cg/CgUsbC";
|
|
4204
|
-
import { HorizontalRhythm as HorizontalRhythm3, Menu as Menu2, MenuGroup as MenuGroup2, MenuItem as
|
|
4223
|
+
import { HorizontalRhythm as HorizontalRhythm3, Menu as Menu2, MenuGroup as MenuGroup2, MenuItem as MenuItem2, MenuItemSeparator as MenuItemSeparator2 } from "@uniformdev/design-system";
|
|
4205
4224
|
import { useRef as useRef11 } from "react";
|
|
4206
4225
|
import { Fragment as Fragment7, jsx as jsx34, jsxs as jsxs19 } from "@emotion/react/jsx-runtime";
|
|
4207
4226
|
function SelectVariableMenu({
|
|
@@ -4244,7 +4263,7 @@ function SelectVariableMenu({
|
|
|
4244
4263
|
menuLabel: menuTooltip,
|
|
4245
4264
|
children: [
|
|
4246
4265
|
showAddVariableMenuOptionForReals ? /* @__PURE__ */ jsx34(
|
|
4247
|
-
|
|
4266
|
+
MenuItem2,
|
|
4248
4267
|
{
|
|
4249
4268
|
onClick: async () => {
|
|
4250
4269
|
const result = await editVariable("", getEditorContext == null ? void 0 : getEditorContext());
|
|
@@ -4266,7 +4285,7 @@ function SelectVariableMenu({
|
|
|
4266
4285
|
return /* @__PURE__ */ jsx34(MenuGroup2, { title: (_a = group.name) != null ? _a : "", children: group.variables.map((variable) => {
|
|
4267
4286
|
const { name, displayName, helpText } = variable;
|
|
4268
4287
|
return /* @__PURE__ */ jsxs19(
|
|
4269
|
-
|
|
4288
|
+
MenuItem2,
|
|
4270
4289
|
{
|
|
4271
4290
|
id: name,
|
|
4272
4291
|
css: menuItemTextGroup,
|
|
@@ -4281,7 +4300,7 @@ function SelectVariableMenu({
|
|
|
4281
4300
|
}) }, group.name);
|
|
4282
4301
|
}),
|
|
4283
4302
|
menuHasVariableOptions && onResetVariables ? /* @__PURE__ */ jsx34(MenuItemSeparator2, {}) : null,
|
|
4284
|
-
onResetVariables ? /* @__PURE__ */ jsx34(
|
|
4303
|
+
onResetVariables ? /* @__PURE__ */ jsx34(MenuItem2, { onClick: onResetVariables, css: { color: "var(--brand-secondary-5)" }, children: "Reset" }) : null,
|
|
4285
4304
|
tip && (menuHasVariableOptions || onResetVariables) ? /* @__PURE__ */ jsx34(MenuItemSeparator2, {}) : null,
|
|
4286
4305
|
tip ? /* @__PURE__ */ jsx34("i", { css: variablesTipText, children: tip }) : null
|
|
4287
4306
|
]
|
|
@@ -4443,6 +4462,7 @@ function VariablesComposer(props) {
|
|
|
4443
4462
|
/* @__PURE__ */ jsx37(
|
|
4444
4463
|
OnChangePlugin,
|
|
4445
4464
|
{
|
|
4465
|
+
ignoreSelectionChange: true,
|
|
4446
4466
|
onChange: (state) => {
|
|
4447
4467
|
editorState.current = state;
|
|
4448
4468
|
if (updateTimeout.current) {
|
|
@@ -4491,14 +4511,18 @@ import {
|
|
|
4491
4511
|
PASTE_COMMAND as PASTE_COMMAND2
|
|
4492
4512
|
} from "lexical";
|
|
4493
4513
|
import { useEffect as useEffect13 } from "react";
|
|
4494
|
-
import { jsx as jsx38, jsxs as jsxs22 } from "@emotion/react/jsx-runtime";
|
|
4495
|
-
function VariablesComposerInput({
|
|
4514
|
+
import { Fragment as Fragment9, jsx as jsx38, jsxs as jsxs22 } from "@emotion/react/jsx-runtime";
|
|
4515
|
+
function VariablesComposerInput({
|
|
4516
|
+
css: css37,
|
|
4517
|
+
placeholder,
|
|
4518
|
+
...contentEditableProps
|
|
4519
|
+
}) {
|
|
4496
4520
|
return /* @__PURE__ */ jsxs22("div", { children: [
|
|
4497
4521
|
/* @__PURE__ */ jsx38(
|
|
4498
4522
|
PlainTextPlugin,
|
|
4499
4523
|
{
|
|
4500
4524
|
contentEditable: /* @__PURE__ */ jsx38(ContentEditable, { ...contentEditableProps }),
|
|
4501
|
-
placeholder: null,
|
|
4525
|
+
placeholder: placeholder ? /* @__PURE__ */ jsx38(Fragment9, { children: placeholder }) : null,
|
|
4502
4526
|
ErrorBoundary: LexicalErrorBoundary
|
|
4503
4527
|
}
|
|
4504
4528
|
),
|
|
@@ -4583,7 +4607,7 @@ function RichishCopyAndPastePlugin() {
|
|
|
4583
4607
|
}
|
|
4584
4608
|
|
|
4585
4609
|
// src/components/Variables/InputVariables.tsx
|
|
4586
|
-
import { Fragment as
|
|
4610
|
+
import { Fragment as Fragment10, jsx as jsx39, jsxs as jsxs23 } from "@emotion/react/jsx-runtime";
|
|
4587
4611
|
function InputVariables(props) {
|
|
4588
4612
|
const {
|
|
4589
4613
|
id,
|
|
@@ -4596,6 +4620,7 @@ function InputVariables(props) {
|
|
|
4596
4620
|
transformPaste,
|
|
4597
4621
|
showAddVariableMenuOption,
|
|
4598
4622
|
inputWhenNoVariables,
|
|
4623
|
+
placeholder,
|
|
4599
4624
|
caption,
|
|
4600
4625
|
errorMessage,
|
|
4601
4626
|
warningMessage,
|
|
@@ -4621,6 +4646,7 @@ function InputVariables(props) {
|
|
|
4621
4646
|
dispatch({ type: "cancelEdit" });
|
|
4622
4647
|
}
|
|
4623
4648
|
},
|
|
4649
|
+
css: disabled ? inputDisabled : "",
|
|
4624
4650
|
children: [
|
|
4625
4651
|
useInputWithNoVariables ? inputWhenNoVariables : /* @__PURE__ */ jsx39(
|
|
4626
4652
|
InputVariablesOverlayMenu,
|
|
@@ -4636,7 +4662,17 @@ function InputVariables(props) {
|
|
|
4636
4662
|
"aria-label": ariaLabel,
|
|
4637
4663
|
"data-testid": dataTestId ? dataTestId : "input-container",
|
|
4638
4664
|
"data-text-value": value,
|
|
4639
|
-
css: [input, styleVariant === "compact" ? inputCompact : null]
|
|
4665
|
+
css: [input, styleVariant === "compact" ? inputCompact : null],
|
|
4666
|
+
placeholder: placeholder ? /* @__PURE__ */ jsx39(
|
|
4667
|
+
Caption,
|
|
4668
|
+
{
|
|
4669
|
+
css: [
|
|
4670
|
+
placeholderCaption,
|
|
4671
|
+
styleVariant === "compact" ? placeholderCompact : null
|
|
4672
|
+
],
|
|
4673
|
+
children: placeholder
|
|
4674
|
+
}
|
|
4675
|
+
) : void 0
|
|
4640
4676
|
}
|
|
4641
4677
|
)
|
|
4642
4678
|
}
|
|
@@ -4695,7 +4731,7 @@ function InputVariablesOverlayMenu({
|
|
|
4695
4731
|
...props
|
|
4696
4732
|
}) {
|
|
4697
4733
|
if (disabled) {
|
|
4698
|
-
return /* @__PURE__ */ jsx39(
|
|
4734
|
+
return /* @__PURE__ */ jsx39(Fragment10, { children });
|
|
4699
4735
|
}
|
|
4700
4736
|
return /* @__PURE__ */ jsxs23("div", { css: menuContainer, children: [
|
|
4701
4737
|
children,
|
|
@@ -5104,7 +5140,6 @@ var tableCellDragIcon = css25`
|
|
|
5104
5140
|
`;
|
|
5105
5141
|
var variableName = css25`
|
|
5106
5142
|
border: none;
|
|
5107
|
-
color: var(--brand-secondary-5);
|
|
5108
5143
|
font-weight: var(--fw-medium);
|
|
5109
5144
|
padding: 0;
|
|
5110
5145
|
background: none;
|
|
@@ -5121,10 +5156,10 @@ var variableValue = css25`
|
|
|
5121
5156
|
`;
|
|
5122
5157
|
|
|
5123
5158
|
// src/components/Variables/VariablesList.tsx
|
|
5124
|
-
import { Fragment as
|
|
5159
|
+
import { Fragment as Fragment11, jsx as jsx43, jsxs as jsxs27 } from "@emotion/react/jsx-runtime";
|
|
5125
5160
|
function VariablesList() {
|
|
5126
|
-
const { variables, dispatch } = useVariables();
|
|
5127
|
-
const sorted = variablesToList(variables);
|
|
5161
|
+
const { variables, dispatch, readOnly } = useVariables();
|
|
5162
|
+
const sorted = variablesToList(variables).filter((variable) => !variable.system);
|
|
5128
5163
|
const onDragEnd = (res) => {
|
|
5129
5164
|
var _a, _b;
|
|
5130
5165
|
if (res.destination && res.source.droppableId === ((_a = res.destination) == null ? void 0 : _a.droppableId)) {
|
|
@@ -5142,7 +5177,7 @@ function VariablesList() {
|
|
|
5142
5177
|
return result;
|
|
5143
5178
|
}
|
|
5144
5179
|
};
|
|
5145
|
-
return /* @__PURE__ */ jsxs27(
|
|
5180
|
+
return /* @__PURE__ */ jsxs27(Fragment11, { children: [
|
|
5146
5181
|
/* @__PURE__ */ jsx43(DragDropContext2, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx43(Droppable2, { droppableId: "variables-table", children: (provided) => /* @__PURE__ */ jsxs27(Table, { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
5147
5182
|
/* @__PURE__ */ jsx43(TableHead, { children: /* @__PURE__ */ jsxs27(TableRow, { children: [
|
|
5148
5183
|
/* @__PURE__ */ jsx43(TableCellHead, { children: "Name" }),
|
|
@@ -5150,7 +5185,7 @@ function VariablesList() {
|
|
|
5150
5185
|
/* @__PURE__ */ jsx43(TableCellHead, {})
|
|
5151
5186
|
] }) }),
|
|
5152
5187
|
/* @__PURE__ */ jsxs27(TableBody, { children: [
|
|
5153
|
-
sorted.map(({ name, displayName, default: defaultValue
|
|
5188
|
+
sorted.map(({ name, displayName, default: defaultValue }, index) => {
|
|
5154
5189
|
const text = displayName != null ? displayName : name;
|
|
5155
5190
|
const textValue = variableDefaultTextValue(defaultValue);
|
|
5156
5191
|
return /* @__PURE__ */ jsx43(
|
|
@@ -5169,7 +5204,7 @@ function VariablesList() {
|
|
|
5169
5204
|
css: tableRow(snapshot.isDragging),
|
|
5170
5205
|
"data-dragging": snapshot.isDragging,
|
|
5171
5206
|
children: [
|
|
5172
|
-
/* @__PURE__ */ jsx43(TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: /* @__PURE__ */ jsx43(
|
|
5207
|
+
/* @__PURE__ */ jsx43(TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: readOnly ? /* @__PURE__ */ jsx43("span", { css: variableName, children: text }) : /* @__PURE__ */ jsx43(
|
|
5173
5208
|
"button",
|
|
5174
5209
|
{
|
|
5175
5210
|
css: variableName,
|
|
@@ -5209,12 +5244,12 @@ function VariablesList() {
|
|
|
5209
5244
|
provided.placeholder
|
|
5210
5245
|
] })
|
|
5211
5246
|
] }) }) }),
|
|
5212
|
-
/* @__PURE__ */ jsx43(
|
|
5247
|
+
!readOnly && /* @__PURE__ */ jsx43(
|
|
5213
5248
|
AddListButton,
|
|
5214
5249
|
{
|
|
5215
5250
|
onButtonClick: () => dispatch({ type: "edit", variable: "" }),
|
|
5216
5251
|
"aria-label": "Add variable",
|
|
5217
|
-
buttonText: "
|
|
5252
|
+
buttonText: "Add variable",
|
|
5218
5253
|
icon: "math-plus",
|
|
5219
5254
|
css: { marginLeft: "var(--spacing-md)" }
|
|
5220
5255
|
}
|
|
@@ -5770,7 +5805,7 @@ function decodeVariablesInUrlEncodedString(string, varValues) {
|
|
|
5770
5805
|
}
|
|
5771
5806
|
|
|
5772
5807
|
// src/components/Request/RequestUrl.tsx
|
|
5773
|
-
import { Fragment as
|
|
5808
|
+
import { Fragment as Fragment12, jsx as jsx52, jsxs as jsxs31 } from "@emotion/react/jsx-runtime";
|
|
5774
5809
|
function RequestUrl() {
|
|
5775
5810
|
var _a, _b;
|
|
5776
5811
|
const { variables } = useVariables();
|
|
@@ -5794,7 +5829,7 @@ function RequestUrl() {
|
|
|
5794
5829
|
request.baseRequest ? /* @__PURE__ */ jsx52("span", { children: (_b = request.baseRequest) == null ? void 0 : _b.baseUrl }) : null,
|
|
5795
5830
|
/* @__PURE__ */ jsxs31("span", { css: { fontWeight: request.baseRequest ? "bold" : "inherit" }, children: [
|
|
5796
5831
|
urlEncodeRequestUrl(request.relativeUrl, variables),
|
|
5797
|
-
mergedParameters.length > 0 ? /* @__PURE__ */ jsxs31(
|
|
5832
|
+
mergedParameters.length > 0 ? /* @__PURE__ */ jsxs31(Fragment12, { children: [
|
|
5798
5833
|
"?",
|
|
5799
5834
|
mergedParameters.map((param, index) => {
|
|
5800
5835
|
const encoded = urlEncodeRequestParameter(param, variables);
|
|
@@ -6749,7 +6784,7 @@ var ObjectSearchResultListTitle = css36`
|
|
|
6749
6784
|
`;
|
|
6750
6785
|
|
|
6751
6786
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
6752
|
-
import { Fragment as
|
|
6787
|
+
import { Fragment as Fragment13, jsx as jsx65, jsxs as jsxs40 } from "@emotion/react/jsx-runtime";
|
|
6753
6788
|
function ObjectSearchResultList({
|
|
6754
6789
|
resultLabelText = "Selected",
|
|
6755
6790
|
removeButtonText = "Remove all",
|
|
@@ -6776,7 +6811,7 @@ function ObjectSearchResultList({
|
|
|
6776
6811
|
return result;
|
|
6777
6812
|
}
|
|
6778
6813
|
};
|
|
6779
|
-
return /* @__PURE__ */ jsxs40(
|
|
6814
|
+
return /* @__PURE__ */ jsxs40(Fragment13, { children: [
|
|
6780
6815
|
/* @__PURE__ */ jsxs40("div", { role: "group", css: ObjectSearchResultListContainer, children: [
|
|
6781
6816
|
/* @__PURE__ */ jsxs40("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
|
|
6782
6817
|
/* @__PURE__ */ jsx65("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
|
|
@@ -7094,7 +7129,7 @@ import {
|
|
|
7094
7129
|
LoadingIndicator as LoadingIndicator5,
|
|
7095
7130
|
LoadingOverlay as LoadingOverlay2,
|
|
7096
7131
|
Menu as Menu4,
|
|
7097
|
-
MenuItem as
|
|
7132
|
+
MenuItem as MenuItem3,
|
|
7098
7133
|
ParameterGroup,
|
|
7099
7134
|
ParameterImage,
|
|
7100
7135
|
ParameterImageInner,
|
|
@@ -7150,7 +7185,7 @@ export {
|
|
|
7150
7185
|
LoadingIndicator5 as LoadingIndicator,
|
|
7151
7186
|
LoadingOverlay2 as LoadingOverlay,
|
|
7152
7187
|
Menu4 as Menu,
|
|
7153
|
-
|
|
7188
|
+
MenuItem3 as MenuItem,
|
|
7154
7189
|
MeshApp,
|
|
7155
7190
|
OPEN_INSERT_VARIABLE_COMMAND,
|
|
7156
7191
|
ObjectSearchContainer,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/mesh-sdk-react",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.71.1-alpha.103+2e172bb17",
|
|
4
4
|
"description": "Uniform Mesh Framework SDK for React",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -50,15 +50,15 @@
|
|
|
50
50
|
"@lexical/selection": "^0.12.0",
|
|
51
51
|
"@lexical/utils": "^0.12.0",
|
|
52
52
|
"@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v4.10.1/react-icons-all-files-4.10.1.tgz",
|
|
53
|
-
"@uniformdev/canvas": "19.
|
|
54
|
-
"@uniformdev/design-system": "19.
|
|
55
|
-
"@uniformdev/mesh-sdk": "19.
|
|
53
|
+
"@uniformdev/canvas": "19.71.1-alpha.103+2e172bb17",
|
|
54
|
+
"@uniformdev/design-system": "19.71.1-alpha.103+2e172bb17",
|
|
55
|
+
"@uniformdev/mesh-sdk": "19.71.1-alpha.103+2e172bb17",
|
|
56
56
|
"dequal": "^2.0.3",
|
|
57
57
|
"lexical": "^0.12.0",
|
|
58
58
|
"mitt": "^3.0.0",
|
|
59
59
|
"react-beautiful-dnd": "13.1.1",
|
|
60
60
|
"react-hook-form": "^7.47.0",
|
|
61
|
-
"react-use": "17.4.
|
|
61
|
+
"react-use": "17.4.2",
|
|
62
62
|
"timeago.js": "4.0.2",
|
|
63
63
|
"uuid": "9.0.1",
|
|
64
64
|
"zod": "3.22.4"
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"@emotion/react": "11.11.1",
|
|
74
74
|
"@storybook/react": "6.5.16",
|
|
75
75
|
"@svgr/cli": "6.5.1",
|
|
76
|
-
"@types/react": "18.2.
|
|
77
|
-
"@types/react-beautiful-dnd": "13.1.
|
|
78
|
-
"@types/react-dom": "18.2.
|
|
76
|
+
"@types/react": "18.2.40",
|
|
77
|
+
"@types/react-beautiful-dnd": "13.1.7",
|
|
78
|
+
"@types/react-dom": "18.2.17",
|
|
79
79
|
"@types/uuid": "9.0.4",
|
|
80
80
|
"react": "18.2.0",
|
|
81
81
|
"react-dom": "18.2.0"
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "2e172bb17f644b34be818605979a1436b8621c90"
|
|
90
90
|
}
|