@uniformdev/canvas 19.199.0 → 19.199.1-alpha.10

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
@@ -1,6 +1,6 @@
1
1
  import { ApiClient, ExceptProject, ClientOptions, ApiClientError } from '@uniformdev/context/api';
2
2
  export { ApiClientError } from '@uniformdev/context/api';
3
- import { AssetGetResponseSingle } from '@uniformdev/assets';
3
+ import { AssetGetResponseSingle, AssetDefinitionType } from '@uniformdev/assets';
4
4
  import { Quirks, StorageCommands, PersonalizedVariant, TestVariant } from '@uniformdev/context';
5
5
  import Pusher from 'pusher-js';
6
6
  import { Options as Options$1 } from 'p-retry';
@@ -467,6 +467,13 @@ interface components$n {
467
467
  [key: string]: components$n["schemas"]["ComponentInstance"][];
468
468
  };
469
469
  variant?: string;
470
+ /** @description Overrides data resource definitions for a pattern component.
471
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
472
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
473
+ * */
474
+ dataResources?: {
475
+ [key: string]: components$n["schemas"]["DataResourceDefinition"];
476
+ };
470
477
  };
471
478
  /**
472
479
  * @description Whether a parameter is overridable
@@ -1081,6 +1088,13 @@ interface components$m {
1081
1088
  [key: string]: components$m["schemas"]["ComponentInstance"][];
1082
1089
  };
1083
1090
  variant?: string;
1091
+ /** @description Overrides data resource definitions for a pattern component.
1092
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
1093
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
1094
+ * */
1095
+ dataResources?: {
1096
+ [key: string]: components$m["schemas"]["DataResourceDefinition"];
1097
+ };
1084
1098
  };
1085
1099
  /** @description Defines how a component on a pattern may have its values overridden.
1086
1100
  * NOTE: Data resources' overridability is defined in the data resource definition, not here.
@@ -1756,6 +1770,11 @@ declare const CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
1756
1770
  declare const CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
1757
1771
  /** Public ID of the Uniform Context enrichment tag parameter on Canvas components */
1758
1772
  declare const CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
1773
+ /**
1774
+ * @deprecated
1775
+ * Public ID of Contextual Editing parameter on Canvas components
1776
+ */
1777
+ declare const CANVAS_CONTEXTUAL_EDITING_PARAM = "$contextualEditing";
1759
1778
  /**
1760
1779
  * The name of the query string used to set a secret to protect for the preview mode.
1761
1780
  * This is not configurable at the moment.
@@ -2231,6 +2250,13 @@ interface components$k {
2231
2250
  [key: string]: components$k["schemas"]["ComponentInstance"][];
2232
2251
  };
2233
2252
  variant?: string;
2253
+ /** @description Overrides data resource definitions for a pattern component.
2254
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
2255
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
2256
+ * */
2257
+ dataResources?: {
2258
+ [key: string]: components$k["schemas"]["DataResourceDefinition"];
2259
+ };
2234
2260
  };
2235
2261
  /**
2236
2262
  * @description Whether a parameter is overridable
@@ -3351,6 +3377,13 @@ interface components$i {
3351
3377
  [key: string]: components$i["schemas"]["ComponentInstance"][];
3352
3378
  };
3353
3379
  variant?: string;
3380
+ /** @description Overrides data resource definitions for a pattern component.
3381
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
3382
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
3383
+ * */
3384
+ dataResources?: {
3385
+ [key: string]: components$i["schemas"]["DataResourceDefinition"];
3386
+ };
3354
3387
  };
3355
3388
  /**
3356
3389
  * @description Whether a parameter is overridable
@@ -5521,6 +5554,13 @@ interface components$b {
5521
5554
  [key: string]: components$b["schemas"]["ComponentInstance"][];
5522
5555
  };
5523
5556
  variant?: string;
5557
+ /** @description Overrides data resource definitions for a pattern component.
5558
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
5559
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
5560
+ * */
5561
+ dataResources?: {
5562
+ [key: string]: components$b["schemas"]["DataResourceDefinition"];
5563
+ };
5524
5564
  };
5525
5565
  /**
5526
5566
  * @description Whether a parameter is overridable
@@ -6646,6 +6686,13 @@ interface components$a {
6646
6686
  [key: string]: components$a["schemas"]["ComponentInstance"][];
6647
6687
  };
6648
6688
  variant?: string;
6689
+ /** @description Overrides data resource definitions for a pattern component.
6690
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
6691
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
6692
+ * */
6693
+ dataResources?: {
6694
+ [key: string]: components$a["schemas"]["DataResourceDefinition"];
6695
+ };
6649
6696
  };
6650
6697
  /**
6651
6698
  * @description Whether a parameter is overridable
@@ -7625,6 +7672,13 @@ interface components$8 {
7625
7672
  [key: string]: components$8["schemas"]["ComponentInstance"][];
7626
7673
  };
7627
7674
  variant?: string;
7675
+ /** @description Overrides data resource definitions for a pattern component.
7676
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
7677
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
7678
+ * */
7679
+ dataResources?: {
7680
+ [key: string]: components$8["schemas"]["DataResourceDefinition"];
7681
+ };
7628
7682
  };
7629
7683
  /**
7630
7684
  * @description Whether a parameter is overridable
@@ -8905,6 +8959,13 @@ interface components$7 {
8905
8959
  [key: string]: components$7["schemas"]["ComponentInstance"][];
8906
8960
  };
8907
8961
  variant?: string;
8962
+ /** @description Overrides data resource definitions for a pattern component.
8963
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
8964
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
8965
+ * */
8966
+ dataResources?: {
8967
+ [key: string]: components$7["schemas"]["DataResourceDefinition"];
8968
+ };
8908
8969
  };
8909
8970
  /**
8910
8971
  * @description Whether a parameter is overridable
@@ -9370,6 +9431,11 @@ type ComponentParameterBlock = Omit<ComponentParameter<BlockValue>, 'type'> & {
9370
9431
  };
9371
9432
  /** Value type of a block parameter or block field */
9372
9433
  type BlockValue = EntryData[];
9434
+ /** Value type of contextual editing parameter used with RSC CANVAS_EDITOR_STATE */
9435
+ type ContextualEditingValue = {
9436
+ /** Names of parameters on the component which are editable */
9437
+ editableParameters: string[];
9438
+ };
9373
9439
  /** The type of the parameters in contextual editing mode. */
