@uniformdev/canvas 19.80.0 → 19.81.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
@@ -12489,8 +12489,9 @@ interface paths$1 {
12489
12489
  parameters: {
12490
12490
  query: {
12491
12491
  projectId: string;
12492
- type: "definition";
12492
+ type: "definition" | "instance";
12493
12493
  definitionIds?: string;
12494
+ instanceIds?: string;
12494
12495
  withCompositions?: boolean | null;
12495
12496
  };
12496
12497
  };
@@ -12850,6 +12851,85 @@ type schemas = components$1['schemas'];
12850
12851
  type InvalidationPayload = schemas['InvalidationPayload'];
12851
12852
  type BatchInvalidationPayload = schemas['BatchInvalidationPayload'];
12852
12853
 
12854
+ /** This is the type value for the asset parameter or field */
12855
+ declare const ASSET_PARAMETER_TYPE = "asset";
12856
+ declare const ASSETS_SOURCE_UNIFORM = "uniform-assets";
12857
+ declare const ASSETS_SOURCE_CUSTOM_URL = "custom-url";
12858
+ type AssetParamValue = AssetParamValueItem[];
12859
+ type AssetParamValueItem = {
12860
+ type: string;
12861
+ _id: string;
12862
+ /**
12863
+ * Internal Uniform source ID or
12864
+ * dataType ID of the global integration library
12865
+ * which created this asset item
12866
+ */
12867
+ _source?: string;
12868
+ fields: {
12869
+ url: {
12870
+ type: 'text';
12871
+ value: string;
12872
+ };
12873
+ id?: {
12874
+ type: 'text';
12875
+ value: string | undefined;
12876
+ };
12877
+ title?: {
12878
+ type: 'text';
12879
+ value: string | undefined;
12880
+ };
12881
+ description?: {
12882
+ type: 'text';
12883
+ value: string | undefined;
12884
+ };
12885
+ mediaType?: {
12886
+ type: 'text';
12887
+ value: string | undefined;
12888
+ };
12889
+ /**
12890
+ * The width of the original asset
12891
+ *
12892
+ * Should resolve to a number but might
12893
+ * be a string with a pointer reference
12894
+ */
12895
+ width?: {
12896
+ type: 'number';
12897
+ value: number | string | undefined;
12898
+ };
12899
+ /**
12900
+ * The height of the original asset
12901
+ *
12902
+ * Should resolve to a number but might
12903
+ * be a string with a pointer reference
12904
+ */
12905
+ height?: {
12906
+ type: 'number';
12907
+ value: number | string | undefined;
12908
+ };
12909
+ /**
12910
+ * The size in bytes of the original asset
12911
+ *
12912
+ * Should resolve to a number but might
12913
+ * be a string with a pointer reference
12914
+ */
12915
+ size?: {
12916
+ type: 'number';
12917
+ value: number | string | undefined;
12918
+ };
12919
+ /**
12920
+ * Any key/value properties which the source
12921
+ * wants to attach to the asset data
12922
+ */
12923
+ custom?: {
12924
+ type: string;
12925
+ value: Record<string, unknown>;
12926
+ };
12927
+ };
12928
+ _overrides?: {
12929
+ fields: ComponentOverride['parameters'];
12930
+ };
12931
+ };
12932
+
12853
12933
  type LinkParameterType = 'projectMapNode' | 'url' | 'tel' | 'email';
12854
12934
  type LinkTypeConfiguration = Partial<Record<LinkParameterType, boolean>>;
12855
12935
  type LinkParamConfiguration = {
@@ -13137,37 +13217,6 @@ declare function enhance<TContext extends EnhancerContext = EnhancerContext>({ c
13137
13217
  onErrors?: (errors: EnhancerError[]) => void;
13138
13218
  }): Promise<void>;
13139
13219
 
13140
- /** @deprecated use walkNodeTree */
13141
- type ComponentLocationReference = {
13142
- component: ComponentInstance;
13143
- parentSlot?: string;
13144
- parentSlotIndex?: number;
13145
- };
13146
- /** @deprecated use walkNodeTree and check for type = slot */
13147
- type WalkComponentTreeActions<TContext> = {
13148
- /** Replaces the component being visited with a new object */
13149
- replaceComponent: (replacementComponent: ComponentInstance) => void;
13150
- /** Removes the component being visited from the composition */
13151
- removeComponent: () => void;
13152
- /** Inserts a new component immediately after the current component in its parent slot */
13153
- insertAfter: (components: ComponentInstance | ComponentInstance[]) => void;
13154
- /** Aborts visitation of components that are in child slots of the current component */
13155
- stopProcessingDescendants: () => void;
13156
- /**
13157
- * Set a new traversal context for descendants of this node.
13158
- * If this is not called, `context` will automatically pass through.
13159
- */
13160
- setDescendantsContext: (context: TContext) => void;
13161
- setChildContext: (child: ComponentInstance, context: TContext) => void;
13162
- };
13163
- /**
13164
- * Walks a composition's component tree, visiting each component instance depth-first, in order.
13165
- * @deprecated use walkNodeTree
13166
- */
13167
- declare function walkComponentTree<TContext = unknown>(component: ComponentInstance, visitor: (component: ComponentInstance, ancestorsAndSelf: Array<ComponentLocationReference>, actions: WalkComponentTreeActions<TContext>,
13168
- /** Traversal context for this node */
13169
- currentContext: TContext | undefined) => void, initialContext?: TContext): void;
13170
-
13171
13220
  /** Ancestor location that is in a slot on a component */
13172
13221
  type ComponentLocationReferenceV2 = {
13173
13222
  type: 'slot';
@@ -13235,8 +13284,49 @@ declare function walkNodeTree<TContext = unknown>(node: ComponentInstance | Entr
13235
13284
  /** Gets the typed value of a block parameter or block field */
13236
13285
  declare function getBlockValue(component: ComponentInstance | EntryData, parameterName: string): BlockValue;
13237
13286
 
13287
+ interface FindInNodeTreeReference {
13288
+ key: string;
13289
+ pointer: string;
13290
+ /** This might be the composition parameter, or entry field */
13291
+ parameter: ComponentParameter;
13292
+ }
13293
+ declare function findParameterInNodeTree(data: ComponentInstance | EntryData | Array<NodeLocationReference>, predicate: (parameter: ComponentParameter, parameterKey: string, node: ComponentInstance | EntryData | Array<NodeLocationReference>) => boolean): FindInNodeTreeReference[];
13294
+
13295
+ /** @deprecated use walkNodeTree */
13296
+ type ComponentLocationReference = {
13297
+ component: ComponentInstance;
13298
+ parentSlot?: string;
13299
+ parentSlotIndex?: number;
13300
+ };
13301
+ /** @deprecated use walkNodeTree and check for type = slot */
13302
+ type WalkComponentTreeActions<TContext> = {
13303
+ /** Replaces the component being visited with a new object */
13304
+ replaceComponent: (replacementComponent: ComponentInstance) => void;
13305
+ /** Removes the component being visited from the composition */
13306
+ removeComponent: () => void;
13307
+ /** Inserts a new component immediately after the current component in its parent slot */
13308
+ insertAfter: (components: ComponentInstance | ComponentInstance[]) => void;
13309
+ /** Aborts visitation of components that are in child slots of the current component */
13310
+ stopProcessingDescendants: () => void;
13311
+ /**
13312
+ * Set a new traversal context for descendants of this node.
13313
+ * If this is not called, `context` will automatically pass through.
13314
+ */
13315
+ setDescendantsContext: (context: TContext) => void;
13316
+ setChildContext: (child: ComponentInstance, context: TContext) => void;
13317
+ };
13318
+ /**
13319
+ * Walks a composition's component tree, visiting each component instance depth-first, in order.
13320
+ * @deprecated use walkNodeTree
13321
+ */
13322
+ declare function walkComponentTree<TContext = unknown>(component: ComponentInstance, visitor: (component: ComponentInstance, ancestorsAndSelf: Array<ComponentLocationReference>, actions: WalkComponentTreeActions<TContext>,
13323
+ /** Traversal context for this node */
13324
+ currentContext: TContext | undefined) => void, initialContext?: TContext): void;
13325
+
13238
13326
  /** Returns the JSON pointer of a component based on its location */
13239
13327
  declare function getComponentJsonPointer(ancestorsAndSelf: Array<NodeLocationReference | ComponentLocationReference>): string;
13328
+ declare function getNounForLocation(parentLocation: NodeLocationReference | ComponentLocationReference | undefined): "parameters" | "fields";
13329
+ declare function getNounForNode(node: ComponentInstance | EntryData | Array<NodeLocationReference>): "parameters" | "fields";
13240
13330
 
13241
13331
  declare function getComponentPath(ancestorsAndSelf: Array<ComponentLocationReference | NodeLocationReference>): string;
13242
13332
 
@@ -13694,7 +13784,17 @@ declare function isRootEntryReference(root: NodeLocationReference): root is Root
13694
13784
  * Check to see if some generic composition data structure
13695
13785
  * looks like Entry data
13696
13786
  */
13697
- declare function isEntryData(entryData: ComponentInstance | EntryData | null | undefined): entryData is EntryData;
13787
+ declare function isEntryData(entryData: ComponentInstance | EntryData | null | undefined | unknown): entryData is EntryData;
13788
+ /**
13789
+ * A fast, non-exhaustive guard which checks the value is an array
13790
+ * as well as the first item if there is one.
13791
+ */
13792
+ declare function isAssetParamValue(value: unknown): value is AssetParamValue;
13793
+ /**
13794
+ * A fast, non-exhaustive guard which checks the
13795
+ * required structure
13796
+ */
13797
+ declare function isAssetParamValueItem(item: unknown): item is AssetParamValueItem;
13698
13798
 
13699
13799
  declare const generateHash: ({ composition, secret, }: {
13700
13800
  composition: RootComponentInstance;
@@ -13784,4 +13884,4 @@ declare function parseVariableExpression(serialized: string, onToken?: (token: s
13784
13884
 
13785
13885
  declare const CanvasClientError: typeof ApiClientError;
13786
13886
 
13787
- export { ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, AddComponentMessage, 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, EventNames, 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, generateComponentPlaceholderId, generateHash, getBlockValue, getChannelName, getComponentJsonPointer, getComponentPath, getParameterAttributes, getPropertiesValue, isAddComponentMessage, isAllowedReferrer, 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 };
13887
+ 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, 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
@@ -12489,8 +12489,9 @@ interface paths$1 {
12489
12489
  parameters: {
12490
12490
  query: {
12491
12491
  projectId: string;
12492
- type: "definition";
12492
+ type: "definition" | "instance";
12493
12493
  definitionIds?: string;
12494
+ instanceIds?: string;
12494
12495
  withCompositions?: boolean | null;
12495
12496
  };
12496
12497
  };
@@ -12850,6 +12851,85 @@ type schemas = components$1['schemas'];
12850
12851
  type InvalidationPayload = schemas['InvalidationPayload'];
12851
12852
  type BatchInvalidationPayload = schemas['BatchInvalidationPayload'];
12852
12853
 
12854
+ /** This is the type value for the asset parameter or field */
12855
+ declare const ASSET_PARAMETER_TYPE = "asset";
12856
+ declare const ASSETS_SOURCE_UNIFORM = "uniform-assets";
12857
+ declare const ASSETS_SOURCE_CUSTOM_URL = "custom-url";
12858
+ type AssetParamValue = AssetParamValueItem[];
12859
+ type AssetParamValueItem = {
12860
+ type: string;
12861
+ _id: string;
12862
+ /**
12863
+ * Internal Uniform source ID or
12864
+ * dataType ID of the global integration library
12865
+ * which created this asset item
12866
+ */
12867
+ _source?: string;
12868
+ fields: {
12869
+ url: {
12870
+ type: 'text';
12871
+ value: string;
12872
+ };
12873
+ id?: {
12874
+ type: 'text';
12875
+ value: string | undefined;
12876
+ };
12877
+ title?: {
12878
+ type: 'text';
12879
+ value: string | undefined;
12880
+ };
12881
+ description?: {
12882
+ type: 'text';
12883
+ value: string | undefined;
12884
+ };
12885
+ mediaType?: {
12886
+ type: 'text';
12887
+ value: string | undefined;
12888
+ };
12889
+ /**
12890
+ * The width of the original asset
12891
+ *
12892
+ * Should resolve to a number but might
12893
+ * be a string with a pointer reference
12894
+ */
12895
+ width?: {
12896
+ type: 'number';
12897
+ value: number | string | undefined;
12898
+ };
12899
+ /**
12900
+ * The height of the original asset
12901
+ *
12902
+ * Should resolve to a number but might
12903
+ * be a string with a pointer reference
12904
+ */
12905
+ height?: {
12906
+ type: 'number';
12907
+ value: number | string | undefined;
12908
+ };
12909
+ /**
12910
+ * The size in bytes of the original asset
12911
+ *
12912
+ * Should resolve to a number but might
12913
+ * be a string with a pointer reference
12914
+ */
12915
+ size?: {
12916
+ type: 'number';
12917
+ value: number | string | undefined;
12918
+ };
12919
+ /**
12920
+ * Any key/value properties which the source
12921
+ * wants to attach to the asset data
12922
+ */
12923
+ custom?: {
12924
+ type: string;
12925
+ value: Record<string, unknown>;
12926
+ };
12927
+ };
12928
+ _overrides?: {
12929
+ fields: ComponentOverride['parameters'];
12930
+ };
12931
+ };
12932
+
12853
12933
  type LinkParameterType = 'projectMapNode' | 'url' | 'tel' | 'email';
12854
12934
  type LinkTypeConfiguration = Partial<Record<LinkParameterType, boolean>>;
12855
12935
  type LinkParamConfiguration = {
@@ -13137,37 +13217,6 @@ declare function enhance<TContext extends EnhancerContext = EnhancerContext>({ c
13137
13217
  onErrors?: (errors: EnhancerError[]) => void;
13138
13218
  }): Promise<void>;
13139
13219
 
13140
- /** @deprecated use walkNodeTree */
13141
- type ComponentLocationReference = {
13142
- component: ComponentInstance;
13143
- parentSlot?: string;
13144
- parentSlotIndex?: number;
13145
- };
13146
- /** @deprecated use walkNodeTree and check for type = slot */
13147
- type WalkComponentTreeActions<TContext> = {
13148
- /** Replaces the component being visited with a new object */
13149
- replaceComponent: (replacementComponent: ComponentInstance) => void;
13150
- /** Removes the component being visited from the composition */
13151
- removeComponent: () => void;
13152
- /** Inserts a new component immediately after the current component in its parent slot */
13153
- insertAfter: (components: ComponentInstance | ComponentInstance[]) => void;
13154
- /** Aborts visitation of components that are in child slots of the current component */
13155
- stopProcessingDescendants: () => void;
13156
- /**
13157
- * Set a new traversal context for descendants of this node.
13158
- * If this is not called, `context` will automatically pass through.
13159
- */
13160
- setDescendantsContext: (context: TContext) => void;
13161
- setChildContext: (child: ComponentInstance, context: TContext) => void;
13162
- };
13163
- /**
13164
- * Walks a composition's component tree, visiting each component instance depth-first, in order.
13165
- * @deprecated use walkNodeTree
13166
- */
13167
- declare function walkComponentTree<TContext = unknown>(component: ComponentInstance, visitor: (component: ComponentInstance, ancestorsAndSelf: Array<ComponentLocationReference>, actions: WalkComponentTreeActions<TContext>,
13168
- /** Traversal context for this node */
13169
- currentContext: TContext | undefined) => void, initialContext?: TContext): void;
13170
-
13171
13220
  /** Ancestor location that is in a slot on a component */
13172
13221
  type ComponentLocationReferenceV2 = {
13173
13222
  type: 'slot';
@@ -13235,8 +13284,49 @@ declare function walkNodeTree<TContext = unknown>(node: ComponentInstance | Entr
13235
13284
  /** Gets the typed value of a block parameter or block field */
13236
13285
  declare function getBlockValue(component: ComponentInstance | EntryData, parameterName: string): BlockValue;
13237
13286
 
13287
+ interface FindInNodeTreeReference {
13288
+ key: string;
13289
+ pointer: string;
13290
+ /** This might be the composition parameter, or entry field */
13291
+ parameter: ComponentParameter;
13292
+ }
13293
+ declare function findParameterInNodeTree(data: ComponentInstance | EntryData | Array<NodeLocationReference>, predicate: (parameter: ComponentParameter, parameterKey: string, node: ComponentInstance | EntryData | Array<NodeLocationReference>) => boolean): FindInNodeTreeReference[];
13294
+
13295
+ /** @deprecated use walkNodeTree */
13296
+ type ComponentLocationReference = {
13297
+ component: ComponentInstance;
13298
+ parentSlot?: string;
13299
+ parentSlotIndex?: number;
13300
+ };
13301
+ /** @deprecated use walkNodeTree and check for type = slot */
13302
+ type WalkComponentTreeActions<TContext> = {
13303
+ /** Replaces the component being visited with a new object */
13304
+ replaceComponent: (replacementComponent: ComponentInstance) => void;
13305
+ /** Removes the component being visited from the composition */
13306
+ removeComponent: () => void;
13307
+ /** Inserts a new component immediately after the current component in its parent slot */
13308
+ insertAfter: (components: ComponentInstance | ComponentInstance[]) => void;
13309
+ /** Aborts visitation of components that are in child slots of the current component */
13310
+ stopProcessingDescendants: () => void;
13311
+ /**
13312
+ * Set a new traversal context for descendants of this node.
13313
+ * If this is not called, `context` will automatically pass through.
13314
+ */
13315
+ setDescendantsContext: (context: TContext) => void;
13316
+ setChildContext: (child: ComponentInstance, context: TContext) => void;
13317
+ };
13318
+ /**
13319
+ * Walks a composition's component tree, visiting each component instance depth-first, in order.
13320
+ * @deprecated use walkNodeTree
13321
+ */
13322
+ declare function walkComponentTree<TContext = unknown>(component: ComponentInstance, visitor: (component: ComponentInstance, ancestorsAndSelf: Array<ComponentLocationReference>, actions: WalkComponentTreeActions<TContext>,
13323
+ /** Traversal context for this node */
13324
+ currentContext: TContext | undefined) => void, initialContext?: TContext): void;
13325
+
13238
13326
  /** Returns the JSON pointer of a component based on its location */
13239
13327
  declare function getComponentJsonPointer(ancestorsAndSelf: Array<NodeLocationReference | ComponentLocationReference>): string;
13328
+ declare function getNounForLocation(parentLocation: NodeLocationReference | ComponentLocationReference | undefined): "parameters" | "fields";
13329
+ declare function getNounForNode(node: ComponentInstance | EntryData | Array<NodeLocationReference>): "parameters" | "fields";
13240
13330
 
13241
13331
  declare function getComponentPath(ancestorsAndSelf: Array<ComponentLocationReference | NodeLocationReference>): string;
13242
13332
 
@@ -13694,7 +13784,17 @@ declare function isRootEntryReference(root: NodeLocationReference): root is Root
13694
13784
  * Check to see if some generic composition data structure
13695
13785
  * looks like Entry data
13696
13786
  */
13697
- declare function isEntryData(entryData: ComponentInstance | EntryData | null | undefined): entryData is EntryData;
13787
+ declare function isEntryData(entryData: ComponentInstance | EntryData | null | undefined | unknown): entryData is EntryData;
13788
+ /**
13789
+ * A fast, non-exhaustive guard which checks the value is an array
13790
+ * as well as the first item if there is one.
13791
+ */
13792
+ declare function isAssetParamValue(value: unknown): value is AssetParamValue;
13793
+ /**
13794
+ * A fast, non-exhaustive guard which checks the
13795
+ * required structure
13796
+ */
13797
+ declare function isAssetParamValueItem(item: unknown): item is AssetParamValueItem;
13698
13798
 
13699
13799
  declare const generateHash: ({ composition, secret, }: {
13700
13800
  composition: RootComponentInstance;
@@ -13784,4 +13884,4 @@ declare function parseVariableExpression(serialized: string, onToken?: (token: s
13784
13884
 
13785
13885
  declare const CanvasClientError: typeof ApiClientError;
13786
13886
 
13787
- export { ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, AddComponentMessage, 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, EventNames, 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, generateComponentPlaceholderId, generateHash, getBlockValue, getChannelName, getComponentJsonPointer, getComponentPath, getParameterAttributes, getPropertiesValue, isAddComponentMessage, isAllowedReferrer, 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 };
13887
+ 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, 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
@@ -1027,6 +1027,14 @@ function isRootEntryReference(root) {
1027
1027
  function isEntryData(entryData) {
1028
1028
  return Boolean(entryData && typeof entryData === "object" && "fields" in entryData);
1029
1029
  }
1030
+ function isAssetParamValue(value) {
1031
+ return Array.isArray(value) && (value.length > 0 ? isAssetParamValueItem(value[0]) : true);
1032
+ }
1033
+ function isAssetParamValueItem(item) {
1034
+ return Boolean(
1035
+ item instanceof Object && "_source" in item && "fields" in item && item.fields instanceof Object && "url" in item.fields && item.fields.url instanceof Object
1036
+ );
1037
+ }
1030
1038
 
1031
1039
  // src/enhancement/walkNodeTree.ts
1032
1040
  function walkNodeTree(node, visitor, options) {
@@ -1567,6 +1575,31 @@ function getNounForLocation(parentLocation) {
1567
1575
  }
1568
1576
  return noun;
1569
1577
  }
1578
+ function getNounForNode(node) {
1579
+ let noun = "parameters";
1580
+ if (isEntryData(node)) {
1581
+ noun = "fields";
1582
+ }
1583
+ return noun;
1584
+ }
1585
+
1586
+ // src/enhancement/findInNodeTree.ts
1587
+ function findParameterInNodeTree(data, predicate) {
1588
+ const results = [];
1589
+ walkNodeTree(data, ({ node, ancestorsAndSelf }) => {
1590
+ const parameters = getPropertiesValue(node);
1591
+ if (parameters) {
1592
+ Object.entries(parameters).filter(([key, field]) => predicate(field, key, node)).forEach(([key, field]) => {
1593
+ results.push({
1594
+ key,
1595
+ pointer: (ancestorsAndSelf.length === 1 ? "" : getComponentJsonPointer(ancestorsAndSelf)) + `/${getNounForNode(node)}/${key}`,
1596
+ parameter: field
1597
+ });
1598
+ });
1599
+ }
1600
+ });
1601
+ return results;
1602
+ }
1570
1603
 
1571
1604
  // src/enhancement/localize.ts
1572
1605
  function extractLocales({ component }) {
@@ -2166,6 +2199,11 @@ var RouteClient = class extends ApiClient8 {
2166
2199
  }
2167
2200
  };
2168
2201
 
2202
+ // src/types/parameters/assetParameterTypes.ts
2203
+ var ASSET_PARAMETER_TYPE = "asset";
2204
+ var ASSETS_SOURCE_UNIFORM = "uniform-assets";
2205
+ var ASSETS_SOURCE_CUSTOM_URL = "custom-url";
2206
+
2169
2207
  // src/utils/createApiEnhancer.ts
2170
2208
  var createUniformApiEnhancer = ({ apiUrl }) => {
2171
2209
  return async (message) => {
@@ -2463,6 +2501,9 @@ function handleRichTextNodeBinding(object, options) {
2463
2501
  import { ApiClientError as ApiClientError2 } from "@uniformdev/context/api";
2464
2502
  var CanvasClientError = ApiClientError2;
2465
2503
  export {
2504
+ ASSETS_SOURCE_CUSTOM_URL,
2505
+ ASSETS_SOURCE_UNIFORM,
2506
+ ASSET_PARAMETER_TYPE,
2466
2507
  ATTRIBUTE_COMPONENT_ID,
2467
2508
  ATTRIBUTE_MULTILINE,
2468
2509
  ATTRIBUTE_PARAMETER_ID,
@@ -2526,16 +2567,21 @@ export {
2526
2567
  createVariableReference,
2527
2568
  enhance,
2528
2569
  extractLocales,
2570
+ findParameterInNodeTree,
2529
2571
  generateComponentPlaceholderId,
2530
2572
  generateHash,
2531
2573
  getBlockValue,
2532
2574
  getChannelName,
2533
2575
  getComponentJsonPointer,
2534
2576
  getComponentPath,
2577
+ getNounForLocation,
2578
+ getNounForNode,
2535
2579
  getParameterAttributes,
2536
2580
  getPropertiesValue,
2537
2581
  isAddComponentMessage,
2538
2582
  isAllowedReferrer,
2583
+ isAssetParamValue,
2584
+ isAssetParamValueItem,
2539
2585
  isComponentActionMessage,
2540
2586
  isComponentPlaceholderId,
2541
2587
  isDismissPlaceholderMessage,
package/dist/index.js CHANGED
@@ -277,6 +277,9 @@ var require_retry2 = __commonJS({
277
277
  // src/index.ts
278
278
  var src_exports = {};
279
279
  __export(src_exports, {
280
+ ASSETS_SOURCE_CUSTOM_URL: () => ASSETS_SOURCE_CUSTOM_URL,
281
+ ASSETS_SOURCE_UNIFORM: () => ASSETS_SOURCE_UNIFORM,
282
+ ASSET_PARAMETER_TYPE: () => ASSET_PARAMETER_TYPE,
280
283
  ATTRIBUTE_COMPONENT_ID: () => ATTRIBUTE_COMPONENT_ID,
281
284
  ATTRIBUTE_MULTILINE: () => ATTRIBUTE_MULTILINE,
282
285
  ATTRIBUTE_PARAMETER_ID: () => ATTRIBUTE_PARAMETER_ID,
@@ -340,16 +343,21 @@ __export(src_exports, {
340
343
  createVariableReference: () => createVariableReference,
341
344
  enhance: () => enhance,
342
345
  extractLocales: () => extractLocales,
346
+ findParameterInNodeTree: () => findParameterInNodeTree,
343
347
  generateComponentPlaceholderId: () => generateComponentPlaceholderId,
344
348
  generateHash: () => generateHash,
345
349
  getBlockValue: () => getBlockValue,
346
350
  getChannelName: () => getChannelName,
347
351
  getComponentJsonPointer: () => getComponentJsonPointer,
348
352
  getComponentPath: () => getComponentPath,
353
+ getNounForLocation: () => getNounForLocation,
354
+ getNounForNode: () => getNounForNode,
349
355
  getParameterAttributes: () => getParameterAttributes,
350
356
  getPropertiesValue: () => getPropertiesValue,
351
357
  isAddComponentMessage: () => isAddComponentMessage,
352
358
  isAllowedReferrer: () => isAllowedReferrer,
359
+ isAssetParamValue: () => isAssetParamValue,
360
+ isAssetParamValueItem: () => isAssetParamValueItem,
353
361
  isComponentActionMessage: () => isComponentActionMessage,
354
362
  isComponentPlaceholderId: () => isComponentPlaceholderId,
355
363
  isDismissPlaceholderMessage: () => isDismissPlaceholderMessage,
@@ -1141,6 +1149,14 @@ function isRootEntryReference(root) {
1141
1149
  function isEntryData(entryData) {
1142
1150
  return Boolean(entryData && typeof entryData === "object" && "fields" in entryData);
1143
1151
  }
1152
+ function isAssetParamValue(value) {
1153
+ return Array.isArray(value) && (value.length > 0 ? isAssetParamValueItem(value[0]) : true);
1154
+ }
1155
+ function isAssetParamValueItem(item) {
1156
+ return Boolean(
1157
+ item instanceof Object && "_source" in item && "fields" in item && item.fields instanceof Object && "url" in item.fields && item.fields.url instanceof Object
1158
+ );
1159
+ }
1144
1160
 
1145
1161
  // src/enhancement/walkNodeTree.ts
1146
1162
  function walkNodeTree(node, visitor, options) {
@@ -1681,6 +1697,31 @@ function getNounForLocation(parentLocation) {
1681
1697
  }
1682
1698
  return noun;
1683
1699
  }
1700
+ function getNounForNode(node) {
1701
+ let noun = "parameters";
1702
+ if (isEntryData(node)) {
1703
+ noun = "fields";
1704
+ }
1705
+ return noun;
1706
+ }
1707
+
1708
+ // src/enhancement/findInNodeTree.ts
1709
+ function findParameterInNodeTree(data, predicate) {
1710
+ const results = [];
1711
+ walkNodeTree(data, ({ node, ancestorsAndSelf }) => {
1712
+ const parameters = getPropertiesValue(node);
1713
+ if (parameters) {
1714
+ Object.entries(parameters).filter(([key, field]) => predicate(field, key, node)).forEach(([key, field]) => {
1715
+ results.push({
1716
+ key,
1717
+ pointer: (ancestorsAndSelf.length === 1 ? "" : getComponentJsonPointer(ancestorsAndSelf)) + `/${getNounForNode(node)}/${key}`,
1718
+ parameter: field
1719
+ });
1720
+ });
1721
+ }
1722
+ });
1723
+ return results;
1724
+ }
1684
1725
 
1685
1726
  // src/enhancement/localize.ts
1686
1727
  function extractLocales({ component }) {
@@ -2280,6 +2321,11 @@ var RouteClient = class extends import_api9.ApiClient {
2280
2321
  }
2281
2322
  };
2282
2323
 
2324
+ // src/types/parameters/assetParameterTypes.ts
2325
+ var ASSET_PARAMETER_TYPE = "asset";
2326
+ var ASSETS_SOURCE_UNIFORM = "uniform-assets";
2327
+ var ASSETS_SOURCE_CUSTOM_URL = "custom-url";
2328
+
2283
2329
  // src/utils/createApiEnhancer.ts
2284
2330
  var createUniformApiEnhancer = ({ apiUrl }) => {
2285
2331
  return async (message) => {
@@ -2578,6 +2624,9 @@ var import_api10 = require("@uniformdev/context/api");
2578
2624
  var CanvasClientError = import_api10.ApiClientError;
2579
2625
  // Annotate the CommonJS export names for ESM import in node:
2580
2626
  0 && (module.exports = {
2627
+ ASSETS_SOURCE_CUSTOM_URL,
2628
+ ASSETS_SOURCE_UNIFORM,
2629
+ ASSET_PARAMETER_TYPE,
2581
2630
  ATTRIBUTE_COMPONENT_ID,
2582
2631
  ATTRIBUTE_MULTILINE,
2583
2632
  ATTRIBUTE_PARAMETER_ID,
@@ -2641,16 +2690,21 @@ var CanvasClientError = import_api10.ApiClientError;
2641
2690
  createVariableReference,
2642
2691
  enhance,
2643
2692
  extractLocales,
2693
+ findParameterInNodeTree,
2644
2694
  generateComponentPlaceholderId,
2645
2695
  generateHash,
2646
2696
  getBlockValue,
2647
2697
  getChannelName,
2648
2698
  getComponentJsonPointer,
2649
2699
  getComponentPath,
2700
+ getNounForLocation,
2701
+ getNounForNode,
2650
2702
  getParameterAttributes,
2651
2703
  getPropertiesValue,
2652
2704
  isAddComponentMessage,
2653
2705
  isAllowedReferrer,
2706
+ isAssetParamValue,
2707
+ isAssetParamValueItem,
2654
2708
  isComponentActionMessage,
2655
2709
  isComponentPlaceholderId,
2656
2710
  isDismissPlaceholderMessage,
package/dist/index.mjs CHANGED
@@ -1027,6 +1027,14 @@ function isRootEntryReference(root) {
1027
1027
  function isEntryData(entryData) {
1028
1028
  return Boolean(entryData && typeof entryData === "object" && "fields" in entryData);
1029
1029
  }
1030
+ function isAssetParamValue(value) {
1031
+ return Array.isArray(value) && (value.length > 0 ? isAssetParamValueItem(value[0]) : true);
1032
+ }
1033
+ function isAssetParamValueItem(item) {
1034
+ return Boolean(
1035
+ item instanceof Object && "_source" in item && "fields" in item && item.fields instanceof Object && "url" in item.fields && item.fields.url instanceof Object
1036
+ );
1037
+ }
1030
1038
 
1031
1039
  // src/enhancement/walkNodeTree.ts
1032
1040
  function walkNodeTree(node, visitor, options) {
@@ -1567,6 +1575,31 @@ function getNounForLocation(parentLocation) {
1567
1575
  }
1568
1576
  return noun;
1569
1577
  }
1578
+ function getNounForNode(node) {
1579
+ let noun = "parameters";
1580
+ if (isEntryData(node)) {
1581
+ noun = "fields";
1582
+ }
1583
+ return noun;
1584
+ }
1585
+
1586
+ // src/enhancement/findInNodeTree.ts
1587
+ function findParameterInNodeTree(data, predicate) {
1588
+ const results = [];
1589
+ walkNodeTree(data, ({ node, ancestorsAndSelf }) => {
1590
+ const parameters = getPropertiesValue(node);
1591
+ if (parameters) {
1592
+ Object.entries(parameters).filter(([key, field]) => predicate(field, key, node)).forEach(([key, field]) => {
1593
+ results.push({
1594
+ key,
1595
+ pointer: (ancestorsAndSelf.length === 1 ? "" : getComponentJsonPointer(ancestorsAndSelf)) + `/${getNounForNode(node)}/${key}`,
1596
+ parameter: field
1597
+ });
1598
+ });
1599
+ }
1600
+ });
1601
+ return results;
1602
+ }
1570
1603
 
1571
1604
  // src/enhancement/localize.ts
1572
1605
  function extractLocales({ component }) {
@@ -2166,6 +2199,11 @@ var RouteClient = class extends ApiClient8 {
2166
2199
  }
2167
2200
  };
2168
2201
 
2202
+ // src/types/parameters/assetParameterTypes.ts
2203
+ var ASSET_PARAMETER_TYPE = "asset";
2204
+ var ASSETS_SOURCE_UNIFORM = "uniform-assets";
2205
+ var ASSETS_SOURCE_CUSTOM_URL = "custom-url";
2206
+
2169
2207
  // src/utils/createApiEnhancer.ts
2170
2208
  var createUniformApiEnhancer = ({ apiUrl }) => {
2171
2209
  return async (message) => {
@@ -2463,6 +2501,9 @@ function handleRichTextNodeBinding(object, options) {
2463
2501
  import { ApiClientError as ApiClientError2 } from "@uniformdev/context/api";
2464
2502
  var CanvasClientError = ApiClientError2;
2465
2503
  export {
2504
+ ASSETS_SOURCE_CUSTOM_URL,
2505
+ ASSETS_SOURCE_UNIFORM,
2506
+ ASSET_PARAMETER_TYPE,
2466
2507
  ATTRIBUTE_COMPONENT_ID,
2467
2508
  ATTRIBUTE_MULTILINE,
2468
2509
  ATTRIBUTE_PARAMETER_ID,
@@ -2526,16 +2567,21 @@ export {
2526
2567
  createVariableReference,
2527
2568
  enhance,
2528
2569
  extractLocales,
2570
+ findParameterInNodeTree,
2529
2571
  generateComponentPlaceholderId,
2530
2572
  generateHash,
2531
2573
  getBlockValue,
2532
2574
  getChannelName,
2533
2575
  getComponentJsonPointer,
2534
2576
  getComponentPath,
2577
+ getNounForLocation,
2578
+ getNounForNode,
2535
2579
  getParameterAttributes,
2536
2580
  getPropertiesValue,
2537
2581
  isAddComponentMessage,
2538
2582
  isAllowedReferrer,
2583
+ isAssetParamValue,
2584
+ isAssetParamValueItem,
2539
2585
  isComponentActionMessage,
2540
2586
  isComponentPlaceholderId,
2541
2587
  isDismissPlaceholderMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.80.0",
3
+ "version": "19.81.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.80.0",
42
- "@uniformdev/context": "19.80.0",
41
+ "@uniformdev/assets": "19.81.1",
42
+ "@uniformdev/context": "19.81.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": "8c61dce79f176cb5aa3cb163657326407f17dee6"
51
+ "gitHead": "e72e4f188122bfe8b9944515be927d1f3febf257"
52
52
  }