@uniformdev/mesh-sdk-react 18.33.0 → 18.33.1-alpha.7
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 +3 -59
- package/dist/index.esm.js +3 -44
- package/dist/index.js +3 -52
- package/dist/index.mjs +3 -44
- 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
|
|
8
|
+
import { MeshLocation, SetValueOptions, DataSourceLocationValue, DataTypeLocationValue } 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,
|
|
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';
|
|
12
12
|
|
|
13
13
|
declare const SvgCaution: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
14
14
|
|
|
@@ -389,8 +389,6 @@ 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;
|
|
394
392
|
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
395
393
|
type: TLocationType;
|
|
396
394
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
@@ -404,8 +402,6 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
404
402
|
type: TLocationType;
|
|
405
403
|
}> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
|
|
406
404
|
type: TLocationType;
|
|
407
|
-
}> | Extract<_uniformdev_mesh_sdk.DataTypeInstanceLocation, {
|
|
408
|
-
type: TLocationType;
|
|
409
405
|
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
410
406
|
type: TLocationType;
|
|
411
407
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
@@ -418,8 +414,6 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
418
414
|
type: TLocationType;
|
|
419
415
|
}> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
|
|
420
416
|
type: TLocationType;
|
|
421
|
-
}> | Extract<_uniformdev_mesh_sdk.DataTypeInstanceLocation, {
|
|
422
|
-
type: TLocationType;
|
|
423
417
|
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
424
418
|
type: TLocationType;
|
|
425
419
|
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
@@ -682,56 +676,6 @@ declare function useRequestParameter(paramName: string): {
|
|
|
682
676
|
update: (value: string) => void;
|
|
683
677
|
};
|
|
684
678
|
|
|
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
|
-
|
|
735
679
|
/**
|
|
736
680
|
* Provides convenient access to the current Uniform Mesh SDK instance via React hook.
|
|
737
681
|
* Intended to be used within <MeshApp />.
|
|
@@ -747,4 +691,4 @@ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
|
|
|
747
691
|
*/
|
|
748
692
|
declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
|
|
749
693
|
|
|
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,
|
|
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 };
|
package/dist/index.esm.js
CHANGED
|
@@ -2655,18 +2655,6 @@ 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
|
-
};
|
|
2670
2658
|
var useUniformMeshSdkContext = () => {
|
|
2671
2659
|
const context = useContext3(UniformMeshSdkContext);
|
|
2672
2660
|
if (!context) {
|
|
@@ -2683,9 +2671,7 @@ function useUniformMeshSdk() {
|
|
|
2683
2671
|
|
|
2684
2672
|
// src/components/UniformMeshLocationContext.tsx
|
|
2685
2673
|
import { jsx as jsx27 } from "@emotion/react/jsx-runtime";
|
|
2686
|
-
var UniformMeshLocationContext = createContext2(
|
|
2687
|
-
void 0
|
|
2688
|
-
);
|
|
2674
|
+
var UniformMeshLocationContext = createContext2(void 0);
|
|
2689
2675
|
var UniformMeshLocationContextProvider = ({
|
|
2690
2676
|
children
|
|
2691
2677
|
}) => {
|
|
@@ -2716,20 +2702,9 @@ var useUniformMeshLocationContext = () => {
|
|
|
2716
2702
|
};
|
|
2717
2703
|
|
|
2718
2704
|
// src/hooks/useMeshLocation.ts
|
|
2719
|
-
var legacyWarned = false;
|
|
2720
2705
|
function useMeshLocation(expectedLocation) {
|
|
2721
2706
|
const { location } = useUniformMeshLocationContext();
|
|
2722
|
-
|
|
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) {
|
|
2707
|
+
if (expectedLocation && location.type !== expectedLocation) {
|
|
2733
2708
|
throw new Error(`Expected location type ${expectedLocation} but got ${location.type}`);
|
|
2734
2709
|
}
|
|
2735
2710
|
const backdoorLocation = useRef7(location);
|
|
@@ -3216,7 +3191,7 @@ function DataResourceVariablesList({
|
|
|
3216
3191
|
const {
|
|
3217
3192
|
value,
|
|
3218
3193
|
metadata: { dataType }
|
|
3219
|
-
} = useMeshLocation("
|
|
3194
|
+
} = useMeshLocation("dataResource");
|
|
3220
3195
|
const variableDefinitions = variablesToList(dataType.variables);
|
|
3221
3196
|
if (variableDefinitions.length === 0) {
|
|
3222
3197
|
if (NoVariablesComponent) {
|
|
@@ -3962,12 +3937,6 @@ var MeshApp = ({
|
|
|
3962
3937
|
] });
|
|
3963
3938
|
};
|
|
3964
3939
|
|
|
3965
|
-
// src/hooks/useUniformMeshLocation.ts
|
|
3966
|
-
function useUniformMeshLocation() {
|
|
3967
|
-
const { location } = useUniformMeshLocationContext();
|
|
3968
|
-
return location;
|
|
3969
|
-
}
|
|
3970
|
-
|
|
3971
3940
|
// src/hooks/index.ts
|
|
3972
3941
|
import { ParameterShellContext, useParameterShell } from "@uniformdev/design-system";
|
|
3973
3942
|
|
|
@@ -3990,7 +3959,6 @@ import {
|
|
|
3990
3959
|
InputKeywordSearch as InputKeywordSearch2,
|
|
3991
3960
|
InputSelect as InputSelect6,
|
|
3992
3961
|
InputToggle,
|
|
3993
|
-
InputKeywordSearch as InputKeywordSearch3,
|
|
3994
3962
|
Label,
|
|
3995
3963
|
LoadingIndicator as LoadingIndicator3,
|
|
3996
3964
|
LoadingOverlay as LoadingOverlay2,
|
|
@@ -4036,7 +4004,6 @@ export {
|
|
|
4036
4004
|
InputSelect6 as InputSelect,
|
|
4037
4005
|
InputToggle,
|
|
4038
4006
|
InputVariables,
|
|
4039
|
-
InputKeywordSearch3 as KeywordSearchInput,
|
|
4040
4007
|
Label,
|
|
4041
4008
|
LoadingIndicator3 as LoadingIndicator,
|
|
4042
4009
|
LoadingOverlay2 as LoadingOverlay,
|
|
@@ -4081,10 +4048,6 @@ export {
|
|
|
4081
4048
|
TextVariableRenderer,
|
|
4082
4049
|
Textarea,
|
|
4083
4050
|
Theme3 as Theme,
|
|
4084
|
-
UniformMeshLocationContext,
|
|
4085
|
-
UniformMeshLocationContextProvider,
|
|
4086
|
-
UniformMeshSdkContext,
|
|
4087
|
-
UniformMeshSdkContextProvider,
|
|
4088
4051
|
VariableEditor,
|
|
4089
4052
|
VariablesList,
|
|
4090
4053
|
VariablesProvider,
|
|
@@ -4153,7 +4116,6 @@ export {
|
|
|
4153
4116
|
selectedItemTitle,
|
|
4154
4117
|
urlEncodeRequestParameter,
|
|
4155
4118
|
urlEncodeRequestUrl,
|
|
4156
|
-
useInitializeUniformMeshSdk,
|
|
4157
4119
|
useMeshLocation,
|
|
4158
4120
|
useParameterShell,
|
|
4159
4121
|
useProductQueryContext,
|
|
@@ -4161,10 +4123,7 @@ export {
|
|
|
4161
4123
|
useRequest,
|
|
4162
4124
|
useRequestHeader,
|
|
4163
4125
|
useRequestParameter,
|
|
4164
|
-
useUniformMeshLocation,
|
|
4165
|
-
useUniformMeshLocationContext,
|
|
4166
4126
|
useUniformMeshSdk,
|
|
4167
|
-
useUniformMeshSdkContext,
|
|
4168
4127
|
useVariables,
|
|
4169
4128
|
variablesToList
|
|
4170
4129
|
};
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,6 @@ __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,
|
|
53
52
|
Label: () => import_design_system25.Label,
|
|
54
53
|
LoadingIndicator: () => import_design_system25.LoadingIndicator,
|
|
55
54
|
LoadingOverlay: () => import_design_system25.LoadingOverlay,
|
|
@@ -94,10 +93,6 @@ __export(src_exports, {
|
|
|
94
93
|
TextVariableRenderer: () => TextVariableRenderer,
|
|
95
94
|
Textarea: () => import_design_system25.Textarea,
|
|
96
95
|
Theme: () => import_design_system25.Theme,
|
|
97
|
-
UniformMeshLocationContext: () => UniformMeshLocationContext,
|
|
98
|
-
UniformMeshLocationContextProvider: () => UniformMeshLocationContextProvider,
|
|
99
|
-
UniformMeshSdkContext: () => UniformMeshSdkContext,
|
|
100
|
-
UniformMeshSdkContextProvider: () => UniformMeshSdkContextProvider,
|
|
101
96
|
VariableEditor: () => VariableEditor,
|
|
102
97
|
VariablesList: () => VariablesList,
|
|
103
98
|
VariablesProvider: () => VariablesProvider,
|
|
@@ -166,7 +161,6 @@ __export(src_exports, {
|
|
|
166
161
|
selectedItemTitle: () => selectedItemTitle,
|
|
167
162
|
urlEncodeRequestParameter: () => urlEncodeRequestParameter,
|
|
168
163
|
urlEncodeRequestUrl: () => urlEncodeRequestUrl,
|
|
169
|
-
useInitializeUniformMeshSdk: () => useInitializeUniformMeshSdk,
|
|
170
164
|
useMeshLocation: () => useMeshLocation,
|
|
171
165
|
useParameterShell: () => import_design_system24.useParameterShell,
|
|
172
166
|
useProductQueryContext: () => useProductQueryContext,
|
|
@@ -174,10 +168,7 @@ __export(src_exports, {
|
|
|
174
168
|
useRequest: () => useRequest,
|
|
175
169
|
useRequestHeader: () => useRequestHeader,
|
|
176
170
|
useRequestParameter: () => useRequestParameter,
|
|
177
|
-
useUniformMeshLocation: () => useUniformMeshLocation,
|
|
178
|
-
useUniformMeshLocationContext: () => useUniformMeshLocationContext,
|
|
179
171
|
useUniformMeshSdk: () => useUniformMeshSdk,
|
|
180
|
-
useUniformMeshSdkContext: () => useUniformMeshSdkContext,
|
|
181
172
|
useVariables: () => useVariables,
|
|
182
173
|
variablesToList: () => variablesToList
|
|
183
174
|
});
|
|
@@ -2824,18 +2815,6 @@ var import_design_system13 = require("@uniformdev/design-system");
|
|
|
2824
2815
|
var import_react25 = require("react");
|
|
2825
2816
|
var import_jsx_runtime26 = require("@emotion/react/jsx-runtime");
|
|
2826
2817
|
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
|
-
};
|
|
2839
2818
|
var useUniformMeshSdkContext = () => {
|
|
2840
2819
|
const context = (0, import_react25.useContext)(UniformMeshSdkContext);
|
|
2841
2820
|
if (!context) {
|
|
@@ -2852,9 +2831,7 @@ function useUniformMeshSdk() {
|
|
|
2852
2831
|
|
|
2853
2832
|
// src/components/UniformMeshLocationContext.tsx
|
|
2854
2833
|
var import_jsx_runtime27 = require("@emotion/react/jsx-runtime");
|
|
2855
|
-
var UniformMeshLocationContext = (0, import_react26.createContext)(
|
|
2856
|
-
void 0
|
|
2857
|
-
);
|
|
2834
|
+
var UniformMeshLocationContext = (0, import_react26.createContext)(void 0);
|
|
2858
2835
|
var UniformMeshLocationContextProvider = ({
|
|
2859
2836
|
children
|
|
2860
2837
|
}) => {
|
|
@@ -2885,20 +2862,9 @@ var useUniformMeshLocationContext = () => {
|
|
|
2885
2862
|
};
|
|
2886
2863
|
|
|
2887
2864
|
// src/hooks/useMeshLocation.ts
|
|
2888
|
-
var legacyWarned = false;
|
|
2889
2865
|
function useMeshLocation(expectedLocation) {
|
|
2890
2866
|
const { location } = useUniformMeshLocationContext();
|
|
2891
|
-
|
|
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) {
|
|
2867
|
+
if (expectedLocation && location.type !== expectedLocation) {
|
|
2902
2868
|
throw new Error(`Expected location type ${expectedLocation} but got ${location.type}`);
|
|
2903
2869
|
}
|
|
2904
2870
|
const backdoorLocation = (0, import_react27.useRef)(location);
|
|
@@ -3375,7 +3341,7 @@ function DataResourceVariablesList({
|
|
|
3375
3341
|
const {
|
|
3376
3342
|
value,
|
|
3377
3343
|
metadata: { dataType }
|
|
3378
|
-
} = useMeshLocation("
|
|
3344
|
+
} = useMeshLocation("dataResource");
|
|
3379
3345
|
const variableDefinitions = variablesToList(dataType.variables);
|
|
3380
3346
|
if (variableDefinitions.length === 0) {
|
|
3381
3347
|
if (NoVariablesComponent) {
|
|
@@ -4103,12 +4069,6 @@ var MeshApp = ({
|
|
|
4103
4069
|
] });
|
|
4104
4070
|
};
|
|
4105
4071
|
|
|
4106
|
-
// src/hooks/useUniformMeshLocation.ts
|
|
4107
|
-
function useUniformMeshLocation() {
|
|
4108
|
-
const { location } = useUniformMeshLocationContext();
|
|
4109
|
-
return location;
|
|
4110
|
-
}
|
|
4111
|
-
|
|
4112
4072
|
// src/hooks/index.ts
|
|
4113
4073
|
var import_design_system24 = require("@uniformdev/design-system");
|
|
4114
4074
|
|
|
@@ -4143,7 +4103,6 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
4143
4103
|
InputSelect,
|
|
4144
4104
|
InputToggle,
|
|
4145
4105
|
InputVariables,
|
|
4146
|
-
KeywordSearchInput,
|
|
4147
4106
|
Label,
|
|
4148
4107
|
LoadingIndicator,
|
|
4149
4108
|
LoadingOverlay,
|
|
@@ -4188,10 +4147,6 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
4188
4147
|
TextVariableRenderer,
|
|
4189
4148
|
Textarea,
|
|
4190
4149
|
Theme,
|
|
4191
|
-
UniformMeshLocationContext,
|
|
4192
|
-
UniformMeshLocationContextProvider,
|
|
4193
|
-
UniformMeshSdkContext,
|
|
4194
|
-
UniformMeshSdkContextProvider,
|
|
4195
4150
|
VariableEditor,
|
|
4196
4151
|
VariablesList,
|
|
4197
4152
|
VariablesProvider,
|
|
@@ -4260,7 +4215,6 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
4260
4215
|
selectedItemTitle,
|
|
4261
4216
|
urlEncodeRequestParameter,
|
|
4262
4217
|
urlEncodeRequestUrl,
|
|
4263
|
-
useInitializeUniformMeshSdk,
|
|
4264
4218
|
useMeshLocation,
|
|
4265
4219
|
useParameterShell,
|
|
4266
4220
|
useProductQueryContext,
|
|
@@ -4268,10 +4222,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
4268
4222
|
useRequest,
|
|
4269
4223
|
useRequestHeader,
|
|
4270
4224
|
useRequestParameter,
|
|
4271
|
-
useUniformMeshLocation,
|
|
4272
|
-
useUniformMeshLocationContext,
|
|
4273
4225
|
useUniformMeshSdk,
|
|
4274
|
-
useUniformMeshSdkContext,
|
|
4275
4226
|
useVariables,
|
|
4276
4227
|
variablesToList
|
|
4277
4228
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -2655,18 +2655,6 @@ 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
|
-
};
|
|
2670
2658
|
var useUniformMeshSdkContext = () => {
|
|
2671
2659
|
const context = useContext3(UniformMeshSdkContext);
|
|
2672
2660
|
if (!context) {
|
|
@@ -2683,9 +2671,7 @@ function useUniformMeshSdk() {
|
|
|
2683
2671
|
|
|
2684
2672
|
// src/components/UniformMeshLocationContext.tsx
|
|
2685
2673
|
import { jsx as jsx27 } from "@emotion/react/jsx-runtime";
|
|
2686
|
-
var UniformMeshLocationContext = createContext2(
|
|
2687
|
-
void 0
|
|
2688
|
-
);
|
|
2674
|
+
var UniformMeshLocationContext = createContext2(void 0);
|
|
2689
2675
|
var UniformMeshLocationContextProvider = ({
|
|
2690
2676
|
children
|
|
2691
2677
|
}) => {
|
|
@@ -2716,20 +2702,9 @@ var useUniformMeshLocationContext = () => {
|
|
|
2716
2702
|
};
|
|
2717
2703
|
|
|
2718
2704
|
// src/hooks/useMeshLocation.ts
|
|
2719
|
-
var legacyWarned = false;
|
|
2720
2705
|
function useMeshLocation(expectedLocation) {
|
|
2721
2706
|
const { location } = useUniformMeshLocationContext();
|
|
2722
|
-
|
|
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) {
|
|
2707
|
+
if (expectedLocation && location.type !== expectedLocation) {
|
|
2733
2708
|
throw new Error(`Expected location type ${expectedLocation} but got ${location.type}`);
|
|
2734
2709
|
}
|
|
2735
2710
|
const backdoorLocation = useRef7(location);
|
|
@@ -3216,7 +3191,7 @@ function DataResourceVariablesList({
|
|
|
3216
3191
|
const {
|
|
3217
3192
|
value,
|
|
3218
3193
|
metadata: { dataType }
|
|
3219
|
-
} = useMeshLocation("
|
|
3194
|
+
} = useMeshLocation("dataResource");
|
|
3220
3195
|
const variableDefinitions = variablesToList(dataType.variables);
|
|
3221
3196
|
if (variableDefinitions.length === 0) {
|
|
3222
3197
|
if (NoVariablesComponent) {
|
|
@@ -3962,12 +3937,6 @@ var MeshApp = ({
|
|
|
3962
3937
|
] });
|
|
3963
3938
|
};
|
|
3964
3939
|
|
|
3965
|
-
// src/hooks/useUniformMeshLocation.ts
|
|
3966
|
-
function useUniformMeshLocation() {
|
|
3967
|
-
const { location } = useUniformMeshLocationContext();
|
|
3968
|
-
return location;
|
|
3969
|
-
}
|
|
3970
|
-
|
|
3971
3940
|
// src/hooks/index.ts
|
|
3972
3941
|
import { ParameterShellContext, useParameterShell } from "@uniformdev/design-system";
|
|
3973
3942
|
|
|
@@ -3990,7 +3959,6 @@ import {
|
|
|
3990
3959
|
InputKeywordSearch as InputKeywordSearch2,
|
|
3991
3960
|
InputSelect as InputSelect6,
|
|
3992
3961
|
InputToggle,
|
|
3993
|
-
InputKeywordSearch as InputKeywordSearch3,
|
|
3994
3962
|
Label,
|
|
3995
3963
|
LoadingIndicator as LoadingIndicator3,
|
|
3996
3964
|
LoadingOverlay as LoadingOverlay2,
|
|
@@ -4036,7 +4004,6 @@ export {
|
|
|
4036
4004
|
InputSelect6 as InputSelect,
|
|
4037
4005
|
InputToggle,
|
|
4038
4006
|
InputVariables,
|
|
4039
|
-
InputKeywordSearch3 as KeywordSearchInput,
|
|
4040
4007
|
Label,
|
|
4041
4008
|
LoadingIndicator3 as LoadingIndicator,
|
|
4042
4009
|
LoadingOverlay2 as LoadingOverlay,
|
|
@@ -4081,10 +4048,6 @@ export {
|
|
|
4081
4048
|
TextVariableRenderer,
|
|
4082
4049
|
Textarea,
|
|
4083
4050
|
Theme3 as Theme,
|
|
4084
|
-
UniformMeshLocationContext,
|
|
4085
|
-
UniformMeshLocationContextProvider,
|
|
4086
|
-
UniformMeshSdkContext,
|
|
4087
|
-
UniformMeshSdkContextProvider,
|
|
4088
4051
|
VariableEditor,
|
|
4089
4052
|
VariablesList,
|
|
4090
4053
|
VariablesProvider,
|
|
@@ -4153,7 +4116,6 @@ export {
|
|
|
4153
4116
|
selectedItemTitle,
|
|
4154
4117
|
urlEncodeRequestParameter,
|
|
4155
4118
|
urlEncodeRequestUrl,
|
|
4156
|
-
useInitializeUniformMeshSdk,
|
|
4157
4119
|
useMeshLocation,
|
|
4158
4120
|
useParameterShell,
|
|
4159
4121
|
useProductQueryContext,
|
|
@@ -4161,10 +4123,7 @@ export {
|
|
|
4161
4123
|
useRequest,
|
|
4162
4124
|
useRequestHeader,
|
|
4163
4125
|
useRequestParameter,
|
|
4164
|
-
useUniformMeshLocation,
|
|
4165
|
-
useUniformMeshLocationContext,
|
|
4166
4126
|
useUniformMeshSdk,
|
|
4167
|
-
useUniformMeshSdkContext,
|
|
4168
4127
|
useVariables,
|
|
4169
4128
|
variablesToList
|
|
4170
4129
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/mesh-sdk-react",
|
|
3
|
-
"version": "18.33.
|
|
3
|
+
"version": "18.33.1-alpha.7+7127237a1",
|
|
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.33.
|
|
47
|
-
"@uniformdev/mesh-sdk": "18.33.
|
|
46
|
+
"@uniformdev/design-system": "18.33.1-alpha.7+7127237a1",
|
|
47
|
+
"@uniformdev/mesh-sdk": "18.33.1-alpha.7+7127237a1",
|
|
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": "7127237a1e099d2a11fa8c06d49cb01cf16c0852"
|
|
77
77
|
}
|