9374
9440
  type ComponentParameterContextualEditing<TValue = unknown> = ComponentParameter<TValue> & {
9375
9441
  /** Data used for visual editing. It's not supposed to be used externally. The format might change without prior notice. */
@@ -9930,6 +9996,11 @@ type RichTextParamConfiguration = {
9930
9996
  elements?: {
9931
9997
  builtIn?: Array<RichTextBuiltInElement>;
9932
9998
  };
9999
+ elementsConfig?: {
10000
+ asset?: {
10001
+ allowedTypes?: AssetDefinitionType[];
10002
+ };
10003
+ };
9933
10004
  };
9934
10005
  type RichTextParamValue = ParameterRichTextValue;
9935
10006
 
@@ -11648,14 +11719,18 @@ type ComponentLocationReferenceV2 = {
11648
11719
  type: 'slot';
11649
11720
  node: ComponentInstance;
11650
11721
  parentSlot: string;
11722
+ /** @deprecated invoke parentSlotIndexFn instead, this property may be unreliable with some bundlers. This will be removed in the next major. */
11651
11723
  parentSlotIndex: number;
11724
+ parentSlotIndexFn: () => number;
11652
11725
  };
11653
11726
  /** Ancestor location that is in a block on a parameter or field */
11654
11727
  type BlockLocationReference = {
11655
11728
  type: 'block';
11656
11729
  node: EntryData;
11657
11730
  fieldName: string;
11731
+ /** @deprecated invoke blockIndexFn instead, this property may be unreliable with some bundlers. This will be removed in the next major. */
11658
11732
  blockIndex: number;
11733
+ blockIndexFn: () => number;
11659
11734
  };
11660
11735
  /** Ancestor location that is the root of a composition or entry */
11661
11736
  type RootLocationReference = {
@@ -12863,4 +12938,4 @@ declare class WorkflowClient extends ApiClient {
12863
12938
 
12864
12939
  declare const CanvasClientError: typeof ApiClientError;
12865
12940
 
12866
- export { ASSETS_SOURCE_CUSTOM_URL, ASSETS_SOURCE_UNIFORM, ASSET_PARAMETER_TYPE, ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, type AddComponentMessage, type AssetParamValue, type AssetParamValueItem, type BatchEnhancer, BatchEntry, type BatchInvalidationPayload, type BindVariablesOptions, type BindVariablesResult, type BindVariablesToObjectOptions, BlockFormatError, type BlockLocationReference, type BlockValue, CANVAS_BLOCK_PARAM_TYPE, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_SLOT_SECTION_SLOT, CANVAS_SLOT_SECTION_TYPE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CANVAS_VIZ_CONTROL_PARAM, CANVAS_VIZ_DI_RULE, CANVAS_VIZ_DYNAMIC_TOKEN_RULE, CANVAS_VIZ_LOCALE_RULE, CANVAS_VIZ_QUIRKS_RULE, CanvasClient, CanvasClientError, type CanvasDefinitions, type CategoriesDeleteParameters, type CategoriesGetParameters, type CategoriesGetResponse, type CategoriesPutParameters, type Category, CategoryClient, type Channel, type ChannelMessage, type ChannelSubscription, ChildEnhancerBuilder, type ComponentDefinition, type ComponentDefinitionDeleteParameters, type ComponentDefinitionGetParameters, type ComponentDefinitionGetResponse, type ComponentDefinitionParameter, type ComponentDefinitionPermission, type ComponentDefinitionPutParameters, type ComponentDefinitionSlot, type ComponentDefinitionSlugSettings, type ComponentDefinitionVariant, type ComponentEnhancer, type ComponentEnhancerFunction, type ComponentEnhancerOptions, type ComponentInstance, type ComponentInstanceContextualEditing, type ComponentInstanceHistoryEntry, type ComponentInstanceHistoryGetParameters, type ComponentInstanceHistoryGetResponse, type ComponentLocationReference, type ComponentLocationReferenceV2, type ComponentOverridability, type ComponentOverride, type ComponentOverrides, type ComponentParameter, type ComponentParameterBlock, type ComponentParameterConditionalValue, type ComponentParameterContextualEditing, type ComponentParameterEnhancer, type ComponentParameterEnhancerFunction, type ComponentParameterEnhancerOptions, type CompositionDataDiagnostic, type CompositionDeleteParameters, type CompositionDiagnostics, type CompositionFilters, type CompositionGetByComponentIdParameters, type CompositionGetByIdParameters, type CompositionGetByNodeIdParameters, type CompositionGetByNodePathParameters, type CompositionGetBySlugParameters, type CompositionGetListResponse, type CompositionGetOrderBy, type CompositionGetParameters, type CompositionGetResponse, type CompositionGetValidResponses, type CompositionIssue, type CompositionPatternIssue, type CompositionPutParameters, type CompositionResolvedGetResponse, type CompositionResolvedListResponse, type CompositionUIStatus, ContentClient, type ContentType, type ContentTypeField, type ContextStorageUpdatedMessage, type ContextualEditingComponentReference, type CopiedComponentSubtree, type DataDiagnostic, type DataElementBindingIssue, type DataElementConnectionDefinition, type DataElementConnectionFailureAction, type DataElementConnectionFailureLogLevel, type DataResolutionConfigIssue, type DataResolutionIssue, type DataResolutionOption, type DataResolutionOptionNegative, type DataResolutionOptionPositive, type DataResolutionParameters, type DataResourceDefinition, type DataResourceDefinitions, type DataResourceIssue, type DataResourceVariables, type DataSource, DataSourceClient, type DataSourceDeleteParameters, type DataSourceGetParameters, type DataSourceGetResponse, type DataSourcePutParameters, type DataSourceVariantData, type DataSourceVariantsKeys, type DataSourcesGetParameters, type DataSourcesGetResponse, type DataType, DataTypeClient, type DataTypeDeleteParameters, type DataTypeGetParameters, type DataTypeGetResponse, type DataTypePutParameters, type DataVariableDefinition, type DataWithProperties, type DeleteContentTypeOptions, type DeleteEntryOptions, type DismissPlaceholderMessage, type DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, type EdgehancersDiagnostics, type EdgehancersWholeResponseCacheDiagnostics, type EditorStateUpdatedMessage, EnhancerBuilder, type EnhancerContext, type EnhancerError, EntityReleasesClient, type EntityReleasesGetParameters, type EntityReleasesGetResponse, type EntriesGetParameters, type EntriesGetResponse, type EntriesHistoryGetParameters, type EntriesHistoryGetResponse, type EntriesResolvedListResponse, type Entry, type EntryData, type EntryFilters, type EntryList, type EvaluateCriteriaGroupOptions, type EvaluateNodeTreeVisibilityOptions, type EvaluateNodeVisibilityParameterOptions, type EvaluatePropertyCriteriaOptions, type EvaluateWalkTreePropertyCriteriaOptions, type EventNames, type Filters, type FindInNodeTreeReference, type FlattenProperty, type FlattenValues, type FlattenValuesOptions, type GetContentTypesOptions, type GetContentTypesResponse, type GetEntriesOptions, type GetEntriesResponse, type GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_FORCED_SETTINGS_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, type InvalidationPayload, LOCALE_DYNAMIC_INPUT_NAME, type LimitPolicy, type LinkComponentParameterValue, type LinkParamConfiguration, type LinkParamValue, type LinkParameterType, type LinkTypeConfiguration, type Locale, LocaleClient, type LocaleDeleteParameters, type LocalePutParameters, type LocalesGetParameters, type LocalesGetResponse, type LocalizeDeprecatedOptions, type LocalizeModernOptions, type MaxDepthExceededIssue, type MessageHandler, type MoveComponentMessage, type NodeLocationReference, type NonProjectMapLinkParamValue, type OpenParameterEditorMessage, type OverrideOptions, PLACEHOLDER_ID, type PatternIssue, PreviewClient, type PreviewEventBus, type PreviewPanelSettings, type PreviewUrl, type PreviewUrlDeleteParameters, type PreviewUrlDeleteResponse, type PreviewUrlPutParameters, type PreviewUrlPutResponse, type PreviewUrlsGetParameters, type PreviewUrlsGetResponse, type PreviewViewport, type PreviewViewportDeleteParameters, type PreviewViewportDeleteResponse, type PreviewViewportPutParameters, type PreviewViewportPutResponse, type PreviewViewportsGetParameters, type PreviewViewportsGetResponse, type ProjectMapLinkComponentParameterValue, type ProjectMapLinkParamValue, type Prompt, PromptClient, type PromptsDeleteParameters, type PromptsGetParameters, type PromptsGetResponse, type PromptsPutParameters, type PropertyCriteriaMatch, type PutContentTypeBody, type PutEntryBody, type ReadyMessage, RelationshipClient, type RelationshipResultInstance, type Release, ReleaseClient, type ReleaseContent, ReleaseContentsClient, type ReleaseContentsDeleteBody, type ReleaseContentsGetParameters, type ReleaseContentsGetResponse, type ReleaseDeleteParameters, type ReleasePatchParameters, type ReleasePutParameters, type ReleaseState, type ReleasesGetParameters, type ReleasesGetResponse, type ReportRenderedCompositionsMessage, type RequestComponentSuggestionMessage, type ResolvedRouteGetResponse, type RichTextBuiltInElement, type RichTextBuiltInFormat, type RichTextParamConfiguration, type RichTextParamValue, type RootComponentInstance, type RootEntryReference, type RootLocationReference, RouteClient, type RouteDynamicInputs, type RouteGetParameters, type RouteGetResponse, type RouteGetResponseComposition, type RouteGetResponseEdgehancedComposition, type RouteGetResponseEdgehancedNotFound, type RouteGetResponseNotFound, type RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, type SelectComponentMessage, type SelectParameterMessage, type SpecificProjectMap, type StringOperators, type SubscribeToCompositionOptions, type SuggestComponentMessage, type TreeNodeInfoTypes, type TriggerComponentActionMessage, type TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, type UnsubscribeCallback, type UpdateComponentParameterMessage, type UpdateComponentReferencesMessage, type UpdateCompositionInternalMessage, type UpdateCompositionMessage, type UpdateContextualEditingStateInternalMessage, type UpdateFeatureFlagsMessage, type UpdatePreviewSettingsMessage, type VisibilityCriteria, type VisibilityCriteriaEvaluationResult, type VisibilityCriteriaGroup, type VisibilityParameterValue, type VisibilityRule, type VisibilityRules, type WalkComponentTreeActions, type WalkNodeTreeActions, type WalkNodeTreeOptions, WorkflowClient, type WorkflowDefinition, type WorkflowStage, type WorkflowStagePermission, type WorkflowStageTransition, type WorkflowStageTransitionPermission, type WorkflowsDeleteParameters, type WorkflowsGetParameters, type WorkflowsGetResponse, type WorkflowsPutParameters, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createDynamicInputVisibilityRule, createDynamicTokenVisibilityRule, createEventBus, createLimitPolicy, createLocaleVisibilityRule, createQuirksVisibilityRule, createUniformApiEnhancer, createVariableReference, enhance, evaluateNodeVisibilityParameter, evaluatePropertyCriteria, evaluateVisibilityCriteriaGroup, evaluateWalkTreeNodeVisibility, evaluateWalkTreePropertyCriteria, extractLocales, findParameterInNodeTree, flattenValues, generateComponentPlaceholderId, generateHash, getBlockValue, getChannelName, getComponentJsonPointer, getComponentPath, getDataSourceVariantFromRouteGetParams, getLocalizedPropertyValues, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, getPropertyValue, hasReferencedVariables, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isContextStorageUpdatedMessage, isDismissPlaceholderMessage, isEntryData, isLinkParamValue, isMovingComponentMessage, isNestedNodeType, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRequestComponentSuggestionMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSuggestComponentMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseComponentPlaceholderId, parseVariableExpression, subscribeToComposition, walkComponentTree, walkNodeTree };
12941
+ export { ASSETS_SOURCE_CUSTOM_URL, ASSETS_SOURCE_UNIFORM, ASSET_PARAMETER_TYPE, ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, type AddComponentMessage, type AssetParamValue, type AssetParamValueItem, type BatchEnhancer, BatchEntry, type BatchInvalidationPayload, type BindVariablesOptions, type BindVariablesResult, type BindVariablesToObjectOptions, BlockFormatError, type BlockLocationReference, type BlockValue, CANVAS_BLOCK_PARAM_TYPE, CANVAS_CONTEXTUAL_EDITING_PARAM, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_SLOT_SECTION_SLOT, CANVAS_SLOT_SECTION_TYPE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CANVAS_VIZ_CONTROL_PARAM, CANVAS_VIZ_DI_RULE, CANVAS_VIZ_DYNAMIC_TOKEN_RULE, CANVAS_VIZ_LOCALE_RULE, CANVAS_VIZ_QUIRKS_RULE, CanvasClient, CanvasClientError, type CanvasDefinitions, type CategoriesDeleteParameters, type CategoriesGetParameters, type CategoriesGetResponse, type CategoriesPutParameters, type Category, CategoryClient, type Channel, type ChannelMessage, type ChannelSubscription, ChildEnhancerBuilder, type ComponentDefinition, type ComponentDefinitionDeleteParameters, type ComponentDefinitionGetParameters, type ComponentDefinitionGetResponse, type ComponentDefinitionParameter, type ComponentDefinitionPermission, type ComponentDefinitionPutParameters, type ComponentDefinitionSlot, type ComponentDefinitionSlugSettings, type ComponentDefinitionVariant, type ComponentEnhancer, type ComponentEnhancerFunction, type ComponentEnhancerOptions, type ComponentInstance, type ComponentInstanceContextualEditing, type ComponentInstanceHistoryEntry, type ComponentInstanceHistoryGetParameters, type ComponentInstanceHistoryGetResponse, type ComponentLocationReference, type ComponentLocationReferenceV2, type ComponentOverridability, type ComponentOverride, type ComponentOverrides, type ComponentParameter, type ComponentParameterBlock, type ComponentParameterConditionalValue, type ComponentParameterContextualEditing, type ComponentParameterEnhancer, type ComponentParameterEnhancerFunction, type ComponentParameterEnhancerOptions, type CompositionDataDiagnostic, type CompositionDeleteParameters, type CompositionDiagnostics, type CompositionFilters, type CompositionGetByComponentIdParameters, type CompositionGetByIdParameters, type CompositionGetByNodeIdParameters, type CompositionGetByNodePathParameters, type CompositionGetBySlugParameters, type CompositionGetListResponse, type CompositionGetOrderBy, type CompositionGetParameters, type CompositionGetResponse, type CompositionGetValidResponses, type CompositionIssue, type CompositionPatternIssue, type CompositionPutParameters, type CompositionResolvedGetResponse, type CompositionResolvedListResponse, type CompositionUIStatus, ContentClient, type ContentType, type ContentTypeField, type ContextStorageUpdatedMessage, type ContextualEditingComponentReference, type ContextualEditingValue, type CopiedComponentSubtree, type DataDiagnostic, type DataElementBindingIssue, type DataElementConnectionDefinition, type DataElementConnectionFailureAction, type DataElementConnectionFailureLogLevel, type DataResolutionConfigIssue, type DataResolutionIssue, type DataResolutionOption, type DataResolutionOptionNegative, type DataResolutionOptionPositive, type DataResolutionParameters, type DataResourceDefinition, type DataResourceDefinitions, type DataResourceIssue, type DataResourceVariables, type DataSource, DataSourceClient, type DataSourceDeleteParameters, type DataSourceGetParameters, type DataSourceGetResponse, type DataSourcePutParameters, type DataSourceVariantData, type DataSourceVariantsKeys, type DataSourcesGetParameters, type DataSourcesGetResponse, type DataType, DataTypeClient, type DataTypeDeleteParameters, type DataTypeGetParameters, type DataTypeGetResponse, type DataTypePutParameters, type DataVariableDefinition, type DataWithProperties, type DeleteContentTypeOptions, type DeleteEntryOptions, type DismissPlaceholderMessage, type DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, type EdgehancersDiagnostics, type EdgehancersWholeResponseCacheDiagnostics, type EditorStateUpdatedMessage, EnhancerBuilder, type EnhancerContext, type EnhancerError, EntityReleasesClient, type EntityReleasesGetParameters, type EntityReleasesGetResponse, type EntriesGetParameters, type EntriesGetResponse, type EntriesHistoryGetParameters, type EntriesHistoryGetResponse, type EntriesResolvedListResponse, type Entry, type EntryData, type EntryFilters, type EntryList, type EvaluateCriteriaGroupOptions, type EvaluateNodeTreeVisibilityOptions, type EvaluateNodeVisibilityParameterOptions, type EvaluatePropertyCriteriaOptions, type EvaluateWalkTreePropertyCriteriaOptions, type EventNames, type Filters, type FindInNodeTreeReference, type FlattenProperty, type FlattenValues, type FlattenValuesOptions, type GetContentTypesOptions, type GetContentTypesResponse, type GetEntriesOptions, type GetEntriesResponse, type GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_FORCED_SETTINGS_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, type InvalidationPayload, LOCALE_DYNAMIC_INPUT_NAME, type LimitPolicy, type LinkComponentParameterValue, type LinkParamConfiguration, type LinkParamValue, type LinkParameterType, type LinkTypeConfiguration, type Locale, LocaleClient, type LocaleDeleteParameters, type LocalePutParameters, type LocalesGetParameters, type LocalesGetResponse, type LocalizeDeprecatedOptions, type LocalizeModernOptions, type MaxDepthExceededIssue, type MessageHandler, type MoveComponentMessage, type NodeLocationReference, type NonProjectMapLinkParamValue, type OpenParameterEditorMessage, type OverrideOptions, PLACEHOLDER_ID, type PatternIssue, PreviewClient, type PreviewEventBus, type PreviewPanelSettings, type PreviewUrl, type PreviewUrlDeleteParameters, type PreviewUrlDeleteResponse, type PreviewUrlPutParameters, type PreviewUrlPutResponse, type PreviewUrlsGetParameters, type PreviewUrlsGetResponse, type PreviewViewport, type PreviewViewportDeleteParameters, type PreviewViewportDeleteResponse, type PreviewViewportPutParameters, type PreviewViewportPutResponse, type PreviewViewportsGetParameters, type PreviewViewportsGetResponse, type ProjectMapLinkComponentParameterValue, type ProjectMapLinkParamValue, type Prompt, PromptClient, type PromptsDeleteParameters, type PromptsGetParameters, type PromptsGetResponse, type PromptsPutParameters, type PropertyCriteriaMatch, type PutContentTypeBody, type PutEntryBody, type ReadyMessage, RelationshipClient, type RelationshipResultInstance, type Release, ReleaseClient, type ReleaseContent, ReleaseContentsClient, type ReleaseContentsDeleteBody, type ReleaseContentsGetParameters, type ReleaseContentsGetResponse, type ReleaseDeleteParameters, type ReleasePatchParameters, type ReleasePutParameters, type ReleaseState, type ReleasesGetParameters, type ReleasesGetResponse, type ReportRenderedCompositionsMessage, type RequestComponentSuggestionMessage, type ResolvedRouteGetResponse, type RichTextBuiltInElement, type RichTextBuiltInFormat, type RichTextParamConfiguration, type RichTextParamValue, type RootComponentInstance, type RootEntryReference, type RootLocationReference, RouteClient, type RouteDynamicInputs, type RouteGetParameters, type RouteGetResponse, type RouteGetResponseComposition, type RouteGetResponseEdgehancedComposition, type RouteGetResponseEdgehancedNotFound, type RouteGetResponseNotFound, type RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, type SelectComponentMessage, type SelectParameterMessage, type SpecificProjectMap, type StringOperators, type SubscribeToCompositionOptions, type SuggestComponentMessage, type TreeNodeInfoTypes, type TriggerComponentActionMessage, type TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, type UnsubscribeCallback, type UpdateComponentParameterMessage, type UpdateComponentReferencesMessage, type UpdateCompositionInternalMessage, type UpdateCompositionMessage, type UpdateContextualEditingStateInternalMessage, type UpdateFeatureFlagsMessage, type UpdatePreviewSettingsMessage, type VisibilityCriteria, type VisibilityCriteriaEvaluationResult, type VisibilityCriteriaGroup, type VisibilityParameterValue, type VisibilityRule, type VisibilityRules, type WalkComponentTreeActions, type WalkNodeTreeActions, type WalkNodeTreeOptions, WorkflowClient, type WorkflowDefinition, type WorkflowStage, type WorkflowStagePermission, type WorkflowStageTransition, type WorkflowStageTransitionPermission, type WorkflowsDeleteParameters, type WorkflowsGetParameters, type WorkflowsGetResponse, type WorkflowsPutParameters, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createDynamicInputVisibilityRule, createDynamicTokenVisibilityRule, createEventBus, createLimitPolicy, createLocaleVisibilityRule, createQuirksVisibilityRule, createUniformApiEnhancer, createVariableReference, enhance, evaluateNodeVisibilityParameter, evaluatePropertyCriteria, evaluateVisibilityCriteriaGroup, evaluateWalkTreeNodeVisibility, evaluateWalkTreePropertyCriteria, extractLocales, findParameterInNodeTree, flattenValues, generateComponentPlaceholderId, generateHash, getBlockValue, getChannelName, getComponentJsonPointer, getComponentPath, getDataSourceVariantFromRouteGetParams, getLocalizedPropertyValues, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, getPropertyValue, hasReferencedVariables, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isContextStorageUpdatedMessage, isDismissPlaceholderMessage, isEntryData, isLinkParamValue, isMovingComponentMessage, isNestedNodeType, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRequestComponentSuggestionMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSuggestComponentMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseComponentPlaceholderId, parseVariableExpression, subscribeToComposition, walkComponentTree, walkNodeTree };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ApiClient, ExceptProject, ClientOptions, ApiClientError } from '@uniformdev/context/api';
2
2
  export { ApiClientError } from '@uniformdev/context/api';
3
- import { AssetGetResponseSingle } from '@uniformdev/assets';
3
+ import { AssetGetResponseSingle, AssetDefinitionType } from '@uniformdev/assets';
4
4
  import { Quirks, StorageCommands, PersonalizedVariant, TestVariant } from '@uniformdev/context';
5
5
  import Pusher from 'pusher-js';
6
6
  import { Options as Options$1 } from 'p-retry';
@@ -467,6 +467,13 @@ interface components$n {
467
467
  [key: string]: components$n["schemas"]["ComponentInstance"][];
468
468
  };
469
469
  variant?: string;
470
+ /** @description Overrides data resource definitions for a pattern component.
471
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
472
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
473
+ * */
474
+ dataResources?: {
475
+ [key: string]: components$n["schemas"]["DataResourceDefinition"];
476
+ };
470
477
  };
471
478
  /**
472
479
  * @description Whether a parameter is overridable
@@ -1081,6 +1088,13 @@ interface components$m {
1081
1088
  [key: string]: components$m["schemas"]["ComponentInstance"][];
1082
1089
  };
1083
1090
  variant?: string;
1091
+ /** @description Overrides data resource definitions for a pattern component.
1092
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
1093
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
1094
+ * */
1095
+ dataResources?: {
1096
+ [key: string]: components$m["schemas"]["DataResourceDefinition"];
1097
+ };
1084
1098
  };
