@uniformdev/mesh-sdk-react 19.99.1-alpha.0 → 19.103.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.mts +34 -6
- package/dist/index.d.ts +34 -6
- package/dist/index.esm.js +23 -0
- package/dist/index.js +24 -0
- package/dist/index.mjs +23 -0
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import { TDate } from 'timeago.js';
|
|
|
5
5
|
import * as _emotion_react from '@emotion/react';
|
|
6
6
|
import { Interpolation, Theme, SerializedStyles } from '@emotion/react';
|
|
7
7
|
import * as _uniformdev_mesh_sdk from '@uniformdev/mesh-sdk';
|
|
8
|
-
import {
|
|
8
|
+
import { DynamicInputs, MeshLocation, SetValueOptions, EditConnectedDataResponseCancellationContext, DataSourceLocationValue, DataTypeLocationValue, BindableTypes } from '@uniformdev/mesh-sdk';
|
|
9
9
|
export * from '@uniformdev/mesh-sdk';
|
|
10
10
|
import { DataVariableDefinition, DataResourceVariables, DataType } from '@uniformdev/canvas';
|
|
11
11
|
import { Emitter } from 'mitt';
|
|
@@ -385,11 +385,9 @@ declare const damSelectedItemMediaContainer: _emotion_react.SerializedStyles;
|
|
|
385
385
|
declare const damSelectedItemInfoBtn: _emotion_react.SerializedStyles;
|
|
386
386
|
declare const damSelectItemImage: _emotion_react.SerializedStyles;
|
|
387
387
|
|
|
388
|
-
type MinimalDynamicInput = Omit<DynamicInput, 'source'>;
|
|
389
|
-
type MinimalDynamicInputs = Record<string, MinimalDynamicInput>;
|
|
390
388
|
type DataResourceDynamicInputProviderProps = {
|
|
391
389
|
/** Explicitly provide dynamic input values. If not set, Mesh location will be used */
|
|
392
|
-
dynamicInputs?:
|
|
390
|
+
dynamicInputs?: DynamicInputs;
|
|
393
391
|
/** Child components of the provider. Variables-using components, such as InputVariables, can be used here. */
|
|
394
392
|
children: ReactNode;
|
|
395
393
|
};
|
|
@@ -1662,7 +1660,7 @@ declare function useRequestParameter(paramName: string): {
|
|
|
1662
1660
|
declare function useConnectedDataAsVariables(connectedData: Record<string, unknown> | undefined): Record<string, MeshDataVariableDefinition>;
|
|
1663
1661
|
|
|
1664
1662
|
/** Converts dynamic inputs into VariablesProvider-format variables */
|
|
1665
|
-
declare function useDynamicInputsAsVariables(dynamicInputs:
|
|
1663
|
+
declare function useDynamicInputsAsVariables(dynamicInputs: DynamicInputs): Record<string, MeshDataVariableDefinition>;
|
|
1666
1664
|
|
|
1667
1665
|
/**
|
|
1668
1666
|
* Provides convenient access to the current Uniform Mesh SDK instance via React hook.
|
|
@@ -1679,4 +1677,34 @@ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
|
|
|
1679
1677
|
*/
|
|
1680
1678
|
declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
|
|
1681
1679
|
|
|
1682
|
-
|
|
1680
|
+
type ContentDataResourceLocaleInfoResult = {
|
|
1681
|
+
/**
|
|
1682
|
+
* Effective locale for data resource. It can be one of two types:
|
|
1683
|
+
* - raw locale string - locale stored in mesh data type/resource (e.g. 'en-US')
|
|
1684
|
+
* - variable reference - locale stored in mesh data type/resource as a variable reference (e.g. '${locale}')
|
|
1685
|
+
*/
|
|
1686
|
+
effectiveLocale: string;
|
|
1687
|
+
/** Bound locale value. It can be one of two types:
|
|
1688
|
+
* - raw locale string - locale stored in mesh data type/resource (e.g. 'en-US')
|
|
1689
|
+
* - empty string - if locale was not set
|
|
1690
|
+
*/
|
|
1691
|
+
boundLocale: string | undefined;
|
|
1692
|
+
};
|
|
1693
|
+
type ContentDataResourceLocaleInfoProps = {
|
|
1694
|
+
/** Current stored locale in mesh data type/resource.
|
|
1695
|
+
* It can be one of tree types:
|
|
1696
|
+
* - undefined - no locale stored in mesh data type/resource yet or it is not localized
|
|
1697
|
+
* - raw locale string - locale stored in mesh data type/resource (e.g. 'en-US')
|
|
1698
|
+
* - variable reference - locale stored in mesh data type/resource as a variable reference (e.g. '${locale}')
|
|
1699
|
+
*
|
|
1700
|
+
* If locale is empty, fallback to dynamic locale value if it is available.
|
|
1701
|
+
*/
|
|
1702
|
+
locale: string | undefined;
|
|
1703
|
+
/** Map of dynamic inputs for current composition. Should be passed down from DataResource metadata */
|
|
1704
|
+
dynamicInputs: DynamicInputs;
|
|
1705
|
+
/** In case of empty locale value, this method is called to bind dynamic locale (sets locale to '${locale}') */
|
|
1706
|
+
setLocale?: (locale: string) => void;
|
|
1707
|
+
};
|
|
1708
|
+
declare function useContentDataResourceLocaleInfo({ locale, setLocale, dynamicInputs, }: ContentDataResourceLocaleInfoProps): ContentDataResourceLocaleInfoResult;
|
|
1709
|
+
|
|
1710
|
+
export { $createVariableNode, $isVariableNode, type BaseRequestData, type Brand, type ContentDataResourceLocaleInfoProps, type ContentDataResourceLocaleInfoResult, 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 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, useContentDataResourceLocaleInfo, useDynamicInputsAsVariables, useMeshLocation, useObjectSearchContext, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshSdk, useVariableEditor, useVariables, useVariablesMenu, variableDefaultTextValue, variablePrefix, variableSuffix, variablesToGroupedList, variablesToList };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { TDate } from 'timeago.js';
|
|
|
5
5
|
import * as _emotion_react from '@emotion/react';
|
|
6
6
|
import { Interpolation, Theme, SerializedStyles } from '@emotion/react';
|
|
7
7
|
import * as _uniformdev_mesh_sdk from '@uniformdev/mesh-sdk';
|
|
8
|
-
import {
|
|
8
|
+
import { DynamicInputs, MeshLocation, SetValueOptions, EditConnectedDataResponseCancellationContext, DataSourceLocationValue, DataTypeLocationValue, BindableTypes } from '@uniformdev/mesh-sdk';
|
|
9
9
|
export * from '@uniformdev/mesh-sdk';
|
|
10
10
|
import { DataVariableDefinition, DataResourceVariables, DataType } from '@uniformdev/canvas';
|
|
11
11
|
import { Emitter } from 'mitt';
|
|
@@ -385,11 +385,9 @@ declare const damSelectedItemMediaContainer: _emotion_react.SerializedStyles;
|
|
|
385
385
|
declare const damSelectedItemInfoBtn: _emotion_react.SerializedStyles;
|
|
386
386
|
declare const damSelectItemImage: _emotion_react.SerializedStyles;
|
|
387
387
|
|
|
388
|
-
type MinimalDynamicInput = Omit<DynamicInput, 'source'>;
|
|
389
|
-
type MinimalDynamicInputs = Record<string, MinimalDynamicInput>;
|
|
390
388
|
type DataResourceDynamicInputProviderProps = {
|
|
391
389
|
/** Explicitly provide dynamic input values. If not set, Mesh location will be used */
|
|
392
|
-
dynamicInputs?:
|
|
390
|
+
dynamicInputs?: DynamicInputs;
|
|
393
391
|
/** Child components of the provider. Variables-using components, such as InputVariables, can be used here. */
|
|
394
392
|
children: ReactNode;
|
|
395
393
|
};
|
|
@@ -1662,7 +1660,7 @@ declare function useRequestParameter(paramName: string): {
|
|
|
1662
1660
|
declare function useConnectedDataAsVariables(connectedData: Record<string, unknown> | undefined): Record<string, MeshDataVariableDefinition>;
|
|
1663
1661
|
|
|
1664
1662
|
/** Converts dynamic inputs into VariablesProvider-format variables */
|
|
1665
|
-
declare function useDynamicInputsAsVariables(dynamicInputs:
|
|
1663
|
+
declare function useDynamicInputsAsVariables(dynamicInputs: DynamicInputs): Record<string, MeshDataVariableDefinition>;
|
|
1666
1664
|
|
|
1667
1665
|
/**
|
|
1668
1666
|
* Provides convenient access to the current Uniform Mesh SDK instance via React hook.
|
|
@@ -1679,4 +1677,34 @@ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
|
|
|
1679
1677
|
*/
|
|
1680
1678
|
declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
|
|
1681
1679
|
|
|
1682
|
-
|
|
1680
|
+
type ContentDataResourceLocaleInfoResult = {
|
|
1681
|
+
/**
|
|
1682
|
+
* Effective locale for data resource. It can be one of two types:
|
|
1683
|
+
* - raw locale string - locale stored in mesh data type/resource (e.g. 'en-US')
|
|
1684
|
+
* - variable reference - locale stored in mesh data type/resource as a variable reference (e.g. '${locale}')
|
|
1685
|
+
*/
|
|
1686
|
+
effectiveLocale: string;
|
|
1687
|
+
/** Bound locale value. It can be one of two types:
|
|
1688
|
+
* - raw locale string - locale stored in mesh data type/resource (e.g. 'en-US')
|
|
1689
|
+
* - empty string - if locale was not set
|
|
1690
|
+
*/
|
|
1691
|
+
boundLocale: string | undefined;
|
|
1692
|
+
};
|
|
1693
|
+
type ContentDataResourceLocaleInfoProps = {
|
|
1694
|
+
/** Current stored locale in mesh data type/resource.
|
|
1695
|
+
* It can be one of tree types:
|
|
1696
|
+
* - undefined - no locale stored in mesh data type/resource yet or it is not localized
|
|
1697
|
+
* - raw locale string - locale stored in mesh data type/resource (e.g. 'en-US')
|
|
1698
|
+
* - variable reference - locale stored in mesh data type/resource as a variable reference (e.g. '${locale}')
|
|
1699
|
+
*
|
|
1700
|
+
* If locale is empty, fallback to dynamic locale value if it is available.
|
|
1701
|
+
*/
|
|
1702
|
+
locale: string | undefined;
|
|
1703
|
+
/** Map of dynamic inputs for current composition. Should be passed down from DataResource metadata */
|
|
1704
|
+
dynamicInputs: DynamicInputs;
|
|
1705
|
+
/** In case of empty locale value, this method is called to bind dynamic locale (sets locale to '${locale}') */
|
|
1706
|
+
setLocale?: (locale: string) => void;
|
|
1707
|
+
};
|
|
1708
|
+
declare function useContentDataResourceLocaleInfo({ locale, setLocale, dynamicInputs, }: ContentDataResourceLocaleInfoProps): ContentDataResourceLocaleInfoResult;
|
|
1709
|
+
|
|
1710
|
+
export { $createVariableNode, $isVariableNode, type BaseRequestData, type Brand, type ContentDataResourceLocaleInfoProps, type ContentDataResourceLocaleInfoResult, 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 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, useContentDataResourceLocaleInfo, useDynamicInputsAsVariables, useMeshLocation, useObjectSearchContext, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshSdk, useVariableEditor, useVariables, useVariablesMenu, variableDefaultTextValue, variablePrefix, variableSuffix, variablesToGroupedList, variablesToList };
|
package/dist/index.esm.js
CHANGED
|
@@ -7135,6 +7135,28 @@ function createLocationValidator(setValue, validate) {
|
|
|
7135
7135
|
});
|
|
7136
7136
|
}
|
|
7137
7137
|
|
|
7138
|
+
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
7139
|
+
import { bindVariables as bindVariables2, createVariableReference as createVariableReference4, LOCALE_DYNAMIC_INPUT_NAME as LOCALE_DYNAMIC_INPUT_NAME2 } from "@uniformdev/canvas";
|
|
7140
|
+
import { useEffect as useEffect18, useRef as useRef16 } from "react";
|
|
7141
|
+
function useContentDataResourceLocaleInfo({
|
|
7142
|
+
locale,
|
|
7143
|
+
setLocale,
|
|
7144
|
+
dynamicInputs
|
|
7145
|
+
}) {
|
|
7146
|
+
var _a;
|
|
7147
|
+
const setLocaleRef = useRef16(setLocale);
|
|
7148
|
+
setLocaleRef.current = setLocale;
|
|
7149
|
+
const { flatVariables } = useVariables();
|
|
7150
|
+
const effectiveLocale = locale != null ? locale : dynamicInputs[LOCALE_DYNAMIC_INPUT_NAME2] ? createVariableReference4(LOCALE_DYNAMIC_INPUT_NAME2) : "";
|
|
7151
|
+
const boundLocale = (_a = bindVariables2({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
7152
|
+
useEffect18(() => {
|
|
7153
|
+
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
7154
|
+
setLocaleRef.current(createVariableReference4(LOCALE_DYNAMIC_INPUT_NAME2));
|
|
7155
|
+
}
|
|
7156
|
+
}, [locale, effectiveLocale]);
|
|
7157
|
+
return { effectiveLocale, boundLocale: boundLocale ? boundLocale : void 0 };
|
|
7158
|
+
}
|
|
7159
|
+
|
|
7138
7160
|
// src/index.ts
|
|
7139
7161
|
import {
|
|
7140
7162
|
AddListButton as AddListButton2,
|
|
@@ -7338,6 +7360,7 @@ export {
|
|
|
7338
7360
|
urlEncodeRequestParameter,
|
|
7339
7361
|
urlEncodeRequestUrl,
|
|
7340
7362
|
useConnectedDataAsVariables,
|
|
7363
|
+
useContentDataResourceLocaleInfo,
|
|
7341
7364
|
useDynamicInputsAsVariables,
|
|
7342
7365
|
useMeshLocation,
|
|
7343
7366
|
useObjectSearchContext,
|
package/dist/index.js
CHANGED
|
@@ -195,6 +195,7 @@ __export(src_exports, {
|
|
|
195
195
|
urlEncodeRequestParameter: () => urlEncodeRequestParameter,
|
|
196
196
|
urlEncodeRequestUrl: () => urlEncodeRequestUrl,
|
|
197
197
|
useConnectedDataAsVariables: () => useConnectedDataAsVariables,
|
|
198
|
+
useContentDataResourceLocaleInfo: () => useContentDataResourceLocaleInfo,
|
|
198
199
|
useDynamicInputsAsVariables: () => useDynamicInputsAsVariables,
|
|
199
200
|
useMeshLocation: () => useMeshLocation,
|
|
200
201
|
useObjectSearchContext: () => useObjectSearchContext,
|
|
@@ -7266,6 +7267,28 @@ function createLocationValidator(setValue, validate) {
|
|
|
7266
7267
|
});
|
|
7267
7268
|
}
|
|
7268
7269
|
|
|
7270
|
+
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
7271
|
+
var import_canvas10 = require("@uniformdev/canvas");
|
|
7272
|
+
var import_react74 = require("react");
|
|
7273
|
+
function useContentDataResourceLocaleInfo({
|
|
7274
|
+
locale,
|
|
7275
|
+
setLocale,
|
|
7276
|
+
dynamicInputs
|
|
7277
|
+
}) {
|
|
7278
|
+
var _a;
|
|
7279
|
+
const setLocaleRef = (0, import_react74.useRef)(setLocale);
|
|
7280
|
+
setLocaleRef.current = setLocale;
|
|
7281
|
+
const { flatVariables } = useVariables();
|
|
7282
|
+
const effectiveLocale = locale != null ? locale : dynamicInputs[import_canvas10.LOCALE_DYNAMIC_INPUT_NAME] ? (0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME) : "";
|
|
7283
|
+
const boundLocale = (_a = (0, import_canvas10.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
7284
|
+
(0, import_react74.useEffect)(() => {
|
|
7285
|
+
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
7286
|
+
setLocaleRef.current((0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME));
|
|
7287
|
+
}
|
|
7288
|
+
}, [locale, effectiveLocale]);
|
|
7289
|
+
return { effectiveLocale, boundLocale: boundLocale ? boundLocale : void 0 };
|
|
7290
|
+
}
|
|
7291
|
+
|
|
7269
7292
|
// src/index.ts
|
|
7270
7293
|
var import_design_system41 = require("@uniformdev/design-system");
|
|
7271
7294
|
__reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
@@ -7435,6 +7458,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
7435
7458
|
urlEncodeRequestParameter,
|
|
7436
7459
|
urlEncodeRequestUrl,
|
|
7437
7460
|
useConnectedDataAsVariables,
|
|
7461
|
+
useContentDataResourceLocaleInfo,
|
|
7438
7462
|
useDynamicInputsAsVariables,
|
|
7439
7463
|
useMeshLocation,
|
|
7440
7464
|
useObjectSearchContext,
|
package/dist/index.mjs
CHANGED
|
@@ -7135,6 +7135,28 @@ function createLocationValidator(setValue, validate) {
|
|
|
7135
7135
|
});
|
|
7136
7136
|
}
|
|
7137
7137
|
|
|
7138
|
+
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
7139
|
+
import { bindVariables as bindVariables2, createVariableReference as createVariableReference4, LOCALE_DYNAMIC_INPUT_NAME as LOCALE_DYNAMIC_INPUT_NAME2 } from "@uniformdev/canvas";
|
|
7140
|
+
import { useEffect as useEffect18, useRef as useRef16 } from "react";
|
|
7141
|
+
function useContentDataResourceLocaleInfo({
|
|
7142
|
+
locale,
|
|
7143
|
+
setLocale,
|
|
7144
|
+
dynamicInputs
|
|
7145
|
+
}) {
|
|
7146
|
+
var _a;
|
|
7147
|
+
const setLocaleRef = useRef16(setLocale);
|
|
7148
|
+
setLocaleRef.current = setLocale;
|
|
7149
|
+
const { flatVariables } = useVariables();
|
|
7150
|
+
const effectiveLocale = locale != null ? locale : dynamicInputs[LOCALE_DYNAMIC_INPUT_NAME2] ? createVariableReference4(LOCALE_DYNAMIC_INPUT_NAME2) : "";
|
|
7151
|
+
const boundLocale = (_a = bindVariables2({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
7152
|
+
useEffect18(() => {
|
|
7153
|
+
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
7154
|
+
setLocaleRef.current(createVariableReference4(LOCALE_DYNAMIC_INPUT_NAME2));
|
|
7155
|
+
}
|
|
7156
|
+
}, [locale, effectiveLocale]);
|
|
7157
|
+
return { effectiveLocale, boundLocale: boundLocale ? boundLocale : void 0 };
|
|
7158
|
+
}
|
|
7159
|
+
|
|
7138
7160
|
// src/index.ts
|
|
7139
7161
|
import {
|
|
7140
7162
|
AddListButton as AddListButton2,
|
|
@@ -7338,6 +7360,7 @@ export {
|
|
|
7338
7360
|
urlEncodeRequestParameter,
|
|
7339
7361
|
urlEncodeRequestUrl,
|
|
7340
7362
|
useConnectedDataAsVariables,
|
|
7363
|
+
useContentDataResourceLocaleInfo,
|
|
7341
7364
|
useDynamicInputsAsVariables,
|
|
7342
7365
|
useMeshLocation,
|
|
7343
7366
|
useObjectSearchContext,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/mesh-sdk-react",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.103.0",
|
|
4
4
|
"description": "Uniform Mesh Framework SDK for React",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -50,9 +50,9 @@
|
|
|
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.103.0",
|
|
54
|
+
"@uniformdev/design-system": "19.103.0",
|
|
55
|
+
"@uniformdev/mesh-sdk": "19.103.0",
|
|
56
56
|
"dequal": "^2.0.3",
|
|
57
57
|
"lexical": "^0.12.0",
|
|
58
58
|
"mitt": "^3.0.0",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "ebdcac3a77d293bff272925f62f8c1c10be855bc"
|
|
90
90
|
}
|