@uniformdev/canvas 19.81.2-alpha.22 → 19.82.1

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 CHANGED
@@ -13284,11 +13284,6 @@ type WalkNodeTreeOptions<TContext> = {
13284
13284
  };
13285
13285
  /** Walks a composition's content tree, visiting each component in a slot or block parameter/field depth-first, in order. */
13286
13286
  declare function walkNodeTree<TContext = unknown>(node: ComponentInstance | EntryData | Array<NodeLocationReference>, visitor: (info: TreeNodeInfoTypes<TContext>) => void, options?: WalkNodeTreeOptions<TContext>): void;
13287
- /**
13288
- * Any types which hold an array of nodes and
13289
- * therefore should be iterated over as child nodes
13290
- */
13291
- declare function isNestedNodeType(type: string): boolean;
13292
13287
  /** Gets the typed value of a block parameter or block field */
13293
13288
  declare function getBlockValue(component: ComponentInstance | EntryData, parameterName: string): BlockValue;
13294
13289
 
@@ -13763,6 +13758,11 @@ declare const createUniformApiEnhancer: ({ apiUrl }: {
13763
13758
  * Removes things like author, stats, etc.
13764
13759
  */
13765
13760
  declare function convertEntryToPutEntry(entry: Entry): PutEntryBody;
13761
+ /**
13762
+ * Gets the object holding the properties (fields or parameters) of an entry or component instance
13763
+ * If no properties are defined, returns undefined.
13764
+ */
13765
+ declare function getPropertiesValue(entity: Pick<ComponentInstance, 'parameters'> | Pick<EntryData, 'fields'>): ComponentInstance['parameters'];
13766
13766
 
13767
13767
  declare const ATTRIBUTE_COMPONENT_ID = "data-uniform-component-id";
13768
13768
  declare const ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
@@ -13842,40 +13842,6 @@ declare function mapSlotToTestVariations(slot: ComponentInstance[] | undefined):
13842
13842
  declare const isComponentPlaceholderId: (id: string | undefined) => boolean;
13843
13843
  declare const generateComponentPlaceholderId: (randomId: string, sdkVersion: number | undefined) => string;
13844
13844
 
13845
- /**
13846
- * Gets the object holding the properties (fields or parameters) of an entry or component instance
13847
- * If no properties are defined, returns undefined.
13848
- */
13849
- declare function getPropertiesValue(entity: Pick<ComponentInstance, 'parameters'> | Pick<EntryData, 'fields'>): ComponentInstance['parameters'];
13850
- interface GetNodeValuesOptions {
13851
- /**
13852
- * If the property has nested properties, like Blocks or Assets
13853
- * can, then how many levels should we traverse.
13854
- *
13855
- * You can set this to `Infinity` although it would be more
13856
- * advisable, for performance, to use the number you need in your code.
13857
- *
13858
- * Where:
13859
- * levels=0 will only extract the properties of the current object
13860
- * levels=1 will include any child blocks or assets on the current object
13861
- * but not any grandchildren
13862
- *
13863
- * @default 1
13864
- */
13865
- levels?: number;
13866
- }
13867
- /**
13868
- * Get the data stored in the value of a component parameter
13869
- * or a field attached to an Entry, Block or Asset
13870
- */
13871
- declare function getPropertyValue<TValue, T extends ComponentParameter<TValue>>(parameter: T): TValue;
13872
- declare function getPropertyValue(parameter: null): null;
13873
- declare function getPropertyValue(parameter: undefined): undefined;
13874
- type NodeWithProperties = Pick<ComponentInstance, 'parameters'> | Pick<EntryData, 'fields'>;
13875
- declare function getNodeValues(node: NodeWithProperties, options?: GetNodeValuesOptions): Record<string, unknown>;
13876
- declare function getNodeValues(node: Array<NodeWithProperties>, options?: GetNodeValuesOptions): Array<Record<string, unknown>>;
13877
- declare function getSingleNodeValues(node: NodeWithProperties, options?: GetNodeValuesOptions): Record<string, unknown>;
13878
-
13879
13845
  type BindVariablesResult<TValue> = {
13880
13846
  /** Number of dynamic expressions that attempted to be bound (regardless of the success of the binding) */
13881
13847
  boundCount: number;
@@ -13935,4 +13901,4 @@ declare function parseVariableExpression(serialized: string, onToken?: (token: s
13935
13901
 
13936
13902
  declare const CanvasClientError: typeof ApiClientError;
13937
13903
 
13938
- 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, AddComponentMessage, AssetParamValue, AssetParamValueItem, BatchEnhancer, BatchEntry, BatchInvalidationPayload, BindVariablesOptions, BindVariablesResult, BindVariablesToObjectOptions, BlockLocationReference, BlockValue, CANVAS_BLOCK_PARAM_TYPE, 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_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, CanvasDefinitions, CategoriesDeleteParameters, CategoriesGetParameters, CategoriesGetResponse, CategoriesPutParameters, Category, CategoryClient, Channel, ChannelMessage, ChannelSubscription, ChildEnhancerBuilder, ComponentDefinition, ComponentDefinitionDeleteParameters, ComponentDefinitionGetParameters, ComponentDefinitionGetResponse, ComponentDefinitionParameter, ComponentDefinitionPermission, ComponentDefinitionPutParameters, ComponentDefinitionSlot, ComponentDefinitionSlugSettings, ComponentDefinitionVariant, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentInstance, ComponentInstanceContextualEditing, ComponentInstanceHistoryEntry, ComponentInstanceHistoryGetParameters, ComponentInstanceHistoryGetResponse, ComponentLocationReference, ComponentLocationReferenceV2, ComponentOverridability, ComponentOverride, ComponentOverrides, ComponentParameter, ComponentParameterBlock, ComponentParameterContextualEditing, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions, CompositionDataDiagnostic, CompositionDeleteParameters, CompositionDiagnostics, CompositionGetByComponentIdParameters, CompositionGetByIdParameters, CompositionGetByNodeIdParameters, CompositionGetByNodePathParameters, CompositionGetBySlugParameters, CompositionGetListResponse, CompositionGetOrderBy, CompositionGetParameters, CompositionGetResponse, CompositionGetValidResponses, CompositionIssue, CompositionPatternIssue, CompositionPutParameters, CompositionRelationshipsClientOptions, CompositionRelationshipsDDefinitionGetResponse, CompositionRelationshipsDefinitionApi, CompositionRelationshipsDefinitionGetParameters, CompositionResolvedGetResponse, CompositionResolvedListResponse, CompositionUIStatus, ContentClient, ContentType, ContentTypeField, ContextualEditingComponentReference, DataDiagnostic, DataElementBindingIssue, DataElementConnectionDefinition, DataResolutionConfigIssue, DataResolutionIssue, DataResolutionOption, DataResolutionOptionNegative, DataResolutionOptionPositive, DataResolutionParameters, DataResourceDefinition, DataResourceDefinitions, DataResourceIssue, DataResourceVariables, DataSource, DataSourceClient, DataSourceDeleteParameters, DataSourceGetParameters, DataSourceGetResponse, DataSourcePutParameters, DataSourcesGetParameters, DataSourcesGetResponse, DataType, DataTypeClient, DataTypeDeleteParameters, DataTypeGetParameters, DataTypeGetResponse, DataTypePutParameters, DataVariableDefinition, DeleteContentTypeOptions, DeleteEntryOptions, DismissPlaceholderMessage, DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, EdgehancersDiagnostics, EditorStateUpdatedMessage, EnhancerBuilder, EnhancerContext, EnhancerError, EntriesGetParameters, EntriesGetResponse, EntriesHistoryGetParameters, EntriesHistoryGetResponse, EntriesResolvedListResponse, Entry, EntryData, EntryList, EventNames, FindInNodeTreeReference, GetContentTypesOptions, GetContentTypesResponse, GetEntriesOptions, GetEntriesResponse, GetNodeValuesOptions, 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_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, InvalidationPayload, LimitPolicy, LinkComponentParameterValue, LinkParamConfiguration, LinkParamValue, LinkParameterType, LinkTypeConfiguration, MessageHandler, MoveComponentMessage, NodeLocationReference, NodeWithProperties, NonProjectMapLinkParamValue, OpenParameterEditorMessage, OverrideOptions, PLACEHOLDER_ID, PatternIssue, PreviewEventBus, PreviewPanelSettings, ProjectMapLinkComponentParameterValue, ProjectMapLinkParamValue, Prompt, PromptClient, PromptsDeleteParameters, PromptsGetParameters, PromptsGetResponse, PromptsPutParameters, PutContentTypeBody, PutEntryBody, ReadyMessage, ReportRenderedCompositionsMessage, ResolvedRouteGetResponse, RichTextBuiltInElement, RichTextBuiltInFormat, RichTextParamConfiguration, RichTextParamValue, RootComponentInstance, RootEntryReference, RootLocationReference, RouteClient, RouteDynamicInputs, RouteGetParameters, RouteGetResponse, RouteGetResponseComposition, RouteGetResponseEdgehancedComposition, RouteGetResponseNotFound, RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, SelectComponentMessage, SelectParameterMessage, SpecificProjectMap, SubscribeToCompositionOptions, TreeNodeInfoTypes, TriggerComponentActionMessage, TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, UnsubscribeCallback, UpdateComponentParameterMessage, UpdateComponentReferencesMessage, UpdateCompositionInternalMessage, UpdateCompositionMessage, UpdateContextualEditingStateInternalMessage, UpdateFeatureFlagsMessage, UpdatePreviewSettingsMessage, UsageTrackingApi, UsageTrackingGetParameters, UsageTrackingGetResponse, UsageTrackingPostParameters, UsageTrackingPostResponse, WalkComponentTreeActions, WalkNodeTreeActions, WalkNodeTreeOptions, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createEventBus, createLimitPolicy, createUniformApiEnhancer, createVariableReference, enhance, extractLocales, findParameterInNodeTree, generateComponentPlaceholderId, generateHash, getBlockValue, getChannelName, getComponentJsonPointer, getComponentPath, getNodeValues, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, getPropertyValue, getSingleNodeValues, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isDismissPlaceholderMessage, isEntryData, isMovingComponentMessage, isNestedNodeType, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseVariableExpression, subscribeToComposition, unstable_CompositionRelationshipClient, walkComponentTree, walkNodeTree };
13904
+ 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, AddComponentMessage, AssetParamValue, AssetParamValueItem, BatchEnhancer, BatchEntry, BatchInvalidationPayload, BindVariablesOptions, BindVariablesResult, BindVariablesToObjectOptions, BlockLocationReference, BlockValue, CANVAS_BLOCK_PARAM_TYPE, 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_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, CanvasDefinitions, CategoriesDeleteParameters, CategoriesGetParameters, CategoriesGetResponse, CategoriesPutParameters, Category, CategoryClient, Channel, ChannelMessage, ChannelSubscription, ChildEnhancerBuilder, ComponentDefinition, ComponentDefinitionDeleteParameters, ComponentDefinitionGetParameters, ComponentDefinitionGetResponse, ComponentDefinitionParameter, ComponentDefinitionPermission, ComponentDefinitionPutParameters, ComponentDefinitionSlot, ComponentDefinitionSlugSettings, ComponentDefinitionVariant, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentInstance, ComponentInstanceContextualEditing, ComponentInstanceHistoryEntry, ComponentInstanceHistoryGetParameters, ComponentInstanceHistoryGetResponse, ComponentLocationReference, ComponentLocationReferenceV2, ComponentOverridability, ComponentOverride, ComponentOverrides, ComponentParameter, ComponentParameterBlock, ComponentParameterContextualEditing, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions, CompositionDataDiagnostic, CompositionDeleteParameters, CompositionDiagnostics, CompositionGetByComponentIdParameters, CompositionGetByIdParameters, CompositionGetByNodeIdParameters, CompositionGetByNodePathParameters, CompositionGetBySlugParameters, CompositionGetListResponse, CompositionGetOrderBy, CompositionGetParameters, CompositionGetResponse, CompositionGetValidResponses, CompositionIssue, CompositionPatternIssue, CompositionPutParameters, CompositionRelationshipsClientOptions, CompositionRelationshipsDDefinitionGetResponse, CompositionRelationshipsDefinitionApi, CompositionRelationshipsDefinitionGetParameters, CompositionResolvedGetResponse, CompositionResolvedListResponse, CompositionUIStatus, ContentClient, ContentType, ContentTypeField, ContextualEditingComponentReference, DataDiagnostic, DataElementBindingIssue, DataElementConnectionDefinition, DataResolutionConfigIssue, DataResolutionIssue, DataResolutionOption, DataResolutionOptionNegative, DataResolutionOptionPositive, DataResolutionParameters, DataResourceDefinition, DataResourceDefinitions, DataResourceIssue, DataResourceVariables, DataSource, DataSourceClient, DataSourceDeleteParameters, DataSourceGetParameters, DataSourceGetResponse, DataSourcePutParameters, DataSourcesGetParameters, DataSourcesGetResponse, DataType, DataTypeClient, DataTypeDeleteParameters, DataTypeGetParameters, DataTypeGetResponse, DataTypePutParameters, DataVariableDefinition, DeleteContentTypeOptions, DeleteEntryOptions, DismissPlaceholderMessage, DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, EdgehancersDiagnostics, EditorStateUpdatedMessage, EnhancerBuilder, EnhancerContext, EnhancerError, EntriesGetParameters, EntriesGetResponse, EntriesHistoryGetParameters, EntriesHistoryGetResponse, EntriesResolvedListResponse, Entry, EntryData, EntryList, EventNames, FindInNodeTreeReference, GetContentTypesOptions, GetContentTypesResponse, GetEntriesOptions, GetEntriesResponse, 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_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, InvalidationPayload, LimitPolicy, LinkComponentParameterValue, LinkParamConfiguration, LinkParamValue, LinkParameterType, LinkTypeConfiguration, MessageHandler, MoveComponentMessage, NodeLocationReference, NonProjectMapLinkParamValue, OpenParameterEditorMessage, OverrideOptions, PLACEHOLDER_ID, PatternIssue, PreviewEventBus, PreviewPanelSettings, ProjectMapLinkComponentParameterValue, ProjectMapLinkParamValue, Prompt, PromptClient, PromptsDeleteParameters, PromptsGetParameters, PromptsGetResponse, PromptsPutParameters, PutContentTypeBody, PutEntryBody, ReadyMessage, ReportRenderedCompositionsMessage, ResolvedRouteGetResponse, RichTextBuiltInElement, RichTextBuiltInFormat, RichTextParamConfiguration, RichTextParamValue, RootComponentInstance, RootEntryReference, RootLocationReference, RouteClient, RouteDynamicInputs, RouteGetParameters, RouteGetResponse, RouteGetResponseComposition, RouteGetResponseEdgehancedComposition, RouteGetResponseNotFound, RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, SelectComponentMessage, SelectParameterMessage, SpecificProjectMap, SubscribeToCompositionOptions, TreeNodeInfoTypes, TriggerComponentActionMessage, TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, UnsubscribeCallback, UpdateComponentParameterMessage, UpdateComponentReferencesMessage, UpdateCompositionInternalMessage, UpdateCompositionMessage, UpdateContextualEditingStateInternalMessage, UpdateFeatureFlagsMessage, UpdatePreviewSettingsMessage, UsageTrackingApi, UsageTrackingGetParameters, UsageTrackingGetResponse, UsageTrackingPostParameters, UsageTrackingPostResponse, WalkComponentTreeActions, WalkNodeTreeActions, WalkNodeTreeOptions, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createEventBus, createLimitPolicy, createUniformApiEnhancer, createVariableReference, enhance, extractLocales, findParameterInNodeTree, generateComponentPlaceholderId, generateHash, getBlockValue, getChannelName, getComponentJsonPointer, getComponentPath, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isDismissPlaceholderMessage, isEntryData, isMovingComponentMessage, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseVariableExpression, subscribeToComposition, unstable_CompositionRelationshipClient, walkComponentTree, walkNodeTree };
package/dist/index.d.ts CHANGED
@@ -13284,11 +13284,6 @@ type WalkNodeTreeOptions<TContext> = {
13284
13284
  };
13285
13285
  /** Walks a composition's content tree, visiting each component in a slot or block parameter/field depth-first, in order. */
13286
13286
  declare function walkNodeTree<TContext = unknown>(node: ComponentInstance | EntryData | Array<NodeLocationReference>, visitor: (info: TreeNodeInfoTypes<TContext>) => void, options?: WalkNodeTreeOptions<TContext>): void;
13287
- /**
13288
- * Any types which hold an array of nodes and
13289
- * therefore should be iterated over as child nodes
13290
- */
13291
- declare function isNestedNodeType(type: string): boolean;
13292
13287
  /** Gets the typed value of a block parameter or block field */
13293
13288
  declare function getBlockValue(component: ComponentInstance | EntryData, parameterName: string): BlockValue;
13294
13289
 
@@ -13763,6 +13758,11 @@ declare const createUniformApiEnhancer: ({ apiUrl }: {
13763
13758
  * Removes things like author, stats, etc.
13764
13759
  */
13765
13760
  declare function convertEntryToPutEntry(entry: Entry): PutEntryBody;
13761
+ /**
13762
+ * Gets the object holding the properties (fields or parameters) of an entry or component instance
13763
+ * If no properties are defined, returns undefined.
13764
+ */
13765
+ declare function getPropertiesValue(entity: Pick<ComponentInstance, 'parameters'> | Pick<EntryData, 'fields'>): ComponentInstance['parameters'];
13766
13766
 
13767
13767
  declare const ATTRIBUTE_COMPONENT_ID = "data-uniform-component-id";
13768
13768
  declare const ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
@@ -13842,40 +13842,6 @@ declare function mapSlotToTestVariations(slot: ComponentInstance[] | undefined):
13842
13842
  declare const isComponentPlaceholderId: (id: string | undefined) => boolean;
13843
13843
  declare const generateComponentPlaceholderId: (randomId: string, sdkVersion: number | undefined) => string;
13844
13844
 
13845
- /**
13846
- * Gets the object holding the properties (fields or parameters) of an entry or component instance
13847
- * If no properties are defined, returns undefined.
13848
- */
13849
- declare function getPropertiesValue(entity: Pick<ComponentInstance, 'parameters'> | Pick<EntryData, 'fields'>): ComponentInstance['parameters'];
13850
- interface GetNodeValuesOptions {
13851
- /**
13852
- * If the property has nested properties, like Blocks or Assets
13853
- * can, then how many levels should we traverse.
13854
- *
13855
- * You can set this to `Infinity` although it would be more
13856
- * advisable, for performance, to use the number you need in your code.
13857
- *
13858
- * Where:
13859
- * levels=0 will only extract the properties of the current object
13860
- * levels=1 will include any child blocks or assets on the current object
13861
- * but not any grandchildren
13862
- *
13863
- * @default 1
13864
- */
13865
- levels?: number;
13866
- }
13867
- /**
13868
- * Get the data stored in the value of a component parameter
13869
- * or a field attached to an Entry, Block or Asset
13870
- */
13871
- declare function getPropertyValue<TValue, T extends ComponentParameter<TValue>>(parameter: T): TValue;
13872
- declare function getPropertyValue(parameter: null): null;
13873
- declare function getPropertyValue(parameter: undefined): undefined;
13874
- type NodeWithProperties = Pick<ComponentInstance, 'parameters'> | Pick<EntryData, 'fields'>;
13875
- declare function getNodeValues(node: NodeWithProperties, options?: GetNodeValuesOptions): Record<string, unknown>;
13876
- declare function getNodeValues(node: Array<NodeWithProperties>, options?: GetNodeValuesOptions): Array<Record<string, unknown>>;
13877
- declare function getSingleNodeValues(node: NodeWithProperties, options?: GetNodeValuesOptions): Record<string, unknown>;
13878
-
13879
13845
  type BindVariablesResult<TValue> = {
13880
13846
  /** Number of dynamic expressions that attempted to be bound (regardless of the success of the binding) */
13881
13847
  boundCount: number;
@@ -13935,4 +13901,4 @@ declare function parseVariableExpression(serialized: string, onToken?: (token: s
13935
13901
 
13936
13902
  declare const CanvasClientError: typeof ApiClientError;
13937
13903
 
13938
- 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, AddComponentMessage, AssetParamValue, AssetParamValueItem, BatchEnhancer, BatchEntry, BatchInvalidationPayload, BindVariablesOptions, BindVariablesResult, BindVariablesToObjectOptions, BlockLocationReference, BlockValue, CANVAS_BLOCK_PARAM_TYPE, 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_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, CanvasDefinitions, CategoriesDeleteParameters, CategoriesGetParameters, CategoriesGetResponse, CategoriesPutParameters, Category, CategoryClient, Channel, ChannelMessage, ChannelSubscription, ChildEnhancerBuilder, ComponentDefinition, ComponentDefinitionDeleteParameters, ComponentDefinitionGetParameters, ComponentDefinitionGetResponse, ComponentDefinitionParameter, ComponentDefinitionPermission, ComponentDefinitionPutParameters, ComponentDefinitionSlot, ComponentDefinitionSlugSettings, ComponentDefinitionVariant, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentInstance, ComponentInstanceContextualEditing, ComponentInstanceHistoryEntry, ComponentInstanceHistoryGetParameters, ComponentInstanceHistoryGetResponse, ComponentLocationReference, ComponentLocationReferenceV2, ComponentOverridability, ComponentOverride, ComponentOverrides, ComponentParameter, ComponentParameterBlock, ComponentParameterContextualEditing, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions, CompositionDataDiagnostic, CompositionDeleteParameters, CompositionDiagnostics, CompositionGetByComponentIdParameters, CompositionGetByIdParameters, CompositionGetByNodeIdParameters, CompositionGetByNodePathParameters, CompositionGetBySlugParameters, CompositionGetListResponse, CompositionGetOrderBy, CompositionGetParameters, CompositionGetResponse, CompositionGetValidResponses, CompositionIssue, CompositionPatternIssue, CompositionPutParameters, CompositionRelationshipsClientOptions, CompositionRelationshipsDDefinitionGetResponse, CompositionRelationshipsDefinitionApi, CompositionRelationshipsDefinitionGetParameters, CompositionResolvedGetResponse, CompositionResolvedListResponse, CompositionUIStatus, ContentClient, ContentType, ContentTypeField, ContextualEditingComponentReference, DataDiagnostic, DataElementBindingIssue, DataElementConnectionDefinition, DataResolutionConfigIssue, DataResolutionIssue, DataResolutionOption, DataResolutionOptionNegative, DataResolutionOptionPositive, DataResolutionParameters, DataResourceDefinition, DataResourceDefinitions, DataResourceIssue, DataResourceVariables, DataSource, DataSourceClient, DataSourceDeleteParameters, DataSourceGetParameters, DataSourceGetResponse, DataSourcePutParameters, DataSourcesGetParameters, DataSourcesGetResponse, DataType, DataTypeClient, DataTypeDeleteParameters, DataTypeGetParameters, DataTypeGetResponse, DataTypePutParameters, DataVariableDefinition, DeleteContentTypeOptions, DeleteEntryOptions, DismissPlaceholderMessage, DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, EdgehancersDiagnostics, EditorStateUpdatedMessage, EnhancerBuilder, EnhancerContext, EnhancerError, EntriesGetParameters, EntriesGetResponse, EntriesHistoryGetParameters, EntriesHistoryGetResponse, EntriesResolvedListResponse, Entry, EntryData, EntryList, EventNames, FindInNodeTreeReference, GetContentTypesOptions, GetContentTypesResponse, GetEntriesOptions, GetEntriesResponse, GetNodeValuesOptions, 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_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, InvalidationPayload, LimitPolicy, LinkComponentParameterValue, LinkParamConfiguration, LinkParamValue, LinkParameterType, LinkTypeConfiguration, MessageHandler, MoveComponentMessage, NodeLocationReference, NodeWithProperties, NonProjectMapLinkParamValue, OpenParameterEditorMessage, OverrideOptions, PLACEHOLDER_ID, PatternIssue, PreviewEventBus, PreviewPanelSettings, ProjectMapLinkComponentParameterValue, ProjectMapLinkParamValue, Prompt, PromptClient, PromptsDeleteParameters, PromptsGetParameters, PromptsGetResponse, PromptsPutParameters, PutContentTypeBody, PutEntryBody, ReadyMessage, ReportRenderedCompositionsMessage, ResolvedRouteGetResponse, RichTextBuiltInElement, RichTextBuiltInFormat, RichTextParamConfiguration, RichTextParamValue, RootComponentInstance, RootEntryReference, RootLocationReference, RouteClient, RouteDynamicInputs, RouteGetParameters, RouteGetResponse, RouteGetResponseComposition, RouteGetResponseEdgehancedComposition, RouteGetResponseNotFound, RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, SelectComponentMessage, SelectParameterMessage, SpecificProjectMap, SubscribeToCompositionOptions, TreeNodeInfoTypes, TriggerComponentActionMessage, TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, UnsubscribeCallback, UpdateComponentParameterMessage, UpdateComponentReferencesMessage, UpdateCompositionInternalMessage, UpdateCompositionMessage, UpdateContextualEditingStateInternalMessage, UpdateFeatureFlagsMessage, UpdatePreviewSettingsMessage, UsageTrackingApi, UsageTrackingGetParameters, UsageTrackingGetResponse, UsageTrackingPostParameters, UsageTrackingPostResponse, WalkComponentTreeActions, WalkNodeTreeActions, WalkNodeTreeOptions, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createEventBus, createLimitPolicy, createUniformApiEnhancer, createVariableReference, enhance, extractLocales, findParameterInNodeTree, generateComponentPlaceholderId, generateHash, getBlockValue, getChannelName, getComponentJsonPointer, getComponentPath, getNodeValues, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, getPropertyValue, getSingleNodeValues, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isDismissPlaceholderMessage, isEntryData, isMovingComponentMessage, isNestedNodeType, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseVariableExpression, subscribeToComposition, unstable_CompositionRelationshipClient, walkComponentTree, walkNodeTree };
13904
+ 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, AddComponentMessage, AssetParamValue, AssetParamValueItem, BatchEnhancer, BatchEntry, BatchInvalidationPayload, BindVariablesOptions, BindVariablesResult, BindVariablesToObjectOptions, BlockLocationReference, BlockValue, CANVAS_BLOCK_PARAM_TYPE, 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_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, CanvasDefinitions, CategoriesDeleteParameters, CategoriesGetParameters, CategoriesGetResponse, CategoriesPutParameters, Category, CategoryClient, Channel, ChannelMessage, ChannelSubscription, ChildEnhancerBuilder, ComponentDefinition, ComponentDefinitionDeleteParameters, ComponentDefinitionGetParameters, ComponentDefinitionGetResponse, ComponentDefinitionParameter, ComponentDefinitionPermission, ComponentDefinitionPutParameters, ComponentDefinitionSlot, ComponentDefinitionSlugSettings, ComponentDefinitionVariant, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentInstance, ComponentInstanceContextualEditing, ComponentInstanceHistoryEntry, ComponentInstanceHistoryGetParameters, ComponentInstanceHistoryGetResponse, ComponentLocationReference, ComponentLocationReferenceV2, ComponentOverridability, ComponentOverride, ComponentOverrides, ComponentParameter, ComponentParameterBlock, ComponentParameterContextualEditing, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions, CompositionDataDiagnostic, CompositionDeleteParameters, CompositionDiagnostics, CompositionGetByComponentIdParameters, CompositionGetByIdParameters, CompositionGetByNodeIdParameters, CompositionGetByNodePathParameters, CompositionGetBySlugParameters, CompositionGetListResponse, CompositionGetOrderBy, CompositionGetParameters, CompositionGetResponse, CompositionGetValidResponses, CompositionIssue, CompositionPatternIssue, CompositionPutParameters, CompositionRelationshipsClientOptions, CompositionRelationshipsDDefinitionGetResponse, CompositionRelationshipsDefinitionApi, CompositionRelationshipsDefinitionGetParameters, CompositionResolvedGetResponse, CompositionResolvedListResponse, CompositionUIStatus, ContentClient, ContentType, ContentTypeField, ContextualEditingComponentReference, DataDiagnostic, DataElementBindingIssue, DataElementConnectionDefinition, DataResolutionConfigIssue, DataResolutionIssue, DataResolutionOption, DataResolutionOptionNegative, DataResolutionOptionPositive, DataResolutionParameters, DataResourceDefinition, DataResourceDefinitions, DataResourceIssue, DataResourceVariables, DataSource, DataSourceClient, DataSourceDeleteParameters, DataSourceGetParameters, DataSourceGetResponse, DataSourcePutParameters, DataSourcesGetParameters, DataSourcesGetResponse, DataType, DataTypeClient, DataTypeDeleteParameters, DataTypeGetParameters, DataTypeGetResponse, DataTypePutParameters, DataVariableDefinition, DeleteContentTypeOptions, DeleteEntryOptions, DismissPlaceholderMessage, DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, EdgehancersDiagnostics, EditorStateUpdatedMessage, EnhancerBuilder, EnhancerContext, EnhancerError, EntriesGetParameters, EntriesGetResponse, EntriesHistoryGetParameters, EntriesHistoryGetResponse, EntriesResolvedListResponse, Entry, EntryData, EntryList, EventNames, FindInNodeTreeReference, GetContentTypesOptions, GetContentTypesResponse, GetEntriesOptions, GetEntriesResponse, 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_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, InvalidationPayload, LimitPolicy, LinkComponentParameterValue, LinkParamConfiguration, LinkParamValue, LinkParameterType, LinkTypeConfiguration, MessageHandler, MoveComponentMessage, NodeLocationReference, NonProjectMapLinkParamValue, OpenParameterEditorMessage, OverrideOptions, PLACEHOLDER_ID, PatternIssue, PreviewEventBus, PreviewPanelSettings, ProjectMapLinkComponentParameterValue, ProjectMapLinkParamValue, Prompt, PromptClient, PromptsDeleteParameters, PromptsGetParameters, PromptsGetResponse, PromptsPutParameters, PutContentTypeBody, PutEntryBody, ReadyMessage, ReportRenderedCompositionsMessage, ResolvedRouteGetResponse, RichTextBuiltInElement, RichTextBuiltInFormat, RichTextParamConfiguration, RichTextParamValue, RootComponentInstance, RootEntryReference, RootLocationReference, RouteClient, RouteDynamicInputs, RouteGetParameters, RouteGetResponse, RouteGetResponseComposition, RouteGetResponseEdgehancedComposition, RouteGetResponseNotFound, RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, SelectComponentMessage, SelectParameterMessage, SpecificProjectMap, SubscribeToCompositionOptions, TreeNodeInfoTypes, TriggerComponentActionMessage, TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, UnsubscribeCallback, UpdateComponentParameterMessage, UpdateComponentReferencesMessage, UpdateCompositionInternalMessage, UpdateCompositionMessage, UpdateContextualEditingStateInternalMessage, UpdateFeatureFlagsMessage, UpdatePreviewSettingsMessage, UsageTrackingApi, UsageTrackingGetParameters, UsageTrackingGetResponse, UsageTrackingPostParameters, UsageTrackingPostResponse, WalkComponentTreeActions, WalkNodeTreeActions, WalkNodeTreeOptions, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createEventBus, createLimitPolicy, createUniformApiEnhancer, createVariableReference, enhance, extractLocales, findParameterInNodeTree, generateComponentPlaceholderId, generateHash, getBlockValue, getChannelName, getComponentJsonPointer, getComponentPath, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isDismissPlaceholderMessage, isEntryData, isMovingComponentMessage, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseVariableExpression, subscribeToComposition, unstable_CompositionRelationshipClient, walkComponentTree, walkNodeTree };
package/dist/index.esm.js CHANGED
@@ -1004,6 +1004,25 @@ var ASSET_PARAMETER_TYPE = "asset";
1004
1004
  var ASSETS_SOURCE_UNIFORM = "uniform-assets";
1005
1005
  var ASSETS_SOURCE_CUSTOM_URL = "custom-url";
1006
1006
 
1007
+ // src/utils/entryConverter.ts
1008
+ function convertEntryToPutEntry(entry) {
1009
+ return {
1010
+ entry: {
1011
+ type: entry.entry.type,
1012
+ _dataResources: entry.entry._dataResources,
1013
+ _id: entry.entry._id,
1014
+ _name: entry.entry._name,
1015
+ _slug: entry.entry._slug,
1016
+ fields: entry.entry.fields
1017
+ },
1018
+ state: entry.state,
1019
+ projectId: entry.projectId
1020
+ };
1021
+ }
1022
+ function getPropertiesValue(entity) {
1023
+ return "parameters" in entity && entity.parameters ? entity.parameters : "fields" in entity && entity.fields ? entity.fields : void 0;
1024
+ }
1025
+
1007
1026
  // src/utils/guards.ts
1008
1027
  function isRootEntryReference(root) {
1009
1028
  return root.type === "root" && isEntryData(root.node);
@@ -1020,37 +1039,6 @@ function isAssetParamValueItem(item) {
1020
1039
  );
1021
1040
  }
1022
1041
 
1023
- // src/utils/properties.ts
1024
- function getPropertiesValue(entity) {
1025
- return "parameters" in entity && entity.parameters ? entity.parameters : "fields" in entity && entity.fields ? entity.fields : void 0;
1026
- }
1027
- function getPropertyValue(parameter) {
1028
- return parameter ? parameter.value : parameter;
1029
- }
1030
- function getNodeValues(node, options = {}) {
1031
- if (Array.isArray(node)) {
1032
- return node.map((node2) => getSingleNodeValues(node2, options));
1033
- } else {
1034
- return getSingleNodeValues(node, options);
1035
- }
1036
- }
1037
- function getSingleNodeValues(node, options = {}) {
1038
- const { levels = 1 } = options;
1039
- const properties = getPropertiesValue(node);
1040
- return properties ? Object.fromEntries(
1041
- Object.entries(properties).map(([id, parameter]) => {
1042
- const value = getPropertyValue(parameter);
1043
- if (levels > 0 && Array.isArray(value) && // In the future ASSET_PARAMETER_TYPE will be a nested node type
1044
- (isNestedNodeType(parameter.type) || parameter.type === ASSET_PARAMETER_TYPE)) {
1045
- const nestedOptions = { ...options, levels: levels - 1 };
1046
- return [id, value.map((item) => getNodeValues(item, nestedOptions))];
1047
- } else {
1048
- return [id, value];
1049
- }
1050
- })
1051
- ) : properties;
1052
- }
1053
-
1054
1042
  // src/enhancement/walkNodeTree.ts
1055
1043
  function walkNodeTree(node, visitor, options) {
1056
1044
  var _a, _b;
@@ -1273,7 +1261,7 @@ function walkNodeTree(node, visitor, options) {
1273
1261
  const propertyEntries = Object.entries(properties);
1274
1262
  for (let propIndex = propertyEntries.length - 1; propIndex >= 0; propIndex--) {
1275
1263
  const [propKey, propObject] = propertyEntries[propIndex];
1276
- if (!isNestedNodeType(propObject.type))
1264
+ if (propObject.type !== CANVAS_BLOCK_PARAM_TYPE)
1277
1265
  continue;
1278
1266
  const blocks = (_b = propObject.value) != null ? _b : [];
1279
1267
  for (let blockIndex = blocks.length - 1; blockIndex >= 0; blockIndex--) {
@@ -1299,9 +1287,6 @@ function walkNodeTree(node, visitor, options) {
1299
1287
  }
1300
1288
  } while (componentQueue.length > 0);
1301
1289
  }
1302
- function isNestedNodeType(type) {
1303
- return type === CANVAS_BLOCK_PARAM_TYPE;
1304
- }
1305
1290
  function getBlockValue(component, parameterName) {
1306
1291
  var _a;
1307
1292
  const parameter = (_a = getPropertiesValue(component)) == null ? void 0 : _a[parameterName];
@@ -2239,22 +2224,6 @@ var createUniformApiEnhancer = ({ apiUrl }) => {
2239
2224
  };
2240
2225
  };
2241
2226
 
2242
- // src/utils/entryConverter.ts
2243
- function convertEntryToPutEntry(entry) {
2244
- return {
2245
- entry: {
2246
- type: entry.entry.type,
2247
- _dataResources: entry.entry._dataResources,
2248
- _id: entry.entry._id,
2249
- _name: entry.entry._name,
2250
- _slug: entry.entry._slug,
2251
- fields: entry.entry.fields
2252
- },
2253
- state: entry.state,
2254
- projectId: entry.projectId
2255
- };
2256
- }
2257
-
2258
2227
  // src/utils/getParameterAttributes.ts
2259
2228
  var ATTRIBUTE_COMPONENT_ID = "data-uniform-component-id";
2260
2229
  var ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
@@ -2603,13 +2572,10 @@ export {
2603
2572
  getChannelName,
2604
2573
  getComponentJsonPointer,
2605
2574
  getComponentPath,
2606
- getNodeValues,
2607
2575
  getNounForLocation,
2608
2576
  getNounForNode,
2609
2577
  getParameterAttributes,
2610
2578
  getPropertiesValue,
2611
- getPropertyValue,
2612
- getSingleNodeValues,
2613
2579
  isAddComponentMessage,
2614
2580
  isAllowedReferrer,
2615
2581
  isAssetParamValue,
@@ -2619,7 +2585,6 @@ export {
2619
2585
  isDismissPlaceholderMessage,
2620
2586
  isEntryData,
2621
2587
  isMovingComponentMessage,
2622
- isNestedNodeType,
2623
2588
  isOpenParameterEditorMessage,
2624
2589
  isReadyMessage,
2625
2590
  isReportRenderedCompositionsMessage,
package/dist/index.js CHANGED
@@ -350,13 +350,10 @@ __export(src_exports, {
350
350
  getChannelName: () => getChannelName,
351
351
  getComponentJsonPointer: () => getComponentJsonPointer,
352
352
  getComponentPath: () => getComponentPath,
353
- getNodeValues: () => getNodeValues,
354
353
  getNounForLocation: () => getNounForLocation,
355
354
  getNounForNode: () => getNounForNode,
356
355
  getParameterAttributes: () => getParameterAttributes,
357
356
  getPropertiesValue: () => getPropertiesValue,
358
- getPropertyValue: () => getPropertyValue,
359
- getSingleNodeValues: () => getSingleNodeValues,
360
357
  isAddComponentMessage: () => isAddComponentMessage,
361
358
  isAllowedReferrer: () => isAllowedReferrer,
362
359
  isAssetParamValue: () => isAssetParamValue,
@@ -366,7 +363,6 @@ __export(src_exports, {
366
363
  isDismissPlaceholderMessage: () => isDismissPlaceholderMessage,
367
364
  isEntryData: () => isEntryData,
368
365
  isMovingComponentMessage: () => isMovingComponentMessage,
369
- isNestedNodeType: () => isNestedNodeType,
370
366
  isOpenParameterEditorMessage: () => isOpenParameterEditorMessage,
371
367
  isReadyMessage: () => isReadyMessage,
372
368
  isReportRenderedCompositionsMessage: () => isReportRenderedCompositionsMessage,
@@ -1130,6 +1126,25 @@ var ASSET_PARAMETER_TYPE = "asset";
1130
1126
  var ASSETS_SOURCE_UNIFORM = "uniform-assets";
1131
1127
  var ASSETS_SOURCE_CUSTOM_URL = "custom-url";
1132
1128
 
1129
+ // src/utils/entryConverter.ts
1130
+ function convertEntryToPutEntry(entry) {
1131
+ return {
1132
+ entry: {
1133
+ type: entry.entry.type,
1134
+ _dataResources: entry.entry._dataResources,
1135
+ _id: entry.entry._id,
1136
+ _name: entry.entry._name,
1137
+ _slug: entry.entry._slug,
1138
+ fields: entry.entry.fields
1139
+ },
1140
+ state: entry.state,
1141
+ projectId: entry.projectId
1142
+ };
1143
+ }
1144
+ function getPropertiesValue(entity) {
1145
+ return "parameters" in entity && entity.parameters ? entity.parameters : "fields" in entity && entity.fields ? entity.fields : void 0;
1146
+ }
1147
+
1133
1148
  // src/utils/guards.ts
1134
1149
  function isRootEntryReference(root) {
1135
1150
  return root.type === "root" && isEntryData(root.node);
@@ -1146,37 +1161,6 @@ function isAssetParamValueItem(item) {
1146
1161
  );
1147
1162
  }
1148
1163
 
1149
- // src/utils/properties.ts
1150
- function getPropertiesValue(entity) {
1151
- return "parameters" in entity && entity.parameters ? entity.parameters : "fields" in entity && entity.fields ? entity.fields : void 0;
1152
- }
1153
- function getPropertyValue(parameter) {
1154
- return parameter ? parameter.value : parameter;
1155
- }
1156
- function getNodeValues(node, options = {}) {
1157
- if (Array.isArray(node)) {
1158
- return node.map((node2) => getSingleNodeValues(node2, options));
1159
- } else {
1160
- return getSingleNodeValues(node, options);
1161
- }
1162
- }
1163
- function getSingleNodeValues(node, options = {}) {
1164
- const { levels = 1 } = options;
1165
- const properties = getPropertiesValue(node);
1166
- return properties ? Object.fromEntries(
1167
- Object.entries(properties).map(([id, parameter]) => {
1168
- const value = getPropertyValue(parameter);
1169
- if (levels > 0 && Array.isArray(value) && // In the future ASSET_PARAMETER_TYPE will be a nested node type
1170
- (isNestedNodeType(parameter.type) || parameter.type === ASSET_PARAMETER_TYPE)) {
1171
- const nestedOptions = { ...options, levels: levels - 1 };
1172
- return [id, value.map((item) => getNodeValues(item, nestedOptions))];
1173
- } else {
1174
- return [id, value];
1175
- }
1176
- })
1177
- ) : properties;
1178
- }
1179
-
1180
1164
  // src/enhancement/walkNodeTree.ts
1181
1165
  function walkNodeTree(node, visitor, options) {
1182
1166
  var _a, _b;
@@ -1399,7 +1383,7 @@ function walkNodeTree(node, visitor, options) {
1399
1383
  const propertyEntries = Object.entries(properties);
1400
1384
  for (let propIndex = propertyEntries.length - 1; propIndex >= 0; propIndex--) {
1401
1385
  const [propKey, propObject] = propertyEntries[propIndex];
1402
- if (!isNestedNodeType(propObject.type))
1386
+ if (propObject.type !== CANVAS_BLOCK_PARAM_TYPE)
1403
1387
  continue;
1404
1388
  const blocks = (_b = propObject.value) != null ? _b : [];
1405
1389
  for (let blockIndex = blocks.length - 1; blockIndex >= 0; blockIndex--) {
@@ -1425,9 +1409,6 @@ function walkNodeTree(node, visitor, options) {
1425
1409
  }
1426
1410
  } while (componentQueue.length > 0);
1427
1411
  }
1428
- function isNestedNodeType(type) {
1429
- return type === CANVAS_BLOCK_PARAM_TYPE;
1430
- }
1431
1412
  function getBlockValue(component, parameterName) {
1432
1413
  var _a;
1433
1414
  const parameter = (_a = getPropertiesValue(component)) == null ? void 0 : _a[parameterName];
@@ -2365,22 +2346,6 @@ var createUniformApiEnhancer = ({ apiUrl }) => {
2365
2346
  };
2366
2347
  };
2367
2348
 
2368
- // src/utils/entryConverter.ts
2369
- function convertEntryToPutEntry(entry) {
2370
- return {
2371
- entry: {
2372
- type: entry.entry.type,
2373
- _dataResources: entry.entry._dataResources,
2374
- _id: entry.entry._id,
2375
- _name: entry.entry._name,
2376
- _slug: entry.entry._slug,
2377
- fields: entry.entry.fields
2378
- },
2379
- state: entry.state,
2380
- projectId: entry.projectId
2381
- };
2382
- }
2383
-
2384
2349
  // src/utils/getParameterAttributes.ts
2385
2350
  var ATTRIBUTE_COMPONENT_ID = "data-uniform-component-id";
2386
2351
  var ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
@@ -2730,13 +2695,10 @@ var CanvasClientError = import_api10.ApiClientError;
2730
2695
  getChannelName,
2731
2696
  getComponentJsonPointer,
2732
2697
  getComponentPath,
2733
- getNodeValues,
2734
2698
  getNounForLocation,
2735
2699
  getNounForNode,
2736
2700
  getParameterAttributes,
2737
2701
  getPropertiesValue,
2738
- getPropertyValue,
2739
- getSingleNodeValues,
2740
2702
  isAddComponentMessage,
2741
2703
  isAllowedReferrer,
2742
2704
  isAssetParamValue,
@@ -2746,7 +2708,6 @@ var CanvasClientError = import_api10.ApiClientError;
2746
2708
  isDismissPlaceholderMessage,
2747
2709
  isEntryData,
2748
2710
  isMovingComponentMessage,
2749
- isNestedNodeType,
2750
2711
  isOpenParameterEditorMessage,
2751
2712
  isReadyMessage,
2752
2713
  isReportRenderedCompositionsMessage,
package/dist/index.mjs CHANGED
@@ -1004,6 +1004,25 @@ var ASSET_PARAMETER_TYPE = "asset";
1004
1004
  var ASSETS_SOURCE_UNIFORM = "uniform-assets";
1005
1005
  var ASSETS_SOURCE_CUSTOM_URL = "custom-url";
1006
1006
 
1007
+ // src/utils/entryConverter.ts
1008
+ function convertEntryToPutEntry(entry) {
1009
+ return {
1010
+ entry: {
1011
+ type: entry.entry.type,
1012
+ _dataResources: entry.entry._dataResources,
1013
+ _id: entry.entry._id,
1014
+ _name: entry.entry._name,
1015
+ _slug: entry.entry._slug,
1016
+ fields: entry.entry.fields
1017
+ },
1018
+ state: entry.state,
1019
+ projectId: entry.projectId
1020
+ };
1021
+ }
1022
+ function getPropertiesValue(entity) {
1023
+ return "parameters" in entity && entity.parameters ? entity.parameters : "fields" in entity && entity.fields ? entity.fields : void 0;
1024
+ }
1025
+
1007
1026
  // src/utils/guards.ts
1008
1027
  function isRootEntryReference(root) {
1009
1028
  return root.type === "root" && isEntryData(root.node);
@@ -1020,37 +1039,6 @@ function isAssetParamValueItem(item) {
1020
1039
  );
1021
1040
  }
1022
1041
 
1023
- // src/utils/properties.ts
1024
- function getPropertiesValue(entity) {
1025
- return "parameters" in entity && entity.parameters ? entity.parameters : "fields" in entity && entity.fields ? entity.fields : void 0;
1026
- }
1027
- function getPropertyValue(parameter) {
1028
- return parameter ? parameter.value : parameter;
1029
- }
1030
- function getNodeValues(node, options = {}) {
1031
- if (Array.isArray(node)) {
1032
- return node.map((node2) => getSingleNodeValues(node2, options));
1033
- } else {
1034
- return getSingleNodeValues(node, options);
1035
- }
1036
- }
1037
- function getSingleNodeValues(node, options = {}) {
1038
- const { levels = 1 } = options;
1039
- const properties = getPropertiesValue(node);
1040
- return properties ? Object.fromEntries(
1041
- Object.entries(properties).map(([id, parameter]) => {
1042
- const value = getPropertyValue(parameter);
1043
- if (levels > 0 && Array.isArray(value) && // In the future ASSET_PARAMETER_TYPE will be a nested node type
1044
- (isNestedNodeType(parameter.type) || parameter.type === ASSET_PARAMETER_TYPE)) {
1045
- const nestedOptions = { ...options, levels: levels - 1 };
1046
- return [id, value.map((item) => getNodeValues(item, nestedOptions))];
1047
- } else {
1048
- return [id, value];
1049
- }
1050
- })
1051
- ) : properties;
1052
- }
1053
-
1054
1042
  // src/enhancement/walkNodeTree.ts
1055
1043
  function walkNodeTree(node, visitor, options) {
1056
1044
  var _a, _b;
@@ -1273,7 +1261,7 @@ function walkNodeTree(node, visitor, options) {
1273
1261
  const propertyEntries = Object.entries(properties);
1274
1262
  for (let propIndex = propertyEntries.length - 1; propIndex >= 0; propIndex--) {
1275
1263
  const [propKey, propObject] = propertyEntries[propIndex];
1276
- if (!isNestedNodeType(propObject.type))
1264
+ if (propObject.type !== CANVAS_BLOCK_PARAM_TYPE)
1277
1265
  continue;
1278
1266
  const blocks = (_b = propObject.value) != null ? _b : [];
1279
1267
  for (let blockIndex = blocks.length - 1; blockIndex >= 0; blockIndex--) {
@@ -1299,9 +1287,6 @@ function walkNodeTree(node, visitor, options) {
1299
1287
  }
1300
1288
  } while (componentQueue.length > 0);
1301
1289
  }
1302
- function isNestedNodeType(type) {
1303
- return type === CANVAS_BLOCK_PARAM_TYPE;
1304
- }
1305
1290
  function getBlockValue(component, parameterName) {
1306
1291
  var _a;
1307
1292
  const parameter = (_a = getPropertiesValue(component)) == null ? void 0 : _a[parameterName];
@@ -2239,22 +2224,6 @@ var createUniformApiEnhancer = ({ apiUrl }) => {
2239
2224
  };
2240
2225
  };
2241
2226
 
2242
- // src/utils/entryConverter.ts
2243
- function convertEntryToPutEntry(entry) {
2244
- return {
2245
- entry: {
2246
- type: entry.entry.type,
2247
- _dataResources: entry.entry._dataResources,
2248
- _id: entry.entry._id,
2249
- _name: entry.entry._name,
2250
- _slug: entry.entry._slug,
2251
- fields: entry.entry.fields
2252
- },
2253
- state: entry.state,
2254
- projectId: entry.projectId
2255
- };
2256
- }
2257
-
2258
2227
  // src/utils/getParameterAttributes.ts
2259
2228
  var ATTRIBUTE_COMPONENT_ID = "data-uniform-component-id";
2260
2229
  var ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
@@ -2603,13 +2572,10 @@ export {
2603
2572
  getChannelName,
2604
2573
  getComponentJsonPointer,
2605
2574
  getComponentPath,
2606
- getNodeValues,
2607
2575
  getNounForLocation,
2608
2576
  getNounForNode,
2609
2577
  getParameterAttributes,
2610
2578
  getPropertiesValue,
2611
- getPropertyValue,
2612
- getSingleNodeValues,
2613
2579
  isAddComponentMessage,
2614
2580
  isAllowedReferrer,
2615
2581
  isAssetParamValue,
@@ -2619,7 +2585,6 @@ export {
2619
2585
  isDismissPlaceholderMessage,
2620
2586
  isEntryData,
2621
2587
  isMovingComponentMessage,
2622
- isNestedNodeType,
2623
2588
  isOpenParameterEditorMessage,
2624
2589
  isReadyMessage,
2625
2590
  isReportRenderedCompositionsMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.81.2-alpha.22+2fbda83df",
3
+ "version": "19.82.1",
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,8 +38,8 @@
38
38
  "pusher-js": "8.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@uniformdev/assets": "19.81.2-alpha.22+2fbda83df",
42
- "@uniformdev/context": "19.81.2-alpha.22+2fbda83df",
41
+ "@uniformdev/assets": "19.82.1",
42
+ "@uniformdev/context": "19.82.1",
43
43
  "immer": "9.0.21"
44
44
  },
45
45
  "files": [
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "2fbda83df1085a9a91c7fbe9ac53056cc64707d2"
51
+ "gitHead": "242b8cbfdb9e52a8020c7660af8363a16c070cfa"
52
52
  }