@uniformdev/canvas 20.7.1-alpha.79 → 20.7.1-alpha.83

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
@@ -2513,10 +2513,55 @@ var EntityReleasesClient = class extends ApiClient6 {
2513
2513
  }
2514
2514
  };
2515
2515
 
2516
- // src/LocaleClient.ts
2516
+ // src/IntegrationPropertyEditorsClient.ts
2517
2517
  import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
2518
+ var _baseUrl;
2519
+ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient extends ApiClient7 {
2520
+ constructor(options) {
2521
+ super(options);
2522
+ this.teamId = options.teamId;
2523
+ }
2524
+ /**
2525
+ * Gets a list of property type and hook names for the current team, including public integrations' hooks.
2526
+ */
2527
+ get(options) {
2528
+ const fetchUri = this.createUrl(__privateGet(_IntegrationPropertyEditorsClient, _baseUrl), {
2529
+ ...options,
2530
+ teamId: this.teamId
2531
+ });
2532
+ return this.apiClient(fetchUri);
2533
+ }
2534
+ /**
2535
+ * Creates or updates a custom AI property editor on a Mesh app.
2536
+ */
2537
+ async deploy(body) {
2538
+ const fetchUri = this.createUrl(__privateGet(_IntegrationPropertyEditorsClient, _baseUrl));
2539
+ await this.apiClient(fetchUri, {
2540
+ method: "PUT",
2541
+ body: JSON.stringify({ ...body, teamId: this.teamId }),
2542
+ expectNoContent: true
2543
+ });
2544
+ }
2545
+ /**
2546
+ * Removes a custom AI property editor from a Mesh app.
2547
+ */
2548
+ async delete(body) {
2549
+ const fetchUri = this.createUrl(__privateGet(_IntegrationPropertyEditorsClient, _baseUrl));
2550
+ await this.apiClient(fetchUri, {
2551
+ method: "DELETE",
2552
+ body: JSON.stringify({ ...body, teamId: this.teamId }),
2553
+ expectNoContent: true
2554
+ });
2555
+ }
2556
+ };
2557
+ _baseUrl = new WeakMap();
2558
+ __privateAdd(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
2559
+ var IntegrationPropertyEditorsClient = _IntegrationPropertyEditorsClient;
2560
+
2561
+ // src/LocaleClient.ts
2562
+ import { ApiClient as ApiClient8 } from "@uniformdev/context/api";
2518
2563
  var localesUrl = "/api/v1/locales";
2519
- var LocaleClient = class extends ApiClient7 {
2564
+ var LocaleClient = class extends ApiClient8 {
2520
2565
  constructor(options) {
2521
2566
  super(options);
2522
2567
  }
@@ -2601,6 +2646,9 @@ var isUpdatePreviewSettingsMessage = (message) => {
2601
2646
  var isUpdateFeatureFlagsMessage = (message) => {
2602
2647
  return message.type === "update-feature-flags";
2603
2648
  };
2649
+ var isUpdateAiActionsMessage = (message) => {
2650
+ return message.type === "update-ai-actions";
2651
+ };
2604
2652
  var isUpdateContextualEditingStateInternalMessage = (message) => {
2605
2653
  return message.type === "update-contextual-editing-state-internal";
2606
2654
  };
@@ -2821,6 +2869,13 @@ var createCanvasChannel = ({
2821
2869
  };
2822
2870
  postMessage(message);
2823
2871
  };
2872
+ const updateAiActions = (options) => {
2873
+ const message = {
2874
+ ...options,
2875
+ type: "update-ai-actions"
2876
+ };
2877
+ postMessage(message);
2878
+ };
2824
2879
  const contextStorageUpdated = (options) => {
2825
2880
  const message = {
2826
2881
  ...options,
@@ -2870,6 +2925,7 @@ var createCanvasChannel = ({
2870
2925
  triggerCompositionAction,
2871
2926
  updatePreviewSettings,
2872
2927
  updateFeatureFlags,
2928
+ updateAiActions,
2873
2929
  updateContextualEditingStateInternal,
2874
2930
  selectParameter,
2875
2931
  openParameterEditor,
@@ -2885,10 +2941,10 @@ var createCanvasChannel = ({
2885
2941
  };
2886
2942
 
2887
2943
  // src/PreviewClient.ts
2888
- import { ApiClient as ApiClient8 } from "@uniformdev/context/api";
2944
+ import { ApiClient as ApiClient9 } from "@uniformdev/context/api";
2889
2945
  var previewUrlsUrl = "/api/v1/preview-urls";
2890
2946
  var previewViewportsUrl = "/api/v1/preview-viewports";
2891
- var PreviewClient = class extends ApiClient8 {
2947
+ var PreviewClient = class extends ApiClient9 {
2892
2948
  constructor(options) {
2893
2949
  super(options);
2894
2950
  }
@@ -2951,9 +3007,9 @@ var PreviewClient = class extends ApiClient8 {
2951
3007
  };
2952
3008
 
2953
3009
  // src/ProjectClient.ts
2954
- import { ApiClient as ApiClient9 } from "@uniformdev/context/api";
3010
+ import { ApiClient as ApiClient10 } from "@uniformdev/context/api";
2955
3011
  var _url2;
2956
- var _ProjectClient = class _ProjectClient extends ApiClient9 {
3012
+ var _ProjectClient = class _ProjectClient extends ApiClient10 {
2957
3013
  constructor(options) {
2958
3014
  super({ ...options, bypassCache: true });
2959
3015
  }
@@ -2985,9 +3041,9 @@ __privateAdd(_ProjectClient, _url2, "/api/v1/project");
2985
3041
  var ProjectClient = _ProjectClient;
2986
3042
 
2987
3043
  // src/PromptClient.ts
2988
- import { ApiClient as ApiClient10 } from "@uniformdev/context/api";
3044
+ import { ApiClient as ApiClient11 } from "@uniformdev/context/api";
2989
3045
  var PromptsUrl = "/api/v1/prompts";
2990
- var PromptClient = class extends ApiClient10 {
3046
+ var PromptClient = class extends ApiClient11 {
2991
3047
  constructor(options) {
2992
3048
  super(options);
2993
3049
  }
@@ -3018,9 +3074,9 @@ var PromptClient = class extends ApiClient10 {
3018
3074
  };
3019
3075
 
3020
3076
  // src/RelationshipClient.ts
3021
- import { ApiClient as ApiClient11 } from "@uniformdev/context/api";
3077
+ import { ApiClient as ApiClient12 } from "@uniformdev/context/api";
3022
3078
  var RELATIONSHIPS_URL = "/api/v1/relationships";
3023
- var RelationshipClient = class extends ApiClient11 {
3079
+ var RelationshipClient = class extends ApiClient12 {
3024
3080
  constructor(options) {
3025
3081
  super(options);
3026
3082
  this.get = async (options) => {
@@ -3032,9 +3088,9 @@ var RelationshipClient = class extends ApiClient11 {
3032
3088
  };
3033
3089
 
3034
3090
  // src/ReleaseClient.ts
3035
- import { ApiClient as ApiClient12 } from "@uniformdev/context/api";
3091
+ import { ApiClient as ApiClient13 } from "@uniformdev/context/api";
3036
3092
  var releasesUrl = "/api/v1/releases";
3037
- var ReleaseClient = class extends ApiClient12 {
3093
+ var ReleaseClient = class extends ApiClient13 {
3038
3094
  constructor(options) {
3039
3095
  super(options);
3040
3096
  }
@@ -3074,9 +3130,9 @@ var ReleaseClient = class extends ApiClient12 {
3074
3130
  };
3075
3131
 
3076
3132
  // src/ReleaseContentsClient.ts
3077
- import { ApiClient as ApiClient13 } from "@uniformdev/context/api";
3133
+ import { ApiClient as ApiClient14 } from "@uniformdev/context/api";
3078
3134
  var releaseContentsUrl2 = "/api/v1/release-contents";
3079
- var ReleaseContentsClient = class extends ApiClient13 {
3135
+ var ReleaseContentsClient = class extends ApiClient14 {
3080
3136
  constructor(options) {
3081
3137
  super(options);
3082
3138
  }
@@ -3098,9 +3154,9 @@ var ReleaseContentsClient = class extends ApiClient13 {
3098
3154
  };
3099
3155
 
3100
3156
  // src/RouteClient.ts
3101
- import { ApiClient as ApiClient14 } from "@uniformdev/context/api";
3157
+ import { ApiClient as ApiClient15 } from "@uniformdev/context/api";
3102
3158
  var ROUTE_URL = "/api/v1/route";
3103
- var RouteClient = class extends ApiClient14 {
3159
+ var RouteClient = class extends ApiClient15 {
3104
3160
  constructor(options) {
3105
3161
  var _a;
3106
3162
  if (!options.limitPolicy) {
@@ -3123,6 +3179,63 @@ var RouteClient = class extends ApiClient14 {
3123
3179
  // src/types/locales.ts
3124
3180
  var LOCALE_DYNAMIC_INPUT_NAME = "locale";
3125
3181
 
3182
+ // src/utils/assetConfig.ts
3183
+ var mergeAssetConfigWithDefaults = (config) => {
3184
+ var _a;
3185
+ return {
3186
+ ...config,
3187
+ // For backwards compatibility reasons undefined represents restriction to
3188
+ // image types
3189
+ allowedTypes: (_a = config.allowedTypes) != null ? _a : ["image"]
3190
+ };
3191
+ };
3192
+
3193
+ // src/utils/autoFixParameterGroups.ts
3194
+ function autoFixParameterGroups(properties) {
3195
+ var _a;
3196
+ const remainingGroups = (_a = properties.filter((param) => param.type === "group")) != null ? _a : [];
3197
+ if (remainingGroups.length === 0) {
3198
+ return false;
3199
+ }
3200
+ let result = false;
3201
+ while (remainingGroups.length > 0) {
3202
+ const group = remainingGroups.shift();
3203
+ const groupParamsConfig = group.typeConfig && typeof group.typeConfig === "object" && "childrenParams" in group.typeConfig && Array.isArray(group.typeConfig.childrenParams) ? group.typeConfig.childrenParams : [];
3204
+ const expectedParamsToFindFollowingGroup = new Set(groupParamsConfig);
3205
+ const groupStartIndex = properties.findIndex((param) => param.id === group.id);
3206
+ const groupItemsCount = expectedParamsToFindFollowingGroup.size;
3207
+ for (let i = groupStartIndex + 1; i <= groupStartIndex + groupItemsCount; i++) {
3208
+ const param = properties[i];
3209
+ if (!param) {
3210
+ continue;
3211
+ }
3212
+ if (expectedParamsToFindFollowingGroup.has(param.id)) {
3213
+ expectedParamsToFindFollowingGroup.delete(param.id);
3214
+ } else {
3215
+ break;
3216
+ }
3217
+ }
3218
+ if (expectedParamsToFindFollowingGroup.size > 0) {
3219
+ const paramsToMove = Array.from(expectedParamsToFindFollowingGroup);
3220
+ let leadingGroupIndex = groupStartIndex + groupItemsCount - expectedParamsToFindFollowingGroup.size;
3221
+ for (const paramId of paramsToMove) {
3222
+ const paramIndex = properties.findIndex((param) => param.id === paramId);
3223
+ if (paramIndex !== -1) {
3224
+ const [param] = properties.splice(paramIndex, 1);
3225
+ if (paramIndex > leadingGroupIndex) {
3226
+ leadingGroupIndex++;
3227
+ }
3228
+ properties.splice(leadingGroupIndex, 0, param);
3229
+ } else {
3230
+ groupParamsConfig.splice(groupParamsConfig.indexOf(paramId), 1);
3231
+ }
3232
+ }
3233
+ result = true;
3234
+ }
3235
+ }
3236
+ return result;
3237
+ }
3238
+
3126
3239
  // src/utils/createApiEnhancer.ts
3127
3240
  var createUniformApiEnhancer = ({ apiUrl }) => {
3128
3241
  return async (message) => {
@@ -3252,7 +3365,8 @@ function mapSlotToTestVariations(slot) {
3252
3365
  return {
3253
3366
  ...v,
3254
3367
  id,
3255
- testDistribution: contextTag == null ? void 0 : contextTag.testDistribution
3368
+ testDistribution: contextTag == null ? void 0 : contextTag.testDistribution,
3369
+ control: contextTag == null ? void 0 : contextTag.control
3256
3370
  };
3257
3371
  });
3258
3372
  }
@@ -3417,12 +3531,12 @@ function handleRichTextNodeBinding(object, options) {
3417
3531
  import { ApiClientError as ApiClientError2 } from "@uniformdev/context/api";
3418
3532
 
3419
3533
  // src/.version.ts
3420
- var version = "20.31.0";
3534
+ var version = "20.39.1";
3421
3535
 
3422
3536
  // src/WorkflowClient.ts
3423
- import { ApiClient as ApiClient15 } from "@uniformdev/context/api";
3537
+ import { ApiClient as ApiClient16 } from "@uniformdev/context/api";
3424
3538
  var workflowsUrl = "/api/v1/workflows";
3425
- var WorkflowClient = class extends ApiClient15 {
3539
+ var WorkflowClient = class extends ApiClient16 {
3426
3540
  constructor(options) {
3427
3541
  super(options);
3428
3542
  }
@@ -3516,6 +3630,7 @@ export {
3516
3630
  IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
3517
3631
  IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
3518
3632
  IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
3633
+ IntegrationPropertyEditorsClient,
3519
3634
  LOCALE_DYNAMIC_INPUT_NAME,
3520
3635
  LocaleClient,
3521
3636
  PLACEHOLDER_ID,
@@ -3532,6 +3647,7 @@ export {
3532
3647
  UncachedContentClient,
3533
3648
  UniqueBatchEntries,
3534
3649
  WorkflowClient,
3650
+ autoFixParameterGroups,
3535
3651
  bindExpressionEscapeChars,
3536
3652
  bindExpressionPrefix,
3537
3653
  bindVariables,
@@ -3593,6 +3709,7 @@ export {
3593
3709
  isSuggestComponentMessage,
3594
3710
  isSystemComponentDefinition,
3595
3711
  isTriggerCompositionActionMessage,
3712
+ isUpdateAiActionsMessage,
3596
3713
  isUpdateComponentParameterMessage,
3597
3714
  isUpdateComponentReferencesMessage,
3598
3715
  isUpdateCompositionInternalMessage,
@@ -3603,6 +3720,7 @@ export {
3603
3720
  localize,
3604
3721
  mapSlotToPersonalizedVariations,
3605
3722
  mapSlotToTestVariations,
3723
+ mergeAssetConfigWithDefaults,
3606
3724
  nullLimitPolicy,
3607
3725
  parseComponentPlaceholderId,
3608
3726
  parseVariableExpression,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "20.7.1-alpha.79+3ce61f1051",
3
+ "version": "20.7.1-alpha.83+9085e999d1",
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.7.1-alpha.79+3ce61f1051",
45
- "@uniformdev/context": "20.7.1-alpha.79+3ce61f1051",
46
- "@uniformdev/richtext": "20.7.1-alpha.79+3ce61f1051",
44
+ "@uniformdev/assets": "20.7.1-alpha.83+9085e999d1",
45
+ "@uniformdev/context": "20.7.1-alpha.83+9085e999d1",
46
+ "@uniformdev/richtext": "20.7.1-alpha.83+9085e999d1",
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": "3ce61f1051baf775fa6a8b716fa554f93f9c3650"
55
+ "gitHead": "9085e999d1c99bc2d084085dc9983eb5df91f556"
56
56
  }