@uniformdev/canvas 19.214.1-alpha.37 → 20.1.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 +1 -42
- package/dist/index.d.ts +1 -42
- package/dist/index.esm.js +8 -132
- package/dist/index.js +9 -139
- package/dist/index.mjs +8 -132
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
@@ -11847,29 +11847,6 @@ declare function getNounForNode(node: ComponentInstance | EntryData | Array<Node
|
|
11847
11847
|
|
11848
11848
|
declare function getComponentPath(ancestorsAndSelf: Array<NodeLocationReference>): string;
|
11849
11849
|
|
11850
|
-
type GetEffectivePropertyValueOptions<TValue> = {
|
11851
|
-
property: ComponentParameter<TValue> | undefined;
|
11852
|
-
/** Current locale to bind (or undefined to bind the non-localized value) */
|
11853
|
-
locale: string | undefined;
|
11854
|
-
/** Condition index to bind (or a negative number to not bind a conditional value) */
|
11855
|
-
conditionIndex: number;
|
11856
|
-
/**
|
11857
|
-
* Enables strict matching, that is
|
11858
|
-
* disallowing a locale conditional to fallback to a locale to fallback to base value,
|
11859
|
-
* or a conditional to fallback to base value.
|
11860
|
-
*/
|
11861
|
-
strict?: boolean;
|
11862
|
-
/**
|
11863
|
-
* Enables greedy locale matching.
|
11864
|
-
* `locale` becomes a preferred locale, but if it's not available, the first available locale is used instead if any others exist.
|
11865
|
-
*
|
11866
|
-
* Useful for computing non-localized display names where a randomly selected value is better than nothing.
|
11867
|
-
*/
|
11868
|
-
greedyLocaleMatching?: boolean;
|
11869
|
-
};
|
11870
|
-
/** Resolves the effective value of a property given a locale and/or condition index */
|
11871
|
-
declare function getEffectivePropertyValue<TValue>({ property, conditionIndex, locale, strict, greedyLocaleMatching, }: GetEffectivePropertyValueOptions<TValue>): TValue | undefined;
|
11872
|
-
|
11873
11850
|
declare function extractLocales({ component }: {
|
11874
11851
|
component: ComponentInstance;
|
11875
11852
|
}): Record<string, ComponentInstance[]>;
|
@@ -12073,19 +12050,6 @@ declare function createQuirksVisibilityRule(quirks: Quirks): VisibilityRules;
|
|
12073
12050
|
type CoreStringOperators = 'is' | 'has' | 'startswith' | 'endswith' | 'empty';
|
12074
12051
|
type StringOperators = CoreStringOperators | `!${CoreStringOperators}`;
|
12075
12052
|
|
12076
|
-
type PropertyValue = {
|
12077
|
-
locale: string | undefined;
|
12078
|
-
conditionIndex: number;
|
12079
|
-
value: unknown;
|
12080
|
-
};
|
12081
|
-
/**
|
12082
|
-
* Visits all property values in any locale or any condition
|
12083
|
-
* The value provided is a strict value. See getEffectivePropertyValue() for more details.
|
12084
|
-
*
|
12085
|
-
* NOTE: conditional values are visited in reverse order, which makes them safe to delete during iteration.
|
12086
|
-
*/
|
12087
|
-
declare function walkPropertyValues(property: ComponentParameter, visitor: (options: PropertyValue) => void): void;
|
12088
|
-
|
12089
12053
|
/** API client to fetch entity across releases */
|
12090
12054
|
declare class EntityReleasesClient extends ApiClient {
|
12091
12055
|
constructor(options: ClientOptions);
|
@@ -12835,11 +12799,6 @@ type BindVariablesOptions = {
|
|
12835
12799
|
*/
|
12836
12800
|
declare function bindVariables({ variables, value, errorPrefix, handleBinding, }: BindVariablesOptions): BindVariablesResult<unknown>;
|
12837
12801
|
|
12838
|
-
declare const bindExpressionPrefix = "#";
|
12839
|
-
declare const bindExpressionEscapeChars: Set<string>;
|
12840
|
-
declare function convertToBindExpression(binding: DataElementConnectionDefinition): string;
|
12841
|
-
declare function escapeBindExpressionDefaultValue(defaultValue: string): string;
|
12842
|
-
|
12843
12802
|
declare function createVariableReference(variableName: string): string;
|
12844
12803
|
|
12845
12804
|
/**
|
@@ -12871,4 +12830,4 @@ declare class WorkflowClient extends ApiClient {
|
|
12871
12830
|
|
12872
12831
|
declare const CanvasClientError: typeof ApiClientError;
|
12873
12832
|
|
12874
|
-
export { ASSETS_SOURCE_CUSTOM_URL, ASSETS_SOURCE_UNIFORM, ASSET_PARAMETER_TYPE, ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, type AddComponentMessage, type AssetParamValue, type AssetParamValueItem, type BatchEnhancer, BatchEntry, type BatchInvalidationPayload, type BindVariablesOptions, type BindVariablesResult, type BindVariablesToObjectOptions, BlockFormatError, type BlockLocationReference, type BlockValue, CANVAS_BLOCK_PARAM_TYPE, CANVAS_CONTEXTUAL_EDITING_PARAM, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_SLOT_SECTION_SLOT, CANVAS_SLOT_SECTION_TYPE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CANVAS_VIZ_CONTROL_PARAM, CANVAS_VIZ_DI_RULE, CANVAS_VIZ_DYNAMIC_TOKEN_RULE, CANVAS_VIZ_LOCALE_RULE, CANVAS_VIZ_QUIRKS_RULE, CanvasClient, CanvasClientError, type CanvasDefinitions, type CategoriesDeleteParameters, type CategoriesGetParameters, type CategoriesGetResponse, type CategoriesPutParameters, type Category, CategoryClient, type Channel, type ChannelMessage, ChildEnhancerBuilder, type ComponentDefinition, type ComponentDefinitionDeleteParameters, type ComponentDefinitionGetParameters, type ComponentDefinitionGetResponse, type ComponentDefinitionParameter, type ComponentDefinitionPermission, type ComponentDefinitionPutParameters, type ComponentDefinitionSlot, type ComponentDefinitionSlugSettings, type ComponentDefinitionVariant, type ComponentEnhancer, type ComponentEnhancerFunction, type ComponentEnhancerOptions, type ComponentInstance, type ComponentInstanceContextualEditing, type ComponentInstanceHistoryEntry, type ComponentInstanceHistoryGetParameters, type ComponentInstanceHistoryGetResponse, type ComponentLocationReference, type ComponentOverridability, type ComponentOverride, type ComponentOverrides, type ComponentParameter, type ComponentParameterBlock, type ComponentParameterConditionalValue, type ComponentParameterContextualEditing, type ComponentParameterEnhancer, type ComponentParameterEnhancerFunction, type ComponentParameterEnhancerOptions, type CompositionDeleteParameters, type CompositionFilters, type CompositionGetByComponentIdParameters, type CompositionGetByIdParameters, type CompositionGetByNodeIdParameters, type CompositionGetByNodePathParameters, type CompositionGetBySlugParameters, type CompositionGetListResponse, type CompositionGetParameters, type CompositionGetResponse, type CompositionGetValidResponses, type CompositionPutParameters, type CompositionResolvedGetResponse, type CompositionResolvedListResponse, type CompositionUIStatus, ContentClient, type ContentType, type ContentTypeField, type ContextStorageUpdatedMessage, type ContextualEditingComponentReference, type ContextualEditingValue, type CopiedComponentSubtree, type DataDiagnostic, type DataElementBindingIssue, type DataElementConnectionDefinition, type DataElementConnectionFailureAction, type DataElementConnectionFailureLogLevel, type DataResolutionConfigIssue, type DataResolutionIssue, type DataResolutionOption, type DataResolutionOptionNegative, type DataResolutionOptionPositive, type DataResolutionParameters, type DataResourceDefinition, type DataResourceDefinitions, type DataResourceIssue, type DataResourceVariables, type DataSource, DataSourceClient, type DataSourceDeleteParameters, type DataSourceGetParameters, type DataSourceGetResponse, type DataSourcePutParameters, type DataSourceVariantData, type DataSourceVariantsKeys, type DataSourcesGetParameters, type DataSourcesGetResponse, type DataType, DataTypeClient, type DataTypeDeleteParameters, type DataTypeGetParameters, type DataTypeGetResponse, type DataTypePutParameters, type DataVariableDefinition, type DataWithProperties, type DeleteContentTypeOptions, type DeleteEntryOptions, type DismissPlaceholderMessage, type DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, type EdgehancersDiagnostics, type EdgehancersWholeResponseCacheDiagnostics, type EditorStateUpdatedMessage, EnhancerBuilder, type EnhancerContext, type EnhancerError, EntityReleasesClient, type EntityReleasesGetParameters, type EntityReleasesGetResponse, type EntriesGetParameters, type EntriesGetResponse, type EntriesHistoryGetParameters, type EntriesHistoryGetResponse, type EntriesResolvedListResponse, type Entry, type EntryData, type EntryFilters, type EntryList, type EvaluateCriteriaGroupOptions, type EvaluateNodeTreeVisibilityOptions, type EvaluateNodeVisibilityParameterOptions, type EvaluatePropertyCriteriaOptions, type EvaluateWalkTreePropertyCriteriaOptions, type Filters, type FindInNodeTreeReference, type FlattenProperty, type FlattenValues, type FlattenValuesOptions, type GetContentTypesOptions, type GetContentTypesResponse, type GetEffectivePropertyValueOptions, type GetEntriesOptions, type GetEntriesResponse, type GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_FORCED_SETTINGS_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, type InvalidationPayload, LOCALE_DYNAMIC_INPUT_NAME, type LimitPolicy, type LinkParamConfiguration, type LinkParamValue, type LinkParameterType, type LinkTypeConfiguration, type Locale, LocaleClient, type LocaleDeleteParameters, type LocalePutParameters, type LocalesGetParameters, type LocalesGetResponse, type LocalizeOptions, type MaxDepthExceededIssue, type MessageHandler, type MoveComponentMessage, type NodeLocationReference, type NonProjectMapLinkParamValue, type OpenParameterEditorMessage, type OverrideOptions, PLACEHOLDER_ID, type PatternIssue, PreviewClient, type PreviewPanelSettings, type PreviewUrl, type PreviewUrlDeleteParameters, type PreviewUrlDeleteResponse, type PreviewUrlPutParameters, type PreviewUrlPutResponse, type PreviewUrlsGetParameters, type PreviewUrlsGetResponse, type PreviewViewport, type PreviewViewportDeleteParameters, type PreviewViewportDeleteResponse, type PreviewViewportPutParameters, type PreviewViewportPutResponse, type PreviewViewportsGetParameters, type PreviewViewportsGetResponse, type ProjectMapLinkParamValue, type Prompt, PromptClient, type PromptsDeleteParameters, type PromptsGetParameters, type PromptsGetResponse, type PromptsPutParameters, type PropertyCriteriaMatch, type PropertyValue, type PutContentTypeBody, type PutEntryBody, type ReadyMessage, RelationshipClient, type RelationshipResultInstance, type Release, ReleaseClient, type ReleaseContent, ReleaseContentsClient, type ReleaseContentsDeleteBody, type ReleaseContentsGetParameters, type ReleaseContentsGetResponse, type ReleaseDeleteParameters, type ReleasePatchParameters, type ReleasePutParameters, type ReleaseState, type ReleasesGetParameters, type ReleasesGetResponse, type ReportRenderedCompositionsMessage, type RequestComponentSuggestionMessage, type ResolvedRouteGetResponse, type RichTextBuiltInElement, type RichTextBuiltInFormat, type RichTextParamConfiguration, type RichTextParamValue, type RootComponentInstance, type RootEntryReference, type RootLocationReference, RouteClient, type RouteDynamicInputs, type RouteGetParameters, type RouteGetResponse, type RouteGetResponseComposition, type RouteGetResponseEdgehancedComposition, type RouteGetResponseEdgehancedNotFound, type RouteGetResponseNotFound, type RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, type SelectComponentMessage, type SelectParameterMessage, type SpecificProjectMap, type StringOperators, type SuggestComponentMessage, type TreeNodeInfoTypes, type TriggerComponentActionMessage, type TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, type UpdateComponentParameterMessage, type UpdateComponentReferencesMessage, type UpdateCompositionInternalMessage, type UpdateCompositionMessage, type UpdateContextualEditingStateInternalMessage, type UpdateFeatureFlagsMessage, type UpdatePreviewSettingsMessage, type VisibilityCriteria, type VisibilityCriteriaEvaluationResult, type VisibilityCriteriaGroup, type VisibilityParameterValue, type VisibilityRule, type VisibilityRules, type WalkNodeTreeActions, type WalkNodeTreeOptions, WorkflowClient, type WorkflowDefinition, type WorkflowStage, type WorkflowStagePermission, type WorkflowStageTransition, type WorkflowStageTransitionPermission, type WorkflowsDeleteParameters, type WorkflowsGetParameters, type WorkflowsGetResponse, type WorkflowsPutParameters, bindExpressionEscapeChars, bindExpressionPrefix, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, convertToBindExpression, createBatchEnhancer, createCanvasChannel, createDynamicInputVisibilityRule, createDynamicTokenVisibilityRule, createLimitPolicy, createLocaleVisibilityRule, createQuirksVisibilityRule, createUniformApiEnhancer, createVariableReference, enhance, escapeBindExpressionDefaultValue, evaluateNodeVisibilityParameter, evaluatePropertyCriteria, evaluateVisibilityCriteriaGroup, evaluateWalkTreeNodeVisibility, evaluateWalkTreePropertyCriteria, extractLocales, findParameterInNodeTree, flattenValues, generateComponentPlaceholderId, generateHash, getBlockValue, getComponentJsonPointer, getComponentPath, getDataSourceVariantFromRouteGetParams, getEffectivePropertyValue, getLocalizedPropertyValues, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, hasReferencedVariables, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isContextStorageUpdatedMessage, isDismissPlaceholderMessage, isEntryData, isLinkParamValue, isMovingComponentMessage, isNestedNodeType, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRequestComponentSuggestionMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSuggestComponentMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseComponentPlaceholderId, parseVariableExpression, walkNodeTree, walkPropertyValues };
|
12833
|
+
export { ASSETS_SOURCE_CUSTOM_URL, ASSETS_SOURCE_UNIFORM, ASSET_PARAMETER_TYPE, ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, type AddComponentMessage, type AssetParamValue, type AssetParamValueItem, type BatchEnhancer, BatchEntry, type BatchInvalidationPayload, type BindVariablesOptions, type BindVariablesResult, type BindVariablesToObjectOptions, BlockFormatError, type BlockLocationReference, type BlockValue, CANVAS_BLOCK_PARAM_TYPE, CANVAS_CONTEXTUAL_EDITING_PARAM, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_SLOT_SECTION_SLOT, CANVAS_SLOT_SECTION_TYPE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CANVAS_VIZ_CONTROL_PARAM, CANVAS_VIZ_DI_RULE, CANVAS_VIZ_DYNAMIC_TOKEN_RULE, CANVAS_VIZ_LOCALE_RULE, CANVAS_VIZ_QUIRKS_RULE, CanvasClient, CanvasClientError, type CanvasDefinitions, type CategoriesDeleteParameters, type CategoriesGetParameters, type CategoriesGetResponse, type CategoriesPutParameters, type Category, CategoryClient, type Channel, type ChannelMessage, ChildEnhancerBuilder, type ComponentDefinition, type ComponentDefinitionDeleteParameters, type ComponentDefinitionGetParameters, type ComponentDefinitionGetResponse, type ComponentDefinitionParameter, type ComponentDefinitionPermission, type ComponentDefinitionPutParameters, type ComponentDefinitionSlot, type ComponentDefinitionSlugSettings, type ComponentDefinitionVariant, type ComponentEnhancer, type ComponentEnhancerFunction, type ComponentEnhancerOptions, type ComponentInstance, type ComponentInstanceContextualEditing, type ComponentInstanceHistoryEntry, type ComponentInstanceHistoryGetParameters, type ComponentInstanceHistoryGetResponse, type ComponentLocationReference, type ComponentOverridability, type ComponentOverride, type ComponentOverrides, type ComponentParameter, type ComponentParameterBlock, type ComponentParameterConditionalValue, type ComponentParameterContextualEditing, type ComponentParameterEnhancer, type ComponentParameterEnhancerFunction, type ComponentParameterEnhancerOptions, type CompositionDeleteParameters, type CompositionFilters, type CompositionGetByComponentIdParameters, type CompositionGetByIdParameters, type CompositionGetByNodeIdParameters, type CompositionGetByNodePathParameters, type CompositionGetBySlugParameters, type CompositionGetListResponse, type CompositionGetParameters, type CompositionGetResponse, type CompositionGetValidResponses, type CompositionPutParameters, type CompositionResolvedGetResponse, type CompositionResolvedListResponse, type CompositionUIStatus, ContentClient, type ContentType, type ContentTypeField, type ContextStorageUpdatedMessage, type ContextualEditingComponentReference, type ContextualEditingValue, type CopiedComponentSubtree, type DataDiagnostic, type DataElementBindingIssue, type DataElementConnectionDefinition, type DataElementConnectionFailureAction, type DataElementConnectionFailureLogLevel, type DataResolutionConfigIssue, type DataResolutionIssue, type DataResolutionOption, type DataResolutionOptionNegative, type DataResolutionOptionPositive, type DataResolutionParameters, type DataResourceDefinition, type DataResourceDefinitions, type DataResourceIssue, type DataResourceVariables, type DataSource, DataSourceClient, type DataSourceDeleteParameters, type DataSourceGetParameters, type DataSourceGetResponse, type DataSourcePutParameters, type DataSourceVariantData, type DataSourceVariantsKeys, type DataSourcesGetParameters, type DataSourcesGetResponse, type DataType, DataTypeClient, type DataTypeDeleteParameters, type DataTypeGetParameters, type DataTypeGetResponse, type DataTypePutParameters, type DataVariableDefinition, type DataWithProperties, type DeleteContentTypeOptions, type DeleteEntryOptions, type DismissPlaceholderMessage, type DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, type EdgehancersDiagnostics, type EdgehancersWholeResponseCacheDiagnostics, type EditorStateUpdatedMessage, EnhancerBuilder, type EnhancerContext, type EnhancerError, EntityReleasesClient, type EntityReleasesGetParameters, type EntityReleasesGetResponse, type EntriesGetParameters, type EntriesGetResponse, type EntriesHistoryGetParameters, type EntriesHistoryGetResponse, type EntriesResolvedListResponse, type Entry, type EntryData, type EntryFilters, type EntryList, type EvaluateCriteriaGroupOptions, type EvaluateNodeTreeVisibilityOptions, type EvaluateNodeVisibilityParameterOptions, type EvaluatePropertyCriteriaOptions, type EvaluateWalkTreePropertyCriteriaOptions, type Filters, type FindInNodeTreeReference, type FlattenProperty, type FlattenValues, type FlattenValuesOptions, type GetContentTypesOptions, type GetContentTypesResponse, type GetEntriesOptions, type GetEntriesResponse, type GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_FORCED_SETTINGS_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, type InvalidationPayload, LOCALE_DYNAMIC_INPUT_NAME, type LimitPolicy, type LinkParamConfiguration, type LinkParamValue, type LinkParameterType, type LinkTypeConfiguration, type Locale, LocaleClient, type LocaleDeleteParameters, type LocalePutParameters, type LocalesGetParameters, type LocalesGetResponse, type LocalizeOptions, type MaxDepthExceededIssue, type MessageHandler, type MoveComponentMessage, type NodeLocationReference, type NonProjectMapLinkParamValue, type OpenParameterEditorMessage, type OverrideOptions, PLACEHOLDER_ID, type PatternIssue, PreviewClient, type PreviewPanelSettings, type PreviewUrl, type PreviewUrlDeleteParameters, type PreviewUrlDeleteResponse, type PreviewUrlPutParameters, type PreviewUrlPutResponse, type PreviewUrlsGetParameters, type PreviewUrlsGetResponse, type PreviewViewport, type PreviewViewportDeleteParameters, type PreviewViewportDeleteResponse, type PreviewViewportPutParameters, type PreviewViewportPutResponse, type PreviewViewportsGetParameters, type PreviewViewportsGetResponse, type ProjectMapLinkParamValue, type Prompt, PromptClient, type PromptsDeleteParameters, type PromptsGetParameters, type PromptsGetResponse, type PromptsPutParameters, type PropertyCriteriaMatch, type PutContentTypeBody, type PutEntryBody, type ReadyMessage, RelationshipClient, type RelationshipResultInstance, type Release, ReleaseClient, type ReleaseContent, ReleaseContentsClient, type ReleaseContentsDeleteBody, type ReleaseContentsGetParameters, type ReleaseContentsGetResponse, type ReleaseDeleteParameters, type ReleasePatchParameters, type ReleasePutParameters, type ReleaseState, type ReleasesGetParameters, type ReleasesGetResponse, type ReportRenderedCompositionsMessage, type RequestComponentSuggestionMessage, type ResolvedRouteGetResponse, type RichTextBuiltInElement, type RichTextBuiltInFormat, type RichTextParamConfiguration, type RichTextParamValue, type RootComponentInstance, type RootEntryReference, type RootLocationReference, RouteClient, type RouteDynamicInputs, type RouteGetParameters, type RouteGetResponse, type RouteGetResponseComposition, type RouteGetResponseEdgehancedComposition, type RouteGetResponseEdgehancedNotFound, type RouteGetResponseNotFound, type RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, type SelectComponentMessage, type SelectParameterMessage, type SpecificProjectMap, type StringOperators, type SuggestComponentMessage, type TreeNodeInfoTypes, type TriggerComponentActionMessage, type TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, type UpdateComponentParameterMessage, type UpdateComponentReferencesMessage, type UpdateCompositionInternalMessage, type UpdateCompositionMessage, type UpdateContextualEditingStateInternalMessage, type UpdateFeatureFlagsMessage, type UpdatePreviewSettingsMessage, type VisibilityCriteria, type VisibilityCriteriaEvaluationResult, type VisibilityCriteriaGroup, type VisibilityParameterValue, type VisibilityRule, type VisibilityRules, type WalkNodeTreeActions, type WalkNodeTreeOptions, WorkflowClient, type WorkflowDefinition, type WorkflowStage, type WorkflowStagePermission, type WorkflowStageTransition, type WorkflowStageTransitionPermission, type WorkflowsDeleteParameters, type WorkflowsGetParameters, type WorkflowsGetResponse, type WorkflowsPutParameters, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createDynamicInputVisibilityRule, createDynamicTokenVisibilityRule, createLimitPolicy, createLocaleVisibilityRule, createQuirksVisibilityRule, createUniformApiEnhancer, createVariableReference, enhance, evaluateNodeVisibilityParameter, evaluatePropertyCriteria, evaluateVisibilityCriteriaGroup, evaluateWalkTreeNodeVisibility, evaluateWalkTreePropertyCriteria, extractLocales, findParameterInNodeTree, flattenValues, generateComponentPlaceholderId, generateHash, getBlockValue, getComponentJsonPointer, getComponentPath, getDataSourceVariantFromRouteGetParams, getLocalizedPropertyValues, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, hasReferencedVariables, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isContextStorageUpdatedMessage, isDismissPlaceholderMessage, isEntryData, isLinkParamValue, isMovingComponentMessage, isNestedNodeType, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRequestComponentSuggestionMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSuggestComponentMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseComponentPlaceholderId, parseVariableExpression, walkNodeTree };
|
package/dist/index.d.ts
CHANGED
@@ -11847,29 +11847,6 @@ declare function getNounForNode(node: ComponentInstance | EntryData | Array<Node
|
|
11847
11847
|
|
11848
11848
|
declare function getComponentPath(ancestorsAndSelf: Array<NodeLocationReference>): string;
|
11849
11849
|
|
11850
|
-
type GetEffectivePropertyValueOptions<TValue> = {
|
11851
|
-
property: ComponentParameter<TValue> | undefined;
|
11852
|
-
/** Current locale to bind (or undefined to bind the non-localized value) */
|
11853
|
-
locale: string | undefined;
|
11854
|
-
/** Condition index to bind (or a negative number to not bind a conditional value) */
|
11855
|
-
conditionIndex: number;
|
11856
|
-
/**
|
11857
|
-
* Enables strict matching, that is
|
11858
|
-
* disallowing a locale conditional to fallback to a locale to fallback to base value,
|
11859
|
-
* or a conditional to fallback to base value.
|
11860
|
-
*/
|
11861
|
-
strict?: boolean;
|
11862
|
-
/**
|
11863
|
-
* Enables greedy locale matching.
|
11864
|
-
* `locale` becomes a preferred locale, but if it's not available, the first available locale is used instead if any others exist.
|
11865
|
-
*
|
11866
|
-
* Useful for computing non-localized display names where a randomly selected value is better than nothing.
|
11867
|
-
*/
|
11868
|
-
greedyLocaleMatching?: boolean;
|
11869
|
-
};
|
11870
|
-
/** Resolves the effective value of a property given a locale and/or condition index */
|
11871
|
-
declare function getEffectivePropertyValue<TValue>({ property, conditionIndex, locale, strict, greedyLocaleMatching, }: GetEffectivePropertyValueOptions<TValue>): TValue | undefined;
|
11872
|
-
|
11873
11850
|
declare function extractLocales({ component }: {
|
11874
11851
|
component: ComponentInstance;
|
11875
11852
|
}): Record<string, ComponentInstance[]>;
|
@@ -12073,19 +12050,6 @@ declare function createQuirksVisibilityRule(quirks: Quirks): VisibilityRules;
|
|
12073
12050
|
type CoreStringOperators = 'is' | 'has' | 'startswith' | 'endswith' | 'empty';
|
12074
12051
|
type StringOperators = CoreStringOperators | `!${CoreStringOperators}`;
|
12075
12052
|
|
12076
|
-
type PropertyValue = {
|
12077
|
-
locale: string | undefined;
|
12078
|
-
conditionIndex: number;
|
12079
|
-
value: unknown;
|
12080
|
-
};
|
12081
|
-
/**
|
12082
|
-
* Visits all property values in any locale or any condition
|
12083
|
-
* The value provided is a strict value. See getEffectivePropertyValue() for more details.
|
12084
|
-
*
|
12085
|
-
* NOTE: conditional values are visited in reverse order, which makes them safe to delete during iteration.
|
12086
|
-
*/
|
12087
|
-
declare function walkPropertyValues(property: ComponentParameter, visitor: (options: PropertyValue) => void): void;
|
12088
|
-
|
12089
12053
|
/** API client to fetch entity across releases */
|
12090
12054
|
declare class EntityReleasesClient extends ApiClient {
|
12091
12055
|
constructor(options: ClientOptions);
|
@@ -12835,11 +12799,6 @@ type BindVariablesOptions = {
|
|
12835
12799
|
*/
|
12836
12800
|
declare function bindVariables({ variables, value, errorPrefix, handleBinding, }: BindVariablesOptions): BindVariablesResult<unknown>;
|
12837
12801
|
|
12838
|
-
declare const bindExpressionPrefix = "#";
|
12839
|
-
declare const bindExpressionEscapeChars: Set<string>;
|
12840
|
-
declare function convertToBindExpression(binding: DataElementConnectionDefinition): string;
|
12841
|
-
declare function escapeBindExpressionDefaultValue(defaultValue: string): string;
|
12842
|
-
|
12843
12802
|
declare function createVariableReference(variableName: string): string;
|
12844
12803
|
|
12845
12804
|
/**
|
@@ -12871,4 +12830,4 @@ declare class WorkflowClient extends ApiClient {
|
|
12871
12830
|
|
12872
12831
|
declare const CanvasClientError: typeof ApiClientError;
|
12873
12832
|
|
12874
|
-
export { ASSETS_SOURCE_CUSTOM_URL, ASSETS_SOURCE_UNIFORM, ASSET_PARAMETER_TYPE, ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, type AddComponentMessage, type AssetParamValue, type AssetParamValueItem, type BatchEnhancer, BatchEntry, type BatchInvalidationPayload, type BindVariablesOptions, type BindVariablesResult, type BindVariablesToObjectOptions, BlockFormatError, type BlockLocationReference, type BlockValue, CANVAS_BLOCK_PARAM_TYPE, CANVAS_CONTEXTUAL_EDITING_PARAM, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_SLOT_SECTION_SLOT, CANVAS_SLOT_SECTION_TYPE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CANVAS_VIZ_CONTROL_PARAM, CANVAS_VIZ_DI_RULE, CANVAS_VIZ_DYNAMIC_TOKEN_RULE, CANVAS_VIZ_LOCALE_RULE, CANVAS_VIZ_QUIRKS_RULE, CanvasClient, CanvasClientError, type CanvasDefinitions, type CategoriesDeleteParameters, type CategoriesGetParameters, type CategoriesGetResponse, type CategoriesPutParameters, type Category, CategoryClient, type Channel, type ChannelMessage, ChildEnhancerBuilder, type ComponentDefinition, type ComponentDefinitionDeleteParameters, type ComponentDefinitionGetParameters, type ComponentDefinitionGetResponse, type ComponentDefinitionParameter, type ComponentDefinitionPermission, type ComponentDefinitionPutParameters, type ComponentDefinitionSlot, type ComponentDefinitionSlugSettings, type ComponentDefinitionVariant, type ComponentEnhancer, type ComponentEnhancerFunction, type ComponentEnhancerOptions, type ComponentInstance, type ComponentInstanceContextualEditing, type ComponentInstanceHistoryEntry, type ComponentInstanceHistoryGetParameters, type ComponentInstanceHistoryGetResponse, type ComponentLocationReference, type ComponentOverridability, type ComponentOverride, type ComponentOverrides, type ComponentParameter, type ComponentParameterBlock, type ComponentParameterConditionalValue, type ComponentParameterContextualEditing, type ComponentParameterEnhancer, type ComponentParameterEnhancerFunction, type ComponentParameterEnhancerOptions, type CompositionDeleteParameters, type CompositionFilters, type CompositionGetByComponentIdParameters, type CompositionGetByIdParameters, type CompositionGetByNodeIdParameters, type CompositionGetByNodePathParameters, type CompositionGetBySlugParameters, type CompositionGetListResponse, type CompositionGetParameters, type CompositionGetResponse, type CompositionGetValidResponses, type CompositionPutParameters, type CompositionResolvedGetResponse, type CompositionResolvedListResponse, type CompositionUIStatus, ContentClient, type ContentType, type ContentTypeField, type ContextStorageUpdatedMessage, type ContextualEditingComponentReference, type ContextualEditingValue, type CopiedComponentSubtree, type DataDiagnostic, type DataElementBindingIssue, type DataElementConnectionDefinition, type DataElementConnectionFailureAction, type DataElementConnectionFailureLogLevel, type DataResolutionConfigIssue, type DataResolutionIssue, type DataResolutionOption, type DataResolutionOptionNegative, type DataResolutionOptionPositive, type DataResolutionParameters, type DataResourceDefinition, type DataResourceDefinitions, type DataResourceIssue, type DataResourceVariables, type DataSource, DataSourceClient, type DataSourceDeleteParameters, type DataSourceGetParameters, type DataSourceGetResponse, type DataSourcePutParameters, type DataSourceVariantData, type DataSourceVariantsKeys, type DataSourcesGetParameters, type DataSourcesGetResponse, type DataType, DataTypeClient, type DataTypeDeleteParameters, type DataTypeGetParameters, type DataTypeGetResponse, type DataTypePutParameters, type DataVariableDefinition, type DataWithProperties, type DeleteContentTypeOptions, type DeleteEntryOptions, type DismissPlaceholderMessage, type DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, type EdgehancersDiagnostics, type EdgehancersWholeResponseCacheDiagnostics, type EditorStateUpdatedMessage, EnhancerBuilder, type EnhancerContext, type EnhancerError, EntityReleasesClient, type EntityReleasesGetParameters, type EntityReleasesGetResponse, type EntriesGetParameters, type EntriesGetResponse, type EntriesHistoryGetParameters, type EntriesHistoryGetResponse, type EntriesResolvedListResponse, type Entry, type EntryData, type EntryFilters, type EntryList, type EvaluateCriteriaGroupOptions, type EvaluateNodeTreeVisibilityOptions, type EvaluateNodeVisibilityParameterOptions, type EvaluatePropertyCriteriaOptions, type EvaluateWalkTreePropertyCriteriaOptions, type Filters, type FindInNodeTreeReference, type FlattenProperty, type FlattenValues, type FlattenValuesOptions, type GetContentTypesOptions, type GetContentTypesResponse, type GetEffectivePropertyValueOptions, type GetEntriesOptions, type GetEntriesResponse, type GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_FORCED_SETTINGS_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, type InvalidationPayload, LOCALE_DYNAMIC_INPUT_NAME, type LimitPolicy, type LinkParamConfiguration, type LinkParamValue, type LinkParameterType, type LinkTypeConfiguration, type Locale, LocaleClient, type LocaleDeleteParameters, type LocalePutParameters, type LocalesGetParameters, type LocalesGetResponse, type LocalizeOptions, type MaxDepthExceededIssue, type MessageHandler, type MoveComponentMessage, type NodeLocationReference, type NonProjectMapLinkParamValue, type OpenParameterEditorMessage, type OverrideOptions, PLACEHOLDER_ID, type PatternIssue, PreviewClient, type PreviewPanelSettings, type PreviewUrl, type PreviewUrlDeleteParameters, type PreviewUrlDeleteResponse, type PreviewUrlPutParameters, type PreviewUrlPutResponse, type PreviewUrlsGetParameters, type PreviewUrlsGetResponse, type PreviewViewport, type PreviewViewportDeleteParameters, type PreviewViewportDeleteResponse, type PreviewViewportPutParameters, type PreviewViewportPutResponse, type PreviewViewportsGetParameters, type PreviewViewportsGetResponse, type ProjectMapLinkParamValue, type Prompt, PromptClient, type PromptsDeleteParameters, type PromptsGetParameters, type PromptsGetResponse, type PromptsPutParameters, type PropertyCriteriaMatch, type PropertyValue, type PutContentTypeBody, type PutEntryBody, type ReadyMessage, RelationshipClient, type RelationshipResultInstance, type Release, ReleaseClient, type ReleaseContent, ReleaseContentsClient, type ReleaseContentsDeleteBody, type ReleaseContentsGetParameters, type ReleaseContentsGetResponse, type ReleaseDeleteParameters, type ReleasePatchParameters, type ReleasePutParameters, type ReleaseState, type ReleasesGetParameters, type ReleasesGetResponse, type ReportRenderedCompositionsMessage, type RequestComponentSuggestionMessage, type ResolvedRouteGetResponse, type RichTextBuiltInElement, type RichTextBuiltInFormat, type RichTextParamConfiguration, type RichTextParamValue, type RootComponentInstance, type RootEntryReference, type RootLocationReference, RouteClient, type RouteDynamicInputs, type RouteGetParameters, type RouteGetResponse, type RouteGetResponseComposition, type RouteGetResponseEdgehancedComposition, type RouteGetResponseEdgehancedNotFound, type RouteGetResponseNotFound, type RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, type SelectComponentMessage, type SelectParameterMessage, type SpecificProjectMap, type StringOperators, type SuggestComponentMessage, type TreeNodeInfoTypes, type TriggerComponentActionMessage, type TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, type UpdateComponentParameterMessage, type UpdateComponentReferencesMessage, type UpdateCompositionInternalMessage, type UpdateCompositionMessage, type UpdateContextualEditingStateInternalMessage, type UpdateFeatureFlagsMessage, type UpdatePreviewSettingsMessage, type VisibilityCriteria, type VisibilityCriteriaEvaluationResult, type VisibilityCriteriaGroup, type VisibilityParameterValue, type VisibilityRule, type VisibilityRules, type WalkNodeTreeActions, type WalkNodeTreeOptions, WorkflowClient, type WorkflowDefinition, type WorkflowStage, type WorkflowStagePermission, type WorkflowStageTransition, type WorkflowStageTransitionPermission, type WorkflowsDeleteParameters, type WorkflowsGetParameters, type WorkflowsGetResponse, type WorkflowsPutParameters, bindExpressionEscapeChars, bindExpressionPrefix, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, convertToBindExpression, createBatchEnhancer, createCanvasChannel, createDynamicInputVisibilityRule, createDynamicTokenVisibilityRule, createLimitPolicy, createLocaleVisibilityRule, createQuirksVisibilityRule, createUniformApiEnhancer, createVariableReference, enhance, escapeBindExpressionDefaultValue, evaluateNodeVisibilityParameter, evaluatePropertyCriteria, evaluateVisibilityCriteriaGroup, evaluateWalkTreeNodeVisibility, evaluateWalkTreePropertyCriteria, extractLocales, findParameterInNodeTree, flattenValues, generateComponentPlaceholderId, generateHash, getBlockValue, getComponentJsonPointer, getComponentPath, getDataSourceVariantFromRouteGetParams, getEffectivePropertyValue, getLocalizedPropertyValues, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, hasReferencedVariables, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isContextStorageUpdatedMessage, isDismissPlaceholderMessage, isEntryData, isLinkParamValue, isMovingComponentMessage, isNestedNodeType, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRequestComponentSuggestionMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSuggestComponentMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseComponentPlaceholderId, parseVariableExpression, walkNodeTree, walkPropertyValues };
|
12833
|
+
export { ASSETS_SOURCE_CUSTOM_URL, ASSETS_SOURCE_UNIFORM, ASSET_PARAMETER_TYPE, ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, type AddComponentMessage, type AssetParamValue, type AssetParamValueItem, type BatchEnhancer, BatchEntry, type BatchInvalidationPayload, type BindVariablesOptions, type BindVariablesResult, type BindVariablesToObjectOptions, BlockFormatError, type BlockLocationReference, type BlockValue, CANVAS_BLOCK_PARAM_TYPE, CANVAS_CONTEXTUAL_EDITING_PARAM, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_SLOT_SECTION_SLOT, CANVAS_SLOT_SECTION_TYPE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CANVAS_VIZ_CONTROL_PARAM, CANVAS_VIZ_DI_RULE, CANVAS_VIZ_DYNAMIC_TOKEN_RULE, CANVAS_VIZ_LOCALE_RULE, CANVAS_VIZ_QUIRKS_RULE, CanvasClient, CanvasClientError, type CanvasDefinitions, type CategoriesDeleteParameters, type CategoriesGetParameters, type CategoriesGetResponse, type CategoriesPutParameters, type Category, CategoryClient, type Channel, type ChannelMessage, ChildEnhancerBuilder, type ComponentDefinition, type ComponentDefinitionDeleteParameters, type ComponentDefinitionGetParameters, type ComponentDefinitionGetResponse, type ComponentDefinitionParameter, type ComponentDefinitionPermission, type ComponentDefinitionPutParameters, type ComponentDefinitionSlot, type ComponentDefinitionSlugSettings, type ComponentDefinitionVariant, type ComponentEnhancer, type ComponentEnhancerFunction, type ComponentEnhancerOptions, type ComponentInstance, type ComponentInstanceContextualEditing, type ComponentInstanceHistoryEntry, type ComponentInstanceHistoryGetParameters, type ComponentInstanceHistoryGetResponse, type ComponentLocationReference, type ComponentOverridability, type ComponentOverride, type ComponentOverrides, type ComponentParameter, type ComponentParameterBlock, type ComponentParameterConditionalValue, type ComponentParameterContextualEditing, type ComponentParameterEnhancer, type ComponentParameterEnhancerFunction, type ComponentParameterEnhancerOptions, type CompositionDeleteParameters, type CompositionFilters, type CompositionGetByComponentIdParameters, type CompositionGetByIdParameters, type CompositionGetByNodeIdParameters, type CompositionGetByNodePathParameters, type CompositionGetBySlugParameters, type CompositionGetListResponse, type CompositionGetParameters, type CompositionGetResponse, type CompositionGetValidResponses, type CompositionPutParameters, type CompositionResolvedGetResponse, type CompositionResolvedListResponse, type CompositionUIStatus, ContentClient, type ContentType, type ContentTypeField, type ContextStorageUpdatedMessage, type ContextualEditingComponentReference, type ContextualEditingValue, type CopiedComponentSubtree, type DataDiagnostic, type DataElementBindingIssue, type DataElementConnectionDefinition, type DataElementConnectionFailureAction, type DataElementConnectionFailureLogLevel, type DataResolutionConfigIssue, type DataResolutionIssue, type DataResolutionOption, type DataResolutionOptionNegative, type DataResolutionOptionPositive, type DataResolutionParameters, type DataResourceDefinition, type DataResourceDefinitions, type DataResourceIssue, type DataResourceVariables, type DataSource, DataSourceClient, type DataSourceDeleteParameters, type DataSourceGetParameters, type DataSourceGetResponse, type DataSourcePutParameters, type DataSourceVariantData, type DataSourceVariantsKeys, type DataSourcesGetParameters, type DataSourcesGetResponse, type DataType, DataTypeClient, type DataTypeDeleteParameters, type DataTypeGetParameters, type DataTypeGetResponse, type DataTypePutParameters, type DataVariableDefinition, type DataWithProperties, type DeleteContentTypeOptions, type DeleteEntryOptions, type DismissPlaceholderMessage, type DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, type EdgehancersDiagnostics, type EdgehancersWholeResponseCacheDiagnostics, type EditorStateUpdatedMessage, EnhancerBuilder, type EnhancerContext, type EnhancerError, EntityReleasesClient, type EntityReleasesGetParameters, type EntityReleasesGetResponse, type EntriesGetParameters, type EntriesGetResponse, type EntriesHistoryGetParameters, type EntriesHistoryGetResponse, type EntriesResolvedListResponse, type Entry, type EntryData, type EntryFilters, type EntryList, type EvaluateCriteriaGroupOptions, type EvaluateNodeTreeVisibilityOptions, type EvaluateNodeVisibilityParameterOptions, type EvaluatePropertyCriteriaOptions, type EvaluateWalkTreePropertyCriteriaOptions, type Filters, type FindInNodeTreeReference, type FlattenProperty, type FlattenValues, type FlattenValuesOptions, type GetContentTypesOptions, type GetContentTypesResponse, type GetEntriesOptions, type GetEntriesResponse, type GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_FORCED_SETTINGS_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, type InvalidationPayload, LOCALE_DYNAMIC_INPUT_NAME, type LimitPolicy, type LinkParamConfiguration, type LinkParamValue, type LinkParameterType, type LinkTypeConfiguration, type Locale, LocaleClient, type LocaleDeleteParameters, type LocalePutParameters, type LocalesGetParameters, type LocalesGetResponse, type LocalizeOptions, type MaxDepthExceededIssue, type MessageHandler, type MoveComponentMessage, type NodeLocationReference, type NonProjectMapLinkParamValue, type OpenParameterEditorMessage, type OverrideOptions, PLACEHOLDER_ID, type PatternIssue, PreviewClient, type PreviewPanelSettings, type PreviewUrl, type PreviewUrlDeleteParameters, type PreviewUrlDeleteResponse, type PreviewUrlPutParameters, type PreviewUrlPutResponse, type PreviewUrlsGetParameters, type PreviewUrlsGetResponse, type PreviewViewport, type PreviewViewportDeleteParameters, type PreviewViewportDeleteResponse, type PreviewViewportPutParameters, type PreviewViewportPutResponse, type PreviewViewportsGetParameters, type PreviewViewportsGetResponse, type ProjectMapLinkParamValue, type Prompt, PromptClient, type PromptsDeleteParameters, type PromptsGetParameters, type PromptsGetResponse, type PromptsPutParameters, type PropertyCriteriaMatch, type PutContentTypeBody, type PutEntryBody, type ReadyMessage, RelationshipClient, type RelationshipResultInstance, type Release, ReleaseClient, type ReleaseContent, ReleaseContentsClient, type ReleaseContentsDeleteBody, type ReleaseContentsGetParameters, type ReleaseContentsGetResponse, type ReleaseDeleteParameters, type ReleasePatchParameters, type ReleasePutParameters, type ReleaseState, type ReleasesGetParameters, type ReleasesGetResponse, type ReportRenderedCompositionsMessage, type RequestComponentSuggestionMessage, type ResolvedRouteGetResponse, type RichTextBuiltInElement, type RichTextBuiltInFormat, type RichTextParamConfiguration, type RichTextParamValue, type RootComponentInstance, type RootEntryReference, type RootLocationReference, RouteClient, type RouteDynamicInputs, type RouteGetParameters, type RouteGetResponse, type RouteGetResponseComposition, type RouteGetResponseEdgehancedComposition, type RouteGetResponseEdgehancedNotFound, type RouteGetResponseNotFound, type RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, type SelectComponentMessage, type SelectParameterMessage, type SpecificProjectMap, type StringOperators, type SuggestComponentMessage, type TreeNodeInfoTypes, type TriggerComponentActionMessage, type TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, type UpdateComponentParameterMessage, type UpdateComponentReferencesMessage, type UpdateCompositionInternalMessage, type UpdateCompositionMessage, type UpdateContextualEditingStateInternalMessage, type UpdateFeatureFlagsMessage, type UpdatePreviewSettingsMessage, type VisibilityCriteria, type VisibilityCriteriaEvaluationResult, type VisibilityCriteriaGroup, type VisibilityParameterValue, type VisibilityRule, type VisibilityRules, type WalkNodeTreeActions, type WalkNodeTreeOptions, WorkflowClient, type WorkflowDefinition, type WorkflowStage, type WorkflowStagePermission, type WorkflowStageTransition, type WorkflowStageTransitionPermission, type WorkflowsDeleteParameters, type WorkflowsGetParameters, type WorkflowsGetResponse, type WorkflowsPutParameters, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createDynamicInputVisibilityRule, createDynamicTokenVisibilityRule, createLimitPolicy, createLocaleVisibilityRule, createQuirksVisibilityRule, createUniformApiEnhancer, createVariableReference, enhance, evaluateNodeVisibilityParameter, evaluatePropertyCriteria, evaluateVisibilityCriteriaGroup, evaluateWalkTreeNodeVisibility, evaluateWalkTreePropertyCriteria, extractLocales, findParameterInNodeTree, flattenValues, generateComponentPlaceholderId, generateHash, getBlockValue, getComponentJsonPointer, getComponentPath, getDataSourceVariantFromRouteGetParams, getLocalizedPropertyValues, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, hasReferencedVariables, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isContextStorageUpdatedMessage, isDismissPlaceholderMessage, isEntryData, isLinkParamValue, isMovingComponentMessage, isNestedNodeType, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRequestComponentSuggestionMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSuggestComponentMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseComponentPlaceholderId, parseVariableExpression, walkNodeTree };
|
package/dist/index.esm.js
CHANGED
@@ -805,9 +805,6 @@ var _ContentClient = class _ContentClient extends ApiClient3 {
|
|
805
805
|
}
|
806
806
|
async upsertContentType(body, opts = {}) {
|
807
807
|
const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
|
808
|
-
if (typeof body.contentType.slugSettings === "object" && body.contentType.slugSettings !== null && Object.keys(body.contentType.slugSettings).length === 0) {
|
809
|
-
delete body.contentType.slugSettings;
|
810
|
-
}
|
811
808
|
await this.apiClient(fetchUri, {
|
812
809
|
method: "PUT",
|
813
810
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
@@ -1858,101 +1855,6 @@ function findParameterInNodeTree(data, predicate) {
|
|
1858
1855
|
return results;
|
1859
1856
|
}
|
1860
1857
|
|
1861
|
-
// src/utils/variables/convertToBindExpression.ts
|
1862
|
-
var bindExpressionPrefix = "#";
|
1863
|
-
var bindExpressionEscapeChars = /* @__PURE__ */ new Set(["#", "\\", "[", "]", ":"]);
|
1864
|
-
function convertToBindExpression(binding) {
|
1865
|
-
if (binding.syntax === "jptr") {
|
1866
|
-
const expressionComponents = [
|
1867
|
-
`${bindExpressionPrefix}${binding.syntax}:${escapeNestedVariableExpressions(
|
1868
|
-
escapeBindExpressionReservedChars(binding.pointer)
|
1869
|
-
)}`
|
1870
|
-
];
|
1871
|
-
if (binding.failureAction && binding.failureAction !== "t") {
|
1872
|
-
expressionComponents.push(`fa=${binding.failureAction}`);
|
1873
|
-
}
|
1874
|
-
if (binding.failureLogLevel && binding.failureLogLevel !== "w") {
|
1875
|
-
expressionComponents.push(`fl=${binding.failureLogLevel}`);
|
1876
|
-
}
|
1877
|
-
if (binding.failureDefault) {
|
1878
|
-
expressionComponents.push(`fd=${escapeBindExpressionDefaultValue(binding.failureDefault)}`);
|
1879
|
-
}
|
1880
|
-
return expressionComponents.join(":");
|
1881
|
-
}
|
1882
|
-
throw new Error(`Unsupported dynamic token binding syntax '${binding.syntax}'`);
|
1883
|
-
}
|
1884
|
-
function escapeNestedVariableExpressions(pointer) {
|
1885
|
-
return pointer.replace(/\$\{([^}]+)\}/g, "$[$1]");
|
1886
|
-
}
|
1887
|
-
function escapeBindExpressionReservedChars(pointer) {
|
1888
|
-
return pointer.split("").map((c) => bindExpressionEscapeChars.has(c) ? `\\${c === ":" ? ";" : c}` : c).join("");
|
1889
|
-
}
|
1890
|
-
function escapeBindExpressionDefaultValue(defaultValue) {
|
1891
|
-
return escapeBindExpressionReservedChars(defaultValue).replace("=", "\\+");
|
1892
|
-
}
|
1893
|
-
|
1894
|
-
// src/utils/variables/createVariableReference.ts
|
1895
|
-
function createVariableReference(variableName) {
|
1896
|
-
return `\${${variableName.replace(/([${}])/g, "\\$1")}}`;
|
1897
|
-
}
|
1898
|
-
|
1899
|
-
// src/enhancement/getEffectivePropertyValue.ts
|
1900
|
-
function getEffectivePropertyValue({
|
1901
|
-
property,
|
1902
|
-
conditionIndex,
|
1903
|
-
locale,
|
1904
|
-
strict,
|
1905
|
-
greedyLocaleMatching
|
1906
|
-
}) {
|
1907
|
-
var _a, _b, _c, _d;
|
1908
|
-
if (!property) {
|
1909
|
-
return void 0;
|
1910
|
-
}
|
1911
|
-
let effectiveValue = property.value;
|
1912
|
-
if (conditionIndex >= 0) {
|
1913
|
-
const conditionalValue = (_b = (_a = property.conditions) == null ? void 0 : _a[conditionIndex]) == null ? void 0 : _b.value;
|
1914
|
-
if (conditionalValue === null) {
|
1915
|
-
return void 0;
|
1916
|
-
}
|
1917
|
-
if (conditionalValue !== void 0 || strict) {
|
1918
|
-
effectiveValue = conditionalValue;
|
1919
|
-
}
|
1920
|
-
}
|
1921
|
-
if (locale) {
|
1922
|
-
const localeValue = getLocaleMatch(property.locales, locale, greedyLocaleMatching);
|
1923
|
-
if (localeValue !== void 0 || strict) {
|
1924
|
-
effectiveValue = localeValue;
|
1925
|
-
}
|
1926
|
-
if (conditionIndex >= 0) {
|
1927
|
-
const localeConditionalValue = (_d = (_c = getLocaleMatch(
|
1928
|
-
property.localesConditions,
|
1929
|
-
locale,
|
1930
|
-
greedyLocaleMatching
|
1931
|
-
)) == null ? void 0 : _c[conditionIndex]) == null ? void 0 : _d.value;
|
1932
|
-
if (localeConditionalValue === null) {
|
1933
|
-
return void 0;
|
1934
|
-
}
|
1935
|
-
if (localeConditionalValue !== void 0 || strict) {
|
1936
|
-
effectiveValue = localeConditionalValue;
|
1937
|
-
}
|
1938
|
-
}
|
1939
|
-
}
|
1940
|
-
if (property.connectedData) {
|
1941
|
-
effectiveValue = createVariableReference(convertToBindExpression(property.connectedData));
|
1942
|
-
}
|
1943
|
-
return effectiveValue;
|
1944
|
-
}
|
1945
|
-
function getLocaleMatch(index, locale, greedy) {
|
1946
|
-
if (!index) {
|
1947
|
-
return void 0;
|
1948
|
-
}
|
1949
|
-
const match = index[locale];
|
1950
|
-
if (match === void 0 && greedy) {
|
1951
|
-
return Object.values(index)[0];
|
1952
|
-
}
|
1953
|
-
return match;
|
1954
|
-
}
|
1955
|
-
|
1956
1858
|
// src/enhancement/visibility/evaluateVisibilityCriteriaGroup.ts
|
1957
1859
|
function evaluateVisibilityCriteriaGroup(options) {
|
1958
1860
|
const { criteriaGroup, simplifyCriteria } = options;
|
@@ -2454,33 +2356,6 @@ var UniqueBatchEntries = class {
|
|
2454
2356
|
}
|
2455
2357
|
};
|
2456
2358
|
|
2457
|
-
// src/enhancement/walkPropertyValues.ts
|
2458
|
-
function walkPropertyValues(property, visitor) {
|
2459
|
-
var _a, _b;
|
2460
|
-
const definedLocales = /* @__PURE__ */ new Set([
|
2461
|
-
...Object.keys((_a = property.locales) != null ? _a : {}),
|
2462
|
-
...Object.keys((_b = property.localesConditions) != null ? _b : {})
|
2463
|
-
]);
|
2464
|
-
const propertyLocales = [void 0, ...definedLocales];
|
2465
|
-
propertyLocales.forEach((locale) => {
|
2466
|
-
var _a2, _b2;
|
2467
|
-
const conditionalValues = (_b2 = locale === void 0 ? property.conditions : (_a2 = property.localesConditions) == null ? void 0 : _a2[locale]) != null ? _b2 : [];
|
2468
|
-
for (let conditionIndex = conditionalValues.length - 1; conditionIndex >= -1; conditionIndex--) {
|
2469
|
-
const value = getEffectivePropertyValue({
|
2470
|
-
property,
|
2471
|
-
locale,
|
2472
|
-
conditionIndex,
|
2473
|
-
strict: true
|
2474
|
-
});
|
2475
|
-
visitor({
|
2476
|
-
locale,
|
2477
|
-
conditionIndex,
|
2478
|
-
value
|
2479
|
-
});
|
2480
|
-
}
|
2481
|
-
});
|
2482
|
-
}
|
2483
|
-
|
2484
2359
|
// src/EntityReleasesClient.ts
|
2485
2360
|
import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
|
2486
2361
|
var releaseContentsUrl = "/api/v1/entity-releases";
|
@@ -3264,6 +3139,13 @@ function bindVariables({
|
|
3264
3139
|
|
3265
3140
|
// src/utils/variables/bindVariablesToObject.ts
|
3266
3141
|
import { isDraft, produce } from "immer";
|
3142
|
+
|
3143
|
+
// src/utils/variables/createVariableReference.ts
|
3144
|
+
function createVariableReference(variableName) {
|
3145
|
+
return `\${${variableName.replace(/([${}])/g, "\\$1")}}`;
|
3146
|
+
}
|
3147
|
+
|
3148
|
+
// src/utils/variables/bindVariablesToObject.ts
|
3267
3149
|
function bindVariablesToObject(options) {
|
3268
3150
|
return bindVariablesToObjectRecursive(options);
|
3269
3151
|
}
|
@@ -3455,13 +3337,10 @@ export {
|
|
3455
3337
|
UncachedContentClient,
|
3456
3338
|
UniqueBatchEntries,
|
3457
3339
|
WorkflowClient,
|
3458
|
-
bindExpressionEscapeChars,
|
3459
|
-
bindExpressionPrefix,
|
3460
3340
|
bindVariables,
|
3461
3341
|
bindVariablesToObject,
|
3462
3342
|
compose,
|
3463
3343
|
convertEntryToPutEntry,
|
3464
|
-
convertToBindExpression,
|
3465
3344
|
createBatchEnhancer,
|
3466
3345
|
createCanvasChannel,
|
3467
3346
|
createDynamicInputVisibilityRule,
|
@@ -3472,7 +3351,6 @@ export {
|
|
3472
3351
|
createUniformApiEnhancer,
|
3473
3352
|
createVariableReference,
|
3474
3353
|
enhance,
|
3475
|
-
escapeBindExpressionDefaultValue,
|
3476
3354
|
evaluateNodeVisibilityParameter,
|
3477
3355
|
evaluatePropertyCriteria,
|
3478
3356
|
evaluateVisibilityCriteriaGroup,
|
@@ -3487,7 +3365,6 @@ export {
|
|
3487
3365
|
getComponentJsonPointer,
|
3488
3366
|
getComponentPath,
|
3489
3367
|
getDataSourceVariantFromRouteGetParams,
|
3490
|
-
getEffectivePropertyValue,
|
3491
3368
|
getLocalizedPropertyValues,
|
3492
3369
|
getNounForLocation,
|
3493
3370
|
getNounForNode,
|
@@ -3529,6 +3406,5 @@ export {
|
|
3529
3406
|
nullLimitPolicy,
|
3530
3407
|
parseComponentPlaceholderId,
|
3531
3408
|
parseVariableExpression,
|
3532
|
-
walkNodeTree
|
3533
|
-
walkPropertyValues
|
3409
|
+
walkNodeTree
|
3534
3410
|
};
|
package/dist/index.js
CHANGED
@@ -460,13 +460,10 @@ __export(src_exports, {
|
|
460
460
|
UncachedContentClient: () => UncachedContentClient,
|
461
461
|
UniqueBatchEntries: () => UniqueBatchEntries,
|
462
462
|
WorkflowClient: () => WorkflowClient,
|
463
|
-
bindExpressionEscapeChars: () => bindExpressionEscapeChars,
|
464
|
-
bindExpressionPrefix: () => bindExpressionPrefix,
|
465
463
|
bindVariables: () => bindVariables,
|
466
464
|
bindVariablesToObject: () => bindVariablesToObject,
|
467
465
|
compose: () => compose,
|
468
466
|
convertEntryToPutEntry: () => convertEntryToPutEntry,
|
469
|
-
convertToBindExpression: () => convertToBindExpression,
|
470
467
|
createBatchEnhancer: () => createBatchEnhancer,
|
471
468
|
createCanvasChannel: () => createCanvasChannel,
|
472
469
|
createDynamicInputVisibilityRule: () => createDynamicInputVisibilityRule,
|
@@ -477,7 +474,6 @@ __export(src_exports, {
|
|
477
474
|
createUniformApiEnhancer: () => createUniformApiEnhancer,
|
478
475
|
createVariableReference: () => createVariableReference,
|
479
476
|
enhance: () => enhance,
|
480
|
-
escapeBindExpressionDefaultValue: () => escapeBindExpressionDefaultValue,
|
481
477
|
evaluateNodeVisibilityParameter: () => evaluateNodeVisibilityParameter,
|
482
478
|
evaluatePropertyCriteria: () => evaluatePropertyCriteria,
|
483
479
|
evaluateVisibilityCriteriaGroup: () => evaluateVisibilityCriteriaGroup,
|
@@ -492,7 +488,6 @@ __export(src_exports, {
|
|
492
488
|
getComponentJsonPointer: () => getComponentJsonPointer,
|
493
489
|
getComponentPath: () => getComponentPath,
|
494
490
|
getDataSourceVariantFromRouteGetParams: () => getDataSourceVariantFromRouteGetParams,
|
495
|
-
getEffectivePropertyValue: () => getEffectivePropertyValue,
|
496
491
|
getLocalizedPropertyValues: () => getLocalizedPropertyValues,
|
497
492
|
getNounForLocation: () => getNounForLocation,
|
498
493
|
getNounForNode: () => getNounForNode,
|
@@ -534,8 +529,7 @@ __export(src_exports, {
|
|
534
529
|
nullLimitPolicy: () => nullLimitPolicy,
|
535
530
|
parseComponentPlaceholderId: () => parseComponentPlaceholderId,
|
536
531
|
parseVariableExpression: () => parseVariableExpression,
|
537
|
-
walkNodeTree: () => walkNodeTree
|
538
|
-
walkPropertyValues: () => walkPropertyValues
|
532
|
+
walkNodeTree: () => walkNodeTree
|
539
533
|
});
|
540
534
|
module.exports = __toCommonJS(src_exports);
|
541
535
|
|
@@ -965,9 +959,6 @@ var _ContentClient = class _ContentClient extends import_api4.ApiClient {
|
|
965
959
|
}
|
966
960
|
async upsertContentType(body, opts = {}) {
|
967
961
|
const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
|
968
|
-
if (typeof body.contentType.slugSettings === "object" && body.contentType.slugSettings !== null && Object.keys(body.contentType.slugSettings).length === 0) {
|
969
|
-
delete body.contentType.slugSettings;
|
970
|
-
}
|
971
962
|
await this.apiClient(fetchUri, {
|
972
963
|
method: "PUT",
|
973
964
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
@@ -2018,101 +2009,6 @@ function findParameterInNodeTree(data, predicate) {
|
|
2018
2009
|
return results;
|
2019
2010
|
}
|
2020
2011
|
|
2021
|
-
// src/utils/variables/convertToBindExpression.ts
|
2022
|
-
var bindExpressionPrefix = "#";
|
2023
|
-
var bindExpressionEscapeChars = /* @__PURE__ */ new Set(["#", "\\", "[", "]", ":"]);
|
2024
|
-
function convertToBindExpression(binding) {
|
2025
|
-
if (binding.syntax === "jptr") {
|
2026
|
-
const expressionComponents = [
|
2027
|
-
`${bindExpressionPrefix}${binding.syntax}:${escapeNestedVariableExpressions(
|
2028
|
-
escapeBindExpressionReservedChars(binding.pointer)
|
2029
|
-
)}`
|
2030
|
-
];
|
2031
|
-
if (binding.failureAction && binding.failureAction !== "t") {
|
2032
|
-
expressionComponents.push(`fa=${binding.failureAction}`);
|
2033
|
-
}
|
2034
|
-
if (binding.failureLogLevel && binding.failureLogLevel !== "w") {
|
2035
|
-
expressionComponents.push(`fl=${binding.failureLogLevel}`);
|
2036
|
-
}
|
2037
|
-
if (binding.failureDefault) {
|
2038
|
-
expressionComponents.push(`fd=${escapeBindExpressionDefaultValue(binding.failureDefault)}`);
|
2039
|
-
}
|
2040
|
-
return expressionComponents.join(":");
|
2041
|
-
}
|
2042
|
-
throw new Error(`Unsupported dynamic token binding syntax '${binding.syntax}'`);
|
2043
|
-
}
|
2044
|
-
function escapeNestedVariableExpressions(pointer) {
|
2045
|
-
return pointer.replace(/\$\{([^}]+)\}/g, "$[$1]");
|
2046
|
-
}
|
2047
|
-
function escapeBindExpressionReservedChars(pointer) {
|
2048
|
-
return pointer.split("").map((c) => bindExpressionEscapeChars.has(c) ? `\\${c === ":" ? ";" : c}` : c).join("");
|
2049
|
-
}
|
2050
|
-
function escapeBindExpressionDefaultValue(defaultValue) {
|
2051
|
-
return escapeBindExpressionReservedChars(defaultValue).replace("=", "\\+");
|
2052
|
-
}
|
2053
|
-
|
2054
|
-
// src/utils/variables/createVariableReference.ts
|
2055
|
-
function createVariableReference(variableName) {
|
2056
|
-
return `\${${variableName.replace(/([${}])/g, "\\$1")}}`;
|
2057
|
-
}
|
2058
|
-
|
2059
|
-
// src/enhancement/getEffectivePropertyValue.ts
|
2060
|
-
function getEffectivePropertyValue({
|
2061
|
-
property,
|
2062
|
-
conditionIndex,
|
2063
|
-
locale,
|
2064
|
-
strict,
|
2065
|
-
greedyLocaleMatching
|
2066
|
-
}) {
|
2067
|
-
var _a, _b, _c, _d;
|
2068
|
-
if (!property) {
|
2069
|
-
return void 0;
|
2070
|
-
}
|
2071
|
-
let effectiveValue = property.value;
|
2072
|
-
if (conditionIndex >= 0) {
|
2073
|
-
const conditionalValue = (_b = (_a = property.conditions) == null ? void 0 : _a[conditionIndex]) == null ? void 0 : _b.value;
|
2074
|
-
if (conditionalValue === null) {
|
2075
|
-
return void 0;
|
2076
|
-
}
|
2077
|
-
if (conditionalValue !== void 0 || strict) {
|
2078
|
-
effectiveValue = conditionalValue;
|
2079
|
-
}
|
2080
|
-
}
|
2081
|
-
if (locale) {
|
2082
|
-
const localeValue = getLocaleMatch(property.locales, locale, greedyLocaleMatching);
|
2083
|
-
if (localeValue !== void 0 || strict) {
|
2084
|
-
effectiveValue = localeValue;
|
2085
|
-
}
|
2086
|
-
if (conditionIndex >= 0) {
|
2087
|
-
const localeConditionalValue = (_d = (_c = getLocaleMatch(
|
2088
|
-
property.localesConditions,
|
2089
|
-
locale,
|
2090
|
-
greedyLocaleMatching
|
2091
|
-
)) == null ? void 0 : _c[conditionIndex]) == null ? void 0 : _d.value;
|
2092
|
-
if (localeConditionalValue === null) {
|
2093
|
-
return void 0;
|
2094
|
-
}
|
2095
|
-
if (localeConditionalValue !== void 0 || strict) {
|
2096
|
-
effectiveValue = localeConditionalValue;
|
2097
|
-
}
|
2098
|
-
}
|
2099
|
-
}
|
2100
|
-
if (property.connectedData) {
|
2101
|
-
effectiveValue = createVariableReference(convertToBindExpression(property.connectedData));
|
2102
|
-
}
|
2103
|
-
return effectiveValue;
|
2104
|
-
}
|
2105
|
-
function getLocaleMatch(index, locale, greedy) {
|
2106
|
-
if (!index) {
|
2107
|
-
return void 0;
|
2108
|
-
}
|
2109
|
-
const match = index[locale];
|
2110
|
-
if (match === void 0 && greedy) {
|
2111
|
-
return Object.values(index)[0];
|
2112
|
-
}
|
2113
|
-
return match;
|
2114
|
-
}
|
2115
|
-
|
2116
2012
|
// src/enhancement/visibility/evaluateVisibilityCriteriaGroup.ts
|
2117
2013
|
function evaluateVisibilityCriteriaGroup(options) {
|
2118
2014
|
const { criteriaGroup, simplifyCriteria } = options;
|
@@ -2614,33 +2510,6 @@ var UniqueBatchEntries = class {
|
|
2614
2510
|
}
|
2615
2511
|
};
|
2616
2512
|
|
2617
|
-
// src/enhancement/walkPropertyValues.ts
|
2618
|
-
function walkPropertyValues(property, visitor) {
|
2619
|
-
var _a, _b;
|
2620
|
-
const definedLocales = /* @__PURE__ */ new Set([
|
2621
|
-
...Object.keys((_a = property.locales) != null ? _a : {}),
|
2622
|
-
...Object.keys((_b = property.localesConditions) != null ? _b : {})
|
2623
|
-
]);
|
2624
|
-
const propertyLocales = [void 0, ...definedLocales];
|
2625
|
-
propertyLocales.forEach((locale) => {
|
2626
|
-
var _a2, _b2;
|
2627
|
-
const conditionalValues = (_b2 = locale === void 0 ? property.conditions : (_a2 = property.localesConditions) == null ? void 0 : _a2[locale]) != null ? _b2 : [];
|
2628
|
-
for (let conditionIndex = conditionalValues.length - 1; conditionIndex >= -1; conditionIndex--) {
|
2629
|
-
const value = getEffectivePropertyValue({
|
2630
|
-
property,
|
2631
|
-
locale,
|
2632
|
-
conditionIndex,
|
2633
|
-
strict: true
|
2634
|
-
});
|
2635
|
-
visitor({
|
2636
|
-
locale,
|
2637
|
-
conditionIndex,
|
2638
|
-
value
|
2639
|
-
});
|
2640
|
-
}
|
2641
|
-
});
|
2642
|
-
}
|
2643
|
-
|
2644
2513
|
// src/EntityReleasesClient.ts
|
2645
2514
|
var import_api7 = require("@uniformdev/context/api");
|
2646
2515
|
var releaseContentsUrl = "/api/v1/entity-releases";
|
@@ -3424,6 +3293,13 @@ function bindVariables({
|
|
3424
3293
|
|
3425
3294
|
// src/utils/variables/bindVariablesToObject.ts
|
3426
3295
|
var import_immer = require("immer");
|
3296
|
+
|
3297
|
+
// src/utils/variables/createVariableReference.ts
|
3298
|
+
function createVariableReference(variableName) {
|
3299
|
+
return `\${${variableName.replace(/([${}])/g, "\\$1")}}`;
|
3300
|
+
}
|
3301
|
+
|
3302
|
+
// src/utils/variables/bindVariablesToObject.ts
|
3427
3303
|
function bindVariablesToObject(options) {
|
3428
3304
|
return bindVariablesToObjectRecursive(options);
|
3429
3305
|
}
|
@@ -3616,13 +3492,10 @@ var CanvasClientError = import_api16.ApiClientError;
|
|
3616
3492
|
UncachedContentClient,
|
3617
3493
|
UniqueBatchEntries,
|
3618
3494
|
WorkflowClient,
|
3619
|
-
bindExpressionEscapeChars,
|
3620
|
-
bindExpressionPrefix,
|
3621
3495
|
bindVariables,
|
3622
3496
|
bindVariablesToObject,
|
3623
3497
|
compose,
|
3624
3498
|
convertEntryToPutEntry,
|
3625
|
-
convertToBindExpression,
|
3626
3499
|
createBatchEnhancer,
|
3627
3500
|
createCanvasChannel,
|
3628
3501
|
createDynamicInputVisibilityRule,
|
@@ -3633,7 +3506,6 @@ var CanvasClientError = import_api16.ApiClientError;
|
|
3633
3506
|
createUniformApiEnhancer,
|
3634
3507
|
createVariableReference,
|
3635
3508
|
enhance,
|
3636
|
-
escapeBindExpressionDefaultValue,
|
3637
3509
|
evaluateNodeVisibilityParameter,
|
3638
3510
|
evaluatePropertyCriteria,
|
3639
3511
|
evaluateVisibilityCriteriaGroup,
|
@@ -3648,7 +3520,6 @@ var CanvasClientError = import_api16.ApiClientError;
|
|
3648
3520
|
getComponentJsonPointer,
|
3649
3521
|
getComponentPath,
|
3650
3522
|
getDataSourceVariantFromRouteGetParams,
|
3651
|
-
getEffectivePropertyValue,
|
3652
3523
|
getLocalizedPropertyValues,
|
3653
3524
|
getNounForLocation,
|
3654
3525
|
getNounForNode,
|
@@ -3690,6 +3561,5 @@ var CanvasClientError = import_api16.ApiClientError;
|
|
3690
3561
|
nullLimitPolicy,
|
3691
3562
|
parseComponentPlaceholderId,
|
3692
3563
|
parseVariableExpression,
|
3693
|
-
walkNodeTree
|
3694
|
-
walkPropertyValues
|
3564
|
+
walkNodeTree
|
3695
3565
|
});
|
package/dist/index.mjs
CHANGED
@@ -805,9 +805,6 @@ var _ContentClient = class _ContentClient extends ApiClient3 {
|
|
805
805
|
}
|
806
806
|
async upsertContentType(body, opts = {}) {
|
807
807
|
const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
|
808
|
-
if (typeof body.contentType.slugSettings === "object" && body.contentType.slugSettings !== null && Object.keys(body.contentType.slugSettings).length === 0) {
|
809
|
-
delete body.contentType.slugSettings;
|
810
|
-
}
|
811
808
|
await this.apiClient(fetchUri, {
|
812
809
|
method: "PUT",
|
813
810
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
@@ -1858,101 +1855,6 @@ function findParameterInNodeTree(data, predicate) {
|
|
1858
1855
|
return results;
|
1859
1856
|
}
|
1860
1857
|
|
1861
|
-
// src/utils/variables/convertToBindExpression.ts
|
1862
|
-
var bindExpressionPrefix = "#";
|
1863
|
-
var bindExpressionEscapeChars = /* @__PURE__ */ new Set(["#", "\\", "[", "]", ":"]);
|
1864
|
-
function convertToBindExpression(binding) {
|
1865
|
-
if (binding.syntax === "jptr") {
|
1866
|
-
const expressionComponents = [
|
1867
|
-
`${bindExpressionPrefix}${binding.syntax}:${escapeNestedVariableExpressions(
|
1868
|
-
escapeBindExpressionReservedChars(binding.pointer)
|
1869
|
-
)}`
|
1870
|
-
];
|
1871
|
-
if (binding.failureAction && binding.failureAction !== "t") {
|
1872
|
-
expressionComponents.push(`fa=${binding.failureAction}`);
|
1873
|
-
}
|
1874
|
-
if (binding.failureLogLevel && binding.failureLogLevel !== "w") {
|
1875
|
-
expressionComponents.push(`fl=${binding.failureLogLevel}`);
|
1876
|
-
}
|
1877
|
-
if (binding.failureDefault) {
|
1878
|
-
expressionComponents.push(`fd=${escapeBindExpressionDefaultValue(binding.failureDefault)}`);
|
1879
|
-
}
|
1880
|
-
return expressionComponents.join(":");
|
1881
|
-
}
|
1882
|
-
throw new Error(`Unsupported dynamic token binding syntax '${binding.syntax}'`);
|
1883
|
-
}
|
1884
|
-
function escapeNestedVariableExpressions(pointer) {
|
1885
|
-
return pointer.replace(/\$\{([^}]+)\}/g, "$[$1]");
|
1886
|
-
}
|
1887
|
-
function escapeBindExpressionReservedChars(pointer) {
|
1888
|
-
return pointer.split("").map((c) => bindExpressionEscapeChars.has(c) ? `\\${c === ":" ? ";" : c}` : c).join("");
|
1889
|
-
}
|
1890
|
-
function escapeBindExpressionDefaultValue(defaultValue) {
|
1891
|
-
return escapeBindExpressionReservedChars(defaultValue).replace("=", "\\+");
|
1892
|
-
}
|
1893
|
-
|
1894
|
-
// src/utils/variables/createVariableReference.ts
|
1895
|
-
function createVariableReference(variableName) {
|
1896
|
-
return `\${${variableName.replace(/([${}])/g, "\\$1")}}`;
|
1897
|
-
}
|
1898
|
-
|
1899
|
-
// src/enhancement/getEffectivePropertyValue.ts
|
1900
|
-
function getEffectivePropertyValue({
|
1901
|
-
property,
|
1902
|
-
conditionIndex,
|
1903
|
-
locale,
|
1904
|
-
strict,
|
1905
|
-
greedyLocaleMatching
|
1906
|
-
}) {
|
1907
|
-
var _a, _b, _c, _d;
|
1908
|
-
if (!property) {
|
1909
|
-
return void 0;
|
1910
|
-
}
|
1911
|
-
let effectiveValue = property.value;
|
1912
|
-
if (conditionIndex >= 0) {
|
1913
|
-
const conditionalValue = (_b = (_a = property.conditions) == null ? void 0 : _a[conditionIndex]) == null ? void 0 : _b.value;
|
1914
|
-
if (conditionalValue === null) {
|
1915
|
-
return void 0;
|
1916
|
-
}
|
1917
|
-
if (conditionalValue !== void 0 || strict) {
|
1918
|
-
effectiveValue = conditionalValue;
|
1919
|
-
}
|
1920
|
-
}
|
1921
|
-
if (locale) {
|
1922
|
-
const localeValue = getLocaleMatch(property.locales, locale, greedyLocaleMatching);
|
1923
|
-
if (localeValue !== void 0 || strict) {
|
1924
|
-
effectiveValue = localeValue;
|
1925
|
-
}
|
1926
|
-
if (conditionIndex >= 0) {
|
1927
|
-
const localeConditionalValue = (_d = (_c = getLocaleMatch(
|
1928
|
-
property.localesConditions,
|
1929
|
-
locale,
|
1930
|
-
greedyLocaleMatching
|
1931
|
-
)) == null ? void 0 : _c[conditionIndex]) == null ? void 0 : _d.value;
|
1932
|
-
if (localeConditionalValue === null) {
|
1933
|
-
return void 0;
|
1934
|
-
}
|
1935
|
-
if (localeConditionalValue !== void 0 || strict) {
|
1936
|
-
effectiveValue = localeConditionalValue;
|
1937
|
-
}
|
1938
|
-
}
|
1939
|
-
}
|
1940
|
-
if (property.connectedData) {
|
1941
|
-
effectiveValue = createVariableReference(convertToBindExpression(property.connectedData));
|
1942
|
-
}
|
1943
|
-
return effectiveValue;
|
1944
|
-
}
|
1945
|
-
function getLocaleMatch(index, locale, greedy) {
|
1946
|
-
if (!index) {
|
1947
|
-
return void 0;
|
1948
|
-
}
|
1949
|
-
const match = index[locale];
|
1950
|
-
if (match === void 0 && greedy) {
|
1951
|
-
return Object.values(index)[0];
|
1952
|
-
}
|
1953
|
-
return match;
|
1954
|
-
}
|
1955
|
-
|
1956
1858
|
// src/enhancement/visibility/evaluateVisibilityCriteriaGroup.ts
|
1957
1859
|
function evaluateVisibilityCriteriaGroup(options) {
|
1958
1860
|
const { criteriaGroup, simplifyCriteria } = options;
|
@@ -2454,33 +2356,6 @@ var UniqueBatchEntries = class {
|
|
2454
2356
|
}
|
2455
2357
|
};
|
2456
2358
|
|
2457
|
-
// src/enhancement/walkPropertyValues.ts
|
2458
|
-
function walkPropertyValues(property, visitor) {
|
2459
|
-
var _a, _b;
|
2460
|
-
const definedLocales = /* @__PURE__ */ new Set([
|
2461
|
-
...Object.keys((_a = property.locales) != null ? _a : {}),
|
2462
|
-
...Object.keys((_b = property.localesConditions) != null ? _b : {})
|
2463
|
-
]);
|
2464
|
-
const propertyLocales = [void 0, ...definedLocales];
|
2465
|
-
propertyLocales.forEach((locale) => {
|
2466
|
-
var _a2, _b2;
|
2467
|
-
const conditionalValues = (_b2 = locale === void 0 ? property.conditions : (_a2 = property.localesConditions) == null ? void 0 : _a2[locale]) != null ? _b2 : [];
|
2468
|
-
for (let conditionIndex = conditionalValues.length - 1; conditionIndex >= -1; conditionIndex--) {
|
2469
|
-
const value = getEffectivePropertyValue({
|
2470
|
-
property,
|
2471
|
-
locale,
|
2472
|
-
conditionIndex,
|
2473
|
-
strict: true
|
2474
|
-
});
|
2475
|
-
visitor({
|
2476
|
-
locale,
|
2477
|
-
conditionIndex,
|
2478
|
-
value
|
2479
|
-
});
|
2480
|
-
}
|
2481
|
-
});
|
2482
|
-
}
|
2483
|
-
|
2484
2359
|
// src/EntityReleasesClient.ts
|
2485
2360
|
import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
|
2486
2361
|
var releaseContentsUrl = "/api/v1/entity-releases";
|
@@ -3264,6 +3139,13 @@ function bindVariables({
|
|
3264
3139
|
|
3265
3140
|
// src/utils/variables/bindVariablesToObject.ts
|
3266
3141
|
import { isDraft, produce } from "immer";
|
3142
|
+
|
3143
|
+
// src/utils/variables/createVariableReference.ts
|
3144
|
+
function createVariableReference(variableName) {
|
3145
|
+
return `\${${variableName.replace(/([${}])/g, "\\$1")}}`;
|
3146
|
+
}
|
3147
|
+
|
3148
|
+
// src/utils/variables/bindVariablesToObject.ts
|
3267
3149
|
function bindVariablesToObject(options) {
|
3268
3150
|
return bindVariablesToObjectRecursive(options);
|
3269
3151
|
}
|
@@ -3455,13 +3337,10 @@ export {
|
|
3455
3337
|
UncachedContentClient,
|
3456
3338
|
UniqueBatchEntries,
|
3457
3339
|
WorkflowClient,
|
3458
|
-
bindExpressionEscapeChars,
|
3459
|
-
bindExpressionPrefix,
|
3460
3340
|
bindVariables,
|
3461
3341
|
bindVariablesToObject,
|
3462
3342
|
compose,
|
3463
3343
|
convertEntryToPutEntry,
|
3464
|
-
convertToBindExpression,
|
3465
3344
|
createBatchEnhancer,
|
3466
3345
|
createCanvasChannel,
|
3467
3346
|
createDynamicInputVisibilityRule,
|
@@ -3472,7 +3351,6 @@ export {
|
|
3472
3351
|
createUniformApiEnhancer,
|
3473
3352
|
createVariableReference,
|
3474
3353
|
enhance,
|
3475
|
-
escapeBindExpressionDefaultValue,
|
3476
3354
|
evaluateNodeVisibilityParameter,
|
3477
3355
|
evaluatePropertyCriteria,
|
3478
3356
|
evaluateVisibilityCriteriaGroup,
|
@@ -3487,7 +3365,6 @@ export {
|
|
3487
3365
|
getComponentJsonPointer,
|
3488
3366
|
getComponentPath,
|
3489
3367
|
getDataSourceVariantFromRouteGetParams,
|
3490
|
-
getEffectivePropertyValue,
|
3491
3368
|
getLocalizedPropertyValues,
|
3492
3369
|
getNounForLocation,
|
3493
3370
|
getNounForNode,
|
@@ -3529,6 +3406,5 @@ export {
|
|
3529
3406
|
nullLimitPolicy,
|
3530
3407
|
parseComponentPlaceholderId,
|
3531
3408
|
parseVariableExpression,
|
3532
|
-
walkNodeTree
|
3533
|
-
walkPropertyValues
|
3409
|
+
walkNodeTree
|
3534
3410
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/canvas",
|
3
|
-
"version": "
|
3
|
+
"version": "20.1.0",
|
4
4
|
"description": "Common functionality and types for Uniform Canvas",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
6
6
|
"main": "./dist/index.js",
|
@@ -38,9 +38,9 @@
|
|
38
38
|
"p-throttle": "5.0.0"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
|
-
"@uniformdev/assets": "
|
42
|
-
"@uniformdev/context": "
|
43
|
-
"@uniformdev/richtext": "
|
41
|
+
"@uniformdev/assets": "20.1.0",
|
42
|
+
"@uniformdev/context": "20.1.0",
|
43
|
+
"@uniformdev/richtext": "20.1.0",
|
44
44
|
"immer": "10.1.1"
|
45
45
|
},
|
46
46
|
"files": [
|
@@ -49,5 +49,5 @@
|
|
49
49
|
"publishConfig": {
|
50
50
|
"access": "public"
|
51
51
|
},
|
52
|
-
"gitHead": "
|
52
|
+
"gitHead": "343f488ce579a33e39d95c88bc7184763404ab07"
|
53
53
|
}
|