1085
1099
  /** @description Defines how a component on a pattern may have its values overridden.
1086
1100
  * NOTE: Data resources' overridability is defined in the data resource definition, not here.
@@ -1756,6 +1770,11 @@ declare const CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
1756
1770
  declare const CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
1757
1771
  /** Public ID of the Uniform Context enrichment tag parameter on Canvas components */
1758
1772
  declare const CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
1773
+ /**
1774
+ * @deprecated
1775
+ * Public ID of Contextual Editing parameter on Canvas components
1776
+ */
1777
+ declare const CANVAS_CONTEXTUAL_EDITING_PARAM = "$contextualEditing";
1759
1778
  /**
1760
1779
  * The name of the query string used to set a secret to protect for the preview mode.
1761
1780
  * This is not configurable at the moment.
@@ -2231,6 +2250,13 @@ interface components$k {
2231
2250
  [key: string]: components$k["schemas"]["ComponentInstance"][];
2232
2251
  };
2233
2252
  variant?: string;
2253
+ /** @description Overrides data resource definitions for a pattern component.
2254
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
2255
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
2256
+ * */
2257
+ dataResources?: {
2258
+ [key: string]: components$k["schemas"]["DataResourceDefinition"];
2259
+ };
2234
2260
  };
2235
2261
  /**
2236
2262
  * @description Whether a parameter is overridable
@@ -3351,6 +3377,13 @@ interface components$i {
3351
3377
  [key: string]: components$i["schemas"]["ComponentInstance"][];
3352
3378
  };
3353
3379
  variant?: string;
3380
+ /** @description Overrides data resource definitions for a pattern component.
3381
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
3382
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
3383
+ * */
3384
+ dataResources?: {
3385
+ [key: string]: components$i["schemas"]["DataResourceDefinition"];
3386
+ };
3354
3387
  };
3355
3388
  /**
3356
3389
  * @description Whether a parameter is overridable
@@ -5521,6 +5554,13 @@ interface components$b {
5521
5554
  [key: string]: components$b["schemas"]["ComponentInstance"][];
5522
5555
  };
5523
5556
  variant?: string;
5557
+ /** @description Overrides data resource definitions for a pattern component.
5558
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
5559
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
5560
+ * */
5561
+ dataResources?: {
5562
+ [key: string]: components$b["schemas"]["DataResourceDefinition"];
5563
+ };
5524
5564
  };
5525
5565
  /**
5526
5566
  * @description Whether a parameter is overridable
@@ -6646,6 +6686,13 @@ interface components$a {
6646
6686
  [key: string]: components$a["schemas"]["ComponentInstance"][];
6647
6687
  };
6648
6688
  variant?: string;
6689
+ /** @description Overrides data resource definitions for a pattern component.
6690
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
6691
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
6692
+ * */
6693
+ dataResources?: {
6694
+ [key: string]: components$a["schemas"]["DataResourceDefinition"];
6695
+ };
6649
6696
  };
6650
6697
  /**
6651
6698
  * @description Whether a parameter is overridable
@@ -7625,6 +7672,13 @@ interface components$8 {
7625
7672
  [key: string]: components$8["schemas"]["ComponentInstance"][];
7626
7673
  };
7627
7674
  variant?: string;
7675
+ /** @description Overrides data resource definitions for a pattern component.
7676
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
7677
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
7678
+ * */
7679
+ dataResources?: {
7680
+ [key: string]: components$8["schemas"]["DataResourceDefinition"];
7681
+ };
7628
7682
  };
7629
7683
  /**
7630
7684
  * @description Whether a parameter is overridable
@@ -8905,6 +8959,13 @@ interface components$7 {
8905
8959
  [key: string]: components$7["schemas"]["ComponentInstance"][];
8906
8960
  };
8907
8961
  variant?: string;
8962
+ /** @description Overrides data resource definitions for a pattern component.
8963
+ * Object keys defined under this property override the corresponding keys in the pattern's data resources.
8964
+ * Overrides defined here replace values in either _dataResources or _patternDataResources on the target component.
8965
+ * */
8966
+ dataResources?: {
8967
+ [key: string]: components$7["schemas"]["DataResourceDefinition"];
8968
+ };
8908
8969
  };
8909
8970
  /**
8910
8971
  * @description Whether a parameter is overridable
@@ -9370,6 +9431,11 @@ type ComponentParameterBlock = Omit<ComponentParameter<BlockValue>, 'type'> & {
9370
9431
  };
9371
9432
  /** Value type of a block parameter or block field */
9372
9433
  type BlockValue = EntryData[];
9434
+ /** Value type of contextual editing parameter used with RSC CANVAS_EDITOR_STATE */
9435
+ type ContextualEditingValue = {
9436
+ /** Names of parameters on the component which are editable */
9437
+ editableParameters: string[];
9438
+ };
9373
9439
  /** The type of the parameters in contextual editing mode. */
