@uniformdev/canvas 20.35.0 → 20.35.1-alpha.58

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.mjs CHANGED
@@ -1091,6 +1091,9 @@ var CANVAS_PERSONALIZATION_ALGORITHM_TYPE = "pzAlgorithm";
1091
1091
  var CANVAS_PERSONALIZATION_TAKE_PARAM = "count";
1092
1092
  var CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
1093
1093
  var CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
1094
+ var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
1095
+ var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
1096
+ var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
1094
1097
  var CANVAS_CONTEXTUAL_EDITING_PARAM = "$contextualEditing";
1095
1098
  var SECRET_QUERY_STRING_PARAM = "secret";
1096
1099
  var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
@@ -2513,10 +2516,55 @@ var EntityReleasesClient = class extends ApiClient6 {
2513
2516
  }
2514
2517
  };
2515
2518
 
2516
- // src/LocaleClient.ts
2519
+ // src/IntegrationPropertyEditorsClient.ts
2517
2520
  import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
2521
+ var _baseUrl;
2522
+ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient extends ApiClient7 {
2523
+ constructor(options) {
2524
+ super(options);
2525
+ this.teamId = options.teamId;
2526
+ }
2527
+ /**
2528
+ * Gets a list of property type and hook names for the current team, including public integrations' hooks.
2529
+ */
2530
+ get(options) {
2531
+ const fetchUri = this.createUrl(__privateGet(_IntegrationPropertyEditorsClient, _baseUrl), {
2532
+ ...options,
2533
+ teamId: this.teamId
2534
+ });
2535
+ return this.apiClient(fetchUri);
2536
+ }
2537
+ /**
2538
+ * Creates or updates a custom AI property editor on a Mesh app.
2539
+ */
2540
+ async deploy(body) {
2541
+ const fetchUri = this.createUrl(__privateGet(_IntegrationPropertyEditorsClient, _baseUrl));
2542
+ await this.apiClient(fetchUri, {
2543
+ method: "PUT",
2544
+ body: JSON.stringify({ ...body, teamId: this.teamId }),
2545
+ expectNoContent: true
2546
+ });
2547
+ }
2548
+ /**
2549
+ * Removes a custom AI property editor from a Mesh app.
2550
+ */
2551
+ async delete(body) {
2552
+ const fetchUri = this.createUrl(__privateGet(_IntegrationPropertyEditorsClient, _baseUrl));
2553
+ await this.apiClient(fetchUri, {
2554
+ method: "DELETE",
2555
+ body: JSON.stringify({ ...body, teamId: this.teamId }),
2556
+ expectNoContent: true
2557
+ });
2558
+ }
2559
+ };
2560
+ _baseUrl = new WeakMap();
2561
+ __privateAdd(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
2562
+ var IntegrationPropertyEditorsClient = _IntegrationPropertyEditorsClient;
2563
+
2564
+ // src/LocaleClient.ts
2565
+ import { ApiClient as ApiClient8 } from "@uniformdev/context/api";
2518
2566
  var localesUrl = "/api/v1/locales";
2519
- var LocaleClient = class extends ApiClient7 {
2567
+ var LocaleClient = class extends ApiClient8 {
2520
2568
  constructor(options) {
2521
2569
  super(options);
2522
2570
  }
@@ -2601,6 +2649,9 @@ var isUpdatePreviewSettingsMessage = (message) => {
2601
2649
  var isUpdateFeatureFlagsMessage = (message) => {
2602
2650
  return message.type === "update-feature-flags";
2603
2651
  };
2652
+ var isUpdateAiActionsMessage = (message) => {
2653
+ return message.type === "update-ai-actions";
2654
+ };
2604
2655
  var isUpdateContextualEditingStateInternalMessage = (message) => {
2605
2656
  return message.type === "update-contextual-editing-state-internal";
2606
2657
  };
@@ -2821,6 +2872,13 @@ var createCanvasChannel = ({
2821
2872
  };
2822
2873
  postMessage(message);
2823
2874
  };
2875
+ const updateAiActions = (options) => {
2876
+ const message = {
2877
+ ...options,
2878
+ type: "update-ai-actions"
2879
+ };
2880
+ postMessage(message);
2881
+ };
2824
2882
  const contextStorageUpdated = (options) => {
2825
2883
  const message = {
2826
2884
  ...options,
@@ -2870,6 +2928,7 @@ var createCanvasChannel = ({
2870
2928
  triggerCompositionAction,
2871
2929
  updatePreviewSettings,
2872
2930
  updateFeatureFlags,
2931
+ updateAiActions,
2873
2932
  updateContextualEditingStateInternal,
2874
2933
  selectParameter,
2875
2934
  openParameterEditor,
@@ -2885,10 +2944,10 @@ var createCanvasChannel = ({
2885
2944
  };
2886
2945
 
2887
2946
  // src/PreviewClient.ts
2888
- import { ApiClient as ApiClient8 } from "@uniformdev/context/api";
2947
+ import { ApiClient as ApiClient9 } from "@uniformdev/context/api";
2889
2948
  var previewUrlsUrl = "/api/v1/preview-urls";
2890
2949
  var previewViewportsUrl = "/api/v1/preview-viewports";
2891
- var PreviewClient = class extends ApiClient8 {
2950
+ var PreviewClient = class extends ApiClient9 {
2892
2951
  constructor(options) {
2893
2952
  super(options);
2894
2953
  }
@@ -2951,9 +3010,9 @@ var PreviewClient = class extends ApiClient8 {
2951
3010
  };
2952
3011
 
2953
3012
  // src/ProjectClient.ts
2954
- import { ApiClient as ApiClient9 } from "@uniformdev/context/api";
3013
+ import { ApiClient as ApiClient10 } from "@uniformdev/context/api";
2955
3014
  var _url2;
2956
- var _ProjectClient = class _ProjectClient extends ApiClient9 {
3015
+ var _ProjectClient = class _ProjectClient extends ApiClient10 {
2957
3016
  constructor(options) {
2958
3017
  super({ ...options, bypassCache: true });
2959
3018
  }
@@ -2985,9 +3044,9 @@ __privateAdd(_ProjectClient, _url2, "/api/v1/project");
2985
3044
  var ProjectClient = _ProjectClient;
2986
3045
 
2987
3046
  // src/PromptClient.ts
2988
- import { ApiClient as ApiClient10 } from "@uniformdev/context/api";
3047
+ import { ApiClient as ApiClient11 } from "@uniformdev/context/api";
2989
3048
  var PromptsUrl = "/api/v1/prompts";
2990
- var PromptClient = class extends ApiClient10 {
3049
+ var PromptClient = class extends ApiClient11 {
2991
3050
  constructor(options) {
2992
3051
  super(options);
2993
3052
  }
@@ -3018,9 +3077,9 @@ var PromptClient = class extends ApiClient10 {
3018
3077
  };
3019
3078
 
3020
3079
  // src/RelationshipClient.ts
3021
- import { ApiClient as ApiClient11 } from "@uniformdev/context/api";
3080
+ import { ApiClient as ApiClient12 } from "@uniformdev/context/api";
3022
3081
  var RELATIONSHIPS_URL = "/api/v1/relationships";
3023
- var RelationshipClient = class extends ApiClient11 {
3082
+ var RelationshipClient = class extends ApiClient12 {
3024
3083
  constructor(options) {
3025
3084
  super(options);
3026
3085
  this.get = async (options) => {
@@ -3032,9 +3091,9 @@ var RelationshipClient = class extends ApiClient11 {
3032
3091
  };
3033
3092
 
3034
3093
  // src/ReleaseClient.ts
3035
- import { ApiClient as ApiClient12 } from "@uniformdev/context/api";
3094
+ import { ApiClient as ApiClient13 } from "@uniformdev/context/api";
3036
3095
  var releasesUrl = "/api/v1/releases";
3037
- var ReleaseClient = class extends ApiClient12 {
3096
+ var ReleaseClient = class extends ApiClient13 {
3038
3097
  constructor(options) {
3039
3098
  super(options);
3040
3099
  }
@@ -3074,9 +3133,9 @@ var ReleaseClient = class extends ApiClient12 {
3074
3133
  };
3075
3134
 
3076
3135
  // src/ReleaseContentsClient.ts
3077
- import { ApiClient as ApiClient13 } from "@uniformdev/context/api";
3136
+ import { ApiClient as ApiClient14 } from "@uniformdev/context/api";
3078
3137
  var releaseContentsUrl2 = "/api/v1/release-contents";
3079
- var ReleaseContentsClient = class extends ApiClient13 {
3138
+ var ReleaseContentsClient = class extends ApiClient14 {
3080
3139
  constructor(options) {
3081
3140
  super(options);
3082
3141
  }
@@ -3098,9 +3157,9 @@ var ReleaseContentsClient = class extends ApiClient13 {
3098
3157
  };
3099
3158
 
3100
3159
  // src/RouteClient.ts
3101
- import { ApiClient as ApiClient14 } from "@uniformdev/context/api";
3160
+ import { ApiClient as ApiClient15 } from "@uniformdev/context/api";
3102
3161
  var ROUTE_URL = "/api/v1/route";
3103
- var RouteClient = class extends ApiClient14 {
3162
+ var RouteClient = class extends ApiClient15 {
3104
3163
  constructor(options) {
3105
3164
  var _a;
3106
3165
  if (!options.limitPolicy) {
@@ -3123,6 +3182,52 @@ var RouteClient = class extends ApiClient14 {
3123
3182
  // src/types/locales.ts
3124
3183
  var LOCALE_DYNAMIC_INPUT_NAME = "locale";
3125
3184
 
3185
+ // src/utils/autoFixParameterGroups.ts
3186
+ function autoFixParameterGroups(properties) {
3187
+ var _a;
3188
+ const remainingGroups = (_a = properties.filter((param) => param.type === "group")) != null ? _a : [];
3189
+ if (remainingGroups.length === 0) {
3190
+ return false;
3191
+ }
3192
+ let result = false;
3193
+ while (remainingGroups.length > 0) {
3194
+ const group = remainingGroups.shift();
3195
+ const groupParamsConfig = group.typeConfig && typeof group.typeConfig === "object" && "childrenParams" in group.typeConfig && Array.isArray(group.typeConfig.childrenParams) ? group.typeConfig.childrenParams : [];
3196
+ const expectedParamsToFindFollowingGroup = new Set(groupParamsConfig);
3197
+ const groupStartIndex = properties.findIndex((param) => param.id === group.id);
3198
+ const groupItemsCount = expectedParamsToFindFollowingGroup.size;
3199
+ for (let i = groupStartIndex + 1; i <= groupStartIndex + groupItemsCount; i++) {
3200
+ const param = properties[i];
3201
+ if (!param) {
3202
+ continue;
3203
+ }
3204
+ if (expectedParamsToFindFollowingGroup.has(param.id)) {
3205
+ expectedParamsToFindFollowingGroup.delete(param.id);
3206
+ } else {
3207
+ break;
3208
+ }
3209
+ }
3210
+ if (expectedParamsToFindFollowingGroup.size > 0) {
3211
+ const paramsToMove = Array.from(expectedParamsToFindFollowingGroup);
3212
+ let leadingGroupIndex = groupStartIndex + groupItemsCount - expectedParamsToFindFollowingGroup.size;
3213
+ for (const paramId of paramsToMove) {
3214
+ const paramIndex = properties.findIndex((param) => param.id === paramId);
3215
+ if (paramIndex !== -1) {
3216
+ const [param] = properties.splice(paramIndex, 1);
3217
+ if (paramIndex > leadingGroupIndex) {
3218
+ leadingGroupIndex++;
3219
+ }
3220
+ properties.splice(leadingGroupIndex, 0, param);
3221
+ } else {
3222
+ groupParamsConfig.splice(groupParamsConfig.indexOf(paramId), 1);
3223
+ }
3224
+ }
3225
+ result = true;
3226
+ }
3227
+ }
3228
+ return result;
3229
+ }
3230
+
3126
3231
  // src/utils/createApiEnhancer.ts
3127
3232
  var createUniformApiEnhancer = ({ apiUrl }) => {
3128
3233
  return async (message) => {
@@ -3252,7 +3357,8 @@ function mapSlotToTestVariations(slot) {
3252
3357
  return {
3253
3358
  ...v,
3254
3359
  id,
3255
- testDistribution: contextTag == null ? void 0 : contextTag.testDistribution
3360
+ testDistribution: contextTag == null ? void 0 : contextTag.testDistribution,
3361
+ control: contextTag == null ? void 0 : contextTag.control
3256
3362
  };
3257
3363
  });
3258
3364
  }
@@ -3417,12 +3523,12 @@ function handleRichTextNodeBinding(object, options) {
3417
3523
  import { ApiClientError as ApiClientError2 } from "@uniformdev/context/api";
3418
3524
 
3419
3525
  // src/.version.ts
3420
- var version = "20.35.0";
3526
+ var version = "20.38.1";
3421
3527
 
3422
3528
  // src/WorkflowClient.ts
3423
- import { ApiClient as ApiClient15 } from "@uniformdev/context/api";
3529
+ import { ApiClient as ApiClient16 } from "@uniformdev/context/api";
3424
3530
  var workflowsUrl = "/api/v1/workflows";
3425
- var WorkflowClient = class extends ApiClient15 {
3531
+ var WorkflowClient = class extends ApiClient16 {
3426
3532
  constructor(options) {
3427
3533
  super(options);
3428
3534
  }
@@ -3468,11 +3574,14 @@ export {
3468
3574
  BatchEntry,
3469
3575
  BlockFormatError,
3470
3576
  CANVAS_BLOCK_PARAM_TYPE,
3577
+ CANVAS_COMPONENT_DISPLAY_NAME_PARAM,
3471
3578
  CANVAS_CONTEXTUAL_EDITING_PARAM,
3472
3579
  CANVAS_DRAFT_STATE,
3473
3580
  CANVAS_EDITOR_STATE,
3474
3581
  CANVAS_ENRICHMENT_TAG_PARAM,
3582
+ CANVAS_HYPOTHESIS_PARAM,
3475
3583
  CANVAS_INTENT_TAG_PARAM,
3584
+ CANVAS_INTERNAL_PARAM_PREFIX,
3476
3585
  CANVAS_LOCALE_TAG_PARAM,
3477
3586
  CANVAS_LOCALIZATION_SLOT,
3478
3587
  CANVAS_LOCALIZATION_TYPE,
@@ -3516,6 +3625,7 @@ export {
3516
3625
  IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
3517
3626
  IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
3518
3627
  IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
3628
+ IntegrationPropertyEditorsClient,
3519
3629
  LOCALE_DYNAMIC_INPUT_NAME,
3520
3630
  LocaleClient,
3521
3631
  PLACEHOLDER_ID,
@@ -3532,6 +3642,7 @@ export {
3532
3642
  UncachedContentClient,
3533
3643
  UniqueBatchEntries,
3534
3644
  WorkflowClient,
3645
+ autoFixParameterGroups,
3535
3646
  bindExpressionEscapeChars,
3536
3647
  bindExpressionPrefix,
3537
3648
  bindVariables,
@@ -3593,6 +3704,7 @@ export {
3593
3704
  isSuggestComponentMessage,
3594
3705
  isSystemComponentDefinition,
3595
3706
  isTriggerCompositionActionMessage,
3707
+ isUpdateAiActionsMessage,
3596
3708
  isUpdateComponentParameterMessage,
3597
3709
  isUpdateComponentReferencesMessage,
3598
3710
  isUpdateCompositionInternalMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "20.35.0",
3
+ "version": "20.35.1-alpha.58+f229d40de4",
4
4
  "description": "Common functionality and types for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -41,9 +41,9 @@
41
41
  "svix": "1.71.0"
42
42
  },
43
43
  "dependencies": {
44
- "@uniformdev/assets": "20.35.0",
45
- "@uniformdev/context": "20.35.0",
46
- "@uniformdev/richtext": "20.35.0",
44
+ "@uniformdev/assets": "20.35.1-alpha.58+f229d40de4",
45
+ "@uniformdev/context": "20.35.1-alpha.58+f229d40de4",
46
+ "@uniformdev/richtext": "20.35.1-alpha.58+f229d40de4",
47
47
  "immer": "10.1.1"
48
48
  },
49
49
  "files": [
@@ -52,5 +52,5 @@
52
52
  "publishConfig": {
53
53
  "access": "public"
54
54
  },
55
- "gitHead": "f228361828ef49a596ca3841e5b79768c64418cf"
55
+ "gitHead": "f229d40de49a1a7e2bba9d2e0a36d4aae6251c81"
56
56
  }