@uniformdev/canvas 19.51.1-alpha.1 → 19.51.1-alpha.22

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
@@ -171,21 +171,15 @@ interface components$5 {
171
171
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
172
172
  fields?: components$5["schemas"]["ComponentDefinitionParameter"][];
173
173
  /**
174
- * Format: uuid
175
- * @description Reference to the category this component definition belongs to
176
- * @default null
177
- */
178
- categoryId?: string | null;
179
- /**
180
- * @description Description of the component definition
174
+ * @description Description of the content type
181
175
  * @default null
182
176
  */
183
177
  description?: string;
184
178
  /**
185
- * @description Description of the component definition
186
- * @default null
179
+ * @description Icon name for the content type (e.g. 'screen')
180
+ * @default file-document
187
181
  */
188
- previewImageUrl?: string;
182
+ icon?: string;
189
183
  /** @description Created date string for this content type (ignored for writes) */
190
184
  created?: string;
191
185
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -838,21 +832,15 @@ interface external$c {
838
832
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
839
833
  fields?: external$c["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
840
834
  /**
841
- * Format: uuid
842
- * @description Reference to the category this component definition belongs to
843
- * @default null
844
- */
845
- categoryId?: string | null;
846
- /**
847
- * @description Description of the component definition
835
+ * @description Description of the content type
848
836
  * @default null
849
837
  */
850
838
  description?: string;
851
839
  /**
852
- * @description Description of the component definition
853
- * @default null
840
+ * @description Icon name for the content type (e.g. 'screen')
841
+ * @default file-document
854
842
  */
855
- previewImageUrl?: string;
843
+ icon?: string;
856
844
  /** @description Created date string for this content type (ignored for writes) */
857
845
  created?: string;
858
846
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -1506,21 +1494,15 @@ interface external$b {
1506
1494
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
1507
1495
  fields?: external$b["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
1508
1496
  /**
1509
- * Format: uuid
1510
- * @description Reference to the category this component definition belongs to
1511
- * @default null
1512
- */
1513
- categoryId?: string | null;
1514
- /**
1515
- * @description Description of the component definition
1497
+ * @description Description of the content type
1516
1498
  * @default null
1517
1499
  */
1518
1500
  description?: string;
1519
1501
  /**
1520
- * @description Description of the component definition
1521
- * @default null
1502
+ * @description Icon name for the content type (e.g. 'screen')
1503
+ * @default file-document
1522
1504
  */
1523
- previewImageUrl?: string;
1505
+ icon?: string;
1524
1506
  /** @description Created date string for this content type (ignored for writes) */
1525
1507
  created?: string;
1526
1508
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -2183,21 +2165,15 @@ interface external$a {
2183
2165
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
2184
2166
  fields?: external$a["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
2185
2167
  /**
2186
- * Format: uuid
2187
- * @description Reference to the category this component definition belongs to
2188
- * @default null
2189
- */
2190
- categoryId?: string | null;
2191
- /**
2192
- * @description Description of the component definition
2168
+ * @description Description of the content type
2193
2169
  * @default null
2194
2170
  */
2195
2171
  description?: string;
2196
2172
  /**
2197
- * @description Description of the component definition
2198
- * @default null
2173
+ * @description Icon name for the content type (e.g. 'screen')
2174
+ * @default file-document
2199
2175
  */
2200
- previewImageUrl?: string;
2176
+ icon?: string;
2201
2177
  /** @description Created date string for this content type (ignored for writes) */
2202
2178
  created?: string;
2203
2179
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -2693,7 +2669,7 @@ interface components$4 {
2693
2669
  _id: string;
2694
2670
  /** @description The name of the entry. */
2695
2671
  _name?: string;
2696
- /** @description The slug of the entry, automatically generated. */
2672
+ /** @description The slug of the entry. */
2697
2673
  _slug?: string;
2698
2674
  /** @description Name of the author of the most recent change. */
2699
2675
  _author?: string;
@@ -2712,6 +2688,8 @@ interface components$4 {
2712
2688
  * @description The public UUID of the entry.
2713
2689
  */
2714
2690
  _id?: string;
2691
+ /** @description The slug of the entry. */
2692
+ _slug?: string;
2715
2693
  /** @description Entry field values. */
2716
2694
  fields?: {
2717
2695
  [key: string]: external$9["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
@@ -3000,21 +2978,15 @@ interface external$9 {
3000
2978
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
3001
2979
  fields?: external$9["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
3002
2980
  /**
3003
- * Format: uuid
3004
- * @description Reference to the category this component definition belongs to
3005
- * @default null
3006
- */
3007
- categoryId?: string | null;
3008
- /**
3009
- * @description Description of the component definition
2981
+ * @description Description of the content type
3010
2982
  * @default null
3011
2983
  */
3012
2984
  description?: string;
3013
2985
  /**
3014
- * @description Description of the component definition
3015
- * @default null
2986
+ * @description Icon name for the content type (e.g. 'screen')
2987
+ * @default file-document
3016
2988
  */
3017
- previewImageUrl?: string;
2989
+ icon?: string;
3018
2990
  /** @description Created date string for this content type (ignored for writes) */
3019
2991
  created?: string;
3020
2992
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -3663,21 +3635,15 @@ interface external$8 {
3663
3635
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
3664
3636
  fields?: external$8["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
3665
3637
  /**
3666
- * Format: uuid
3667
- * @description Reference to the category this component definition belongs to
3668
- * @default null
3669
- */
3670
- categoryId?: string | null;
3671
- /**
3672
- * @description Description of the component definition
3638
+ * @description Description of the content type
3673
3639
  * @default null
3674
3640
  */
3675
3641
  description?: string;
3676
3642
  /**
3677
- * @description Description of the component definition
3678
- * @default null
3643
+ * @description Icon name for the content type (e.g. 'screen')
3644
+ * @default file-document
3679
3645
  */
3680
- previewImageUrl?: string;
3646
+ icon?: string;
3681
3647
  /** @description Created date string for this content type (ignored for writes) */
3682
3648
  created?: string;
3683
3649
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -4270,21 +4236,15 @@ interface external$7 {
4270
4236
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
4271
4237
  fields?: external$7["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
4272
4238
  /**
4273
- * Format: uuid
4274
- * @description Reference to the category this component definition belongs to
4275
- * @default null
4276
- */
4277
- categoryId?: string | null;
4278
- /**
4279
- * @description Description of the component definition
4239
+ * @description Description of the content type
4280
4240
  * @default null
4281
4241
  */
4282
4242
  description?: string;
4283
4243
  /**
4284
- * @description Description of the component definition
4285
- * @default null
4244
+ * @description Icon name for the content type (e.g. 'screen')
4245
+ * @default file-document
4286
4246
  */
4287
- previewImageUrl?: string;
4247
+ icon?: string;
4288
4248
  /** @description Created date string for this content type (ignored for writes) */
4289
4249
  created?: string;
4290
4250
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -4912,21 +4872,15 @@ interface external$6 {
4912
4872
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
4913
4873
  fields?: external$6["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
4914
4874
  /**
4915
- * Format: uuid
4916
- * @description Reference to the category this component definition belongs to
4917
- * @default null
4918
- */
4919
- categoryId?: string | null;
4920
- /**
4921
- * @description Description of the component definition
4875
+ * @description Description of the content type
4922
4876
  * @default null
4923
4877
  */
4924
4878
  description?: string;
4925
4879
  /**
4926
- * @description Description of the component definition
4927
- * @default null
4880
+ * @description Icon name for the content type (e.g. 'screen')
4881
+ * @default file-document
4928
4882
  */
4929
- previewImageUrl?: string;
4883
+ icon?: string;
4930
4884
  /** @description Created date string for this content type (ignored for writes) */
4931
4885
  created?: string;
4932
4886
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -5983,21 +5937,15 @@ interface external$5 {
5983
5937
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
5984
5938
  fields?: external$5["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
5985
5939
  /**
5986
- * Format: uuid
5987
- * @description Reference to the category this component definition belongs to
5988
- * @default null
5989
- */
5990
- categoryId?: string | null;
5991
- /**
5992
- * @description Description of the component definition
5940
+ * @description Description of the content type
5993
5941
  * @default null
5994
5942
  */
5995
5943
  description?: string;
5996
5944
  /**
5997
- * @description Description of the component definition
5998
- * @default null
5945
+ * @description Icon name for the content type (e.g. 'screen')
5946
+ * @default file-document
5999
5947
  */
6000
- previewImageUrl?: string;
5948
+ icon?: string;
6001
5949
  /** @description Created date string for this content type (ignored for writes) */
6002
5950
  created?: string;
6003
5951
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -6831,21 +6779,15 @@ interface external$3 {
6831
6779
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
6832
6780
  fields?: external$3["../../../lambda/functions/uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
6833
6781
  /**
6834
- * Format: uuid
6835
- * @description Reference to the category this component definition belongs to
6836
- * @default null
6837
- */
6838
- categoryId?: string | null;
6839
- /**
6840
- * @description Description of the component definition
6782
+ * @description Description of the content type
6841
6783
  * @default null
6842
6784
  */
6843
6785
  description?: string;
6844
6786
  /**
6845
- * @description Description of the component definition
6846
- * @default null
6787
+ * @description Icon name for the content type (e.g. 'screen')
6788
+ * @default file-document
6847
6789
  */
6848
- previewImageUrl?: string;
6790
+ icon?: string;
6849
6791
  /** @description Created date string for this content type (ignored for writes) */
6850
6792
  created?: string;
6851
6793
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -7807,7 +7749,7 @@ interface external$3 {
7807
7749
  _id: string;
7808
7750
  /** @description The name of the entry. */
7809
7751
  _name?: string;
7810
- /** @description The slug of the entry, automatically generated. */
7752
+ /** @description The slug of the entry. */
7811
7753
  _slug?: string;
7812
7754
  /** @description Name of the author of the most recent change. */
7813
7755
  _author?: string;
@@ -7826,6 +7768,8 @@ interface external$3 {
7826
7768
  * @description The public UUID of the entry.
7827
7769
  */
7828
7770
  _id?: string;
7771
+ /** @description The slug of the entry. */
7772
+ _slug?: string;
7829
7773
  /** @description Entry field values. */
7830
7774
  fields?: {
7831
7775
  [key: string]: external$3["../../../lambda/functions/uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
@@ -8603,21 +8547,15 @@ interface external$2 {
8603
8547
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
8604
8548
  fields?: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
8605
8549
  /**
8606
- * Format: uuid
8607
- * @description Reference to the category this component definition belongs to
8608
- * @default null
8609
- */
8610
- categoryId?: string | null;
8611
- /**
8612
- * @description Description of the component definition
8550
+ * @description Description of the content type
8613
8551
  * @default null
8614
8552
  */
8615
8553
  description?: string;
8616
8554
  /**
8617
- * @description Description of the component definition
8618
- * @default null
8555
+ * @description Icon name for the content type (e.g. 'screen')
8556
+ * @default file-document
8619
8557
  */
8620
- previewImageUrl?: string;
8558
+ icon?: string;
8621
8559
  /** @description Created date string for this content type (ignored for writes) */
8622
8560
  created?: string;
8623
8561
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -10904,7 +10842,18 @@ type UpdatePreviewSettingsMessage = {
10904
10842
  type UpdateContextualEditingStateInternalMessage = {
10905
10843
  type: 'update-contextual-editing-state-internal';
10906
10844
  state: {
10907
- selectedComponentReference?: Omit<ContextualEditingComponentReference, 'elements'>;
10845
+ selectedComponentReference?: {
10846
+ id: string;
10847
+ slotName?: string;
10848
+ componentIndex?: number;
10849
+ totalComponents?: number;
10850
+ componentName?: string;
10851
+ componentTitle?: string;
10852
+ parentId?: string;
10853
+ parentType?: string;
10854
+ isLocalized?: boolean;
10855
+ isReadOnly?: boolean | undefined;
10856
+ };
10908
10857
  };
10909
10858
  };
10910
10859
  type ReportRenderedCompositionsMessage = {
@@ -11253,6 +11202,12 @@ declare const generateHash: ({ composition, secret, }: {
11253
11202
  secret: string | undefined;
11254
11203
  }) => number | undefined;
11255
11204
 
11205
+ /**
11206
+ * Checks if page is opened from inside Uniform Canvas Editor.
11207
+ * So if you open preview in incognito or via copy/paste link, it will return false.
11208
+ */
11209
+ declare const isAllowedReferrer: (referrer: string | undefined) => boolean;
11210
+
11256
11211
  /** Determines if a given Canvas component type is a system-defined type */
11257
11212
  declare const isSystemComponentDefinition: (componentType: string) => boolean;
11258
11213
 
@@ -11268,6 +11223,9 @@ declare function mapSlotToPersonalizedVariations(slot: ComponentInstance[] | und
11268
11223
  */
11269
11224
  declare function mapSlotToTestVariations(slot: ComponentInstance[] | undefined): Array<ComponentInstance & TestVariant>;
11270
11225
 
11226
+ declare const isComponentPlaceholderId: (id: string | undefined) => boolean | undefined;
11227
+ declare const generateComponentPlaceholderId: (randomId: string) => string;
11228
+
11271
11229
  type BindVariablesResult<TValue> = {
11272
11230
  /** Number of dynamic expressions that attempted to be bound (regardless of the success of the binding) */
11273
11231
  boundCount: number;
@@ -11327,4 +11285,4 @@ declare function parseVariableExpression(serialized: string, onToken?: (token: s
11327
11285
 
11328
11286
  declare const CanvasClientError: typeof ApiClientError;
11329
11287
 
11330
- export { ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, AddComponentMessage, BatchEnhancer, BatchEntry, BatchInvalidationPayload, BindVariablesOptions, BindVariablesResult, BindVariablesToObjectOptions, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, CanvasDefinitions, CategoriesDeleteParameters, CategoriesGetParameters, CategoriesGetResponse, CategoriesPutParameters, Category, CategoryClient, Channel, ChannelMessage, ChannelSubscription, ChildEnhancerBuilder, ComponentDefinition, ComponentDefinitionDeleteParameters, ComponentDefinitionGetParameters, ComponentDefinitionGetResponse, ComponentDefinitionParameter, ComponentDefinitionPermission, ComponentDefinitionPutParameters, ComponentDefinitionSlot, ComponentDefinitionSlugSettings, ComponentDefinitionVariant, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentInstance, ComponentInstanceContextualEditing, ComponentInstanceHistoryEntry, ComponentInstanceHistoryGetParameters, ComponentInstanceHistoryGetResponse, ComponentLocationReference, ComponentOverridability, ComponentOverride, ComponentOverrides, ComponentParameter, ComponentParameterContextualEditing, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions, CompositionDataDiagnostic, CompositionDeleteParameters, CompositionDiagnostics, CompositionGetByComponentIdParameters, CompositionGetByIdParameters, CompositionGetByNodeIdParameters, CompositionGetByNodePathParameters, CompositionGetBySlugParameters, CompositionGetListResponse, CompositionGetOrderBy, CompositionGetParameters, CompositionGetResponse, CompositionGetValidResponses, CompositionIssue, CompositionPatternIssue, CompositionPutParameters, CompositionRelationshipsClientOptions, CompositionRelationshipsDDefinitionGetResponse, CompositionRelationshipsDefinitionApi, CompositionRelationshipsDefinitionGetParameters, CompositionResolvedGetResponse, CompositionResolvedListResponse, CompositionUIStatus, ContentClient, ContentType, ContentTypeField, ContextualEditingComponentReference, DataDiagnostic, DataElementBindingIssue, DataElementConnectionDefinition, DataResolutionConfigIssue, DataResolutionIssue, DataResolutionOption, DataResolutionOptionNegative, DataResolutionOptionPositive, DataResolutionParameters, DataResourceDefinition, DataResourceDefinitions, DataResourceIssue, DataResourceVariables, DataSource, DataSourceClient, DataSourceDeleteParameters, DataSourceGetParameters, DataSourceGetResponse, DataSourcePutParameters, DataSourcesGetParameters, DataSourcesGetResponse, DataType, DataTypeClient, DataTypeDeleteParameters, DataTypeGetParameters, DataTypeGetResponse, DataTypePutParameters, DataVariableDefinition, DeleteContentTypeOptions, DeleteEntryOptions, DismissPlaceholderMessage, DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS, EDGE_MAX_CACHE_TTL, EDGE_MAX_L2_CACHE_TTL_IN_HOURS, EDGE_MIN_CACHE_TTL, EDGE_MIN_L2_CACHE_TTL_IN_HOURS, EMPTY_COMPOSITION, EdgehancersDiagnostics, EditorStateUpdatedMessage, EnhancerBuilder, EnhancerContext, EnhancerError, EntriesGetParameters, EntriesGetResponse, EntriesResolvedListResponse, Entry, EventNames, GetContentTypesOptions, GetContentTypesResponse, GetEntriesOptions, GetEntriesResponse, GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, InvalidationPayload, LimitPolicy, LinkComponentParameterValue, LinkParamConfiguration, LinkParamValue, LinkParameterType, LinkTypeConfiguration, MessageHandler, MoveComponentMessage, NonProjectMapLinkParamValue, OpenParameterEditorMessage, OverrideOptions, PLACEHOLDER_ID, PatternIssue, PreviewEventBus, PreviewPanelSettings, ProjectMapLinkComponentParameterValue, ProjectMapLinkParamValue, PutContentTypeBody, PutEntryBody, ReadyMessage, ReportRenderedCompositionsMessage, ResolvedRouteGetResponse, RichTextBuiltInElement, RichTextBuiltInFormat, RichTextParamConfiguration, RichTextParamValue, RootComponentInstance, RouteClient, RouteDynamicInputs, RouteGetParameters, RouteGetResponse, RouteGetResponseComposition, RouteGetResponseEdgehancedComposition, RouteGetResponseNotFound, RouteGetResponseRedirect, SelectComponentMessage, SelectParameterMessage, SpecificProjectMap, SubscribeToCompositionOptions, TriggerComponentActionMessage, TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, UnsubscribeCallback, UpdateComponentParameterMessage, UpdateComponentReferencesMessage, UpdateCompositionInternalMessage, UpdateCompositionMessage, UpdateContextualEditingStateInternalMessage, UpdatePreviewSettingsMessage, UsageTrackingApi, UsageTrackingGetParameters, UsageTrackingGetResponse, UsageTrackingPostParameters, UsageTrackingPostResponse, WalkComponentTreeActions, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createEventBus, createLimitPolicy, createUniformApiEnhancer, createVariableReference, enhance, extractLocales, generateHash, getChannelName, getComponentJsonPointer, getComponentPath, getParameterAttributes, isAddComponentMessage, isComponentActionMessage, isDismissPlaceholderMessage, isMovingComponentMessage, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isSelectComponentMessage, isSelectParameterMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseVariableExpression, subscribeToComposition, unstable_CompositionRelationshipClient, walkComponentTree };
11288
+ export { ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, AddComponentMessage, BatchEnhancer, BatchEntry, BatchInvalidationPayload, BindVariablesOptions, BindVariablesResult, BindVariablesToObjectOptions, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, CanvasDefinitions, CategoriesDeleteParameters, CategoriesGetParameters, CategoriesGetResponse, CategoriesPutParameters, Category, CategoryClient, Channel, ChannelMessage, ChannelSubscription, ChildEnhancerBuilder, ComponentDefinition, ComponentDefinitionDeleteParameters, ComponentDefinitionGetParameters, ComponentDefinitionGetResponse, ComponentDefinitionParameter, ComponentDefinitionPermission, ComponentDefinitionPutParameters, ComponentDefinitionSlot, ComponentDefinitionSlugSettings, ComponentDefinitionVariant, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentInstance, ComponentInstanceContextualEditing, ComponentInstanceHistoryEntry, ComponentInstanceHistoryGetParameters, ComponentInstanceHistoryGetResponse, ComponentLocationReference, ComponentOverridability, ComponentOverride, ComponentOverrides, ComponentParameter, ComponentParameterContextualEditing, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions, CompositionDataDiagnostic, CompositionDeleteParameters, CompositionDiagnostics, CompositionGetByComponentIdParameters, CompositionGetByIdParameters, CompositionGetByNodeIdParameters, CompositionGetByNodePathParameters, CompositionGetBySlugParameters, CompositionGetListResponse, CompositionGetOrderBy, CompositionGetParameters, CompositionGetResponse, CompositionGetValidResponses, CompositionIssue, CompositionPatternIssue, CompositionPutParameters, CompositionRelationshipsClientOptions, CompositionRelationshipsDDefinitionGetResponse, CompositionRelationshipsDefinitionApi, CompositionRelationshipsDefinitionGetParameters, CompositionResolvedGetResponse, CompositionResolvedListResponse, CompositionUIStatus, ContentClient, ContentType, ContentTypeField, ContextualEditingComponentReference, DataDiagnostic, DataElementBindingIssue, DataElementConnectionDefinition, DataResolutionConfigIssue, DataResolutionIssue, DataResolutionOption, DataResolutionOptionNegative, DataResolutionOptionPositive, DataResolutionParameters, DataResourceDefinition, DataResourceDefinitions, DataResourceIssue, DataResourceVariables, DataSource, DataSourceClient, DataSourceDeleteParameters, DataSourceGetParameters, DataSourceGetResponse, DataSourcePutParameters, DataSourcesGetParameters, DataSourcesGetResponse, DataType, DataTypeClient, DataTypeDeleteParameters, DataTypeGetParameters, DataTypeGetResponse, DataTypePutParameters, DataVariableDefinition, DeleteContentTypeOptions, DeleteEntryOptions, DismissPlaceholderMessage, DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS, EDGE_MAX_CACHE_TTL, EDGE_MAX_L2_CACHE_TTL_IN_HOURS, EDGE_MIN_CACHE_TTL, EDGE_MIN_L2_CACHE_TTL_IN_HOURS, EMPTY_COMPOSITION, EdgehancersDiagnostics, EditorStateUpdatedMessage, EnhancerBuilder, EnhancerContext, EnhancerError, EntriesGetParameters, EntriesGetResponse, EntriesResolvedListResponse, Entry, EventNames, GetContentTypesOptions, GetContentTypesResponse, GetEntriesOptions, GetEntriesResponse, GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, InvalidationPayload, LimitPolicy, LinkComponentParameterValue, LinkParamConfiguration, LinkParamValue, LinkParameterType, LinkTypeConfiguration, MessageHandler, MoveComponentMessage, NonProjectMapLinkParamValue, OpenParameterEditorMessage, OverrideOptions, PLACEHOLDER_ID, PatternIssue, PreviewEventBus, PreviewPanelSettings, ProjectMapLinkComponentParameterValue, ProjectMapLinkParamValue, PutContentTypeBody, PutEntryBody, ReadyMessage, ReportRenderedCompositionsMessage, ResolvedRouteGetResponse, RichTextBuiltInElement, RichTextBuiltInFormat, RichTextParamConfiguration, RichTextParamValue, RootComponentInstance, RouteClient, RouteDynamicInputs, RouteGetParameters, RouteGetResponse, RouteGetResponseComposition, RouteGetResponseEdgehancedComposition, RouteGetResponseNotFound, RouteGetResponseRedirect, SelectComponentMessage, SelectParameterMessage, SpecificProjectMap, SubscribeToCompositionOptions, TriggerComponentActionMessage, TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, UnsubscribeCallback, UpdateComponentParameterMessage, UpdateComponentReferencesMessage, UpdateCompositionInternalMessage, UpdateCompositionMessage, UpdateContextualEditingStateInternalMessage, UpdatePreviewSettingsMessage, UsageTrackingApi, UsageTrackingGetParameters, UsageTrackingGetResponse, UsageTrackingPostParameters, UsageTrackingPostResponse, WalkComponentTreeActions, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createEventBus, createLimitPolicy, createUniformApiEnhancer, createVariableReference, enhance, extractLocales, generateComponentPlaceholderId, generateHash, getChannelName, getComponentJsonPointer, getComponentPath, getParameterAttributes, isAddComponentMessage, isAllowedReferrer, isComponentActionMessage, isComponentPlaceholderId, isDismissPlaceholderMessage, isMovingComponentMessage, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isSelectComponentMessage, isSelectParameterMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseVariableExpression, subscribeToComposition, unstable_CompositionRelationshipClient, walkComponentTree };
package/dist/index.d.ts CHANGED
@@ -171,21 +171,15 @@ interface components$5 {
171
171
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
172
172
  fields?: components$5["schemas"]["ComponentDefinitionParameter"][];
173
173
  /**
174
- * Format: uuid
175
- * @description Reference to the category this component definition belongs to
176
- * @default null
177
- */
178
- categoryId?: string | null;
179
- /**
180
- * @description Description of the component definition
174
+ * @description Description of the content type
181
175
  * @default null
182
176
  */
183
177
  description?: string;
184
178
  /**
185
- * @description Description of the component definition
186
- * @default null
179
+ * @description Icon name for the content type (e.g. 'screen')
180
+ * @default file-document
187
181
  */
188
- previewImageUrl?: string;
182
+ icon?: string;
189
183
  /** @description Created date string for this content type (ignored for writes) */
190
184
  created?: string;
191
185
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -838,21 +832,15 @@ interface external$c {
838
832
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
839
833
  fields?: external$c["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
840
834
  /**
841
- * Format: uuid
842
- * @description Reference to the category this component definition belongs to
843
- * @default null
844
- */
845
- categoryId?: string | null;
846
- /**
847
- * @description Description of the component definition
835
+ * @description Description of the content type
848
836
  * @default null
849
837
  */
850
838
  description?: string;
851
839
  /**
852
- * @description Description of the component definition
853
- * @default null
840
+ * @description Icon name for the content type (e.g. 'screen')
841
+ * @default file-document
854
842
  */
855
- previewImageUrl?: string;
843
+ icon?: string;
856
844
  /** @description Created date string for this content type (ignored for writes) */
857
845
  created?: string;
858
846
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -1506,21 +1494,15 @@ interface external$b {
1506
1494
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
1507
1495
  fields?: external$b["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
1508
1496
  /**
1509
- * Format: uuid
1510
- * @description Reference to the category this component definition belongs to
1511
- * @default null
1512
- */
1513
- categoryId?: string | null;
1514
- /**
1515
- * @description Description of the component definition
1497
+ * @description Description of the content type
1516
1498
  * @default null
1517
1499
  */
1518
1500
  description?: string;
1519
1501
  /**
1520
- * @description Description of the component definition
1521
- * @default null
1502
+ * @description Icon name for the content type (e.g. 'screen')
1503
+ * @default file-document
1522
1504
  */
1523
- previewImageUrl?: string;
1505
+ icon?: string;
1524
1506
  /** @description Created date string for this content type (ignored for writes) */
1525
1507
  created?: string;
1526
1508
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -2183,21 +2165,15 @@ interface external$a {
2183
2165
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
2184
2166
  fields?: external$a["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
2185
2167
  /**
2186
- * Format: uuid
2187
- * @description Reference to the category this component definition belongs to
2188
- * @default null
2189
- */
2190
- categoryId?: string | null;
2191
- /**
2192
- * @description Description of the component definition
2168
+ * @description Description of the content type
2193
2169
  * @default null
2194
2170
  */
2195
2171
  description?: string;
2196
2172
  /**
2197
- * @description Description of the component definition
2198
- * @default null
2173
+ * @description Icon name for the content type (e.g. 'screen')
2174
+ * @default file-document
2199
2175
  */
2200
- previewImageUrl?: string;
2176
+ icon?: string;
2201
2177
  /** @description Created date string for this content type (ignored for writes) */
2202
2178
  created?: string;
2203
2179
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -2693,7 +2669,7 @@ interface components$4 {
2693
2669
  _id: string;
2694
2670
  /** @description The name of the entry. */
2695
2671
  _name?: string;
2696
- /** @description The slug of the entry, automatically generated. */
2672
+ /** @description The slug of the entry. */
2697
2673
  _slug?: string;
2698
2674
  /** @description Name of the author of the most recent change. */
2699
2675
  _author?: string;
@@ -2712,6 +2688,8 @@ interface components$4 {
2712
2688
  * @description The public UUID of the entry.
2713
2689
  */
2714
2690
  _id?: string;
2691
+ /** @description The slug of the entry. */
2692
+ _slug?: string;
2715
2693
  /** @description Entry field values. */
2716
2694
  fields?: {
2717
2695
  [key: string]: external$9["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
@@ -3000,21 +2978,15 @@ interface external$9 {
3000
2978
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
3001
2979
  fields?: external$9["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
3002
2980
  /**
3003
- * Format: uuid
3004
- * @description Reference to the category this component definition belongs to
3005
- * @default null
3006
- */
3007
- categoryId?: string | null;
3008
- /**
3009
- * @description Description of the component definition
2981
+ * @description Description of the content type
3010
2982
  * @default null
3011
2983
  */
3012
2984
  description?: string;
3013
2985
  /**
3014
- * @description Description of the component definition
3015
- * @default null
2986
+ * @description Icon name for the content type (e.g. 'screen')
2987
+ * @default file-document
3016
2988
  */
3017
- previewImageUrl?: string;
2989
+ icon?: string;
3018
2990
  /** @description Created date string for this content type (ignored for writes) */
3019
2991
  created?: string;
3020
2992
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -3663,21 +3635,15 @@ interface external$8 {
3663
3635
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
3664
3636
  fields?: external$8["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
3665
3637
  /**
3666
- * Format: uuid
3667
- * @description Reference to the category this component definition belongs to
3668
- * @default null
3669
- */
3670
- categoryId?: string | null;
3671
- /**
3672
- * @description Description of the component definition
3638
+ * @description Description of the content type
3673
3639
  * @default null
3674
3640
  */
3675
3641
  description?: string;
3676
3642
  /**
3677
- * @description Description of the component definition
3678
- * @default null
3643
+ * @description Icon name for the content type (e.g. 'screen')
3644
+ * @default file-document
3679
3645
  */
3680
- previewImageUrl?: string;
3646
+ icon?: string;
3681
3647
  /** @description Created date string for this content type (ignored for writes) */
3682
3648
  created?: string;
3683
3649
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -4270,21 +4236,15 @@ interface external$7 {
4270
4236
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
4271
4237
  fields?: external$7["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
4272
4238
  /**
4273
- * Format: uuid
4274
- * @description Reference to the category this component definition belongs to
4275
- * @default null
4276
- */
4277
- categoryId?: string | null;
4278
- /**
4279
- * @description Description of the component definition
4239
+ * @description Description of the content type
4280
4240
  * @default null
4281
4241
  */
4282
4242
  description?: string;
4283
4243
  /**
4284
- * @description Description of the component definition
4285
- * @default null
4244
+ * @description Icon name for the content type (e.g. 'screen')
4245
+ * @default file-document
4286
4246
  */
4287
- previewImageUrl?: string;
4247
+ icon?: string;
4288
4248
  /** @description Created date string for this content type (ignored for writes) */
4289
4249
  created?: string;
4290
4250
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -4912,21 +4872,15 @@ interface external$6 {
4912
4872
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
4913
4873
  fields?: external$6["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
4914
4874
  /**
4915
- * Format: uuid
4916
- * @description Reference to the category this component definition belongs to
4917
- * @default null
4918
- */
4919
- categoryId?: string | null;
4920
- /**
4921
- * @description Description of the component definition
4875
+ * @description Description of the content type
4922
4876
  * @default null
4923
4877
  */
4924
4878
  description?: string;
4925
4879
  /**
4926
- * @description Description of the component definition
4927
- * @default null
4880
+ * @description Icon name for the content type (e.g. 'screen')
4881
+ * @default file-document
4928
4882
  */
4929
- previewImageUrl?: string;
4883
+ icon?: string;
4930
4884
  /** @description Created date string for this content type (ignored for writes) */
4931
4885
  created?: string;
4932
4886
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -5983,21 +5937,15 @@ interface external$5 {
5983
5937
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
5984
5938
  fields?: external$5["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
5985
5939
  /**
5986
- * Format: uuid
5987
- * @description Reference to the category this component definition belongs to
5988
- * @default null
5989
- */
5990
- categoryId?: string | null;
5991
- /**
5992
- * @description Description of the component definition
5940
+ * @description Description of the content type
5993
5941
  * @default null
5994
5942
  */
5995
5943
  description?: string;
5996
5944
  /**
5997
- * @description Description of the component definition
5998
- * @default null
5945
+ * @description Icon name for the content type (e.g. 'screen')
5946
+ * @default file-document
5999
5947
  */
6000
- previewImageUrl?: string;
5948
+ icon?: string;
6001
5949
  /** @description Created date string for this content type (ignored for writes) */
6002
5950
  created?: string;
6003
5951
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -6831,21 +6779,15 @@ interface external$3 {
6831
6779
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
6832
6780
  fields?: external$3["../../../lambda/functions/uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
6833
6781
  /**
6834
- * Format: uuid
6835
- * @description Reference to the category this component definition belongs to
6836
- * @default null
6837
- */
6838
- categoryId?: string | null;
6839
- /**
6840
- * @description Description of the component definition
6782
+ * @description Description of the content type
6841
6783
  * @default null
6842
6784
  */
6843
6785
  description?: string;
6844
6786
  /**
6845
- * @description Description of the component definition
6846
- * @default null
6787
+ * @description Icon name for the content type (e.g. 'screen')
6788
+ * @default file-document
6847
6789
  */
6848
- previewImageUrl?: string;
6790
+ icon?: string;
6849
6791
  /** @description Created date string for this content type (ignored for writes) */
6850
6792
  created?: string;
6851
6793
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -7807,7 +7749,7 @@ interface external$3 {
7807
7749
  _id: string;
7808
7750
  /** @description The name of the entry. */
7809
7751
  _name?: string;
7810
- /** @description The slug of the entry, automatically generated. */
7752
+ /** @description The slug of the entry. */
7811
7753
  _slug?: string;
7812
7754
  /** @description Name of the author of the most recent change. */
7813
7755
  _author?: string;
@@ -7826,6 +7768,8 @@ interface external$3 {
7826
7768
  * @description The public UUID of the entry.
7827
7769
  */
7828
7770
  _id?: string;
7771
+ /** @description The slug of the entry. */
7772
+ _slug?: string;
7829
7773
  /** @description Entry field values. */
7830
7774
  fields?: {
7831
7775
  [key: string]: external$3["../../../lambda/functions/uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
@@ -8603,21 +8547,15 @@ interface external$2 {
8603
8547
  /** @description The fields for this content type. Fields are key-value pairs that can be text, numbers, JSON objects, etc. */
8604
8548
  fields?: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
8605
8549
  /**
8606
- * Format: uuid
8607
- * @description Reference to the category this component definition belongs to
8608
- * @default null
8609
- */
8610
- categoryId?: string | null;
8611
- /**
8612
- * @description Description of the component definition
8550
+ * @description Description of the content type
8613
8551
  * @default null
8614
8552
  */
8615
8553
  description?: string;
8616
8554
  /**
8617
- * @description Description of the component definition
8618
- * @default null
8555
+ * @description Icon name for the content type (e.g. 'screen')
8556
+ * @default file-document
8619
8557
  */
8620
- previewImageUrl?: string;
8558
+ icon?: string;
8621
8559
  /** @description Created date string for this content type (ignored for writes) */
8622
8560
  created?: string;
8623
8561
  /** @description Last modified date string for this content type (ignored for writes) */
@@ -10904,7 +10842,18 @@ type UpdatePreviewSettingsMessage = {
10904
10842
  type UpdateContextualEditingStateInternalMessage = {
10905
10843
  type: 'update-contextual-editing-state-internal';
10906
10844
  state: {
10907
- selectedComponentReference?: Omit<ContextualEditingComponentReference, 'elements'>;
10845
+ selectedComponentReference?: {
10846
+ id: string;
10847
+ slotName?: string;
10848
+ componentIndex?: number;
10849
+ totalComponents?: number;
10850
+ componentName?: string;
10851
+ componentTitle?: string;
10852
+ parentId?: string;
10853
+ parentType?: string;
10854
+ isLocalized?: boolean;
10855
+ isReadOnly?: boolean | undefined;
10856
+ };
10908
10857
  };
10909
10858
  };
10910
10859
  type ReportRenderedCompositionsMessage = {
@@ -11253,6 +11202,12 @@ declare const generateHash: ({ composition, secret, }: {
11253
11202
  secret: string | undefined;
11254
11203
  }) => number | undefined;
11255
11204
 
11205
+ /**
11206
+ * Checks if page is opened from inside Uniform Canvas Editor.
11207
+ * So if you open preview in incognito or via copy/paste link, it will return false.
11208
+ */
11209
+ declare const isAllowedReferrer: (referrer: string | undefined) => boolean;
11210
+
11256
11211
  /** Determines if a given Canvas component type is a system-defined type */
11257
11212
  declare const isSystemComponentDefinition: (componentType: string) => boolean;
11258
11213
 
@@ -11268,6 +11223,9 @@ declare function mapSlotToPersonalizedVariations(slot: ComponentInstance[] | und
11268
11223
  */
11269
11224
  declare function mapSlotToTestVariations(slot: ComponentInstance[] | undefined): Array<ComponentInstance & TestVariant>;
11270
11225
 
11226
+ declare const isComponentPlaceholderId: (id: string | undefined) => boolean | undefined;
11227
+ declare const generateComponentPlaceholderId: (randomId: string) => string;
11228
+
11271
11229
  type BindVariablesResult<TValue> = {
11272
11230
  /** Number of dynamic expressions that attempted to be bound (regardless of the success of the binding) */
11273
11231
  boundCount: number;
@@ -11327,4 +11285,4 @@ declare function parseVariableExpression(serialized: string, onToken?: (token: s
11327
11285
 
11328
11286
  declare const CanvasClientError: typeof ApiClientError;
11329
11287
 
11330
- export { ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, AddComponentMessage, BatchEnhancer, BatchEntry, BatchInvalidationPayload, BindVariablesOptions, BindVariablesResult, BindVariablesToObjectOptions, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, CanvasDefinitions, CategoriesDeleteParameters, CategoriesGetParameters, CategoriesGetResponse, CategoriesPutParameters, Category, CategoryClient, Channel, ChannelMessage, ChannelSubscription, ChildEnhancerBuilder, ComponentDefinition, ComponentDefinitionDeleteParameters, ComponentDefinitionGetParameters, ComponentDefinitionGetResponse, ComponentDefinitionParameter, ComponentDefinitionPermission, ComponentDefinitionPutParameters, ComponentDefinitionSlot, ComponentDefinitionSlugSettings, ComponentDefinitionVariant, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentInstance, ComponentInstanceContextualEditing, ComponentInstanceHistoryEntry, ComponentInstanceHistoryGetParameters, ComponentInstanceHistoryGetResponse, ComponentLocationReference, ComponentOverridability, ComponentOverride, ComponentOverrides, ComponentParameter, ComponentParameterContextualEditing, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions, CompositionDataDiagnostic, CompositionDeleteParameters, CompositionDiagnostics, CompositionGetByComponentIdParameters, CompositionGetByIdParameters, CompositionGetByNodeIdParameters, CompositionGetByNodePathParameters, CompositionGetBySlugParameters, CompositionGetListResponse, CompositionGetOrderBy, CompositionGetParameters, CompositionGetResponse, CompositionGetValidResponses, CompositionIssue, CompositionPatternIssue, CompositionPutParameters, CompositionRelationshipsClientOptions, CompositionRelationshipsDDefinitionGetResponse, CompositionRelationshipsDefinitionApi, CompositionRelationshipsDefinitionGetParameters, CompositionResolvedGetResponse, CompositionResolvedListResponse, CompositionUIStatus, ContentClient, ContentType, ContentTypeField, ContextualEditingComponentReference, DataDiagnostic, DataElementBindingIssue, DataElementConnectionDefinition, DataResolutionConfigIssue, DataResolutionIssue, DataResolutionOption, DataResolutionOptionNegative, DataResolutionOptionPositive, DataResolutionParameters, DataResourceDefinition, DataResourceDefinitions, DataResourceIssue, DataResourceVariables, DataSource, DataSourceClient, DataSourceDeleteParameters, DataSourceGetParameters, DataSourceGetResponse, DataSourcePutParameters, DataSourcesGetParameters, DataSourcesGetResponse, DataType, DataTypeClient, DataTypeDeleteParameters, DataTypeGetParameters, DataTypeGetResponse, DataTypePutParameters, DataVariableDefinition, DeleteContentTypeOptions, DeleteEntryOptions, DismissPlaceholderMessage, DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS, EDGE_MAX_CACHE_TTL, EDGE_MAX_L2_CACHE_TTL_IN_HOURS, EDGE_MIN_CACHE_TTL, EDGE_MIN_L2_CACHE_TTL_IN_HOURS, EMPTY_COMPOSITION, EdgehancersDiagnostics, EditorStateUpdatedMessage, EnhancerBuilder, EnhancerContext, EnhancerError, EntriesGetParameters, EntriesGetResponse, EntriesResolvedListResponse, Entry, EventNames, GetContentTypesOptions, GetContentTypesResponse, GetEntriesOptions, GetEntriesResponse, GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, InvalidationPayload, LimitPolicy, LinkComponentParameterValue, LinkParamConfiguration, LinkParamValue, LinkParameterType, LinkTypeConfiguration, MessageHandler, MoveComponentMessage, NonProjectMapLinkParamValue, OpenParameterEditorMessage, OverrideOptions, PLACEHOLDER_ID, PatternIssue, PreviewEventBus, PreviewPanelSettings, ProjectMapLinkComponentParameterValue, ProjectMapLinkParamValue, PutContentTypeBody, PutEntryBody, ReadyMessage, ReportRenderedCompositionsMessage, ResolvedRouteGetResponse, RichTextBuiltInElement, RichTextBuiltInFormat, RichTextParamConfiguration, RichTextParamValue, RootComponentInstance, RouteClient, RouteDynamicInputs, RouteGetParameters, RouteGetResponse, RouteGetResponseComposition, RouteGetResponseEdgehancedComposition, RouteGetResponseNotFound, RouteGetResponseRedirect, SelectComponentMessage, SelectParameterMessage, SpecificProjectMap, SubscribeToCompositionOptions, TriggerComponentActionMessage, TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, UnsubscribeCallback, UpdateComponentParameterMessage, UpdateComponentReferencesMessage, UpdateCompositionInternalMessage, UpdateCompositionMessage, UpdateContextualEditingStateInternalMessage, UpdatePreviewSettingsMessage, UsageTrackingApi, UsageTrackingGetParameters, UsageTrackingGetResponse, UsageTrackingPostParameters, UsageTrackingPostResponse, WalkComponentTreeActions, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createEventBus, createLimitPolicy, createUniformApiEnhancer, createVariableReference, enhance, extractLocales, generateHash, getChannelName, getComponentJsonPointer, getComponentPath, getParameterAttributes, isAddComponentMessage, isComponentActionMessage, isDismissPlaceholderMessage, isMovingComponentMessage, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isSelectComponentMessage, isSelectParameterMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseVariableExpression, subscribeToComposition, unstable_CompositionRelationshipClient, walkComponentTree };
11288
+ export { ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, AddComponentMessage, BatchEnhancer, BatchEntry, BatchInvalidationPayload, BindVariablesOptions, BindVariablesResult, BindVariablesToObjectOptions, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, CanvasDefinitions, CategoriesDeleteParameters, CategoriesGetParameters, CategoriesGetResponse, CategoriesPutParameters, Category, CategoryClient, Channel, ChannelMessage, ChannelSubscription, ChildEnhancerBuilder, ComponentDefinition, ComponentDefinitionDeleteParameters, ComponentDefinitionGetParameters, ComponentDefinitionGetResponse, ComponentDefinitionParameter, ComponentDefinitionPermission, ComponentDefinitionPutParameters, ComponentDefinitionSlot, ComponentDefinitionSlugSettings, ComponentDefinitionVariant, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentInstance, ComponentInstanceContextualEditing, ComponentInstanceHistoryEntry, ComponentInstanceHistoryGetParameters, ComponentInstanceHistoryGetResponse, ComponentLocationReference, ComponentOverridability, ComponentOverride, ComponentOverrides, ComponentParameter, ComponentParameterContextualEditing, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions, CompositionDataDiagnostic, CompositionDeleteParameters, CompositionDiagnostics, CompositionGetByComponentIdParameters, CompositionGetByIdParameters, CompositionGetByNodeIdParameters, CompositionGetByNodePathParameters, CompositionGetBySlugParameters, CompositionGetListResponse, CompositionGetOrderBy, CompositionGetParameters, CompositionGetResponse, CompositionGetValidResponses, CompositionIssue, CompositionPatternIssue, CompositionPutParameters, CompositionRelationshipsClientOptions, CompositionRelationshipsDDefinitionGetResponse, CompositionRelationshipsDefinitionApi, CompositionRelationshipsDefinitionGetParameters, CompositionResolvedGetResponse, CompositionResolvedListResponse, CompositionUIStatus, ContentClient, ContentType, ContentTypeField, ContextualEditingComponentReference, DataDiagnostic, DataElementBindingIssue, DataElementConnectionDefinition, DataResolutionConfigIssue, DataResolutionIssue, DataResolutionOption, DataResolutionOptionNegative, DataResolutionOptionPositive, DataResolutionParameters, DataResourceDefinition, DataResourceDefinitions, DataResourceIssue, DataResourceVariables, DataSource, DataSourceClient, DataSourceDeleteParameters, DataSourceGetParameters, DataSourceGetResponse, DataSourcePutParameters, DataSourcesGetParameters, DataSourcesGetResponse, DataType, DataTypeClient, DataTypeDeleteParameters, DataTypeGetParameters, DataTypeGetResponse, DataTypePutParameters, DataVariableDefinition, DeleteContentTypeOptions, DeleteEntryOptions, DismissPlaceholderMessage, DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS, EDGE_MAX_CACHE_TTL, EDGE_MAX_L2_CACHE_TTL_IN_HOURS, EDGE_MIN_CACHE_TTL, EDGE_MIN_L2_CACHE_TTL_IN_HOURS, EMPTY_COMPOSITION, EdgehancersDiagnostics, EditorStateUpdatedMessage, EnhancerBuilder, EnhancerContext, EnhancerError, EntriesGetParameters, EntriesGetResponse, EntriesResolvedListResponse, Entry, EventNames, GetContentTypesOptions, GetContentTypesResponse, GetEntriesOptions, GetEntriesResponse, GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, InvalidationPayload, LimitPolicy, LinkComponentParameterValue, LinkParamConfiguration, LinkParamValue, LinkParameterType, LinkTypeConfiguration, MessageHandler, MoveComponentMessage, NonProjectMapLinkParamValue, OpenParameterEditorMessage, OverrideOptions, PLACEHOLDER_ID, PatternIssue, PreviewEventBus, PreviewPanelSettings, ProjectMapLinkComponentParameterValue, ProjectMapLinkParamValue, PutContentTypeBody, PutEntryBody, ReadyMessage, ReportRenderedCompositionsMessage, ResolvedRouteGetResponse, RichTextBuiltInElement, RichTextBuiltInFormat, RichTextParamConfiguration, RichTextParamValue, RootComponentInstance, RouteClient, RouteDynamicInputs, RouteGetParameters, RouteGetResponse, RouteGetResponseComposition, RouteGetResponseEdgehancedComposition, RouteGetResponseNotFound, RouteGetResponseRedirect, SelectComponentMessage, SelectParameterMessage, SpecificProjectMap, SubscribeToCompositionOptions, TriggerComponentActionMessage, TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, UnsubscribeCallback, UpdateComponentParameterMessage, UpdateComponentReferencesMessage, UpdateCompositionInternalMessage, UpdateCompositionMessage, UpdateContextualEditingStateInternalMessage, UpdatePreviewSettingsMessage, UsageTrackingApi, UsageTrackingGetParameters, UsageTrackingGetResponse, UsageTrackingPostParameters, UsageTrackingPostResponse, WalkComponentTreeActions, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createEventBus, createLimitPolicy, createUniformApiEnhancer, createVariableReference, enhance, extractLocales, generateComponentPlaceholderId, generateHash, getChannelName, getComponentJsonPointer, getComponentPath, getParameterAttributes, isAddComponentMessage, isAllowedReferrer, isComponentActionMessage, isComponentPlaceholderId, isDismissPlaceholderMessage, isMovingComponentMessage, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isSelectComponentMessage, isSelectParameterMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseVariableExpression, subscribeToComposition, unstable_CompositionRelationshipClient, walkComponentTree };
package/dist/index.esm.js CHANGED
@@ -1586,7 +1586,12 @@ var createCanvasChannel = ({
1586
1586
  };
1587
1587
  postMessage(message);
1588
1588
  };
1589
- const updateContextualEditingStateInternal = () => {
1589
+ const updateContextualEditingStateInternal = (options) => {
1590
+ const message = {
1591
+ ...options,
1592
+ type: "update-contextual-editing-state-internal"
1593
+ };
1594
+ postMessage(message);
1590
1595
  };
1591
1596
  const reportRenderedCompositions = (options) => {
1592
1597
  const message = {
@@ -1798,6 +1803,7 @@ function convertEntryToPutEntry(entry) {
1798
1803
  type: entry.entry.type,
1799
1804
  _dataResources: entry.entry._dataResources,
1800
1805
  _id: entry.entry._id,
1806
+ _slug: entry.entry._slug,
1801
1807
  fields: entry.entry.fields
1802
1808
  },
1803
1809
  state: entry.state,
@@ -1835,6 +1841,11 @@ var getParameterAttributes = ({
1835
1841
  };
1836
1842
  };
1837
1843
 
1844
+ // src/utils/isAllowedReferrer.ts
1845
+ var isAllowedReferrer = (referrer) => {
1846
+ return Boolean(referrer == null ? void 0 : referrer.match(/(^https:\/\/|\.)(uniform.app|uniform.wtf|localhost:\d{4})\//));
1847
+ };
1848
+
1838
1849
  // src/utils/isSystemComponentDefinition.ts
1839
1850
  var isSystemComponentDefinition = (componentType) => {
1840
1851
  return componentType.startsWith("$");
@@ -1872,6 +1883,17 @@ function mapSlotToTestVariations(slot) {
1872
1883
  });
1873
1884
  }
1874
1885
 
1886
+ // src/utils/placeholder.ts
1887
+ var isComponentPlaceholderId = (id) => {
1888
+ if (id === PLACEHOLDER_ID) {
1889
+ return true;
1890
+ }
1891
+ return id == null ? void 0 : id.startsWith(PLACEHOLDER_ID);
1892
+ };
1893
+ var generateComponentPlaceholderId = (randomId) => {
1894
+ return `${PLACEHOLDER_ID}_${randomId}`;
1895
+ };
1896
+
1875
1897
  // src/utils/variables/parseVariableExpression.ts
1876
1898
  var escapeCharacter = "\\";
1877
1899
  var variablePrefix = "${";
@@ -2007,7 +2029,15 @@ function bindVariablesToObjectRecursive({
2007
2029
  boundCount += bindResult.boundCount;
2008
2030
  draft[property] = bindResult.result;
2009
2031
  if (bindResult.errors) {
2010
- errors.push(...bindResult.errors.map((e) => `${currentObjectPath}: ${e}`));
2032
+ errors.push(
2033
+ ...bindResult.errors.map((e) => {
2034
+ if (typeof e === "string") {
2035
+ return `${currentObjectPath}: ${e}`;
2036
+ }
2037
+ e.message = `${currentObjectPath}: ${e.message}`;
2038
+ return e;
2039
+ })
2040
+ );
2011
2041
  }
2012
2042
  }
2013
2043
  return;
@@ -2113,13 +2143,16 @@ export {
2113
2143
  createVariableReference,
2114
2144
  enhance,
2115
2145
  extractLocales,
2146
+ generateComponentPlaceholderId,
2116
2147
  generateHash,
2117
2148
  getChannelName,
2118
2149
  getComponentJsonPointer,
2119
2150
  getComponentPath,
2120
2151
  getParameterAttributes,
2121
2152
  isAddComponentMessage,
2153
+ isAllowedReferrer,
2122
2154
  isComponentActionMessage,
2155
+ isComponentPlaceholderId,
2123
2156
  isDismissPlaceholderMessage,
2124
2157
  isMovingComponentMessage,
2125
2158
  isOpenParameterEditorMessage,
package/dist/index.js CHANGED
@@ -340,13 +340,16 @@ __export(src_exports, {
340
340
  createVariableReference: () => createVariableReference,
341
341
  enhance: () => enhance,
342
342
  extractLocales: () => extractLocales,
343
+ generateComponentPlaceholderId: () => generateComponentPlaceholderId,
343
344
  generateHash: () => generateHash,
344
345
  getChannelName: () => getChannelName,
345
346
  getComponentJsonPointer: () => getComponentJsonPointer,
346
347
  getComponentPath: () => getComponentPath,
347
348
  getParameterAttributes: () => getParameterAttributes,
348
349
  isAddComponentMessage: () => isAddComponentMessage,
350
+ isAllowedReferrer: () => isAllowedReferrer,
349
351
  isComponentActionMessage: () => isComponentActionMessage,
352
+ isComponentPlaceholderId: () => isComponentPlaceholderId,
350
353
  isDismissPlaceholderMessage: () => isDismissPlaceholderMessage,
351
354
  isMovingComponentMessage: () => isMovingComponentMessage,
352
355
  isOpenParameterEditorMessage: () => isOpenParameterEditorMessage,
@@ -1691,7 +1694,12 @@ var createCanvasChannel = ({
1691
1694
  };
1692
1695
  postMessage(message);
1693
1696
  };
1694
- const updateContextualEditingStateInternal = () => {
1697
+ const updateContextualEditingStateInternal = (options) => {
1698
+ const message = {
1699
+ ...options,
1700
+ type: "update-contextual-editing-state-internal"
1701
+ };
1702
+ postMessage(message);
1695
1703
  };
1696
1704
  const reportRenderedCompositions = (options) => {
1697
1705
  const message = {
@@ -1903,6 +1911,7 @@ function convertEntryToPutEntry(entry) {
1903
1911
  type: entry.entry.type,
1904
1912
  _dataResources: entry.entry._dataResources,
1905
1913
  _id: entry.entry._id,
1914
+ _slug: entry.entry._slug,
1906
1915
  fields: entry.entry.fields
1907
1916
  },
1908
1917
  state: entry.state,
@@ -1940,6 +1949,11 @@ var getParameterAttributes = ({
1940
1949
  };
1941
1950
  };
1942
1951
 
1952
+ // src/utils/isAllowedReferrer.ts
1953
+ var isAllowedReferrer = (referrer) => {
1954
+ return Boolean(referrer == null ? void 0 : referrer.match(/(^https:\/\/|\.)(uniform.app|uniform.wtf|localhost:\d{4})\//));
1955
+ };
1956
+
1943
1957
  // src/utils/isSystemComponentDefinition.ts
1944
1958
  var isSystemComponentDefinition = (componentType) => {
1945
1959
  return componentType.startsWith("$");
@@ -1977,6 +1991,17 @@ function mapSlotToTestVariations(slot) {
1977
1991
  });
1978
1992
  }
1979
1993
 
1994
+ // src/utils/placeholder.ts
1995
+ var isComponentPlaceholderId = (id) => {
1996
+ if (id === PLACEHOLDER_ID) {
1997
+ return true;
1998
+ }
1999
+ return id == null ? void 0 : id.startsWith(PLACEHOLDER_ID);
2000
+ };
2001
+ var generateComponentPlaceholderId = (randomId) => {
2002
+ return `${PLACEHOLDER_ID}_${randomId}`;
2003
+ };
2004
+
1980
2005
  // src/utils/variables/parseVariableExpression.ts
1981
2006
  var escapeCharacter = "\\";
1982
2007
  var variablePrefix = "${";
@@ -2112,7 +2137,15 @@ function bindVariablesToObjectRecursive({
2112
2137
  boundCount += bindResult.boundCount;
2113
2138
  draft[property] = bindResult.result;
2114
2139
  if (bindResult.errors) {
2115
- errors.push(...bindResult.errors.map((e) => `${currentObjectPath}: ${e}`));
2140
+ errors.push(
2141
+ ...bindResult.errors.map((e) => {
2142
+ if (typeof e === "string") {
2143
+ return `${currentObjectPath}: ${e}`;
2144
+ }
2145
+ e.message = `${currentObjectPath}: ${e.message}`;
2146
+ return e;
2147
+ })
2148
+ );
2116
2149
  }
2117
2150
  }
2118
2151
  return;
@@ -2219,13 +2252,16 @@ var CanvasClientError = import_api9.ApiClientError;
2219
2252
  createVariableReference,
2220
2253
  enhance,
2221
2254
  extractLocales,
2255
+ generateComponentPlaceholderId,
2222
2256
  generateHash,
2223
2257
  getChannelName,
2224
2258
  getComponentJsonPointer,
2225
2259
  getComponentPath,
2226
2260
  getParameterAttributes,
2227
2261
  isAddComponentMessage,
2262
+ isAllowedReferrer,
2228
2263
  isComponentActionMessage,
2264
+ isComponentPlaceholderId,
2229
2265
  isDismissPlaceholderMessage,
2230
2266
  isMovingComponentMessage,
2231
2267
  isOpenParameterEditorMessage,
package/dist/index.mjs CHANGED
@@ -1586,7 +1586,12 @@ var createCanvasChannel = ({
1586
1586
  };
1587
1587
  postMessage(message);
1588
1588
  };
1589
- const updateContextualEditingStateInternal = () => {
1589
+ const updateContextualEditingStateInternal = (options) => {
1590
+ const message = {
1591
+ ...options,
1592
+ type: "update-contextual-editing-state-internal"
1593
+ };
1594
+ postMessage(message);
1590
1595
  };
1591
1596
  const reportRenderedCompositions = (options) => {
1592
1597
  const message = {
@@ -1798,6 +1803,7 @@ function convertEntryToPutEntry(entry) {
1798
1803
  type: entry.entry.type,
1799
1804
  _dataResources: entry.entry._dataResources,
1800
1805
  _id: entry.entry._id,
1806
+ _slug: entry.entry._slug,
1801
1807
  fields: entry.entry.fields
1802
1808
  },
1803
1809
  state: entry.state,
@@ -1835,6 +1841,11 @@ var getParameterAttributes = ({
1835
1841
  };
1836
1842
  };
1837
1843
 
1844
+ // src/utils/isAllowedReferrer.ts
1845
+ var isAllowedReferrer = (referrer) => {
1846
+ return Boolean(referrer == null ? void 0 : referrer.match(/(^https:\/\/|\.)(uniform.app|uniform.wtf|localhost:\d{4})\//));
1847
+ };
1848
+
1838
1849
  // src/utils/isSystemComponentDefinition.ts
1839
1850
  var isSystemComponentDefinition = (componentType) => {
1840
1851
  return componentType.startsWith("$");
@@ -1872,6 +1883,17 @@ function mapSlotToTestVariations(slot) {
1872
1883
  });
1873
1884
  }
1874
1885
 
1886
+ // src/utils/placeholder.ts
1887
+ var isComponentPlaceholderId = (id) => {
1888
+ if (id === PLACEHOLDER_ID) {
1889
+ return true;
1890
+ }
1891
+ return id == null ? void 0 : id.startsWith(PLACEHOLDER_ID);
1892
+ };
1893
+ var generateComponentPlaceholderId = (randomId) => {
1894
+ return `${PLACEHOLDER_ID}_${randomId}`;
1895
+ };
1896
+
1875
1897
  // src/utils/variables/parseVariableExpression.ts
1876
1898
  var escapeCharacter = "\\";
1877
1899
  var variablePrefix = "${";
@@ -2007,7 +2029,15 @@ function bindVariablesToObjectRecursive({
2007
2029
  boundCount += bindResult.boundCount;
2008
2030
  draft[property] = bindResult.result;
2009
2031
  if (bindResult.errors) {
2010
- errors.push(...bindResult.errors.map((e) => `${currentObjectPath}: ${e}`));
2032
+ errors.push(
2033
+ ...bindResult.errors.map((e) => {
2034
+ if (typeof e === "string") {
2035
+ return `${currentObjectPath}: ${e}`;
2036
+ }
2037
+ e.message = `${currentObjectPath}: ${e.message}`;
2038
+ return e;
2039
+ })
2040
+ );
2011
2041
  }
2012
2042
  }
2013
2043
  return;
@@ -2113,13 +2143,16 @@ export {
2113
2143
  createVariableReference,
2114
2144
  enhance,
2115
2145
  extractLocales,
2146
+ generateComponentPlaceholderId,
2116
2147
  generateHash,
2117
2148
  getChannelName,
2118
2149
  getComponentJsonPointer,
2119
2150
  getComponentPath,
2120
2151
  getParameterAttributes,
2121
2152
  isAddComponentMessage,
2153
+ isAllowedReferrer,
2122
2154
  isComponentActionMessage,
2155
+ isComponentPlaceholderId,
2123
2156
  isDismissPlaceholderMessage,
2124
2157
  isMovingComponentMessage,
2125
2158
  isOpenParameterEditorMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.51.1-alpha.1+e55ae6c1e",
3
+ "version": "19.51.1-alpha.22+ee274f045",
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,7 +38,7 @@
38
38
  "pusher-js": "8.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@uniformdev/context": "19.51.1-alpha.1+e55ae6c1e",
41
+ "@uniformdev/context": "19.51.1-alpha.22+ee274f045",
42
42
  "immer": "9.0.21"
43
43
  },
44
44
  "files": [
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "e55ae6c1ea8df19f04a9dba22769d76e16d28d70"
50
+ "gitHead": "ee274f04521c4024826b21fee01d50fcc1e414a1"
51
51
  }