9374
9440
  type ComponentParameterContextualEditing<TValue = unknown> = ComponentParameter<TValue> & {
9375
9441
  /** Data used for visual editing. It's not supposed to be used externally. The format might change without prior notice. */
@@ -9930,6 +9996,11 @@ type RichTextParamConfiguration = {
9930
9996
  elements?: {
9931
9997
  builtIn?: Array<RichTextBuiltInElement>;
9932
9998
  };
9999
+ elementsConfig?: {
10000
+ asset?: {
10001
+ allowedTypes?: AssetDefinitionType[];
10002
+ };
10003
+ };
9933
10004
  };
9934
10005
  type RichTextParamValue = ParameterRichTextValue;
9935
10006
 
@@ -11648,14 +11719,18 @@ type ComponentLocationReferenceV2 = {
11648
11719
  type: 'slot';
11649
11720
  node: ComponentInstance;
11650
11721
  parentSlot: string;
11722
+ /** @deprecated invoke parentSlotIndexFn instead, this property may be unreliable with some bundlers. This will be removed in the next major. */
11651
11723
  parentSlotIndex: number;
11724
+ parentSlotIndexFn: () => number;
11652
11725
  };
11653
11726
  /** Ancestor location that is in a block on a parameter or field */
11654
11727
  type BlockLocationReference = {
11655
11728
  type: 'block';
11656
11729
  node: EntryData;
11657
11730
  fieldName: string;
11731
+ /** @deprecated invoke blockIndexFn instead, this property may be unreliable with some bundlers. This will be removed in the next major. */
11658
11732
  blockIndex: number;
11733
+ blockIndexFn: () => number;
11659
11734
  };
11660
11735
  /** Ancestor location that is the root of a composition or entry */
11661
11736
  type RootLocationReference = {
@@ -12863,4 +12938,4 @@ declare class WorkflowClient extends ApiClient {
12863
12938
 
12864
12939
  declare const CanvasClientError: typeof ApiClientError;
12865
12940
 
12866
- export { ASSETS_SOURCE_CUSTOM_URL, ASSETS_SOURCE_UNIFORM, ASSET_PARAMETER_TYPE, ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, type AddComponentMessage, type AssetParamValue, type AssetParamValueItem, type BatchEnhancer, BatchEntry, type BatchInvalidationPayload, type BindVariablesOptions, type BindVariablesResult, type BindVariablesToObjectOptions, BlockFormatError, type BlockLocationReference, type BlockValue, CANVAS_BLOCK_PARAM_TYPE, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_SLOT_SECTION_SLOT, CANVAS_SLOT_SECTION_TYPE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CANVAS_VIZ_CONTROL_PARAM, CANVAS_VIZ_DI_RULE, CANVAS_VIZ_DYNAMIC_TOKEN_RULE, CANVAS_VIZ_LOCALE_RULE, CANVAS_VIZ_QUIRKS_RULE, CanvasClient, CanvasClientError, type CanvasDefinitions, type CategoriesDeleteParameters, type CategoriesGetParameters, type CategoriesGetResponse, type CategoriesPutParameters, type Category, CategoryClient, type Channel, type ChannelMessage, type ChannelSubscription, ChildEnhancerBuilder, type ComponentDefinition, type ComponentDefinitionDeleteParameters, type ComponentDefinitionGetParameters, type ComponentDefinitionGetResponse, type ComponentDefinitionParameter, type ComponentDefinitionPermission, type ComponentDefinitionPutParameters, type ComponentDefinitionSlot, type ComponentDefinitionSlugSettings, type ComponentDefinitionVariant, type ComponentEnhancer, type ComponentEnhancerFunction, type ComponentEnhancerOptions, type ComponentInstance, type ComponentInstanceContextualEditing, type ComponentInstanceHistoryEntry, type ComponentInstanceHistoryGetParameters, type ComponentInstanceHistoryGetResponse, type ComponentLocationReference, type ComponentLocationReferenceV2, type ComponentOverridability, type ComponentOverride, type ComponentOverrides, type ComponentParameter, type ComponentParameterBlock, type ComponentParameterConditionalValue, type ComponentParameterContextualEditing, type ComponentParameterEnhancer, type ComponentParameterEnhancerFunction, type ComponentParameterEnhancerOptions, type CompositionDataDiagnostic, type CompositionDeleteParameters, type CompositionDiagnostics, type CompositionFilters, type CompositionGetByComponentIdParameters, type CompositionGetByIdParameters, type CompositionGetByNodeIdParameters, type CompositionGetByNodePathParameters, type CompositionGetBySlugParameters, type CompositionGetListResponse, type CompositionGetOrderBy, type CompositionGetParameters, type CompositionGetResponse, type CompositionGetValidResponses, type CompositionIssue, type CompositionPatternIssue, type CompositionPutParameters, type CompositionResolvedGetResponse, type CompositionResolvedListResponse, type CompositionUIStatus, ContentClient, type ContentType, type ContentTypeField, type ContextStorageUpdatedMessage, type ContextualEditingComponentReference, type CopiedComponentSubtree, type DataDiagnostic, type DataElementBindingIssue, type DataElementConnectionDefinition, type DataElementConnectionFailureAction, type DataElementConnectionFailureLogLevel, type DataResolutionConfigIssue, type DataResolutionIssue, type DataResolutionOption, type DataResolutionOptionNegative, type DataResolutionOptionPositive, type DataResolutionParameters, type DataResourceDefinition, type DataResourceDefinitions, type DataResourceIssue, type DataResourceVariables, type DataSource, DataSourceClient, type DataSourceDeleteParameters, type DataSourceGetParameters, type DataSourceGetResponse, type DataSourcePutParameters, type DataSourceVariantData, type DataSourceVariantsKeys, type DataSourcesGetParameters, type DataSourcesGetResponse, type DataType, DataTypeClient, type DataTypeDeleteParameters, type DataTypeGetParameters, type DataTypeGetResponse, type DataTypePutParameters, type DataVariableDefinition, type DataWithProperties, type DeleteContentTypeOptions, type DeleteEntryOptions, type DismissPlaceholderMessage, type DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, type EdgehancersDiagnostics, type EdgehancersWholeResponseCacheDiagnostics, type EditorStateUpdatedMessage, EnhancerBuilder, type EnhancerContext, type EnhancerError, EntityReleasesClient, type EntityReleasesGetParameters, type EntityReleasesGetResponse, type EntriesGetParameters, type EntriesGetResponse, type EntriesHistoryGetParameters, type EntriesHistoryGetResponse, type EntriesResolvedListResponse, type Entry, type EntryData, type EntryFilters, type EntryList, type EvaluateCriteriaGroupOptions, type EvaluateNodeTreeVisibilityOptions, type EvaluateNodeVisibilityParameterOptions, type EvaluatePropertyCriteriaOptions, type EvaluateWalkTreePropertyCriteriaOptions, type EventNames, type Filters, type FindInNodeTreeReference, type FlattenProperty, type FlattenValues, type FlattenValuesOptions, type GetContentTypesOptions, type GetContentTypesResponse, type GetEntriesOptions, type GetEntriesResponse, type GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_FORCED_SETTINGS_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, type InvalidationPayload, LOCALE_DYNAMIC_INPUT_NAME, type LimitPolicy, type LinkComponentParameterValue, type LinkParamConfiguration, type LinkParamValue, type LinkParameterType, type LinkTypeConfiguration, type Locale, LocaleClient, type LocaleDeleteParameters, type LocalePutParameters, type LocalesGetParameters, type LocalesGetResponse, type LocalizeDeprecatedOptions, type LocalizeModernOptions, type MaxDepthExceededIssue, type MessageHandler, type MoveComponentMessage, type NodeLocationReference, type NonProjectMapLinkParamValue, type OpenParameterEditorMessage, type OverrideOptions, PLACEHOLDER_ID, type PatternIssue, PreviewClient, type PreviewEventBus, type PreviewPanelSettings, type PreviewUrl, type PreviewUrlDeleteParameters, type PreviewUrlDeleteResponse, type PreviewUrlPutParameters, type PreviewUrlPutResponse, type PreviewUrlsGetParameters, type PreviewUrlsGetResponse, type PreviewViewport, type PreviewViewportDeleteParameters, type PreviewViewportDeleteResponse, type PreviewViewportPutParameters, type PreviewViewportPutResponse, type PreviewViewportsGetParameters, type PreviewViewportsGetResponse, type ProjectMapLinkComponentParameterValue, type ProjectMapLinkParamValue, type Prompt, PromptClient, type PromptsDeleteParameters, type PromptsGetParameters, type PromptsGetResponse, type PromptsPutParameters, type PropertyCriteriaMatch, type PutContentTypeBody, type PutEntryBody, type ReadyMessage, RelationshipClient, type RelationshipResultInstance, type Release, ReleaseClient, type ReleaseContent, ReleaseContentsClient, type ReleaseContentsDeleteBody, type ReleaseContentsGetParameters, type ReleaseContentsGetResponse, type ReleaseDeleteParameters, type ReleasePatchParameters, type ReleasePutParameters, type ReleaseState, type ReleasesGetParameters, type ReleasesGetResponse, type ReportRenderedCompositionsMessage, type RequestComponentSuggestionMessage, type ResolvedRouteGetResponse, type RichTextBuiltInElement, type RichTextBuiltInFormat, type RichTextParamConfiguration, type RichTextParamValue, type RootComponentInstance, type RootEntryReference, type RootLocationReference, RouteClient, type RouteDynamicInputs, type RouteGetParameters, type RouteGetResponse, type RouteGetResponseComposition, type RouteGetResponseEdgehancedComposition, type RouteGetResponseEdgehancedNotFound, type RouteGetResponseNotFound, type RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, type SelectComponentMessage, type SelectParameterMessage, type SpecificProjectMap, type StringOperators, type SubscribeToCompositionOptions, type SuggestComponentMessage, type TreeNodeInfoTypes, type TriggerComponentActionMessage, type TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, type UnsubscribeCallback, type UpdateComponentParameterMessage, type UpdateComponentReferencesMessage, type UpdateCompositionInternalMessage, type UpdateCompositionMessage, type UpdateContextualEditingStateInternalMessage, type UpdateFeatureFlagsMessage, type UpdatePreviewSettingsMessage, type VisibilityCriteria, type VisibilityCriteriaEvaluationResult, type VisibilityCriteriaGroup, type VisibilityParameterValue, type VisibilityRule, type VisibilityRules, type WalkComponentTreeActions, type WalkNodeTreeActions, type WalkNodeTreeOptions, WorkflowClient, type WorkflowDefinition, type WorkflowStage, type WorkflowStagePermission, type WorkflowStageTransition, type WorkflowStageTransitionPermission, type WorkflowsDeleteParameters, type WorkflowsGetParameters, type WorkflowsGetResponse, type WorkflowsPutParameters, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createDynamicInputVisibilityRule, createDynamicTokenVisibilityRule, createEventBus, createLimitPolicy, createLocaleVisibilityRule, createQuirksVisibilityRule, createUniformApiEnhancer, createVariableReference, enhance, evaluateNodeVisibilityParameter, evaluatePropertyCriteria, evaluateVisibilityCriteriaGroup, evaluateWalkTreeNodeVisibility, evaluateWalkTreePropertyCriteria, extractLocales, findParameterInNodeTree, flattenValues, generateComponentPlaceholderId, generateHash, getBlockValue, getChannelName, getComponentJsonPointer, getComponentPath, getDataSourceVariantFromRouteGetParams, getLocalizedPropertyValues, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, getPropertyValue, hasReferencedVariables, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isContextStorageUpdatedMessage, isDismissPlaceholderMessage, isEntryData, isLinkParamValue, isMovingComponentMessage, isNestedNodeType, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRequestComponentSuggestionMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSuggestComponentMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseComponentPlaceholderId, parseVariableExpression, subscribeToComposition, walkComponentTree, walkNodeTree };
12941
+ export { ASSETS_SOURCE_CUSTOM_URL, ASSETS_SOURCE_UNIFORM, ASSET_PARAMETER_TYPE, ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, type AddComponentMessage, type AssetParamValue, type AssetParamValueItem, type BatchEnhancer, BatchEntry, type BatchInvalidationPayload, type BindVariablesOptions, type BindVariablesResult, type BindVariablesToObjectOptions, BlockFormatError, type BlockLocationReference, type BlockValue, CANVAS_BLOCK_PARAM_TYPE, CANVAS_CONTEXTUAL_EDITING_PARAM, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_SLOT_SECTION_SLOT, CANVAS_SLOT_SECTION_TYPE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CANVAS_VIZ_CONTROL_PARAM, CANVAS_VIZ_DI_RULE, CANVAS_VIZ_DYNAMIC_TOKEN_RULE, CANVAS_VIZ_LOCALE_RULE, CANVAS_VIZ_QUIRKS_RULE, CanvasClient, CanvasClientError, type CanvasDefinitions, type CategoriesDeleteParameters, type CategoriesGetParameters, type CategoriesGetResponse, type CategoriesPutParameters, type Category, CategoryClient, type Channel, type ChannelMessage, type ChannelSubscription, ChildEnhancerBuilder, type ComponentDefinition, type ComponentDefinitionDeleteParameters, type ComponentDefinitionGetParameters, type ComponentDefinitionGetResponse, type ComponentDefinitionParameter, type ComponentDefinitionPermission, type ComponentDefinitionPutParameters, type ComponentDefinitionSlot, type ComponentDefinitionSlugSettings, type ComponentDefinitionVariant, type ComponentEnhancer, type ComponentEnhancerFunction, type ComponentEnhancerOptions, type ComponentInstance, type ComponentInstanceContextualEditing, type ComponentInstanceHistoryEntry, type ComponentInstanceHistoryGetParameters, type ComponentInstanceHistoryGetResponse, type ComponentLocationReference, type ComponentLocationReferenceV2, type ComponentOverridability, type ComponentOverride, type ComponentOverrides, type ComponentParameter, type ComponentParameterBlock, type ComponentParameterConditionalValue, type ComponentParameterContextualEditing, type ComponentParameterEnhancer, type ComponentParameterEnhancerFunction, type ComponentParameterEnhancerOptions, type CompositionDataDiagnostic, type CompositionDeleteParameters, type CompositionDiagnostics, type CompositionFilters, type CompositionGetByComponentIdParameters, type CompositionGetByIdParameters, type CompositionGetByNodeIdParameters, type CompositionGetByNodePathParameters, type CompositionGetBySlugParameters, type CompositionGetListResponse, type CompositionGetOrderBy, type CompositionGetParameters, type CompositionGetResponse, type CompositionGetValidResponses, type CompositionIssue, type CompositionPatternIssue, type CompositionPutParameters, type CompositionResolvedGetResponse, type CompositionResolvedListResponse, type CompositionUIStatus, ContentClient, type ContentType, type ContentTypeField, type ContextStorageUpdatedMessage, type ContextualEditingComponentReference, type ContextualEditingValue, type CopiedComponentSubtree, type DataDiagnostic, type DataElementBindingIssue, type DataElementConnectionDefinition, type DataElementConnectionFailureAction, type DataElementConnectionFailureLogLevel, type DataResolutionConfigIssue, type DataResolutionIssue, type DataResolutionOption, type DataResolutionOptionNegative, type DataResolutionOptionPositive, type DataResolutionParameters, type DataResourceDefinition, type DataResourceDefinitions, type DataResourceIssue, type DataResourceVariables, type DataSource, DataSourceClient, type DataSourceDeleteParameters, type DataSourceGetParameters, type DataSourceGetResponse, type DataSourcePutParameters, type DataSourceVariantData, type DataSourceVariantsKeys, type DataSourcesGetParameters, type DataSourcesGetResponse, type DataType, DataTypeClient, type DataTypeDeleteParameters, type DataTypeGetParameters, type DataTypeGetResponse, type DataTypePutParameters, type DataVariableDefinition, type DataWithProperties, type DeleteContentTypeOptions, type DeleteEntryOptions, type DismissPlaceholderMessage, type DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, type EdgehancersDiagnostics, type EdgehancersWholeResponseCacheDiagnostics, type EditorStateUpdatedMessage, EnhancerBuilder, type EnhancerContext, type EnhancerError, EntityReleasesClient, type EntityReleasesGetParameters, type EntityReleasesGetResponse, type EntriesGetParameters, type EntriesGetResponse, type EntriesHistoryGetParameters, type EntriesHistoryGetResponse, type EntriesResolvedListResponse, type Entry, type EntryData, type EntryFilters, type EntryList, type EvaluateCriteriaGroupOptions, type EvaluateNodeTreeVisibilityOptions, type EvaluateNodeVisibilityParameterOptions, type EvaluatePropertyCriteriaOptions, type EvaluateWalkTreePropertyCriteriaOptions, type EventNames, type Filters, type FindInNodeTreeReference, type FlattenProperty, type FlattenValues, type FlattenValuesOptions, type GetContentTypesOptions, type GetContentTypesResponse, type GetEntriesOptions, type GetEntriesResponse, type GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_FORCED_SETTINGS_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, type InvalidationPayload, LOCALE_DYNAMIC_INPUT_NAME, type LimitPolicy, type LinkComponentParameterValue, type LinkParamConfiguration, type LinkParamValue, type LinkParameterType, type LinkTypeConfiguration, type Locale, LocaleClient, type LocaleDeleteParameters, type LocalePutParameters, type LocalesGetParameters, type LocalesGetResponse, type LocalizeDeprecatedOptions, type LocalizeModernOptions, type MaxDepthExceededIssue, type MessageHandler, type MoveComponentMessage, type NodeLocationReference, type NonProjectMapLinkParamValue, type OpenParameterEditorMessage, type OverrideOptions, PLACEHOLDER_ID, type PatternIssue, PreviewClient, type PreviewEventBus, type PreviewPanelSettings, type PreviewUrl, type PreviewUrlDeleteParameters, type PreviewUrlDeleteResponse, type PreviewUrlPutParameters, type PreviewUrlPutResponse, type PreviewUrlsGetParameters, type PreviewUrlsGetResponse, type PreviewViewport, type PreviewViewportDeleteParameters, type PreviewViewportDeleteResponse, type PreviewViewportPutParameters, type PreviewViewportPutResponse, type PreviewViewportsGetParameters, type PreviewViewportsGetResponse, type ProjectMapLinkComponentParameterValue, type ProjectMapLinkParamValue, type Prompt, PromptClient, type PromptsDeleteParameters, type PromptsGetParameters, type PromptsGetResponse, type PromptsPutParameters, type PropertyCriteriaMatch, type PutContentTypeBody, type PutEntryBody, type ReadyMessage, RelationshipClient, type RelationshipResultInstance, type Release, ReleaseClient, type ReleaseContent, ReleaseContentsClient, type ReleaseContentsDeleteBody, type ReleaseContentsGetParameters, type ReleaseContentsGetResponse, type ReleaseDeleteParameters, type ReleasePatchParameters, type ReleasePutParameters, type ReleaseState, type ReleasesGetParameters, type ReleasesGetResponse, type ReportRenderedCompositionsMessage, type RequestComponentSuggestionMessage, type ResolvedRouteGetResponse, type RichTextBuiltInElement, type RichTextBuiltInFormat, type RichTextParamConfiguration, type RichTextParamValue, type RootComponentInstance, type RootEntryReference, type RootLocationReference, RouteClient, type RouteDynamicInputs, type RouteGetParameters, type RouteGetResponse, type RouteGetResponseComposition, type RouteGetResponseEdgehancedComposition, type RouteGetResponseEdgehancedNotFound, type RouteGetResponseNotFound, type RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, type SelectComponentMessage, type SelectParameterMessage, type SpecificProjectMap, type StringOperators, type SubscribeToCompositionOptions, type SuggestComponentMessage, type TreeNodeInfoTypes, type TriggerComponentActionMessage, type TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, type UnsubscribeCallback, type UpdateComponentParameterMessage, type UpdateComponentReferencesMessage, type UpdateCompositionInternalMessage, type UpdateCompositionMessage, type UpdateContextualEditingStateInternalMessage, type UpdateFeatureFlagsMessage, type UpdatePreviewSettingsMessage, type VisibilityCriteria, type VisibilityCriteriaEvaluationResult, type VisibilityCriteriaGroup, type VisibilityParameterValue, type VisibilityRule, type VisibilityRules, type WalkComponentTreeActions, type WalkNodeTreeActions, type WalkNodeTreeOptions, WorkflowClient, type WorkflowDefinition, type WorkflowStage, type WorkflowStagePermission, type WorkflowStageTransition, type WorkflowStageTransitionPermission, type WorkflowsDeleteParameters, type WorkflowsGetParameters, type WorkflowsGetResponse, type WorkflowsPutParameters, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createDynamicInputVisibilityRule, createDynamicTokenVisibilityRule, createEventBus, createLimitPolicy, createLocaleVisibilityRule, createQuirksVisibilityRule, createUniformApiEnhancer, createVariableReference, enhance, evaluateNodeVisibilityParameter, evaluatePropertyCriteria, evaluateVisibilityCriteriaGroup, evaluateWalkTreeNodeVisibility, evaluateWalkTreePropertyCriteria, extractLocales, findParameterInNodeTree, flattenValues, generateComponentPlaceholderId, generateHash, getBlockValue, getChannelName, getComponentJsonPointer, getComponentPath, getDataSourceVariantFromRouteGetParams, getLocalizedPropertyValues, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, getPropertyValue, hasReferencedVariables, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isContextStorageUpdatedMessage, isDismissPlaceholderMessage, isEntryData, isLinkParamValue, isMovingComponentMessage, isNestedNodeType, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRequestComponentSuggestionMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSuggestComponentMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseComponentPlaceholderId, parseVariableExpression, subscribeToComposition, walkComponentTree, walkNodeTree };
package/dist/index.esm.js CHANGED
@@ -910,7 +910,8 @@ function getComponentPath(ancestorsAndSelf) {
910
910
  const parentLocation = ancestorsAndSelf[i + 1];
911
911
  if ("type" in currentLocation && currentLocation.type !== "slot") {
912
912
  if (currentLocation.type === "block") {
913
- const { fieldName, blockIndex } = currentLocation;
913
+ const { fieldName, blockIndexFn } = currentLocation;
914
+ const blockIndex = blockIndexFn();
914
915
  if (fieldName && blockIndex !== void 0) {
915
916
  const noun = parentLocation && "type" in parentLocation && parentLocation.type === "block" ? "fields" : "parameters";
916
917
  path.push(`${noun}.${fieldName}.value[${blockIndex}]`);
@@ -919,7 +920,8 @@ function getComponentPath(ancestorsAndSelf) {
919
920
  }
920
921
  continue;
921
922
  }
922
- const { parentSlot, parentSlotIndex } = currentLocation;
923
+ const parentSlotIndex = "parentSlotIndexFn" in currentLocation ? currentLocation.parentSlotIndexFn() : currentLocation.parentSlotIndex;
924
+ const { parentSlot } = currentLocation;
923
925
  if (parentSlot && parentSlotIndex !== void 0) {
924
926
  path.push(`${parentSlot}[${parentSlotIndex}]`);
925
927
  }
@@ -945,6 +947,7 @@ var CANVAS_EDITOR_STATE = 63;
945
947
  var CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
946
948
  var CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
947
949
  var CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
950
+ var CANVAS_CONTEXTUAL_EDITING_PARAM = "$contextualEditing";
948
951
  var SECRET_QUERY_STRING_PARAM = "secret";
949
952
  var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
950
953
  var IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM = "is_incontext_editing_playground";
@@ -1156,7 +1159,8 @@ function walkNodeTree(node, visitor, options) {
1156
1159
  const currentComponentLocation = currentQueueEntry.ancestorsAndSelf[0];
1157
1160
  const parentComponent = currentQueueEntry.ancestorsAndSelf[1];
1158
1161
  if (currentComponentLocation.type === "block") {
1159
- const { fieldName, blockIndex } = currentComponentLocation;
1162
+ const { fieldName, blockIndexFn } = currentComponentLocation;
1163
+ const blockIndex = blockIndexFn();
1160
1164
  const blockValue = getBlockValue(parentComponent.node, fieldName);
1161
1165
  blockValue.splice(blockIndex, 1);
1162
1166
  if (blockValue.length === 0) {
@@ -1173,7 +1177,8 @@ function walkNodeTree(node, visitor, options) {
1173
1177
  if (currentNodeInfo.type !== "block") {
1174
1178
  throw new Error("Unknown type");
1175
1179
  }
1176
- const { fieldName, blockIndex } = currentNodeInfo;
1180
+ const { fieldName, blockIndexFn } = currentNodeInfo;
1181
+ const blockIndex = blockIndexFn();
1177
1182
  const parentComponent = currentQueueEntry.ancestorsAndSelf[1];
1178
1183
  const nodesToInsert = Array.isArray(nodes) ? nodes : [nodes];
1179
1184
  if (fieldName && typeof blockIndex !== "undefined") {
@@ -1183,22 +1188,28 @@ function walkNodeTree(node, visitor, options) {
1183
1188
  ...nodesToInsert
1184
1189
  );
1185
1190
  componentQueue.unshift(
1186
- ...nodesToInsert.map((enqueueingComponent) => ({
1187
- ancestorsAndSelf: [
1188
- {
1189
- type: "block",
1190
- node: enqueueingComponent,
1191
- fieldName,
1192
- get blockIndex() {
1193
- const parentArray = getPropertiesValue(parentComponent.node)[fieldName].value;
1194
- return parentArray.findIndex((x) => x === enqueueingComponent);
1195
- }
1196
- },
1197
- // slice removes 'self' since we are inserting a peer of self
1198
- ...currentQueueEntry.ancestorsAndSelf.slice(1)
1199
- ],
1200
- context: descendantContext
1201
- }))
1191
+ ...nodesToInsert.map((enqueueingComponent) => {
1192
+ const blockIndexFn2 = () => {
1193
+ const parentArray = getPropertiesValue(parentComponent.node)[fieldName].value;
1194
+ return parentArray.findIndex((x) => x === enqueueingComponent);
1195
+ };
1196
+ return {
1197
+ ancestorsAndSelf: [
1198
+ {
1199
+ type: "block",
1200
+ node: enqueueingComponent,
1201
+ fieldName,
1202
+ get blockIndex() {
1203
+ return blockIndexFn2();
1204
+ },
1205
+ blockIndexFn: blockIndexFn2
1206
+ },
1207
+ // slice removes 'self' since we are inserting a peer of self
1208
+ ...currentQueueEntry.ancestorsAndSelf.slice(1)
1209
+ ],
1210
+ context: descendantContext
1211
+ };
1212
+ })
1202
1213
  );
1203
1214
  }
1204
1215
  },
@@ -1247,7 +1258,8 @@ function walkNodeTree(node, visitor, options) {
1247
1258
  throw new Error("Unable to delete root node.");
1248
1259
  }
1249
1260
  if (currentComponentLocation.type === "slot") {
1250
- const { parentSlot, parentSlotIndex } = currentComponentLocation;
1261
+ const { parentSlot, parentSlotIndexFn } = currentComponentLocation;
1262
+ const parentSlotIndex = parentSlotIndexFn();
1251
1263
  parentComponent.node.slots[parentSlot].splice(parentSlotIndex, 1);
1252
1264
  } else {
1253
1265
  throw new Error("Unknown node type");
@@ -1261,7 +1273,8 @@ function walkNodeTree(node, visitor, options) {
1261
1273
  throw new Error("Unable to insert after root node.");
1262
1274
  }
1263
1275
  if (currentNodeInfo.type === "slot") {
1264
- const { parentSlot, parentSlotIndex } = currentNodeInfo;
1276
+ const { parentSlot, parentSlotIndexFn } = currentNodeInfo;
1277
+ const parentSlotIndex = parentSlotIndexFn();
1265
1278
  const parentComponent = currentQueueEntry.ancestorsAndSelf[1];
1266
1279
  if (parentSlot && typeof parentSlotIndex !== "undefined") {
1267
1280
  parentComponent.node.slots[parentSlot].splice(
@@ -1270,24 +1283,30 @@ function walkNodeTree(node, visitor, options) {
1270
1283
  ...nodesToInsert
1271
1284
  );
1272
1285
  componentQueue.unshift(
1273
- ...nodesToInsert.map((enqueueingComponent) => ({
1274
- type: "slot",
1275
- ancestorsAndSelf: [
1276
- {
1277
- type: "slot",
1278
- node: enqueueingComponent,
1279
- parentSlot,
1280
- get parentSlotIndex() {
1281
- return parentComponent.node.slots[parentSlot].findIndex(
1282
- (x) => x === enqueueingComponent
1283
- );
1284
- }
1285
- },
1286
- // slice removes 'self' since we are inserting a peer of self
1287
- ...currentQueueEntry.ancestorsAndSelf.slice(1)
1288
- ],
1289
- context: descendantContext
1290
- }))
1286
+ ...nodesToInsert.map((enqueueingComponent) => {
1287
+ const parentSlotIndexFn2 = () => {
1288
+ return parentComponent.node.slots[parentSlot].findIndex(
1289
+ (x) => x === enqueueingComponent
1290
+ );
1291
+ };
1292
+ return {
1293
+ type: "slot",
1294
+ ancestorsAndSelf: [
1295
+ {
1296
+ type: "slot",
1297
+ node: enqueueingComponent,
1298
+ parentSlot,
1299
+ get parentSlotIndex() {
1300
+ return parentSlotIndexFn2();
1301
+ },
1302
+ parentSlotIndexFn: parentSlotIndexFn2
1303
+ },
1304
+ // slice removes 'self' since we are inserting a peer of self
1305
+ ...currentQueueEntry.ancestorsAndSelf.slice(1)
1306
+ ],
1307
+ context: descendantContext
1308
+ };
1309
+ })
1291
1310
  );
1292
1311
  }
1293
1312
  } else {
@@ -1319,6 +1338,12 @@ function walkNodeTree(node, visitor, options) {
1319
1338
  const components = slots[slotKey];
1320
1339
  for (let componentIndex = components.length - 1; componentIndex >= 0; componentIndex--) {
1321
1340
  const enqueueingComponent = components[componentIndex];
1341
+ const parentSlotIndexFn = () => {
1342
+ const result = currentComponent.node.slots[slotKey].findIndex(
1343
+ (x) => x === enqueueingComponent
1344
+ );
1345
+ return result;
1346
+ };
1322
1347
  componentQueue.push({
1323
1348
  ancestorsAndSelf: [
1324
1349
  {
@@ -1326,10 +1351,9 @@ function walkNodeTree(node, visitor, options) {
1326
1351
  node: enqueueingComponent,
1327
1352
  parentSlot: slotKey,
1328
1353
  get parentSlotIndex() {
1329
- return currentComponent.node.slots[slotKey].findIndex(
1330
- (x) => x === enqueueingComponent
1331
- );
1332
- }
1354
+ return parentSlotIndexFn();
1355
+ },
1356
+ parentSlotIndexFn
1333
1357
  },
1334
1358
  ...currentQueueEntry.ancestorsAndSelf
1335
1359
  ],
@@ -1365,6 +1389,9 @@ function walkNodeTree(node, visitor, options) {
1365
1389
  const blocks = (_b = propObject.value) != null ? _b : [];
1366
1390
  for (let blockIndex = blocks.length - 1; blockIndex >= 0; blockIndex--) {
1367
1391
  const enqueueingBlock = blocks[blockIndex];
1392
+ const blockIndexFn = () => {
1393
+ return getBlockValue(currentComponent.node, propKey).findIndex((x) => x === enqueueingBlock);
1394
+ };
1368
1395
  componentQueue.push({
1369
1396
  ancestorsAndSelf: [
1370
1397
  {
@@ -1372,10 +1399,9 @@ function walkNodeTree(node, visitor, options) {
1372
1399
  node: enqueueingBlock,
1373
1400
  fieldName: propKey,
1374
1401
  get blockIndex() {
1375
- return getBlockValue(currentComponent.node, propKey).findIndex(
1376
- (x) => x === enqueueingBlock
1377
- );
1378
- }
1402
+ return blockIndexFn();
1403
+ },
1404
+ blockIndexFn
1379
1405
  },
1380
1406
  ...currentQueueEntry.ancestorsAndSelf
1381
1407
  ],
@@ -1666,7 +1692,8 @@ function getComponentJsonPointer(ancestorsAndSelf) {
1666
1692
  const parentLocation = ancestorsAndSelf[i + 1];
1667
1693
  if ("type" in currentLocation && currentLocation.type !== "slot") {
1668
1694
  if (currentLocation.type === "block") {
1669
- const { fieldName: parameterName, blockIndex } = currentLocation;
1695
+ const { fieldName: parameterName, blockIndexFn } = currentLocation;
1696
+ const blockIndex = blockIndexFn();
1670
1697
  if (parameterName && blockIndex !== void 0) {
1671
1698
  const noun = getNounForLocation(parentLocation);
1672
1699
  path.push(`${noun}/${parameterName}/value/${blockIndex}`);
@@ -1675,7 +1702,8 @@ function getComponentJsonPointer(ancestorsAndSelf) {
1675
1702
  }
1676
1703
  continue;
1677
1704
  }
1678
- const { parentSlot, parentSlotIndex } = currentLocation;
1705
+ const parentSlotIndex = "parentSlotIndexFn" in currentLocation ? currentLocation.parentSlotIndexFn() : currentLocation.parentSlotIndex;
1706
+ const { parentSlot } = currentLocation;
1679
1707
  if (parentSlot && parentSlotIndex !== void 0) {
1680
1708
  path.push(`slots/${parentSlot}/${parentSlotIndex}`);
1681
1709
  }
@@ -3336,6 +3364,7 @@ export {
3336
3364
  BatchEntry,
3337
3365
  BlockFormatError,
3338
3366
  CANVAS_BLOCK_PARAM_TYPE,
3367
+ CANVAS_CONTEXTUAL_EDITING_PARAM,
3339
3368
  CANVAS_DRAFT_STATE,
3340
3369
  CANVAS_EDITOR_STATE,
3341
3370
  CANVAS_ENRICHMENT_TAG_PARAM,
package/dist/index.js CHANGED
@@ -283,6 +283,7 @@ __export(src_exports, {
283
283
  BatchEntry: () => BatchEntry,
284
284
  BlockFormatError: () => BlockFormatError,
285
285
  CANVAS_BLOCK_PARAM_TYPE: () => CANVAS_BLOCK_PARAM_TYPE,
286
+ CANVAS_CONTEXTUAL_EDITING_PARAM: () => CANVAS_CONTEXTUAL_EDITING_PARAM,
286
287
  CANVAS_DRAFT_STATE: () => CANVAS_DRAFT_STATE,
287
288
  CANVAS_EDITOR_STATE: () => CANVAS_EDITOR_STATE,
288
289
  CANVAS_ENRICHMENT_TAG_PARAM: () => CANVAS_ENRICHMENT_TAG_PARAM,
@@ -1068,7 +1069,8 @@ function getComponentPath(ancestorsAndSelf) {
1068
1069
  const parentLocation = ancestorsAndSelf[i + 1];
1069
1070
  if ("type" in currentLocation && currentLocation.type !== "slot") {
1070
1071
  if (currentLocation.type === "block") {
1071
- const { fieldName, blockIndex } = currentLocation;
1072
+ const { fieldName, blockIndexFn } = currentLocation;
1073
+ const blockIndex = blockIndexFn();
1072
1074
  if (fieldName && blockIndex !== void 0) {
1073
1075
  const noun = parentLocation && "type" in parentLocation && parentLocation.type === "block" ? "fields" : "parameters";
1074
1076
  path.push(`${noun}.${fieldName}.value[${blockIndex}]`);
@@ -1077,7 +1079,8 @@ function getComponentPath(ancestorsAndSelf) {
1077
1079
  }
1078
1080
  continue;
1079
1081
  }
1080
- const { parentSlot, parentSlotIndex } = currentLocation;
1082
+ const parentSlotIndex = "parentSlotIndexFn" in currentLocation ? currentLocation.parentSlotIndexFn() : currentLocation.parentSlotIndex;
1083
+ const { parentSlot } = currentLocation;
1081
1084
  if (parentSlot && parentSlotIndex !== void 0) {
1082
1085
  path.push(`${parentSlot}[${parentSlotIndex}]`);
1083
1086
  }
@@ -1103,6 +1106,7 @@ var CANVAS_EDITOR_STATE = 63;
1103
1106
  var CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
1104
1107
  var CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
1105
1108
  var CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
1109
+ var CANVAS_CONTEXTUAL_EDITING_PARAM = "$contextualEditing";
1106
1110
  var SECRET_QUERY_STRING_PARAM = "secret";
1107
1111
  var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
1108
1112
  var IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM = "is_incontext_editing_playground";
@@ -1314,7 +1318,8 @@ function walkNodeTree(node, visitor, options) {
1314
1318
  const currentComponentLocation = currentQueueEntry.ancestorsAndSelf[0];
1315
1319
  const parentComponent = currentQueueEntry.ancestorsAndSelf[1];
1316
1320
  if (currentComponentLocation.type === "block") {
1317
- const { fieldName, blockIndex } = currentComponentLocation;
1321
+ const { fieldName, blockIndexFn } = currentComponentLocation;
1322
+ const blockIndex = blockIndexFn();
1318
1323
  const blockValue = getBlockValue(parentComponent.node, fieldName);
1319
1324
  blockValue.splice(blockIndex, 1);
1320
1325
  if (blockValue.length === 0) {
@@ -1331,7 +1336,8 @@ function walkNodeTree(node, visitor, options) {
1331
1336
  if (currentNodeInfo.type !== "block") {
1332
1337
  throw new Error("Unknown type");
1333
1338
  }
1334
- const { fieldName, blockIndex } = currentNodeInfo;
1339
+ const { fieldName, blockIndexFn } = currentNodeInfo;
1340
+ const blockIndex = blockIndexFn();
1335
1341
  const parentComponent = currentQueueEntry.ancestorsAndSelf[1];
1336
1342
  const nodesToInsert = Array.isArray(nodes) ? nodes : [nodes];
1337
1343
  if (fieldName && typeof blockIndex !== "undefined") {
@@ -1341,22 +1347,28 @@ function walkNodeTree(node, visitor, options) {
1341
1347
  ...nodesToInsert
1342
1348
  );
1343
1349
  componentQueue.unshift(
1344
- ...nodesToInsert.map((enqueueingComponent) => ({
1345
- ancestorsAndSelf: [
1346
- {
1347
- type: "block",
1348
- node: enqueueingComponent,
1349
- fieldName,
1350
- get blockIndex() {
1351
- const parentArray = getPropertiesValue(parentComponent.node)[fieldName].value;
1352
- return parentArray.findIndex((x) => x === enqueueingComponent);
1353
- }
1354
- },
1355
- // slice removes 'self' since we are inserting a peer of self
1356
- ...currentQueueEntry.ancestorsAndSelf.slice(1)
1357
- ],
1358
- context: descendantContext
1359
- }))
1350
+ ...nodesToInsert.map((enqueueingComponent) => {
1351
+ const blockIndexFn2 = () => {
1352
+ const parentArray = getPropertiesValue(parentComponent.node)[fieldName].value;
1353
+ return parentArray.findIndex((x) => x === enqueueingComponent);
1354
+ };
1355
+ return {
1356
+ ancestorsAndSelf: [
1357
+ {
1358
+ type: "block",
1359
+ node: enqueueingComponent,
1360
+ fieldName,
1361
+ get blockIndex() {
1362
+ return blockIndexFn2();
1363
+ },
1364
+ blockIndexFn: blockIndexFn2
1365
+ },
1366
+ // slice removes 'self' since we are inserting a peer of self
1367
+ ...currentQueueEntry.ancestorsAndSelf.slice(1)
1368
+ ],
1369
+ context: descendantContext
1370
+ };
1371
+ })
1360
1372
  );
1361
1373
  }
1362
1374
  },
@@ -1405,7 +1417,8 @@ function walkNodeTree(node, visitor, options) {
1405
1417
  throw new Error("Unable to delete root node.");
1406
1418
  }
1407
1419
  if (currentComponentLocation.type === "slot") {
1408
- const { parentSlot, parentSlotIndex } = currentComponentLocation;
1420
+ const { parentSlot, parentSlotIndexFn } = currentComponentLocation;
1421
+ const parentSlotIndex = parentSlotIndexFn();
1409
1422
  parentComponent.node.slots[parentSlot].splice(parentSlotIndex, 1);
1410
1423
  } else {
1411
1424
  throw new Error("Unknown node type");
@@ -1419,7 +1432,8 @@ function walkNodeTree(node, visitor, options) {
1419
1432
  throw new Error("Unable to insert after root node.");
1420
1433
  }
1421
1434
  if (currentNodeInfo.type === "slot") {
1422
- const { parentSlot, parentSlotIndex } = currentNodeInfo;
1435
+ const { parentSlot, parentSlotIndexFn } = currentNodeInfo;
1436
+ const parentSlotIndex = parentSlotIndexFn();
1423
1437
  const parentComponent = currentQueueEntry.ancestorsAndSelf[1];
1424
1438
  if (parentSlot && typeof parentSlotIndex !== "undefined") {
1425
1439
  parentComponent.node.slots[parentSlot].splice(
@@ -1428,24 +1442,30 @@ function walkNodeTree(node, visitor, options) {
1428
1442
  ...nodesToInsert
1429
1443
  );
1430
1444
  componentQueue.unshift(
1431
- ...nodesToInsert.map((enqueueingComponent) => ({
1432
- type: "slot",
1433
- ancestorsAndSelf: [
1434
- {
1435
- type: "slot",
1436
- node: enqueueingComponent,
1437
- parentSlot,
1438
- get parentSlotIndex() {
1439
- return parentComponent.node.slots[parentSlot].findIndex(
1440
- (x) => x === enqueueingComponent
1441
- );
1442
- }
1443
- },
1444
- // slice removes 'self' since we are inserting a peer of self
1445
- ...currentQueueEntry.ancestorsAndSelf.slice(1)
1446
- ],
1447
- context: descendantContext
1448
- }))
1445
+ ...nodesToInsert.map((enqueueingComponent) => {
1446
+ const parentSlotIndexFn2 = () => {
1447
+ return parentComponent.node.slots[parentSlot].findIndex(
1448
+ (x) => x === enqueueingComponent
1449
+ );
1450
+ };
1451
+ return {
1452
+ type: "slot",
1453
+ ancestorsAndSelf: [
1454
+ {
1455
+ type: "slot",
1456
+ node: enqueueingComponent,
1457
+ parentSlot,
1458
+ get parentSlotIndex() {
1459
+ return parentSlotIndexFn2();
1460
+ },
1461
+ parentSlotIndexFn: parentSlotIndexFn2
1462
+ },
1463
+ // slice removes 'self' since we are inserting a peer of self
1464
+ ...currentQueueEntry.ancestorsAndSelf.slice(1)
1465
+ ],
1466
+ context: descendantContext
1467
+ };
1468
+ })
1449
1469
  );
1450
1470
  }
1451
1471
  } else {
@@ -1477,6 +1497,12 @@ function walkNodeTree(node, visitor, options) {
1477
1497
  const components = slots[slotKey];
1478
1498
  for (let componentIndex = components.length - 1; componentIndex >= 0; componentIndex--) {
1479
1499
  const enqueueingComponent = components[componentIndex];
1500
+ const parentSlotIndexFn = () => {
1501
+ const result = currentComponent.node.slots[slotKey].findIndex(
1502
+ (x) => x === enqueueingComponent
1503
+ );
1504
+ return result;
1505
+ };
1480
1506
  componentQueue.push({
1481
1507
  ancestorsAndSelf: [
1482
1508
  {
@@ -1484,10 +1510,9 @@ function walkNodeTree(node, visitor, options) {
1484
1510
  node: enqueueingComponent,
1485
1511
  parentSlot: slotKey,
1486
1512
  get parentSlotIndex() {
1487
- return currentComponent.node.slots[slotKey].findIndex(
1488
- (x) => x === enqueueingComponent
1489
- );
1490
- }
1513
+ return parentSlotIndexFn();
1514
+ },
1515
+ parentSlotIndexFn
1491
1516
  },
1492
1517
  ...currentQueueEntry.ancestorsAndSelf
1493
1518
  ],
@@ -1523,6 +1548,9 @@ function walkNodeTree(node, visitor, options) {
1523
1548
  const blocks = (_b = propObject.value) != null ? _b : [];
1524
1549
  for (let blockIndex = blocks.length - 1; blockIndex >= 0; blockIndex--) {
1525
1550
  const enqueueingBlock = blocks[blockIndex];
1551
+ const blockIndexFn = () => {
1552
+ return getBlockValue(currentComponent.node, propKey).findIndex((x) => x === enqueueingBlock);
1553
+ };
1526
1554
  componentQueue.push({
1527
1555
  ancestorsAndSelf: [
1528
1556
  {
@@ -1530,10 +1558,9 @@ function walkNodeTree(node, visitor, options) {
1530
1558
  node: enqueueingBlock,
1531
1559
  fieldName: propKey,
1532
1560
  get blockIndex() {
1533
- return getBlockValue(currentComponent.node, propKey).findIndex(
1534
- (x) => x === enqueueingBlock
1535
- );
1536
- }
1561
+ return blockIndexFn();
1562
+ },
1563
+ blockIndexFn
1537
1564
  },
1538
1565
  ...currentQueueEntry.ancestorsAndSelf
1539
1566
  ],
@@ -1824,7 +1851,8 @@ function getComponentJsonPointer(ancestorsAndSelf) {
1824
1851
  const parentLocation = ancestorsAndSelf[i + 1];
1825
1852
  if ("type" in currentLocation && currentLocation.type !== "slot") {
1826
1853
  if (currentLocation.type === "block") {
1827
- const { fieldName: parameterName, blockIndex } = currentLocation;
1854
+ const { fieldName: parameterName, blockIndexFn } = currentLocation;
1855
+ const blockIndex = blockIndexFn();
1828
1856
  if (parameterName && blockIndex !== void 0) {
1829
1857
  const noun = getNounForLocation(parentLocation);
1830
1858
  path.push(`${noun}/${parameterName}/value/${blockIndex}`);
@@ -1833,7 +1861,8 @@ function getComponentJsonPointer(ancestorsAndSelf) {
1833
1861
  }
1834
1862
  continue;
1835
1863
  }
1836
- const { parentSlot, parentSlotIndex } = currentLocation;
1864
+ const parentSlotIndex = "parentSlotIndexFn" in currentLocation ? currentLocation.parentSlotIndexFn() : currentLocation.parentSlotIndex;
1865
+ const { parentSlot } = currentLocation;
1837
1866
  if (parentSlot && parentSlotIndex !== void 0) {
1838
1867
  path.push(`slots/${parentSlot}/${parentSlotIndex}`);
1839
1868
  }
@@ -3495,6 +3524,7 @@ var CanvasClientError = import_api16.ApiClientError;
3495
3524
  BatchEntry,
3496
3525
  BlockFormatError,
3497
3526
  CANVAS_BLOCK_PARAM_TYPE,
3527
+ CANVAS_CONTEXTUAL_EDITING_PARAM,
3498
3528
  CANVAS_DRAFT_STATE,
3499
3529
  CANVAS_EDITOR_STATE,
3500
3530
  CANVAS_ENRICHMENT_TAG_PARAM,
package/dist/index.mjs CHANGED
@@ -910,7 +910,8 @@ function getComponentPath(ancestorsAndSelf) {
910
910
  const parentLocation = ancestorsAndSelf[i + 1];
911
911
  if ("type" in currentLocation && currentLocation.type !== "slot") {
912
912
  if (currentLocation.type === "block") {
913
- const { fieldName, blockIndex } = currentLocation;
913
+ const { fieldName, blockIndexFn } = currentLocation;
914
+ const blockIndex = blockIndexFn();
914
915
  if (fieldName && blockIndex !== void 0) {
915
916
  const noun = parentLocation && "type" in parentLocation && parentLocation.type === "block" ? "fields" : "parameters";
916
917
  path.push(`${noun}.${fieldName}.value[${blockIndex}]`);
@@ -919,7 +920,8 @@ function getComponentPath(ancestorsAndSelf) {
919
920
  }
920
921
  continue;
921
922
  }
922
- const { parentSlot, parentSlotIndex } = currentLocation;
923
+ const parentSlotIndex = "parentSlotIndexFn" in currentLocation ? currentLocation.parentSlotIndexFn() : currentLocation.parentSlotIndex;
924
+ const { parentSlot } = currentLocation;
923
925
  if (parentSlot && parentSlotIndex !== void 0) {
924
926
  path.push(`${parentSlot}[${parentSlotIndex}]`);
925
927
  }
@@ -945,6 +947,7 @@ var CANVAS_EDITOR_STATE = 63;
945
947
  var CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
946
948
  var CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
947
949
  var CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
950
+ var CANVAS_CONTEXTUAL_EDITING_PARAM = "$contextualEditing";
948
951
  var SECRET_QUERY_STRING_PARAM = "secret";
949
952
  var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
950
953
  var IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM = "is_incontext_editing_playground";
@@ -1156,7 +1159,8 @@ function walkNodeTree(node, visitor, options) {
1156
1159
  const currentComponentLocation = currentQueueEntry.ancestorsAndSelf[0];
1157
1160
  const parentComponent = currentQueueEntry.ancestorsAndSelf[1];
1158
1161
  if (currentComponentLocation.type === "block") {
1159
- const { fieldName, blockIndex } = currentComponentLocation;
1162
+ const { fieldName, blockIndexFn } = currentComponentLocation;
1163
+ const blockIndex = blockIndexFn();
1160
1164
  const blockValue = getBlockValue(parentComponent.node, fieldName);
1161
1165
  blockValue.splice(blockIndex, 1);
1162
1166
  if (blockValue.length === 0) {
@@ -1173,7 +1177,8 @@ function walkNodeTree(node, visitor, options) {
1173
1177
  if (currentNodeInfo.type !== "block") {
1174
1178
  throw new Error("Unknown type");
1175
1179
  }
1176
- const { fieldName, blockIndex } = currentNodeInfo;
1180
+ const { fieldName, blockIndexFn } = currentNodeInfo;
1181
+ const blockIndex = blockIndexFn();
1177
1182
  const parentComponent = currentQueueEntry.ancestorsAndSelf[1];
1178
1183
  const nodesToInsert = Array.isArray(nodes) ? nodes : [nodes];
1179
1184
  if (fieldName && typeof blockIndex !== "undefined") {
@@ -1183,22 +1188,28 @@ function walkNodeTree(node, visitor, options) {
1183
1188
  ...nodesToInsert
1184
1189
  );
1185
1190
  componentQueue.unshift(
1186
- ...nodesToInsert.map((enqueueingComponent) => ({
1187
- ancestorsAndSelf: [
1188
- {
1189
- type: "block",
1190
- node: enqueueingComponent,
1191
- fieldName,
1192
- get blockIndex() {
1193
- const parentArray = getPropertiesValue(parentComponent.node)[fieldName].value;
1194
- return parentArray.findIndex((x) => x === enqueueingComponent);
1195
- }
1196
- },
1197
- // slice removes 'self' since we are inserting a peer of self
1198
- ...currentQueueEntry.ancestorsAndSelf.slice(1)
1199
- ],
1200
- context: descendantContext
1201
- }))
1191
+ ...nodesToInsert.map((enqueueingComponent) => {
1192
+ const blockIndexFn2 = () => {
1193
+ const parentArray = getPropertiesValue(parentComponent.node)[fieldName].value;
1194
+ return parentArray.findIndex((x) => x === enqueueingComponent);
1195
+ };
1196
+ return {
1197
+ ancestorsAndSelf: [
1198
+ {
1199
+ type: "block",
1200
+ node: enqueueingComponent,
1201
+ fieldName,
1202
+ get blockIndex() {
1203
+ return blockIndexFn2();
1204
+ },
1205
+ blockIndexFn: blockIndexFn2
1206
+ },
1207
+ // slice removes 'self' since we are inserting a peer of self
1208
+ ...currentQueueEntry.ancestorsAndSelf.slice(1)
1209
+ ],
1210
+ context: descendantContext
1211
+ };
1212
+ })
1202
1213
  );
1203
1214
  }
1204
1215
  },
@@ -1247,7 +1258,8 @@ function walkNodeTree(node, visitor, options) {
1247
1258
  throw new Error("Unable to delete root node.");
1248
1259
  }
1249
1260
  if (currentComponentLocation.type === "slot") {
1250
- const { parentSlot, parentSlotIndex } = currentComponentLocation;
1261
+ const { parentSlot, parentSlotIndexFn } = currentComponentLocation;
1262
+ const parentSlotIndex = parentSlotIndexFn();
1251
1263
  parentComponent.node.slots[parentSlot].splice(parentSlotIndex, 1);
1252
1264
  } else {
1253
1265
  throw new Error("Unknown node type");
@@ -1261,7 +1273,8 @@ function walkNodeTree(node, visitor, options) {
1261
1273
  throw new Error("Unable to insert after root node.");
1262
1274
  }
1263
1275
  if (currentNodeInfo.type === "slot") {
1264
- const { parentSlot, parentSlotIndex } = currentNodeInfo;
1276
+ const { parentSlot, parentSlotIndexFn } = currentNodeInfo;
1277
+ const parentSlotIndex = parentSlotIndexFn();
1265
1278
  const parentComponent = currentQueueEntry.ancestorsAndSelf[1];
1266
1279
  if (parentSlot && typeof parentSlotIndex !== "undefined") {
1267
1280
  parentComponent.node.slots[parentSlot].splice(
@@ -1270,24 +1283,30 @@ function walkNodeTree(node, visitor, options) {
1270
1283
  ...nodesToInsert
1271
1284
  );
1272
1285
  componentQueue.unshift(
1273
- ...nodesToInsert.map((enqueueingComponent) => ({
1274
- type: "slot",
1275
- ancestorsAndSelf: [
1276
- {
1277
- type: "slot",
1278
- node: enqueueingComponent,
1279
- parentSlot,
1280
- get parentSlotIndex() {
1281
- return parentComponent.node.slots[parentSlot].findIndex(
1282
- (x) => x === enqueueingComponent
1283
- );
1284
- }
1285
- },
1286
- // slice removes 'self' since we are inserting a peer of self
1287
- ...currentQueueEntry.ancestorsAndSelf.slice(1)
1288
- ],
1289
- context: descendantContext
1290
- }))
1286
+ ...nodesToInsert.map((enqueueingComponent) => {
1287
+ const parentSlotIndexFn2 = () => {
1288
+ return parentComponent.node.slots[parentSlot].findIndex(
1289
+ (x) => x === enqueueingComponent
1290
+ );
1291
+ };
1292
+ return {
1293
+ type: "slot",
1294
+ ancestorsAndSelf: [
1295
+ {
1296
+ type: "slot",
1297
+ node: enqueueingComponent,
1298
+ parentSlot,
1299
+ get parentSlotIndex() {
1300
+ return parentSlotIndexFn2();
1301
+ },
1302
+ parentSlotIndexFn: parentSlotIndexFn2
1303
+ },
1304
+ // slice removes 'self' since we are inserting a peer of self
1305
+ ...currentQueueEntry.ancestorsAndSelf.slice(1)
1306
+ ],
1307
+ context: descendantContext
1308
+ };
1309
+ })
1291
1310
  );
1292
1311
  }
1293
1312
  } else {
@@ -1319,6 +1338,12 @@ function walkNodeTree(node, visitor, options) {
1319
1338
  const components = slots[slotKey];
1320
1339
  for (let componentIndex = components.length - 1; componentIndex >= 0; componentIndex--) {
1321
1340
  const enqueueingComponent = components[componentIndex];
1341
+ const parentSlotIndexFn = () => {
1342
+ const result = currentComponent.node.slots[slotKey].findIndex(
1343
+ (x) => x === enqueueingComponent
1344
+ );
1345
+ return result;
1346
+ };
1322
1347
  componentQueue.push({
1323
1348
  ancestorsAndSelf: [
1324
1349
  {
@@ -1326,10 +1351,9 @@ function walkNodeTree(node, visitor, options) {
1326
1351
  node: enqueueingComponent,
1327
1352
  parentSlot: slotKey,
1328
1353
  get parentSlotIndex() {
1329
- return currentComponent.node.slots[slotKey].findIndex(
1330
- (x) => x === enqueueingComponent
1331
- );
1332
- }
1354
+ return parentSlotIndexFn();
1355
+ },
1356
+ parentSlotIndexFn
1333
1357
  },
1334
1358
  ...currentQueueEntry.ancestorsAndSelf
1335
1359
  ],
@@ -1365,6 +1389,9 @@ function walkNodeTree(node, visitor, options) {
1365
1389
  const blocks = (_b = propObject.value) != null ? _b : [];
1366
1390
  for (let blockIndex = blocks.length - 1; blockIndex >= 0; blockIndex--) {
1367
1391
  const enqueueingBlock = blocks[blockIndex];
1392
+ const blockIndexFn = () => {
1393
+ return getBlockValue(currentComponent.node, propKey).findIndex((x) => x === enqueueingBlock);
1394
+ };
1368
1395
  componentQueue.push({
1369
1396
  ancestorsAndSelf: [
1370
1397
  {
@@ -1372,10 +1399,9 @@ function walkNodeTree(node, visitor, options) {
1372
1399
  node: enqueueingBlock,
1373
1400
  fieldName: propKey,
1374
1401
  get blockIndex() {
1375
- return getBlockValue(currentComponent.node, propKey).findIndex(
1376
- (x) => x === enqueueingBlock
1377
- );
1378
- }
1402
+ return blockIndexFn();
1403
+ },
1404
+ blockIndexFn
1379
1405
  },
1380
1406
  ...currentQueueEntry.ancestorsAndSelf
1381
1407
  ],
@@ -1666,7 +1692,8 @@ function getComponentJsonPointer(ancestorsAndSelf) {
1666
1692
  const parentLocation = ancestorsAndSelf[i + 1];
1667
1693
  if ("type" in currentLocation && currentLocation.type !== "slot") {
1668
1694
  if (currentLocation.type === "block") {
1669
- const { fieldName: parameterName, blockIndex } = currentLocation;
1695
+ const { fieldName: parameterName, blockIndexFn } = currentLocation;
1696
+ const blockIndex = blockIndexFn();
1670
1697
  if (parameterName && blockIndex !== void 0) {
1671
1698
  const noun = getNounForLocation(parentLocation);
1672
1699
  path.push(`${noun}/${parameterName}/value/${blockIndex}`);
@@ -1675,7 +1702,8 @@ function getComponentJsonPointer(ancestorsAndSelf) {
1675
1702
  }
1676
1703
  continue;
1677
1704
  }
1678
- const { parentSlot, parentSlotIndex } = currentLocation;
1705
+ const parentSlotIndex = "parentSlotIndexFn" in currentLocation ? currentLocation.parentSlotIndexFn() : currentLocation.parentSlotIndex;
1706
+ const { parentSlot } = currentLocation;
1679
1707
  if (parentSlot && parentSlotIndex !== void 0) {
1680
1708
  path.push(`slots/${parentSlot}/${parentSlotIndex}`);
1681
1709
  }
@@ -3336,6 +3364,7 @@ export {
3336
3364
  BatchEntry,
3337
3365
  BlockFormatError,
3338
3366
  CANVAS_BLOCK_PARAM_TYPE,
3367
+ CANVAS_CONTEXTUAL_EDITING_PARAM,
3339
3368
  CANVAS_DRAFT_STATE,
3340
3369
  CANVAS_EDITOR_STATE,
3341
3370
  CANVAS_ENRICHMENT_TAG_PARAM,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.199.0",
3
+ "version": "19.199.1-alpha.10+7f62130189",
4
4
  "description": "Common functionality and types for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -38,9 +38,9 @@
38
38
  "pusher-js": "8.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@uniformdev/assets": "19.199.0",
42
- "@uniformdev/context": "19.199.0",
43
- "@uniformdev/richtext": "19.199.0",
41
+ "@uniformdev/assets": "19.199.1-alpha.10+7f62130189",
42
+ "@uniformdev/context": "19.199.1-alpha.10+7f62130189",
43
+ "@uniformdev/richtext": "19.199.1-alpha.10+7f62130189",
44
44
  "immer": "10.1.1"
45
45
  },
46
46
  "files": [
@@ -49,5 +49,5 @@
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "gitHead": "10b981b78ca171d82d8535f8162c2072e1e944c5"
52
+ "gitHead": "7f62130189d43f7ecaaed0a41c929e5c166860d2"
53
53
  }