@uniformdev/mesh-sdk-react 18.33.1-alpha.7 → 18.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +59 -3
- package/dist/index.esm.js +44 -3
- package/dist/index.js +52 -3
- package/dist/index.mjs +44 -3
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ import { TDate } from 'timeago.js';
|
|
|
5
5
|
import * as _emotion_react from '@emotion/react';
|
|
6
6
|
import { DataVariableDefinition, DataResourceVariables } from '@uniformdev/canvas';
|
|
7
7
|
import * as _uniformdev_mesh_sdk from '@uniformdev/mesh-sdk';
|
|
8
|
-
import { MeshLocation, SetValueOptions, DataSourceLocationValue, DataTypeLocationValue } from '@uniformdev/mesh-sdk';
|
|
8
|
+
import { MeshLocation, SetValueOptions, DataSourceLocationValue, DataTypeLocationValue, UniformMeshSDK, MeshLocationCore } from '@uniformdev/mesh-sdk';
|
|
9
9
|
export * from '@uniformdev/mesh-sdk';
|
|
10
10
|
import { InputSelectProps } from '@uniformdev/design-system';
|
|
11
|
-
export { AddListButton, AddListButtonProps, Button, ButtonProps, Callout, CalloutProps, Heading, HeadingProps, Input, InputComboBox, InputComboBoxProps, InputKeywordSearch, InputProps, InputSelect, InputToggle, InputToggleProps, Label, LabelProps, LoadingIndicator, LoadingOverlay, Menu, MenuItem, MenuItemProps, MenuProps, ParameterGroup, ParameterGroupProps, ParameterImage, ParameterImageInner, ParameterImageProps, ParameterInput, ParameterInputInner, ParameterInputProps, ParameterLabel, ParameterLabelProps, ParameterMenuButton, ParameterMenuButtonProps, ParameterSelect, ParameterSelectInner, ParameterSelectProps, ParameterShell, ParameterShellContext, ParameterShellProps, ParameterTextarea, ParameterTextareaInner, ParameterTextareaProps, ParameterToggle, ParameterToggleInner, ParameterToggleProps, ScrollableList, ScrollableListItem, ScrollableListItemProps, ScrollableListProps, Switch, SwitchProps, Textarea, TextareaProps, Theme, ThemeProps, useParameterShell } from '@uniformdev/design-system';
|
|
11
|
+
export { AddListButton, AddListButtonProps, Button, ButtonProps, Callout, CalloutProps, Heading, HeadingProps, Input, InputComboBox, InputComboBoxProps, InputKeywordSearch, InputProps, InputSelect, InputToggle, InputToggleProps, InputKeywordSearch as KeywordSearchInput, Label, LabelProps, LoadingIndicator, LoadingOverlay, Menu, MenuItem, MenuItemProps, MenuProps, ParameterGroup, ParameterGroupProps, ParameterImage, ParameterImageInner, ParameterImageProps, ParameterInput, ParameterInputInner, ParameterInputProps, ParameterLabel, ParameterLabelProps, ParameterMenuButton, ParameterMenuButtonProps, ParameterSelect, ParameterSelectInner, ParameterSelectProps, ParameterShell, ParameterShellContext, ParameterShellProps, ParameterTextarea, ParameterTextareaInner, ParameterTextareaProps, ParameterToggle, ParameterToggleInner, ParameterToggleProps, ScrollableList, ScrollableListItem, ScrollableListItemProps, ScrollableListProps, Switch, SwitchProps, Textarea, TextareaProps, Theme, ThemeProps, useParameterShell } from '@uniformdev/design-system';
|
|
12
12
|
|
|
13
13
|
declare const SvgCaution: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
14
14
|
|
|
@@ -389,6 +389,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
389
389
|
type: TLocationType;
|
|
390
390
|
}> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
|
|
391
391
|
type: TLocationType;
|
|
392
|
+
}> | Extract<_uniformdev_mesh_sdk.DataTypeInstanceLocation, {
|
|
393
|
+
type: TLocationType;
|
|
392
394
|
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
393
395
|
type: TLocationType;
|
|
394
396
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
@@ -402,6 +404,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
402
404
|
type: TLocationType;
|
|
403
405
|
}> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
|
|
404
406
|
type: TLocationType;
|
|
407
|
+
}> | Extract<_uniformdev_mesh_sdk.DataTypeInstanceLocation, {
|
|
408
|
+
type: TLocationType;
|
|
405
409
|
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
406
410
|
type: TLocationType;
|
|
407
411
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
@@ -414,6 +418,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
414
418
|
type: TLocationType;
|
|
415
419
|
}> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
|
|
416
420
|
type: TLocationType;
|
|
421
|
+
}> | Extract<_uniformdev_mesh_sdk.DataTypeInstanceLocation, {
|
|
422
|
+
type: TLocationType;
|
|
417
423
|
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
418
424
|
type: TLocationType;
|
|
419
425
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
@@ -676,6 +682,56 @@ declare function useRequestParameter(paramName: string): {
|
|
|
676
682
|
update: (value: string) => void;
|
|
677
683
|
};
|
|
678
684
|
|
|
685
|
+
/** @deprecated */
|
|
686
|
+
interface UniformMeshLocationContextValue<TLocationValue = unknown, TLocationSetValue = TLocationValue> {
|
|
687
|
+
location: MeshLocation<TLocationValue, TLocationSetValue>;
|
|
688
|
+
}
|
|
689
|
+
/** @deprecated not intended for public usage */
|
|
690
|
+
declare const UniformMeshLocationContext: React__default.Context<UniformMeshLocationContextValue<unknown, unknown> | undefined>;
|
|
691
|
+
/** @deprecated not intended for public usage. Use <MeshApp /> instead. */
|
|
692
|
+
declare const UniformMeshLocationContextProvider: React__default.FC<React__default.PropsWithChildren<unknown>>;
|
|
693
|
+
/**
|
|
694
|
+
* Provides access to the current UniformMeshLocationContext value.
|
|
695
|
+
* @deprecated Not intended for public use. Use `useUniformMeshLocation` instead.
|
|
696
|
+
*/
|
|
697
|
+
declare const useUniformMeshLocationContext: <TLocationValue = unknown, TLocationSetValue = TLocationValue>() => UniformMeshLocationContextValue<TLocationValue, TLocationSetValue>;
|
|
698
|
+
|
|
699
|
+
interface UniformMeshSdkContextValue {
|
|
700
|
+
sdk: UniformMeshSDK;
|
|
701
|
+
}
|
|
702
|
+
/** @deprecated not intended for public usage */
|
|
703
|
+
declare const UniformMeshSdkContext: React__default.Context<UniformMeshSdkContextValue | undefined>;
|
|
704
|
+
/** @deprecated not intended for public usage; use <MeshApp /> instead */
|
|
705
|
+
declare const UniformMeshSdkContextProvider: React__default.FC<React__default.PropsWithChildren<unknown>>;
|
|
706
|
+
/**
|
|
707
|
+
* Provides access to the current (initialized) Uniform Mesh SDK context value.
|
|
708
|
+
* @deprecated Not intended for public use. Use `useUniformMeshLocation` or `useUniformMeshSdk` instead.
|
|
709
|
+
*/
|
|
710
|
+
declare const useUniformMeshSdkContext: () => UniformMeshSdkContextValue;
|
|
711
|
+
|
|
712
|
+
interface UseUniformMeshSdkOptions {
|
|
713
|
+
autoResizingDisabled?: boolean;
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Provides a React-hook wrapper around Uniform Mesh SDK initialization.
|
|
717
|
+
* NOTE: initialization is an async operation and should be handled as such.
|
|
718
|
+
*
|
|
719
|
+
* @deprecated prefer <MeshApp /> to initialize and provide in a single component
|
|
720
|
+
*/
|
|
721
|
+
declare const useInitializeUniformMeshSdk: ({ autoResizingDisabled }?: UseUniformMeshSdkOptions) => {
|
|
722
|
+
initializing: boolean;
|
|
723
|
+
error: Error | undefined;
|
|
724
|
+
sdk: UniformMeshSDK | undefined;
|
|
725
|
+
};
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* Provides convenient access to the current Uniform Mesh location via React hook.
|
|
729
|
+
* Intended to be used within <MeshApp />.
|
|
730
|
+
*
|
|
731
|
+
* @deprecated prefer useMeshLocation which has much more accurate type safety
|
|
732
|
+
*/
|
|
733
|
+
declare function useUniformMeshLocation<TLocationValue = unknown, TLocationMetadata = never, TLocationSetValue = TLocationValue>(): MeshLocationCore<TLocationValue, TLocationMetadata, TLocationSetValue>;
|
|
734
|
+
|
|
679
735
|
/**
|
|
680
736
|
* Provides convenient access to the current Uniform Mesh SDK instance via React hook.
|
|
681
737
|
* Intended to be used within <MeshApp />.
|
|
@@ -691,4 +747,4 @@ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
|
|
|
691
747
|
*/
|
|
692
748
|
declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
|
|
693
749
|
|
|
694
|
-
export { BaseRequestData, Brand, DamItem, DamSelectedItem, DamSelectedItemProps, DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListProps, DataSourceEditor, DataSourceEditorProps, DataTypeEditor, DataTypeEditorProps, DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, DispatchResult, EntrySearch, EntrySearchContentType, EntrySearchProps, EntrySearchQueryOptions, EntrySearchResult, EntrySearchRowProps, EntrySearchSelectedItemProps, GetProductOptions, GetProductsOptions, index as Icons, InputToken, InputVariables, InputVariablesProps, MeshApp, MeshAppProps, NoResultsProps, ProductCategory, ProductDynamicSelectorValue, ProductPreviewList, ProductQuery, ProductQueryCategory, ProductQueryContext, ProductQueryContextValue, ProductQueryProps, ProductSearch, ProductSearchContext, ProductSearchContextValue, ProductSearchProps, ProductSearchResult, ProductSearchResults, ProductSearchRow, ProductSelectedItem, RequestAction, RequestBody, RequestContext, RequestData, RequestHeaders, RequestMethodSelect, RequestParameter, RequestParameters, RequestParametersProps, RequestProvider, RequestProviderProps, RequestTypeContainer, RequestTypeContainerProps, RequestUrl, RequestUrlInput, ResolvableLoadingValue, SelectionField, SelectionFieldValue, SetLocationValueDispatch, SetLocationValueFunction, TextVariableRenderer, VariableEditor, VariableEditorProps, VariablesAction, VariablesContext, VariablesList, VariablesProvider, VariablesProviderProps, badgeIcon, createLocationValidator, damSelectItemImage, damSelectedItemContainer, damSelectedItemCopy, damSelectedItemDetails, damSelectedItemIcon, damSelectedItemInfoBtn, damSelectedItemInner, damSelectedItemLinkBtn, damSelectedItemLinkContainer, damSelectedItemMediaContainer, damSelectedItemPopover, damSelectedItemPopoverLabel, damSelectedItemSmallText, damSelectedItemTitle, draggableContainer, draggableIcon, draggableIconOffset, draggableIconWrapper, entrySearchBtn, entrySearchConfig, entrySearchConfigHidden, entrySearchLoadMoreBtn, entrySearchResultList, entrySearchSelectIcon, entrySearchSelectImg, entrySearchSelectInput, entrySearchSelectOption, entrySearchWrapper, productSearchRowActiveIcon, productSearchRowCategory, productSearchRowContainer, productSearchRowContent, productSearchRowContentActive, productSearchRowDetails, productSearchRowTitle, productSelectedItemContainer, productSelectedItemContent, productSelectedItemDetails, productSelectedItemIcon, productSelectedItemImage, productSelectedItemLinkContainer, productedSelectedItemLinkBtn, productedSelectedItemSmallText, searchRowBtn, searchRowContainer, searchRowContainerActive, searchRowContainerWithPopover, searchRowPopover, searchRowText, searchRowTextSmall, selectItemLinkBtn, selectItemLinkContainer, selectItemPopover, selectItemPopoverLabel, selectItemSmallText, selectedItemContainer, selectedItemCopy, selectedItemDetails, selectedItemIcon, selectedItemInner, selectedItemTitle, urlEncodeRequestParameter, urlEncodeRequestUrl, useMeshLocation, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshSdk, useVariables, variablesToList };
|
|
750
|
+
export { BaseRequestData, Brand, DamItem, DamSelectedItem, DamSelectedItemProps, DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListProps, DataSourceEditor, DataSourceEditorProps, DataTypeEditor, DataTypeEditorProps, DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, DispatchResult, EntrySearch, EntrySearchContentType, EntrySearchProps, EntrySearchQueryOptions, EntrySearchResult, EntrySearchRowProps, EntrySearchSelectedItemProps, GetProductOptions, GetProductsOptions, index as Icons, InputToken, InputVariables, InputVariablesProps, MeshApp, MeshAppProps, NoResultsProps, ProductCategory, ProductDynamicSelectorValue, ProductPreviewList, ProductQuery, ProductQueryCategory, ProductQueryContext, ProductQueryContextValue, ProductQueryProps, ProductSearch, ProductSearchContext, ProductSearchContextValue, ProductSearchProps, ProductSearchResult, ProductSearchResults, ProductSearchRow, ProductSelectedItem, RequestAction, RequestBody, RequestContext, RequestData, RequestHeaders, RequestMethodSelect, RequestParameter, RequestParameters, RequestParametersProps, RequestProvider, RequestProviderProps, RequestTypeContainer, RequestTypeContainerProps, RequestUrl, RequestUrlInput, ResolvableLoadingValue, SelectionField, SelectionFieldValue, SetLocationValueDispatch, SetLocationValueFunction, TextVariableRenderer, UniformMeshLocationContext, UniformMeshLocationContextProvider, UniformMeshLocationContextValue, UniformMeshSdkContext, UniformMeshSdkContextProvider, UniformMeshSdkContextValue, UseUniformMeshSdkOptions, VariableEditor, VariableEditorProps, VariablesAction, VariablesContext, VariablesList, VariablesProvider, VariablesProviderProps, badgeIcon, createLocationValidator, damSelectItemImage, damSelectedItemContainer, damSelectedItemCopy, damSelectedItemDetails, damSelectedItemIcon, damSelectedItemInfoBtn, damSelectedItemInner, damSelectedItemLinkBtn, damSelectedItemLinkContainer, damSelectedItemMediaContainer, damSelectedItemPopover, damSelectedItemPopoverLabel, damSelectedItemSmallText, damSelectedItemTitle, draggableContainer, draggableIcon, draggableIconOffset, draggableIconWrapper, entrySearchBtn, entrySearchConfig, entrySearchConfigHidden, entrySearchLoadMoreBtn, entrySearchResultList, entrySearchSelectIcon, entrySearchSelectImg, entrySearchSelectInput, entrySearchSelectOption, entrySearchWrapper, productSearchRowActiveIcon, productSearchRowCategory, productSearchRowContainer, productSearchRowContent, productSearchRowContentActive, productSearchRowDetails, productSearchRowTitle, productSelectedItemContainer, productSelectedItemContent, productSelectedItemDetails, productSelectedItemIcon, productSelectedItemImage, productSelectedItemLinkContainer, productedSelectedItemLinkBtn, productedSelectedItemSmallText, searchRowBtn, searchRowContainer, searchRowContainerActive, searchRowContainerWithPopover, searchRowPopover, searchRowText, searchRowTextSmall, selectItemLinkBtn, selectItemLinkContainer, selectItemPopover, selectItemPopoverLabel, selectItemSmallText, selectedItemContainer, selectedItemCopy, selectedItemDetails, selectedItemIcon, selectedItemInner, selectedItemTitle, urlEncodeRequestParameter, urlEncodeRequestUrl, useInitializeUniformMeshSdk, useMeshLocation, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshLocation, useUniformMeshLocationContext, useUniformMeshSdk, useUniformMeshSdkContext, useVariables, variablesToList };
|
package/dist/index.esm.js
CHANGED
|
@@ -2655,6 +2655,18 @@ import { Theme } from "@uniformdev/design-system";
|
|
|
2655
2655
|
import { createContext, useContext as useContext3 } from "react";
|
|
2656
2656
|
import { jsx as jsx26, jsxs as jsxs15 } from "@emotion/react/jsx-runtime";
|
|
2657
2657
|
var UniformMeshSdkContext = createContext(void 0);
|
|
2658
|
+
var UniformMeshSdkContextProvider = ({ children }) => {
|
|
2659
|
+
let value = void 0;
|
|
2660
|
+
if (typeof window !== "undefined" && typeof window.UniformMeshSDK !== "undefined") {
|
|
2661
|
+
value = {
|
|
2662
|
+
sdk: window.UniformMeshSDK
|
|
2663
|
+
};
|
|
2664
|
+
}
|
|
2665
|
+
return /* @__PURE__ */ jsxs15(UniformMeshSdkContext.Provider, { value, children: [
|
|
2666
|
+
/* @__PURE__ */ jsx26(Theme, {}),
|
|
2667
|
+
/* @__PURE__ */ jsx26(UniformMeshLocationContextProvider, { children })
|
|
2668
|
+
] });
|
|
2669
|
+
};
|
|
2658
2670
|
var useUniformMeshSdkContext = () => {
|
|
2659
2671
|
const context = useContext3(UniformMeshSdkContext);
|
|
2660
2672
|
if (!context) {
|
|
@@ -2671,7 +2683,9 @@ function useUniformMeshSdk() {
|
|
|
2671
2683
|
|
|
2672
2684
|
// src/components/UniformMeshLocationContext.tsx
|
|
2673
2685
|
import { jsx as jsx27 } from "@emotion/react/jsx-runtime";
|
|
2674
|
-
var UniformMeshLocationContext = createContext2(
|
|
2686
|
+
var UniformMeshLocationContext = createContext2(
|
|
2687
|
+
void 0
|
|
2688
|
+
);
|
|
2675
2689
|
var UniformMeshLocationContextProvider = ({
|
|
2676
2690
|
children
|
|
2677
2691
|
}) => {
|
|
@@ -2702,9 +2716,20 @@ var useUniformMeshLocationContext = () => {
|
|
|
2702
2716
|
};
|
|
2703
2717
|
|
|
2704
2718
|
// src/hooks/useMeshLocation.ts
|
|
2719
|
+
var legacyWarned = false;
|
|
2705
2720
|
function useMeshLocation(expectedLocation) {
|
|
2706
2721
|
const { location } = useUniformMeshLocationContext();
|
|
2707
|
-
|
|
2722
|
+
let effectiveExpected = expectedLocation;
|
|
2723
|
+
if (expectedLocation === "dataTypeInstance") {
|
|
2724
|
+
effectiveExpected = "dataResource";
|
|
2725
|
+
if (!legacyWarned) {
|
|
2726
|
+
console.warn(
|
|
2727
|
+
"`dataTypeInstance` mesh location is deprecated, please switch to `dataResource` instead."
|
|
2728
|
+
);
|
|
2729
|
+
legacyWarned = true;
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
if (effectiveExpected && location.type !== effectiveExpected) {
|
|
2708
2733
|
throw new Error(`Expected location type ${expectedLocation} but got ${location.type}`);
|
|
2709
2734
|
}
|
|
2710
2735
|
const backdoorLocation = useRef7(location);
|
|
@@ -3191,7 +3216,7 @@ function DataResourceVariablesList({
|
|
|
3191
3216
|
const {
|
|
3192
3217
|
value,
|
|
3193
3218
|
metadata: { dataType }
|
|
3194
|
-
} = useMeshLocation("
|
|
3219
|
+
} = useMeshLocation("dataTypeInstance");
|
|
3195
3220
|
const variableDefinitions = variablesToList(dataType.variables);
|
|
3196
3221
|
if (variableDefinitions.length === 0) {
|
|
3197
3222
|
if (NoVariablesComponent) {
|
|
@@ -3937,6 +3962,12 @@ var MeshApp = ({
|
|
|
3937
3962
|
] });
|
|
3938
3963
|
};
|
|
3939
3964
|
|
|
3965
|
+
// src/hooks/useUniformMeshLocation.ts
|
|
3966
|
+
function useUniformMeshLocation() {
|
|
3967
|
+
const { location } = useUniformMeshLocationContext();
|
|
3968
|
+
return location;
|
|
3969
|
+
}
|
|
3970
|
+
|
|
3940
3971
|
// src/hooks/index.ts
|
|
3941
3972
|
import { ParameterShellContext, useParameterShell } from "@uniformdev/design-system";
|
|
3942
3973
|
|
|
@@ -3959,6 +3990,7 @@ import {
|
|
|
3959
3990
|
InputKeywordSearch as InputKeywordSearch2,
|
|
3960
3991
|
InputSelect as InputSelect6,
|
|
3961
3992
|
InputToggle,
|
|
3993
|
+
InputKeywordSearch as InputKeywordSearch3,
|
|
3962
3994
|
Label,
|
|
3963
3995
|
LoadingIndicator as LoadingIndicator3,
|
|
3964
3996
|
LoadingOverlay as LoadingOverlay2,
|
|
@@ -4004,6 +4036,7 @@ export {
|
|
|
4004
4036
|
InputSelect6 as InputSelect,
|
|
4005
4037
|
InputToggle,
|
|
4006
4038
|
InputVariables,
|
|
4039
|
+
InputKeywordSearch3 as KeywordSearchInput,
|
|
4007
4040
|
Label,
|
|
4008
4041
|
LoadingIndicator3 as LoadingIndicator,
|
|
4009
4042
|
LoadingOverlay2 as LoadingOverlay,
|
|
@@ -4048,6 +4081,10 @@ export {
|
|
|
4048
4081
|
TextVariableRenderer,
|
|
4049
4082
|
Textarea,
|
|
4050
4083
|
Theme3 as Theme,
|
|
4084
|
+
UniformMeshLocationContext,
|
|
4085
|
+
UniformMeshLocationContextProvider,
|
|
4086
|
+
UniformMeshSdkContext,
|
|
4087
|
+
UniformMeshSdkContextProvider,
|
|
4051
4088
|
VariableEditor,
|
|
4052
4089
|
VariablesList,
|
|
4053
4090
|
VariablesProvider,
|
|
@@ -4116,6 +4153,7 @@ export {
|
|
|
4116
4153
|
selectedItemTitle,
|
|
4117
4154
|
urlEncodeRequestParameter,
|
|
4118
4155
|
urlEncodeRequestUrl,
|
|
4156
|
+
useInitializeUniformMeshSdk,
|
|
4119
4157
|
useMeshLocation,
|
|
4120
4158
|
useParameterShell,
|
|
4121
4159
|
useProductQueryContext,
|
|
@@ -4123,7 +4161,10 @@ export {
|
|
|
4123
4161
|
useRequest,
|
|
4124
4162
|
useRequestHeader,
|
|
4125
4163
|
useRequestParameter,
|
|
4164
|
+
useUniformMeshLocation,
|
|
4165
|
+
useUniformMeshLocationContext,
|
|
4126
4166
|
useUniformMeshSdk,
|
|
4167
|
+
useUniformMeshSdkContext,
|
|
4127
4168
|
useVariables,
|
|
4128
4169
|
variablesToList
|
|
4129
4170
|
};
|
package/dist/index.js
CHANGED
|
@@ -49,6 +49,7 @@ __export(src_exports, {
|
|
|
49
49
|
InputSelect: () => import_design_system25.InputSelect,
|
|
50
50
|
InputToggle: () => import_design_system25.InputToggle,
|
|
51
51
|
InputVariables: () => InputVariables,
|
|
52
|
+
KeywordSearchInput: () => import_design_system25.InputKeywordSearch,
|
|
52
53
|
Label: () => import_design_system25.Label,
|
|
53
54
|
LoadingIndicator: () => import_design_system25.LoadingIndicator,
|
|
54
55
|
LoadingOverlay: () => import_design_system25.LoadingOverlay,
|
|
@@ -93,6 +94,10 @@ __export(src_exports, {
|
|
|
93
94
|
TextVariableRenderer: () => TextVariableRenderer,
|
|
94
95
|
Textarea: () => import_design_system25.Textarea,
|
|
95
96
|
Theme: () => import_design_system25.Theme,
|
|
97
|
+
UniformMeshLocationContext: () => UniformMeshLocationContext,
|
|
98
|
+
UniformMeshLocationContextProvider: () => UniformMeshLocationContextProvider,
|
|
99
|
+
UniformMeshSdkContext: () => UniformMeshSdkContext,
|
|
100
|
+
UniformMeshSdkContextProvider: () => UniformMeshSdkContextProvider,
|
|
96
101
|
VariableEditor: () => VariableEditor,
|
|
97
102
|
VariablesList: () => VariablesList,
|
|
98
103
|
VariablesProvider: () => VariablesProvider,
|
|
@@ -161,6 +166,7 @@ __export(src_exports, {
|
|
|
161
166
|
selectedItemTitle: () => selectedItemTitle,
|
|
162
167
|
urlEncodeRequestParameter: () => urlEncodeRequestParameter,
|
|
163
168
|
urlEncodeRequestUrl: () => urlEncodeRequestUrl,
|
|
169
|
+
useInitializeUniformMeshSdk: () => useInitializeUniformMeshSdk,
|
|
164
170
|
useMeshLocation: () => useMeshLocation,
|
|
165
171
|
useParameterShell: () => import_design_system24.useParameterShell,
|
|
166
172
|
useProductQueryContext: () => useProductQueryContext,
|
|
@@ -168,7 +174,10 @@ __export(src_exports, {
|
|
|
168
174
|
useRequest: () => useRequest,
|
|
169
175
|
useRequestHeader: () => useRequestHeader,
|
|
170
176
|
useRequestParameter: () => useRequestParameter,
|
|
177
|
+
useUniformMeshLocation: () => useUniformMeshLocation,
|
|
178
|
+
useUniformMeshLocationContext: () => useUniformMeshLocationContext,
|
|
171
179
|
useUniformMeshSdk: () => useUniformMeshSdk,
|
|
180
|
+
useUniformMeshSdkContext: () => useUniformMeshSdkContext,
|
|
172
181
|
useVariables: () => useVariables,
|
|
173
182
|
variablesToList: () => variablesToList
|
|
174
183
|
});
|
|
@@ -2815,6 +2824,18 @@ var import_design_system13 = require("@uniformdev/design-system");
|
|
|
2815
2824
|
var import_react25 = require("react");
|
|
2816
2825
|
var import_jsx_runtime26 = require("@emotion/react/jsx-runtime");
|
|
2817
2826
|
var UniformMeshSdkContext = (0, import_react25.createContext)(void 0);
|
|
2827
|
+
var UniformMeshSdkContextProvider = ({ children }) => {
|
|
2828
|
+
let value = void 0;
|
|
2829
|
+
if (typeof window !== "undefined" && typeof window.UniformMeshSDK !== "undefined") {
|
|
2830
|
+
value = {
|
|
2831
|
+
sdk: window.UniformMeshSDK
|
|
2832
|
+
};
|
|
2833
|
+
}
|
|
2834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(UniformMeshSdkContext.Provider, { value, children: [
|
|
2835
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_design_system13.Theme, {}),
|
|
2836
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(UniformMeshLocationContextProvider, { children })
|
|
2837
|
+
] });
|
|
2838
|
+
};
|
|
2818
2839
|
var useUniformMeshSdkContext = () => {
|
|
2819
2840
|
const context = (0, import_react25.useContext)(UniformMeshSdkContext);
|
|
2820
2841
|
if (!context) {
|
|
@@ -2831,7 +2852,9 @@ function useUniformMeshSdk() {
|
|
|
2831
2852
|
|
|
2832
2853
|
// src/components/UniformMeshLocationContext.tsx
|
|
2833
2854
|
var import_jsx_runtime27 = require("@emotion/react/jsx-runtime");
|
|
2834
|
-
var UniformMeshLocationContext = (0, import_react26.createContext)(
|
|
2855
|
+
var UniformMeshLocationContext = (0, import_react26.createContext)(
|
|
2856
|
+
void 0
|
|
2857
|
+
);
|
|
2835
2858
|
var UniformMeshLocationContextProvider = ({
|
|
2836
2859
|
children
|
|
2837
2860
|
}) => {
|
|
@@ -2862,9 +2885,20 @@ var useUniformMeshLocationContext = () => {
|
|
|
2862
2885
|
};
|
|
2863
2886
|
|
|
2864
2887
|
// src/hooks/useMeshLocation.ts
|
|
2888
|
+
var legacyWarned = false;
|
|
2865
2889
|
function useMeshLocation(expectedLocation) {
|
|
2866
2890
|
const { location } = useUniformMeshLocationContext();
|
|
2867
|
-
|
|
2891
|
+
let effectiveExpected = expectedLocation;
|
|
2892
|
+
if (expectedLocation === "dataTypeInstance") {
|
|
2893
|
+
effectiveExpected = "dataResource";
|
|
2894
|
+
if (!legacyWarned) {
|
|
2895
|
+
console.warn(
|
|
2896
|
+
"`dataTypeInstance` mesh location is deprecated, please switch to `dataResource` instead."
|
|
2897
|
+
);
|
|
2898
|
+
legacyWarned = true;
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
if (effectiveExpected && location.type !== effectiveExpected) {
|
|
2868
2902
|
throw new Error(`Expected location type ${expectedLocation} but got ${location.type}`);
|
|
2869
2903
|
}
|
|
2870
2904
|
const backdoorLocation = (0, import_react27.useRef)(location);
|
|
@@ -3341,7 +3375,7 @@ function DataResourceVariablesList({
|
|
|
3341
3375
|
const {
|
|
3342
3376
|
value,
|
|
3343
3377
|
metadata: { dataType }
|
|
3344
|
-
} = useMeshLocation("
|
|
3378
|
+
} = useMeshLocation("dataTypeInstance");
|
|
3345
3379
|
const variableDefinitions = variablesToList(dataType.variables);
|
|
3346
3380
|
if (variableDefinitions.length === 0) {
|
|
3347
3381
|
if (NoVariablesComponent) {
|
|
@@ -4069,6 +4103,12 @@ var MeshApp = ({
|
|
|
4069
4103
|
] });
|
|
4070
4104
|
};
|
|
4071
4105
|
|
|
4106
|
+
// src/hooks/useUniformMeshLocation.ts
|
|
4107
|
+
function useUniformMeshLocation() {
|
|
4108
|
+
const { location } = useUniformMeshLocationContext();
|
|
4109
|
+
return location;
|
|
4110
|
+
}
|
|
4111
|
+
|
|
4072
4112
|
// src/hooks/index.ts
|
|
4073
4113
|
var import_design_system24 = require("@uniformdev/design-system");
|
|
4074
4114
|
|
|
@@ -4103,6 +4143,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
4103
4143
|
InputSelect,
|
|
4104
4144
|
InputToggle,
|
|
4105
4145
|
InputVariables,
|
|
4146
|
+
KeywordSearchInput,
|
|
4106
4147
|
Label,
|
|
4107
4148
|
LoadingIndicator,
|
|
4108
4149
|
LoadingOverlay,
|
|
@@ -4147,6 +4188,10 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
4147
4188
|
TextVariableRenderer,
|
|
4148
4189
|
Textarea,
|
|
4149
4190
|
Theme,
|
|
4191
|
+
UniformMeshLocationContext,
|
|
4192
|
+
UniformMeshLocationContextProvider,
|
|
4193
|
+
UniformMeshSdkContext,
|
|
4194
|
+
UniformMeshSdkContextProvider,
|
|
4150
4195
|
VariableEditor,
|
|
4151
4196
|
VariablesList,
|
|
4152
4197
|
VariablesProvider,
|
|
@@ -4215,6 +4260,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
4215
4260
|
selectedItemTitle,
|
|
4216
4261
|
urlEncodeRequestParameter,
|
|
4217
4262
|
urlEncodeRequestUrl,
|
|
4263
|
+
useInitializeUniformMeshSdk,
|
|
4218
4264
|
useMeshLocation,
|
|
4219
4265
|
useParameterShell,
|
|
4220
4266
|
useProductQueryContext,
|
|
@@ -4222,7 +4268,10 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
4222
4268
|
useRequest,
|
|
4223
4269
|
useRequestHeader,
|
|
4224
4270
|
useRequestParameter,
|
|
4271
|
+
useUniformMeshLocation,
|
|
4272
|
+
useUniformMeshLocationContext,
|
|
4225
4273
|
useUniformMeshSdk,
|
|
4274
|
+
useUniformMeshSdkContext,
|
|
4226
4275
|
useVariables,
|
|
4227
4276
|
variablesToList
|
|
4228
4277
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -2655,6 +2655,18 @@ import { Theme } from "@uniformdev/design-system";
|
|
|
2655
2655
|
import { createContext, useContext as useContext3 } from "react";
|
|
2656
2656
|
import { jsx as jsx26, jsxs as jsxs15 } from "@emotion/react/jsx-runtime";
|
|
2657
2657
|
var UniformMeshSdkContext = createContext(void 0);
|
|
2658
|
+
var UniformMeshSdkContextProvider = ({ children }) => {
|
|
2659
|
+
let value = void 0;
|
|
2660
|
+
if (typeof window !== "undefined" && typeof window.UniformMeshSDK !== "undefined") {
|
|
2661
|
+
value = {
|
|
2662
|
+
sdk: window.UniformMeshSDK
|
|
2663
|
+
};
|
|
2664
|
+
}
|
|
2665
|
+
return /* @__PURE__ */ jsxs15(UniformMeshSdkContext.Provider, { value, children: [
|
|
2666
|
+
/* @__PURE__ */ jsx26(Theme, {}),
|
|
2667
|
+
/* @__PURE__ */ jsx26(UniformMeshLocationContextProvider, { children })
|
|
2668
|
+
] });
|
|
2669
|
+
};
|
|
2658
2670
|
var useUniformMeshSdkContext = () => {
|
|
2659
2671
|
const context = useContext3(UniformMeshSdkContext);
|
|
2660
2672
|
if (!context) {
|
|
@@ -2671,7 +2683,9 @@ function useUniformMeshSdk() {
|
|
|
2671
2683
|
|
|
2672
2684
|
// src/components/UniformMeshLocationContext.tsx
|
|
2673
2685
|
import { jsx as jsx27 } from "@emotion/react/jsx-runtime";
|
|
2674
|
-
var UniformMeshLocationContext = createContext2(
|
|
2686
|
+
var UniformMeshLocationContext = createContext2(
|
|
2687
|
+
void 0
|
|
2688
|
+
);
|
|
2675
2689
|
var UniformMeshLocationContextProvider = ({
|
|
2676
2690
|
children
|
|
2677
2691
|
}) => {
|
|
@@ -2702,9 +2716,20 @@ var useUniformMeshLocationContext = () => {
|
|
|
2702
2716
|
};
|
|
2703
2717
|
|
|
2704
2718
|
// src/hooks/useMeshLocation.ts
|
|
2719
|
+
var legacyWarned = false;
|
|
2705
2720
|
function useMeshLocation(expectedLocation) {
|
|
2706
2721
|
const { location } = useUniformMeshLocationContext();
|
|
2707
|
-
|
|
2722
|
+
let effectiveExpected = expectedLocation;
|
|
2723
|
+
if (expectedLocation === "dataTypeInstance") {
|
|
2724
|
+
effectiveExpected = "dataResource";
|
|
2725
|
+
if (!legacyWarned) {
|
|
2726
|
+
console.warn(
|
|
2727
|
+
"`dataTypeInstance` mesh location is deprecated, please switch to `dataResource` instead."
|
|
2728
|
+
);
|
|
2729
|
+
legacyWarned = true;
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
if (effectiveExpected && location.type !== effectiveExpected) {
|
|
2708
2733
|
throw new Error(`Expected location type ${expectedLocation} but got ${location.type}`);
|
|
2709
2734
|
}
|
|
2710
2735
|
const backdoorLocation = useRef7(location);
|
|
@@ -3191,7 +3216,7 @@ function DataResourceVariablesList({
|
|
|
3191
3216
|
const {
|
|
3192
3217
|
value,
|
|
3193
3218
|
metadata: { dataType }
|
|
3194
|
-
} = useMeshLocation("
|
|
3219
|
+
} = useMeshLocation("dataTypeInstance");
|
|
3195
3220
|
const variableDefinitions = variablesToList(dataType.variables);
|
|
3196
3221
|
if (variableDefinitions.length === 0) {
|
|
3197
3222
|
if (NoVariablesComponent) {
|
|
@@ -3937,6 +3962,12 @@ var MeshApp = ({
|
|
|
3937
3962
|
] });
|
|
3938
3963
|
};
|
|
3939
3964
|
|
|
3965
|
+
// src/hooks/useUniformMeshLocation.ts
|
|
3966
|
+
function useUniformMeshLocation() {
|
|
3967
|
+
const { location } = useUniformMeshLocationContext();
|
|
3968
|
+
return location;
|
|
3969
|
+
}
|
|
3970
|
+
|
|
3940
3971
|
// src/hooks/index.ts
|
|
3941
3972
|
import { ParameterShellContext, useParameterShell } from "@uniformdev/design-system";
|
|
3942
3973
|
|
|
@@ -3959,6 +3990,7 @@ import {
|
|
|
3959
3990
|
InputKeywordSearch as InputKeywordSearch2,
|
|
3960
3991
|
InputSelect as InputSelect6,
|
|
3961
3992
|
InputToggle,
|
|
3993
|
+
InputKeywordSearch as InputKeywordSearch3,
|
|
3962
3994
|
Label,
|
|
3963
3995
|
LoadingIndicator as LoadingIndicator3,
|
|
3964
3996
|
LoadingOverlay as LoadingOverlay2,
|
|
@@ -4004,6 +4036,7 @@ export {
|
|
|
4004
4036
|
InputSelect6 as InputSelect,
|
|
4005
4037
|
InputToggle,
|
|
4006
4038
|
InputVariables,
|
|
4039
|
+
InputKeywordSearch3 as KeywordSearchInput,
|
|
4007
4040
|
Label,
|
|
4008
4041
|
LoadingIndicator3 as LoadingIndicator,
|
|
4009
4042
|
LoadingOverlay2 as LoadingOverlay,
|
|
@@ -4048,6 +4081,10 @@ export {
|
|
|
4048
4081
|
TextVariableRenderer,
|
|
4049
4082
|
Textarea,
|
|
4050
4083
|
Theme3 as Theme,
|
|
4084
|
+
UniformMeshLocationContext,
|
|
4085
|
+
UniformMeshLocationContextProvider,
|
|
4086
|
+
UniformMeshSdkContext,
|
|
4087
|
+
UniformMeshSdkContextProvider,
|
|
4051
4088
|
VariableEditor,
|
|
4052
4089
|
VariablesList,
|
|
4053
4090
|
VariablesProvider,
|
|
@@ -4116,6 +4153,7 @@ export {
|
|
|
4116
4153
|
selectedItemTitle,
|
|
4117
4154
|
urlEncodeRequestParameter,
|
|
4118
4155
|
urlEncodeRequestUrl,
|
|
4156
|
+
useInitializeUniformMeshSdk,
|
|
4119
4157
|
useMeshLocation,
|
|
4120
4158
|
useParameterShell,
|
|
4121
4159
|
useProductQueryContext,
|
|
@@ -4123,7 +4161,10 @@ export {
|
|
|
4123
4161
|
useRequest,
|
|
4124
4162
|
useRequestHeader,
|
|
4125
4163
|
useRequestParameter,
|
|
4164
|
+
useUniformMeshLocation,
|
|
4165
|
+
useUniformMeshLocationContext,
|
|
4126
4166
|
useUniformMeshSdk,
|
|
4167
|
+
useUniformMeshSdkContext,
|
|
4127
4168
|
useVariables,
|
|
4128
4169
|
variablesToList
|
|
4129
4170
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/mesh-sdk-react",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.34.0",
|
|
4
4
|
"description": "Uniform Mesh Framework SDK for React",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"document": "api-extractor run --local"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@uniformdev/design-system": "18.
|
|
47
|
-
"@uniformdev/mesh-sdk": "18.
|
|
46
|
+
"@uniformdev/design-system": "18.34.0",
|
|
47
|
+
"@uniformdev/mesh-sdk": "18.34.0",
|
|
48
48
|
"formik": "^2.2.9",
|
|
49
49
|
"react-beautiful-dnd": "13.1.1",
|
|
50
50
|
"react-icons": "4.8.0",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "563ab31aa4308102c988bea321028e73efe836d0"
|
|
77
77
|
}
|