@uniformdev/canvas 20.6.5-alpha.1 → 20.7.1-alpha.106

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.js CHANGED
@@ -397,7 +397,7 @@ __export(src_exports, {
397
397
  ATTRIBUTE_PARAMETER_TYPE: () => ATTRIBUTE_PARAMETER_TYPE,
398
398
  ATTRIBUTE_PARAMETER_VALUE: () => ATTRIBUTE_PARAMETER_VALUE,
399
399
  ATTRIBUTE_PLACEHOLDER: () => ATTRIBUTE_PLACEHOLDER,
400
- ApiClientError: () => import_api16.ApiClientError,
400
+ ApiClientError: () => import_api18.ApiClientError,
401
401
  BatchEntry: () => BatchEntry,
402
402
  BlockFormatError: () => BlockFormatError,
403
403
  CANVAS_BLOCK_PARAM_TYPE: () => CANVAS_BLOCK_PARAM_TYPE,
@@ -409,7 +409,11 @@ __export(src_exports, {
409
409
  CANVAS_LOCALE_TAG_PARAM: () => CANVAS_LOCALE_TAG_PARAM,
410
410
  CANVAS_LOCALIZATION_SLOT: () => CANVAS_LOCALIZATION_SLOT,
411
411
  CANVAS_LOCALIZATION_TYPE: () => CANVAS_LOCALIZATION_TYPE,
412
+ CANVAS_PERSONALIZATION_ALGORITHM_PARAM: () => CANVAS_PERSONALIZATION_ALGORITHM_PARAM,
413
+ CANVAS_PERSONALIZATION_ALGORITHM_TYPE: () => CANVAS_PERSONALIZATION_ALGORITHM_TYPE,
414
+ CANVAS_PERSONALIZATION_EVENT_NAME_PARAM: () => CANVAS_PERSONALIZATION_EVENT_NAME_PARAM,
412
415
  CANVAS_PERSONALIZATION_PARAM: () => CANVAS_PERSONALIZATION_PARAM,
416
+ CANVAS_PERSONALIZATION_TAKE_PARAM: () => CANVAS_PERSONALIZATION_TAKE_PARAM,
413
417
  CANVAS_PERSONALIZE_SLOT: () => CANVAS_PERSONALIZE_SLOT,
414
418
  CANVAS_PERSONALIZE_TYPE: () => CANVAS_PERSONALIZE_TYPE,
415
419
  CANVAS_PUBLISHED_STATE: () => CANVAS_PUBLISHED_STATE,
@@ -445,10 +449,12 @@ __export(src_exports, {
445
449
  IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM: () => IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
446
450
  IN_CONTEXT_EDITOR_QUERY_STRING_PARAM: () => IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
447
451
  IS_RENDERED_BY_UNIFORM_ATTRIBUTE: () => IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
452
+ IntegrationPropertyEditorsClient: () => IntegrationPropertyEditorsClient,
448
453
  LOCALE_DYNAMIC_INPUT_NAME: () => LOCALE_DYNAMIC_INPUT_NAME,
449
454
  LocaleClient: () => LocaleClient,
450
455
  PLACEHOLDER_ID: () => PLACEHOLDER_ID,
451
456
  PreviewClient: () => PreviewClient,
457
+ ProjectClient: () => ProjectClient,
452
458
  PromptClient: () => PromptClient,
453
459
  RelationshipClient: () => RelationshipClient,
454
460
  ReleaseClient: () => ReleaseClient,
@@ -460,6 +466,7 @@ __export(src_exports, {
460
466
  UncachedContentClient: () => UncachedContentClient,
461
467
  UniqueBatchEntries: () => UniqueBatchEntries,
462
468
  WorkflowClient: () => WorkflowClient,
469
+ autoFixParameterGroups: () => autoFixParameterGroups,
463
470
  bindExpressionEscapeChars: () => bindExpressionEscapeChars,
464
471
  bindExpressionPrefix: () => bindExpressionPrefix,
465
472
  bindVariables: () => bindVariables,
@@ -521,6 +528,7 @@ __export(src_exports, {
521
528
  isSuggestComponentMessage: () => isSuggestComponentMessage,
522
529
  isSystemComponentDefinition: () => isSystemComponentDefinition,
523
530
  isTriggerCompositionActionMessage: () => isTriggerCompositionActionMessage,
531
+ isUpdateAiActionsMessage: () => isUpdateAiActionsMessage,
524
532
  isUpdateComponentParameterMessage: () => isUpdateComponentParameterMessage,
525
533
  isUpdateComponentReferencesMessage: () => isUpdateComponentReferencesMessage,
526
534
  isUpdateCompositionInternalMessage: () => isUpdateCompositionInternalMessage,
@@ -531,9 +539,11 @@ __export(src_exports, {
531
539
  localize: () => localize,
532
540
  mapSlotToPersonalizedVariations: () => mapSlotToPersonalizedVariations,
533
541
  mapSlotToTestVariations: () => mapSlotToTestVariations,
542
+ mergeAssetConfigWithDefaults: () => mergeAssetConfigWithDefaults,
534
543
  nullLimitPolicy: () => nullLimitPolicy,
535
544
  parseComponentPlaceholderId: () => parseComponentPlaceholderId,
536
545
  parseVariableExpression: () => parseVariableExpression,
546
+ version: () => version,
537
547
  walkNodeTree: () => walkNodeTree,
538
548
  walkPropertyValues: () => walkPropertyValues
539
549
  });
@@ -784,7 +794,7 @@ var CanvasClient = class extends import_api2.ApiClient {
784
794
  const edgeParams = {
785
795
  ...originParams,
786
796
  projectId,
787
- ...params.diagnostics ? { diagnostics: "true" } : {},
797
+ diagnostics: typeof params.diagnostics === "boolean" ? params.diagnostics : params.diagnostics === "no-data" ? "no-data" : void 0,
788
798
  ...rewrittenFilters
789
799
  };
790
800
  const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
@@ -825,18 +835,23 @@ var CanvasClient = class extends import_api2.ApiClient {
825
835
  const edgeParams = {
826
836
  ...params,
827
837
  projectId,
828
- ...diagnostics ? { diagnostics: "true" } : {}
838
+ diagnostics: typeof diagnostics === "boolean" ? diagnostics : diagnostics === "no-data" ? "no-data" : void 0
829
839
  };
830
840
  const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
831
841
  return this.apiClient(edgeUrl, this.edgeApiRequestInit);
832
842
  }
833
843
  /** Updates or creates a Canvas component definition */
834
- async updateComposition(body) {
844
+ async updateComposition(body, options) {
835
845
  const fetchUri = this.createUrl(CANVAS_URL);
846
+ const headers = {};
847
+ if (options == null ? void 0 : options.ifUnmodifiedSince) {
848
+ headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
849
+ }
836
850
  const { response } = await this.apiClientWithResponse(fetchUri, {
837
851
  method: "PUT",
838
852
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
839
- expectNoContent: true
853
+ expectNoContent: true,
854
+ headers
840
855
  });
841
856
  return { modified: response.headers.get("x-modified-at") };
842
857
  }
@@ -976,12 +991,17 @@ var _ContentClient = class _ContentClient extends import_api4.ApiClient {
976
991
  headers: opts.autogenerateDataTypes ? { "x-uniform-autogenerate-data-types": "true" } : {}
977
992
  });
978
993
  }
979
- async upsertEntry(body) {
994
+ async upsertEntry(body, options) {
980
995
  const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
996
+ const headers = {};
997
+ if (options == null ? void 0 : options.ifUnmodifiedSince) {
998
+ headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
999
+ }
981
1000
  const { response } = await this.apiClientWithResponse(fetchUri, {
982
1001
  method: "PUT",
983
1002
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
984
- expectNoContent: true
1003
+ expectNoContent: true,
1004
+ headers
985
1005
  });
986
1006
  return { modified: response.headers.get("x-modified-at") };
987
1007
  }
@@ -1007,7 +1027,7 @@ var _ContentClient = class _ContentClient extends import_api4.ApiClient {
1007
1027
  return {
1008
1028
  projectId,
1009
1029
  ...params,
1010
- diagnostics: (options == null ? void 0 : options.diagnostics) ? "true" : void 0
1030
+ diagnostics: typeof options.diagnostics === "boolean" ? options.diagnostics : options.diagnostics === "no-data" ? "no-data" : void 0
1011
1031
  };
1012
1032
  }
1013
1033
  };
@@ -1235,6 +1255,10 @@ var CANVAS_DRAFT_STATE = 0;
1235
1255
  var CANVAS_PUBLISHED_STATE = 64;
1236
1256
  var CANVAS_EDITOR_STATE = 63;
1237
1257
  var CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
1258
+ var CANVAS_PERSONALIZATION_EVENT_NAME_PARAM = "trackingEventName";
1259
+ var CANVAS_PERSONALIZATION_ALGORITHM_PARAM = "algorithm";
1260
+ var CANVAS_PERSONALIZATION_ALGORITHM_TYPE = "pzAlgorithm";
1261
+ var CANVAS_PERSONALIZATION_TAKE_PARAM = "count";
1238
1262
  var CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
1239
1263
  var CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
1240
1264
  var CANVAS_CONTEXTUAL_EDITING_PARAM = "$contextualEditing";
@@ -2249,15 +2273,19 @@ function evaluateNodeVisibility({
2249
2273
  function evaluateWalkTreeNodeVisibility({
2250
2274
  rules,
2251
2275
  showIndeterminate,
2276
+ rootNodeInvisibleHandling = "throw",
2252
2277
  context
2253
2278
  }) {
2254
- const { type, node, actions } = context;
2279
+ const { type, node, actions, ancestorsAndSelf } = context;
2255
2280
  if (type !== "component") {
2256
2281
  return;
2257
2282
  }
2258
2283
  const result = evaluateNodeVisibility({ node, rules, simplifyCriteria: true });
2259
2284
  if (result === null && !showIndeterminate || result === false) {
2260
- actions.remove();
2285
+ if (ancestorsAndSelf.length === 1 && rootNodeInvisibleHandling === "ignore") {
2286
+ } else {
2287
+ actions.remove();
2288
+ }
2261
2289
  return false;
2262
2290
  }
2263
2291
  return true;
@@ -2493,25 +2521,24 @@ function extractLocales({ component }) {
2493
2521
  function localize(options) {
2494
2522
  const nodes = options.nodes;
2495
2523
  const locale = options.locale;
2496
- const isUsingModernOptions = typeof locale === "string";
2497
- const vizControlLocaleRule = isUsingModernOptions ? createLocaleVisibilityRule(locale) : {};
2524
+ if (!locale) {
2525
+ return;
2526
+ }
2527
+ const vizControlLocaleRule = createLocaleVisibilityRule(locale);
2498
2528
  walkNodeTree(nodes, (context) => {
2499
2529
  const { type, node, actions } = context;
2500
2530
  if (type !== "component") {
2501
- if (isUsingModernOptions) {
2502
- localizeProperties(node, locale, vizControlLocaleRule);
2503
- }
2531
+ localizeProperties(node, locale, vizControlLocaleRule);
2504
2532
  return;
2505
2533
  }
2506
- if (isUsingModernOptions) {
2507
- const result = evaluateWalkTreeNodeVisibility({
2508
- context,
2509
- rules: vizControlLocaleRule,
2510
- showIndeterminate: true
2511
- });
2512
- if (!result) {
2513
- return;
2514
- }
2534
+ const result = evaluateWalkTreeNodeVisibility({
2535
+ context,
2536
+ rules: vizControlLocaleRule,
2537
+ showIndeterminate: true,
2538
+ rootNodeInvisibleHandling: "ignore"
2539
+ });
2540
+ if (!result) {
2541
+ return;
2515
2542
  }
2516
2543
  if (node.type === CANVAS_LOCALIZATION_TYPE) {
2517
2544
  const locales = extractLocales({ component: node });
@@ -2522,9 +2549,7 @@ function localize(options) {
2522
2549
  if (replaceComponent == null ? void 0 : replaceComponent.length) {
2523
2550
  replaceComponent.forEach((component) => {
2524
2551
  removeLocaleProperty(component);
2525
- if (isUsingModernOptions) {
2526
- localizeProperties(component, locale, vizControlLocaleRule);
2527
- }
2552
+ localizeProperties(component, locale, vizControlLocaleRule);
2528
2553
  });
2529
2554
  const [first, ...rest] = replaceComponent;
2530
2555
  actions.replace(first);
@@ -2534,7 +2559,7 @@ function localize(options) {
2534
2559
  } else {
2535
2560
  actions.remove();
2536
2561
  }
2537
- } else if (isUsingModernOptions) {
2562
+ } else {
2538
2563
  localizeProperties(node, locale, vizControlLocaleRule);
2539
2564
  }
2540
2565
  });
@@ -2658,10 +2683,55 @@ var EntityReleasesClient = class extends import_api7.ApiClient {
2658
2683
  }
2659
2684
  };
2660
2685
 
2661
- // src/LocaleClient.ts
2686
+ // src/IntegrationPropertyEditorsClient.ts
2662
2687
  var import_api8 = require("@uniformdev/context/api");
2688
+ var _baseUrl;
2689
+ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient extends import_api8.ApiClient {
2690
+ constructor(options) {
2691
+ super(options);
2692
+ this.teamId = options.teamId;
2693
+ }
2694
+ /**
2695
+ * Gets a list of property type and hook names for the current team, including public integrations' hooks.
2696
+ */
2697
+ get(options) {
2698
+ const fetchUri = this.createUrl(__privateGet(_IntegrationPropertyEditorsClient, _baseUrl), {
2699
+ ...options,
2700
+ teamId: this.teamId
2701
+ });
2702
+ return this.apiClient(fetchUri);
2703
+ }
2704
+ /**
2705
+ * Creates or updates a custom AI property editor on a Mesh app.
2706
+ */
2707
+ async deploy(body) {
2708
+ const fetchUri = this.createUrl(__privateGet(_IntegrationPropertyEditorsClient, _baseUrl));
2709
+ await this.apiClient(fetchUri, {
2710
+ method: "PUT",
2711
+ body: JSON.stringify({ ...body, teamId: this.teamId }),
2712
+ expectNoContent: true
2713
+ });
2714
+ }
2715
+ /**
2716
+ * Removes a custom AI property editor from a Mesh app.
2717
+ */
2718
+ async delete(body) {
2719
+ const fetchUri = this.createUrl(__privateGet(_IntegrationPropertyEditorsClient, _baseUrl));
2720
+ await this.apiClient(fetchUri, {
2721
+ method: "DELETE",
2722
+ body: JSON.stringify({ ...body, teamId: this.teamId }),
2723
+ expectNoContent: true
2724
+ });
2725
+ }
2726
+ };
2727
+ _baseUrl = new WeakMap();
2728
+ __privateAdd(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
2729
+ var IntegrationPropertyEditorsClient = _IntegrationPropertyEditorsClient;
2730
+
2731
+ // src/LocaleClient.ts
2732
+ var import_api9 = require("@uniformdev/context/api");
2663
2733
  var localesUrl = "/api/v1/locales";
2664
- var LocaleClient = class extends import_api8.ApiClient {
2734
+ var LocaleClient = class extends import_api9.ApiClient {
2665
2735
  constructor(options) {
2666
2736
  super(options);
2667
2737
  }
@@ -2746,6 +2816,9 @@ var isUpdatePreviewSettingsMessage = (message) => {
2746
2816
  var isUpdateFeatureFlagsMessage = (message) => {
2747
2817
  return message.type === "update-feature-flags";
2748
2818
  };
2819
+ var isUpdateAiActionsMessage = (message) => {
2820
+ return message.type === "update-ai-actions";
2821
+ };
2749
2822
  var isUpdateContextualEditingStateInternalMessage = (message) => {
2750
2823
  return message.type === "update-contextual-editing-state-internal";
2751
2824
  };
@@ -2794,17 +2867,19 @@ var createCanvasChannel = ({
2794
2867
  postMessage(message);
2795
2868
  };
2796
2869
  const ready = (options) => {
2797
- var _a, _b;
2870
+ var _a, _b, _c;
2798
2871
  if (typeof window === "undefined") {
2799
2872
  return;
2800
2873
  }
2801
2874
  const framework = (_a = window.__UNIFORM_CONTEXTUAL_EDITING__) == null ? void 0 : _a.framework;
2802
- const version = (_b = window.__UNIFORM_CONTEXTUAL_EDITING__) == null ? void 0 : _b.version;
2875
+ const version2 = (_b = window.__UNIFORM_CONTEXTUAL_EDITING__) == null ? void 0 : _b.version;
2876
+ const canvasPackageVersion = (_c = window.__UNIFORM_CONTEXTUAL_EDITING__) == null ? void 0 : _c.canvasPackageVersion;
2803
2877
  const message = {
2804
2878
  type: "ready",
2805
2879
  framework,
2806
- version,
2807
- rsc: options == null ? void 0 : options.rsc
2880
+ version: version2,
2881
+ rsc: options == null ? void 0 : options.rsc,
2882
+ canvasPackageVersion
2808
2883
  };
2809
2884
  postMessage(message);
2810
2885
  };
@@ -2964,6 +3039,13 @@ var createCanvasChannel = ({
2964
3039
  };
2965
3040
  postMessage(message);
2966
3041
  };
3042
+ const updateAiActions = (options) => {
3043
+ const message = {
3044
+ ...options,
3045
+ type: "update-ai-actions"
3046
+ };
3047
+ postMessage(message);
3048
+ };
2967
3049
  const contextStorageUpdated = (options) => {
2968
3050
  const message = {
2969
3051
  ...options,
@@ -3013,6 +3095,7 @@ var createCanvasChannel = ({
3013
3095
  triggerCompositionAction,
3014
3096
  updatePreviewSettings,
3015
3097
  updateFeatureFlags,
3098
+ updateAiActions,
3016
3099
  updateContextualEditingStateInternal,
3017
3100
  selectParameter,
3018
3101
  openParameterEditor,
@@ -3028,10 +3111,10 @@ var createCanvasChannel = ({
3028
3111
  };
3029
3112
 
3030
3113
  // src/PreviewClient.ts
3031
- var import_api9 = require("@uniformdev/context/api");
3114
+ var import_api10 = require("@uniformdev/context/api");
3032
3115
  var previewUrlsUrl = "/api/v1/preview-urls";
3033
3116
  var previewViewportsUrl = "/api/v1/preview-viewports";
3034
- var PreviewClient = class extends import_api9.ApiClient {
3117
+ var PreviewClient = class extends import_api10.ApiClient {
3035
3118
  constructor(options) {
3036
3119
  super(options);
3037
3120
  }
@@ -3093,10 +3176,44 @@ var PreviewClient = class extends import_api9.ApiClient {
3093
3176
  }
3094
3177
  };
3095
3178
 
3179
+ // src/ProjectClient.ts
3180
+ var import_api11 = require("@uniformdev/context/api");
3181
+ var _url2;
3182
+ var _ProjectClient = class _ProjectClient extends import_api11.ApiClient {
3183
+ constructor(options) {
3184
+ super({ ...options, bypassCache: true });
3185
+ }
3186
+ /** Fetches single Project */
3187
+ async get(options) {
3188
+ const fetchUri = this.createUrl(__privateGet(_ProjectClient, _url2), { ...options });
3189
+ return await this.apiClient(fetchUri);
3190
+ }
3191
+ /** Updates or creates (based on id) a Project */
3192
+ async upsert(body) {
3193
+ const fetchUri = this.createUrl(__privateGet(_ProjectClient, _url2));
3194
+ return await this.apiClient(fetchUri, {
3195
+ method: "PUT",
3196
+ body: JSON.stringify({ ...body })
3197
+ });
3198
+ }
3199
+ /** Deletes a Project */
3200
+ async delete(body) {
3201
+ const fetchUri = this.createUrl(__privateGet(_ProjectClient, _url2));
3202
+ await this.apiClient(fetchUri, {
3203
+ method: "DELETE",
3204
+ body: JSON.stringify({ ...body }),
3205
+ expectNoContent: true
3206
+ });
3207
+ }
3208
+ };
3209
+ _url2 = new WeakMap();
3210
+ __privateAdd(_ProjectClient, _url2, "/api/v1/project");
3211
+ var ProjectClient = _ProjectClient;
3212
+
3096
3213
  // src/PromptClient.ts
3097
- var import_api10 = require("@uniformdev/context/api");
3214
+ var import_api12 = require("@uniformdev/context/api");
3098
3215
  var PromptsUrl = "/api/v1/prompts";
3099
- var PromptClient = class extends import_api10.ApiClient {
3216
+ var PromptClient = class extends import_api12.ApiClient {
3100
3217
  constructor(options) {
3101
3218
  super(options);
3102
3219
  }
@@ -3127,9 +3244,9 @@ var PromptClient = class extends import_api10.ApiClient {
3127
3244
  };
3128
3245
 
3129
3246
  // src/RelationshipClient.ts
3130
- var import_api11 = require("@uniformdev/context/api");
3247
+ var import_api13 = require("@uniformdev/context/api");
3131
3248
  var RELATIONSHIPS_URL = "/api/v1/relationships";
3132
- var RelationshipClient = class extends import_api11.ApiClient {
3249
+ var RelationshipClient = class extends import_api13.ApiClient {
3133
3250
  constructor(options) {
3134
3251
  super(options);
3135
3252
  this.get = async (options) => {
@@ -3141,9 +3258,9 @@ var RelationshipClient = class extends import_api11.ApiClient {
3141
3258
  };
3142
3259
 
3143
3260
  // src/ReleaseClient.ts
3144
- var import_api12 = require("@uniformdev/context/api");
3261
+ var import_api14 = require("@uniformdev/context/api");
3145
3262
  var releasesUrl = "/api/v1/releases";
3146
- var ReleaseClient = class extends import_api12.ApiClient {
3263
+ var ReleaseClient = class extends import_api14.ApiClient {
3147
3264
  constructor(options) {
3148
3265
  super(options);
3149
3266
  }
@@ -3183,9 +3300,9 @@ var ReleaseClient = class extends import_api12.ApiClient {
3183
3300
  };
3184
3301
 
3185
3302
  // src/ReleaseContentsClient.ts
3186
- var import_api13 = require("@uniformdev/context/api");
3303
+ var import_api15 = require("@uniformdev/context/api");
3187
3304
  var releaseContentsUrl2 = "/api/v1/release-contents";
3188
- var ReleaseContentsClient = class extends import_api13.ApiClient {
3305
+ var ReleaseContentsClient = class extends import_api15.ApiClient {
3189
3306
  constructor(options) {
3190
3307
  super(options);
3191
3308
  }
@@ -3207,9 +3324,9 @@ var ReleaseContentsClient = class extends import_api13.ApiClient {
3207
3324
  };
3208
3325
 
3209
3326
  // src/RouteClient.ts
3210
- var import_api14 = require("@uniformdev/context/api");
3327
+ var import_api16 = require("@uniformdev/context/api");
3211
3328
  var ROUTE_URL = "/api/v1/route";
3212
- var RouteClient = class extends import_api14.ApiClient {
3329
+ var RouteClient = class extends import_api16.ApiClient {
3213
3330
  constructor(options) {
3214
3331
  var _a;
3215
3332
  if (!options.limitPolicy) {
@@ -3232,6 +3349,63 @@ var RouteClient = class extends import_api14.ApiClient {
3232
3349
  // src/types/locales.ts
3233
3350
  var LOCALE_DYNAMIC_INPUT_NAME = "locale";
3234
3351
 
3352
+ // src/utils/assetConfig.ts
3353
+ var mergeAssetConfigWithDefaults = (config) => {
3354
+ var _a;
3355
+ return {
3356
+ ...config,
3357
+ // For backwards compatibility reasons undefined represents restriction to
3358
+ // image types
3359
+ allowedTypes: (_a = config.allowedTypes) != null ? _a : ["image"]
3360
+ };
3361
+ };
3362
+
3363
+ // src/utils/autoFixParameterGroups.ts
3364
+ function autoFixParameterGroups(properties) {
3365
+ var _a;
3366
+ const remainingGroups = (_a = properties.filter((param) => param.type === "group")) != null ? _a : [];
3367
+ if (remainingGroups.length === 0) {
3368
+ return false;
3369
+ }
3370
+ let result = false;
3371
+ while (remainingGroups.length > 0) {
3372
+ const group = remainingGroups.shift();
3373
+ const groupParamsConfig = group.typeConfig && typeof group.typeConfig === "object" && "childrenParams" in group.typeConfig && Array.isArray(group.typeConfig.childrenParams) ? group.typeConfig.childrenParams : [];
3374
+ const expectedParamsToFindFollowingGroup = new Set(groupParamsConfig);
3375
+ const groupStartIndex = properties.findIndex((param) => param.id === group.id);
3376
+ const groupItemsCount = expectedParamsToFindFollowingGroup.size;
3377
+ for (let i = groupStartIndex + 1; i <= groupStartIndex + groupItemsCount; i++) {
3378
+ const param = properties[i];
3379
+ if (!param) {
3380
+ continue;
3381
+ }
3382
+ if (expectedParamsToFindFollowingGroup.has(param.id)) {
3383
+ expectedParamsToFindFollowingGroup.delete(param.id);
3384
+ } else {
3385
+ break;
3386
+ }
3387
+ }
3388
+ if (expectedParamsToFindFollowingGroup.size > 0) {
3389
+ const paramsToMove = Array.from(expectedParamsToFindFollowingGroup);
3390
+ let leadingGroupIndex = groupStartIndex + groupItemsCount - expectedParamsToFindFollowingGroup.size;
3391
+ for (const paramId of paramsToMove) {
3392
+ const paramIndex = properties.findIndex((param) => param.id === paramId);
3393
+ if (paramIndex !== -1) {
3394
+ const [param] = properties.splice(paramIndex, 1);
3395
+ if (paramIndex > leadingGroupIndex) {
3396
+ leadingGroupIndex++;
3397
+ }
3398
+ properties.splice(leadingGroupIndex, 0, param);
3399
+ } else {
3400
+ groupParamsConfig.splice(groupParamsConfig.indexOf(paramId), 1);
3401
+ }
3402
+ }
3403
+ result = true;
3404
+ }
3405
+ }
3406
+ return result;
3407
+ }
3408
+
3235
3409
  // src/utils/createApiEnhancer.ts
3236
3410
  var createUniformApiEnhancer = ({ apiUrl }) => {
3237
3411
  return async (message) => {
@@ -3361,7 +3535,8 @@ function mapSlotToTestVariations(slot) {
3361
3535
  return {
3362
3536
  ...v,
3363
3537
  id,
3364
- testDistribution: contextTag == null ? void 0 : contextTag.testDistribution
3538
+ testDistribution: contextTag == null ? void 0 : contextTag.testDistribution,
3539
+ control: contextTag == null ? void 0 : contextTag.control
3365
3540
  };
3366
3541
  });
3367
3542
  }
@@ -3523,12 +3698,15 @@ function handleRichTextNodeBinding(object, options) {
3523
3698
  }
3524
3699
 
3525
3700
  // src/index.ts
3526
- var import_api16 = require("@uniformdev/context/api");
3701
+ var import_api18 = require("@uniformdev/context/api");
3702
+
3703
+ // src/.version.ts
3704
+ var version = "20.43.0";
3527
3705
 
3528
3706
  // src/WorkflowClient.ts
3529
- var import_api15 = require("@uniformdev/context/api");
3707
+ var import_api17 = require("@uniformdev/context/api");
3530
3708
  var workflowsUrl = "/api/v1/workflows";
3531
- var WorkflowClient = class extends import_api15.ApiClient {
3709
+ var WorkflowClient = class extends import_api17.ApiClient {
3532
3710
  constructor(options) {
3533
3711
  super(options);
3534
3712
  }
@@ -3559,7 +3737,7 @@ var WorkflowClient = class extends import_api15.ApiClient {
3559
3737
  };
3560
3738
 
3561
3739
  // src/index.ts
3562
- var CanvasClientError = import_api16.ApiClientError;
3740
+ var CanvasClientError = import_api18.ApiClientError;
3563
3741
  // Annotate the CommonJS export names for ESM import in node:
3564
3742
  0 && (module.exports = {
3565
3743
  ASSETS_SOURCE_CUSTOM_URL,
@@ -3583,7 +3761,11 @@ var CanvasClientError = import_api16.ApiClientError;
3583
3761
  CANVAS_LOCALE_TAG_PARAM,
3584
3762
  CANVAS_LOCALIZATION_SLOT,
3585
3763
  CANVAS_LOCALIZATION_TYPE,
3764
+ CANVAS_PERSONALIZATION_ALGORITHM_PARAM,
3765
+ CANVAS_PERSONALIZATION_ALGORITHM_TYPE,
3766
+ CANVAS_PERSONALIZATION_EVENT_NAME_PARAM,
3586
3767
  CANVAS_PERSONALIZATION_PARAM,
3768
+ CANVAS_PERSONALIZATION_TAKE_PARAM,
3587
3769
  CANVAS_PERSONALIZE_SLOT,
3588
3770
  CANVAS_PERSONALIZE_TYPE,
3589
3771
  CANVAS_PUBLISHED_STATE,
@@ -3619,10 +3801,12 @@ var CanvasClientError = import_api16.ApiClientError;
3619
3801
  IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
3620
3802
  IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
3621
3803
  IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
3804
+ IntegrationPropertyEditorsClient,
3622
3805
  LOCALE_DYNAMIC_INPUT_NAME,
3623
3806
  LocaleClient,
3624
3807
  PLACEHOLDER_ID,
3625
3808
  PreviewClient,
3809
+ ProjectClient,
3626
3810
  PromptClient,
3627
3811
  RelationshipClient,
3628
3812
  ReleaseClient,
@@ -3634,6 +3818,7 @@ var CanvasClientError = import_api16.ApiClientError;
3634
3818
  UncachedContentClient,
3635
3819
  UniqueBatchEntries,
3636
3820
  WorkflowClient,
3821
+ autoFixParameterGroups,
3637
3822
  bindExpressionEscapeChars,
3638
3823
  bindExpressionPrefix,
3639
3824
  bindVariables,
@@ -3695,6 +3880,7 @@ var CanvasClientError = import_api16.ApiClientError;
3695
3880
  isSuggestComponentMessage,
3696
3881
  isSystemComponentDefinition,
3697
3882
  isTriggerCompositionActionMessage,
3883
+ isUpdateAiActionsMessage,
3698
3884
  isUpdateComponentParameterMessage,
3699
3885
  isUpdateComponentReferencesMessage,
3700
3886
  isUpdateCompositionInternalMessage,
@@ -3705,9 +3891,11 @@ var CanvasClientError = import_api16.ApiClientError;
3705
3891
  localize,
3706
3892
  mapSlotToPersonalizedVariations,
3707
3893
  mapSlotToTestVariations,
3894
+ mergeAssetConfigWithDefaults,
3708
3895
  nullLimitPolicy,
3709
3896
  parseComponentPlaceholderId,
3710
3897
  parseVariableExpression,
3898
+ version,
3711
3899
  walkNodeTree,
3712
3900
  walkPropertyValues
3713
3901
  });