@uniformdev/canvas 20.6.2-alpha.11 → 20.7.1-alpha.102
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/LICENSE.txt +1 -1
- package/dist/index.d.mts +1873 -1165
- package/dist/index.d.ts +1873 -1165
- package/dist/index.esm.js +224 -50
- package/dist/index.js +234 -53
- package/dist/index.mjs +224 -50
- package/package.json +13 -10
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: () =>
|
|
400
|
+
ApiClientError: () => import_api18.ApiClientError,
|
|
401
401
|
BatchEntry: () => BatchEntry,
|
|
402
402
|
BlockFormatError: () => BlockFormatError,
|
|
403
403
|
CANVAS_BLOCK_PARAM_TYPE: () => CANVAS_BLOCK_PARAM_TYPE,
|
|
@@ -410,6 +410,7 @@ __export(src_exports, {
|
|
|
410
410
|
CANVAS_LOCALIZATION_SLOT: () => CANVAS_LOCALIZATION_SLOT,
|
|
411
411
|
CANVAS_LOCALIZATION_TYPE: () => CANVAS_LOCALIZATION_TYPE,
|
|
412
412
|
CANVAS_PERSONALIZATION_ALGORITHM_PARAM: () => CANVAS_PERSONALIZATION_ALGORITHM_PARAM,
|
|
413
|
+
CANVAS_PERSONALIZATION_ALGORITHM_TYPE: () => CANVAS_PERSONALIZATION_ALGORITHM_TYPE,
|
|
413
414
|
CANVAS_PERSONALIZATION_EVENT_NAME_PARAM: () => CANVAS_PERSONALIZATION_EVENT_NAME_PARAM,
|
|
414
415
|
CANVAS_PERSONALIZATION_PARAM: () => CANVAS_PERSONALIZATION_PARAM,
|
|
415
416
|
CANVAS_PERSONALIZATION_TAKE_PARAM: () => CANVAS_PERSONALIZATION_TAKE_PARAM,
|
|
@@ -448,10 +449,12 @@ __export(src_exports, {
|
|
|
448
449
|
IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM: () => IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
|
|
449
450
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM: () => IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
|
450
451
|
IS_RENDERED_BY_UNIFORM_ATTRIBUTE: () => IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
|
452
|
+
IntegrationPropertyEditorsClient: () => IntegrationPropertyEditorsClient,
|
|
451
453
|
LOCALE_DYNAMIC_INPUT_NAME: () => LOCALE_DYNAMIC_INPUT_NAME,
|
|
452
454
|
LocaleClient: () => LocaleClient,
|
|
453
455
|
PLACEHOLDER_ID: () => PLACEHOLDER_ID,
|
|
454
456
|
PreviewClient: () => PreviewClient,
|
|
457
|
+
ProjectClient: () => ProjectClient,
|
|
455
458
|
PromptClient: () => PromptClient,
|
|
456
459
|
RelationshipClient: () => RelationshipClient,
|
|
457
460
|
ReleaseClient: () => ReleaseClient,
|
|
@@ -463,6 +466,7 @@ __export(src_exports, {
|
|
|
463
466
|
UncachedContentClient: () => UncachedContentClient,
|
|
464
467
|
UniqueBatchEntries: () => UniqueBatchEntries,
|
|
465
468
|
WorkflowClient: () => WorkflowClient,
|
|
469
|
+
autoFixParameterGroups: () => autoFixParameterGroups,
|
|
466
470
|
bindExpressionEscapeChars: () => bindExpressionEscapeChars,
|
|
467
471
|
bindExpressionPrefix: () => bindExpressionPrefix,
|
|
468
472
|
bindVariables: () => bindVariables,
|
|
@@ -524,6 +528,7 @@ __export(src_exports, {
|
|
|
524
528
|
isSuggestComponentMessage: () => isSuggestComponentMessage,
|
|
525
529
|
isSystemComponentDefinition: () => isSystemComponentDefinition,
|
|
526
530
|
isTriggerCompositionActionMessage: () => isTriggerCompositionActionMessage,
|
|
531
|
+
isUpdateAiActionsMessage: () => isUpdateAiActionsMessage,
|
|
527
532
|
isUpdateComponentParameterMessage: () => isUpdateComponentParameterMessage,
|
|
528
533
|
isUpdateComponentReferencesMessage: () => isUpdateComponentReferencesMessage,
|
|
529
534
|
isUpdateCompositionInternalMessage: () => isUpdateCompositionInternalMessage,
|
|
@@ -534,9 +539,11 @@ __export(src_exports, {
|
|
|
534
539
|
localize: () => localize,
|
|
535
540
|
mapSlotToPersonalizedVariations: () => mapSlotToPersonalizedVariations,
|
|
536
541
|
mapSlotToTestVariations: () => mapSlotToTestVariations,
|
|
542
|
+
mergeAssetConfigWithDefaults: () => mergeAssetConfigWithDefaults,
|
|
537
543
|
nullLimitPolicy: () => nullLimitPolicy,
|
|
538
544
|
parseComponentPlaceholderId: () => parseComponentPlaceholderId,
|
|
539
545
|
parseVariableExpression: () => parseVariableExpression,
|
|
546
|
+
version: () => version,
|
|
540
547
|
walkNodeTree: () => walkNodeTree,
|
|
541
548
|
walkPropertyValues: () => walkPropertyValues
|
|
542
549
|
});
|
|
@@ -787,7 +794,7 @@ var CanvasClient = class extends import_api2.ApiClient {
|
|
|
787
794
|
const edgeParams = {
|
|
788
795
|
...originParams,
|
|
789
796
|
projectId,
|
|
790
|
-
|
|
797
|
+
diagnostics: typeof params.diagnostics === "boolean" ? params.diagnostics : params.diagnostics === "no-data" ? "no-data" : void 0,
|
|
791
798
|
...rewrittenFilters
|
|
792
799
|
};
|
|
793
800
|
const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
|
|
@@ -828,19 +835,25 @@ var CanvasClient = class extends import_api2.ApiClient {
|
|
|
828
835
|
const edgeParams = {
|
|
829
836
|
...params,
|
|
830
837
|
projectId,
|
|
831
|
-
|
|
838
|
+
diagnostics: typeof diagnostics === "boolean" ? diagnostics : diagnostics === "no-data" ? "no-data" : void 0
|
|
832
839
|
};
|
|
833
840
|
const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
|
|
834
841
|
return this.apiClient(edgeUrl, this.edgeApiRequestInit);
|
|
835
842
|
}
|
|
836
843
|
/** Updates or creates a Canvas component definition */
|
|
837
|
-
async updateComposition(body) {
|
|
844
|
+
async updateComposition(body, options) {
|
|
838
845
|
const fetchUri = this.createUrl(CANVAS_URL);
|
|
839
|
-
|
|
846
|
+
const headers = {};
|
|
847
|
+
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
848
|
+
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
849
|
+
}
|
|
850
|
+
const { response } = await this.apiClientWithResponse(fetchUri, {
|
|
840
851
|
method: "PUT",
|
|
841
852
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
842
|
-
expectNoContent: true
|
|
853
|
+
expectNoContent: true,
|
|
854
|
+
headers
|
|
843
855
|
});
|
|
856
|
+
return { modified: response.headers.get("x-modified-at") };
|
|
844
857
|
}
|
|
845
858
|
/** Deletes a Canvas component definition */
|
|
846
859
|
async removeComposition(body) {
|
|
@@ -978,13 +991,19 @@ var _ContentClient = class _ContentClient extends import_api4.ApiClient {
|
|
|
978
991
|
headers: opts.autogenerateDataTypes ? { "x-uniform-autogenerate-data-types": "true" } : {}
|
|
979
992
|
});
|
|
980
993
|
}
|
|
981
|
-
async upsertEntry(body) {
|
|
994
|
+
async upsertEntry(body, options) {
|
|
982
995
|
const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
|
|
983
|
-
|
|
996
|
+
const headers = {};
|
|
997
|
+
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
998
|
+
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
999
|
+
}
|
|
1000
|
+
const { response } = await this.apiClientWithResponse(fetchUri, {
|
|
984
1001
|
method: "PUT",
|
|
985
1002
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
986
|
-
expectNoContent: true
|
|
1003
|
+
expectNoContent: true,
|
|
1004
|
+
headers
|
|
987
1005
|
});
|
|
1006
|
+
return { modified: response.headers.get("x-modified-at") };
|
|
988
1007
|
}
|
|
989
1008
|
async deleteContentType(body) {
|
|
990
1009
|
const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
|
|
@@ -1008,7 +1027,7 @@ var _ContentClient = class _ContentClient extends import_api4.ApiClient {
|
|
|
1008
1027
|
return {
|
|
1009
1028
|
projectId,
|
|
1010
1029
|
...params,
|
|
1011
|
-
diagnostics:
|
|
1030
|
+
diagnostics: typeof options.diagnostics === "boolean" ? options.diagnostics : options.diagnostics === "no-data" ? "no-data" : void 0
|
|
1012
1031
|
};
|
|
1013
1032
|
}
|
|
1014
1033
|
};
|
|
@@ -1238,6 +1257,7 @@ var CANVAS_EDITOR_STATE = 63;
|
|
|
1238
1257
|
var CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
|
|
1239
1258
|
var CANVAS_PERSONALIZATION_EVENT_NAME_PARAM = "trackingEventName";
|
|
1240
1259
|
var CANVAS_PERSONALIZATION_ALGORITHM_PARAM = "algorithm";
|
|
1260
|
+
var CANVAS_PERSONALIZATION_ALGORITHM_TYPE = "pzAlgorithm";
|
|
1241
1261
|
var CANVAS_PERSONALIZATION_TAKE_PARAM = "count";
|
|
1242
1262
|
var CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
|
|
1243
1263
|
var CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
|
|
@@ -2253,15 +2273,19 @@ function evaluateNodeVisibility({
|
|
|
2253
2273
|
function evaluateWalkTreeNodeVisibility({
|
|
2254
2274
|
rules,
|
|
2255
2275
|
showIndeterminate,
|
|
2276
|
+
rootNodeInvisibleHandling = "throw",
|
|
2256
2277
|
context
|
|
2257
2278
|
}) {
|
|
2258
|
-
const { type, node, actions } = context;
|
|
2279
|
+
const { type, node, actions, ancestorsAndSelf } = context;
|
|
2259
2280
|
if (type !== "component") {
|
|
2260
2281
|
return;
|
|
2261
2282
|
}
|
|
2262
2283
|
const result = evaluateNodeVisibility({ node, rules, simplifyCriteria: true });
|
|
2263
2284
|
if (result === null && !showIndeterminate || result === false) {
|
|
2264
|
-
|
|
2285
|
+
if (ancestorsAndSelf.length === 1 && rootNodeInvisibleHandling === "ignore") {
|
|
2286
|
+
} else {
|
|
2287
|
+
actions.remove();
|
|
2288
|
+
}
|
|
2265
2289
|
return false;
|
|
2266
2290
|
}
|
|
2267
2291
|
return true;
|
|
@@ -2497,25 +2521,24 @@ function extractLocales({ component }) {
|
|
|
2497
2521
|
function localize(options) {
|
|
2498
2522
|
const nodes = options.nodes;
|
|
2499
2523
|
const locale = options.locale;
|
|
2500
|
-
|
|
2501
|
-
|
|
2524
|
+
if (!locale) {
|
|
2525
|
+
return;
|
|
2526
|
+
}
|
|
2527
|
+
const vizControlLocaleRule = createLocaleVisibilityRule(locale);
|
|
2502
2528
|
walkNodeTree(nodes, (context) => {
|
|
2503
2529
|
const { type, node, actions } = context;
|
|
2504
2530
|
if (type !== "component") {
|
|
2505
|
-
|
|
2506
|
-
localizeProperties(node, locale, vizControlLocaleRule);
|
|
2507
|
-
}
|
|
2531
|
+
localizeProperties(node, locale, vizControlLocaleRule);
|
|
2508
2532
|
return;
|
|
2509
2533
|
}
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
}
|
|
2534
|
+
const result = evaluateWalkTreeNodeVisibility({
|
|
2535
|
+
context,
|
|
2536
|
+
rules: vizControlLocaleRule,
|
|
2537
|
+
showIndeterminate: true,
|
|
2538
|
+
rootNodeInvisibleHandling: "ignore"
|
|
2539
|
+
});
|
|
2540
|
+
if (!result) {
|
|
2541
|
+
return;
|
|
2519
2542
|
}
|
|
2520
2543
|
if (node.type === CANVAS_LOCALIZATION_TYPE) {
|
|
2521
2544
|
const locales = extractLocales({ component: node });
|
|
@@ -2526,9 +2549,7 @@ function localize(options) {
|
|
|
2526
2549
|
if (replaceComponent == null ? void 0 : replaceComponent.length) {
|
|
2527
2550
|
replaceComponent.forEach((component) => {
|
|
2528
2551
|
removeLocaleProperty(component);
|
|
2529
|
-
|
|
2530
|
-
localizeProperties(component, locale, vizControlLocaleRule);
|
|
2531
|
-
}
|
|
2552
|
+
localizeProperties(component, locale, vizControlLocaleRule);
|
|
2532
2553
|
});
|
|
2533
2554
|
const [first, ...rest] = replaceComponent;
|
|
2534
2555
|
actions.replace(first);
|
|
@@ -2538,7 +2559,7 @@ function localize(options) {
|
|
|
2538
2559
|
} else {
|
|
2539
2560
|
actions.remove();
|
|
2540
2561
|
}
|
|
2541
|
-
} else
|
|
2562
|
+
} else {
|
|
2542
2563
|
localizeProperties(node, locale, vizControlLocaleRule);
|
|
2543
2564
|
}
|
|
2544
2565
|
});
|
|
@@ -2662,10 +2683,55 @@ var EntityReleasesClient = class extends import_api7.ApiClient {
|
|
|
2662
2683
|
}
|
|
2663
2684
|
};
|
|
2664
2685
|
|
|
2665
|
-
// src/
|
|
2686
|
+
// src/IntegrationPropertyEditorsClient.ts
|
|
2666
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");
|
|
2667
2733
|
var localesUrl = "/api/v1/locales";
|
|
2668
|
-
var LocaleClient = class extends
|
|
2734
|
+
var LocaleClient = class extends import_api9.ApiClient {
|
|
2669
2735
|
constructor(options) {
|
|
2670
2736
|
super(options);
|
|
2671
2737
|
}
|
|
@@ -2750,6 +2816,9 @@ var isUpdatePreviewSettingsMessage = (message) => {
|
|
|
2750
2816
|
var isUpdateFeatureFlagsMessage = (message) => {
|
|
2751
2817
|
return message.type === "update-feature-flags";
|
|
2752
2818
|
};
|
|
2819
|
+
var isUpdateAiActionsMessage = (message) => {
|
|
2820
|
+
return message.type === "update-ai-actions";
|
|
2821
|
+
};
|
|
2753
2822
|
var isUpdateContextualEditingStateInternalMessage = (message) => {
|
|
2754
2823
|
return message.type === "update-contextual-editing-state-internal";
|
|
2755
2824
|
};
|
|
@@ -2798,17 +2867,19 @@ var createCanvasChannel = ({
|
|
|
2798
2867
|
postMessage(message);
|
|
2799
2868
|
};
|
|
2800
2869
|
const ready = (options) => {
|
|
2801
|
-
var _a, _b;
|
|
2870
|
+
var _a, _b, _c;
|
|
2802
2871
|
if (typeof window === "undefined") {
|
|
2803
2872
|
return;
|
|
2804
2873
|
}
|
|
2805
2874
|
const framework = (_a = window.__UNIFORM_CONTEXTUAL_EDITING__) == null ? void 0 : _a.framework;
|
|
2806
|
-
const
|
|
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;
|
|
2807
2877
|
const message = {
|
|
2808
2878
|
type: "ready",
|
|
2809
2879
|
framework,
|
|
2810
|
-
version,
|
|
2811
|
-
rsc: options == null ? void 0 : options.rsc
|
|
2880
|
+
version: version2,
|
|
2881
|
+
rsc: options == null ? void 0 : options.rsc,
|
|
2882
|
+
canvasPackageVersion
|
|
2812
2883
|
};
|
|
2813
2884
|
postMessage(message);
|
|
2814
2885
|
};
|
|
@@ -2968,6 +3039,13 @@ var createCanvasChannel = ({
|
|
|
2968
3039
|
};
|
|
2969
3040
|
postMessage(message);
|
|
2970
3041
|
};
|
|
3042
|
+
const updateAiActions = (options) => {
|
|
3043
|
+
const message = {
|
|
3044
|
+
...options,
|
|
3045
|
+
type: "update-ai-actions"
|
|
3046
|
+
};
|
|
3047
|
+
postMessage(message);
|
|
3048
|
+
};
|
|
2971
3049
|
const contextStorageUpdated = (options) => {
|
|
2972
3050
|
const message = {
|
|
2973
3051
|
...options,
|
|
@@ -3017,6 +3095,7 @@ var createCanvasChannel = ({
|
|
|
3017
3095
|
triggerCompositionAction,
|
|
3018
3096
|
updatePreviewSettings,
|
|
3019
3097
|
updateFeatureFlags,
|
|
3098
|
+
updateAiActions,
|
|
3020
3099
|
updateContextualEditingStateInternal,
|
|
3021
3100
|
selectParameter,
|
|
3022
3101
|
openParameterEditor,
|
|
@@ -3032,10 +3111,10 @@ var createCanvasChannel = ({
|
|
|
3032
3111
|
};
|
|
3033
3112
|
|
|
3034
3113
|
// src/PreviewClient.ts
|
|
3035
|
-
var
|
|
3114
|
+
var import_api10 = require("@uniformdev/context/api");
|
|
3036
3115
|
var previewUrlsUrl = "/api/v1/preview-urls";
|
|
3037
3116
|
var previewViewportsUrl = "/api/v1/preview-viewports";
|
|
3038
|
-
var PreviewClient = class extends
|
|
3117
|
+
var PreviewClient = class extends import_api10.ApiClient {
|
|
3039
3118
|
constructor(options) {
|
|
3040
3119
|
super(options);
|
|
3041
3120
|
}
|
|
@@ -3097,10 +3176,44 @@ var PreviewClient = class extends import_api9.ApiClient {
|
|
|
3097
3176
|
}
|
|
3098
3177
|
};
|
|
3099
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
|
+
|
|
3100
3213
|
// src/PromptClient.ts
|
|
3101
|
-
var
|
|
3214
|
+
var import_api12 = require("@uniformdev/context/api");
|
|
3102
3215
|
var PromptsUrl = "/api/v1/prompts";
|
|
3103
|
-
var PromptClient = class extends
|
|
3216
|
+
var PromptClient = class extends import_api12.ApiClient {
|
|
3104
3217
|
constructor(options) {
|
|
3105
3218
|
super(options);
|
|
3106
3219
|
}
|
|
@@ -3131,9 +3244,9 @@ var PromptClient = class extends import_api10.ApiClient {
|
|
|
3131
3244
|
};
|
|
3132
3245
|
|
|
3133
3246
|
// src/RelationshipClient.ts
|
|
3134
|
-
var
|
|
3247
|
+
var import_api13 = require("@uniformdev/context/api");
|
|
3135
3248
|
var RELATIONSHIPS_URL = "/api/v1/relationships";
|
|
3136
|
-
var RelationshipClient = class extends
|
|
3249
|
+
var RelationshipClient = class extends import_api13.ApiClient {
|
|
3137
3250
|
constructor(options) {
|
|
3138
3251
|
super(options);
|
|
3139
3252
|
this.get = async (options) => {
|
|
@@ -3145,9 +3258,9 @@ var RelationshipClient = class extends import_api11.ApiClient {
|
|
|
3145
3258
|
};
|
|
3146
3259
|
|
|
3147
3260
|
// src/ReleaseClient.ts
|
|
3148
|
-
var
|
|
3261
|
+
var import_api14 = require("@uniformdev/context/api");
|
|
3149
3262
|
var releasesUrl = "/api/v1/releases";
|
|
3150
|
-
var ReleaseClient = class extends
|
|
3263
|
+
var ReleaseClient = class extends import_api14.ApiClient {
|
|
3151
3264
|
constructor(options) {
|
|
3152
3265
|
super(options);
|
|
3153
3266
|
}
|
|
@@ -3187,9 +3300,9 @@ var ReleaseClient = class extends import_api12.ApiClient {
|
|
|
3187
3300
|
};
|
|
3188
3301
|
|
|
3189
3302
|
// src/ReleaseContentsClient.ts
|
|
3190
|
-
var
|
|
3303
|
+
var import_api15 = require("@uniformdev/context/api");
|
|
3191
3304
|
var releaseContentsUrl2 = "/api/v1/release-contents";
|
|
3192
|
-
var ReleaseContentsClient = class extends
|
|
3305
|
+
var ReleaseContentsClient = class extends import_api15.ApiClient {
|
|
3193
3306
|
constructor(options) {
|
|
3194
3307
|
super(options);
|
|
3195
3308
|
}
|
|
@@ -3211,9 +3324,9 @@ var ReleaseContentsClient = class extends import_api13.ApiClient {
|
|
|
3211
3324
|
};
|
|
3212
3325
|
|
|
3213
3326
|
// src/RouteClient.ts
|
|
3214
|
-
var
|
|
3327
|
+
var import_api16 = require("@uniformdev/context/api");
|
|
3215
3328
|
var ROUTE_URL = "/api/v1/route";
|
|
3216
|
-
var RouteClient = class extends
|
|
3329
|
+
var RouteClient = class extends import_api16.ApiClient {
|
|
3217
3330
|
constructor(options) {
|
|
3218
3331
|
var _a;
|
|
3219
3332
|
if (!options.limitPolicy) {
|
|
@@ -3236,6 +3349,63 @@ var RouteClient = class extends import_api14.ApiClient {
|
|
|
3236
3349
|
// src/types/locales.ts
|
|
3237
3350
|
var LOCALE_DYNAMIC_INPUT_NAME = "locale";
|
|
3238
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
|
+
|
|
3239
3409
|
// src/utils/createApiEnhancer.ts
|
|
3240
3410
|
var createUniformApiEnhancer = ({ apiUrl }) => {
|
|
3241
3411
|
return async (message) => {
|
|
@@ -3365,7 +3535,8 @@ function mapSlotToTestVariations(slot) {
|
|
|
3365
3535
|
return {
|
|
3366
3536
|
...v,
|
|
3367
3537
|
id,
|
|
3368
|
-
testDistribution: contextTag == null ? void 0 : contextTag.testDistribution
|
|
3538
|
+
testDistribution: contextTag == null ? void 0 : contextTag.testDistribution,
|
|
3539
|
+
control: contextTag == null ? void 0 : contextTag.control
|
|
3369
3540
|
};
|
|
3370
3541
|
});
|
|
3371
3542
|
}
|
|
@@ -3527,12 +3698,15 @@ function handleRichTextNodeBinding(object, options) {
|
|
|
3527
3698
|
}
|
|
3528
3699
|
|
|
3529
3700
|
// src/index.ts
|
|
3530
|
-
var
|
|
3701
|
+
var import_api18 = require("@uniformdev/context/api");
|
|
3702
|
+
|
|
3703
|
+
// src/.version.ts
|
|
3704
|
+
var version = "20.43.0";
|
|
3531
3705
|
|
|
3532
3706
|
// src/WorkflowClient.ts
|
|
3533
|
-
var
|
|
3707
|
+
var import_api17 = require("@uniformdev/context/api");
|
|
3534
3708
|
var workflowsUrl = "/api/v1/workflows";
|
|
3535
|
-
var WorkflowClient = class extends
|
|
3709
|
+
var WorkflowClient = class extends import_api17.ApiClient {
|
|
3536
3710
|
constructor(options) {
|
|
3537
3711
|
super(options);
|
|
3538
3712
|
}
|
|
@@ -3563,7 +3737,7 @@ var WorkflowClient = class extends import_api15.ApiClient {
|
|
|
3563
3737
|
};
|
|
3564
3738
|
|
|
3565
3739
|
// src/index.ts
|
|
3566
|
-
var CanvasClientError =
|
|
3740
|
+
var CanvasClientError = import_api18.ApiClientError;
|
|
3567
3741
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3568
3742
|
0 && (module.exports = {
|
|
3569
3743
|
ASSETS_SOURCE_CUSTOM_URL,
|
|
@@ -3588,6 +3762,7 @@ var CanvasClientError = import_api16.ApiClientError;
|
|
|
3588
3762
|
CANVAS_LOCALIZATION_SLOT,
|
|
3589
3763
|
CANVAS_LOCALIZATION_TYPE,
|
|
3590
3764
|
CANVAS_PERSONALIZATION_ALGORITHM_PARAM,
|
|
3765
|
+
CANVAS_PERSONALIZATION_ALGORITHM_TYPE,
|
|
3591
3766
|
CANVAS_PERSONALIZATION_EVENT_NAME_PARAM,
|
|
3592
3767
|
CANVAS_PERSONALIZATION_PARAM,
|
|
3593
3768
|
CANVAS_PERSONALIZATION_TAKE_PARAM,
|
|
@@ -3626,10 +3801,12 @@ var CanvasClientError = import_api16.ApiClientError;
|
|
|
3626
3801
|
IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
|
|
3627
3802
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
|
3628
3803
|
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
|
3804
|
+
IntegrationPropertyEditorsClient,
|
|
3629
3805
|
LOCALE_DYNAMIC_INPUT_NAME,
|
|
3630
3806
|
LocaleClient,
|
|
3631
3807
|
PLACEHOLDER_ID,
|
|
3632
3808
|
PreviewClient,
|
|
3809
|
+
ProjectClient,
|
|
3633
3810
|
PromptClient,
|
|
3634
3811
|
RelationshipClient,
|
|
3635
3812
|
ReleaseClient,
|
|
@@ -3641,6 +3818,7 @@ var CanvasClientError = import_api16.ApiClientError;
|
|
|
3641
3818
|
UncachedContentClient,
|
|
3642
3819
|
UniqueBatchEntries,
|
|
3643
3820
|
WorkflowClient,
|
|
3821
|
+
autoFixParameterGroups,
|
|
3644
3822
|
bindExpressionEscapeChars,
|
|
3645
3823
|
bindExpressionPrefix,
|
|
3646
3824
|
bindVariables,
|
|
@@ -3702,6 +3880,7 @@ var CanvasClientError = import_api16.ApiClientError;
|
|
|
3702
3880
|
isSuggestComponentMessage,
|
|
3703
3881
|
isSystemComponentDefinition,
|
|
3704
3882
|
isTriggerCompositionActionMessage,
|
|
3883
|
+
isUpdateAiActionsMessage,
|
|
3705
3884
|
isUpdateComponentParameterMessage,
|
|
3706
3885
|
isUpdateComponentReferencesMessage,
|
|
3707
3886
|
isUpdateCompositionInternalMessage,
|
|
@@ -3712,9 +3891,11 @@ var CanvasClientError = import_api16.ApiClientError;
|
|
|
3712
3891
|
localize,
|
|
3713
3892
|
mapSlotToPersonalizedVariations,
|
|
3714
3893
|
mapSlotToTestVariations,
|
|
3894
|
+
mergeAssetConfigWithDefaults,
|
|
3715
3895
|
nullLimitPolicy,
|
|
3716
3896
|
parseComponentPlaceholderId,
|
|
3717
3897
|
parseVariableExpression,
|
|
3898
|
+
version,
|
|
3718
3899
|
walkNodeTree,
|
|
3719
3900
|
walkPropertyValues
|
|
3720
3901
|
});
|