@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.esm.js
CHANGED
|
@@ -624,7 +624,7 @@ var CanvasClient = class extends ApiClient {
|
|
|
624
624
|
const edgeParams = {
|
|
625
625
|
...originParams,
|
|
626
626
|
projectId,
|
|
627
|
-
|
|
627
|
+
diagnostics: typeof params.diagnostics === "boolean" ? params.diagnostics : params.diagnostics === "no-data" ? "no-data" : void 0,
|
|
628
628
|
...rewrittenFilters
|
|
629
629
|
};
|
|
630
630
|
const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
|
|
@@ -665,19 +665,25 @@ var CanvasClient = class extends ApiClient {
|
|
|
665
665
|
const edgeParams = {
|
|
666
666
|
...params,
|
|
667
667
|
projectId,
|
|
668
|
-
|
|
668
|
+
diagnostics: typeof diagnostics === "boolean" ? diagnostics : diagnostics === "no-data" ? "no-data" : void 0
|
|
669
669
|
};
|
|
670
670
|
const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
|
|
671
671
|
return this.apiClient(edgeUrl, this.edgeApiRequestInit);
|
|
672
672
|
}
|
|
673
673
|
/** Updates or creates a Canvas component definition */
|
|
674
|
-
async updateComposition(body) {
|
|
674
|
+
async updateComposition(body, options) {
|
|
675
675
|
const fetchUri = this.createUrl(CANVAS_URL);
|
|
676
|
-
|
|
676
|
+
const headers = {};
|
|
677
|
+
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
678
|
+
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
679
|
+
}
|
|
680
|
+
const { response } = await this.apiClientWithResponse(fetchUri, {
|
|
677
681
|
method: "PUT",
|
|
678
682
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
679
|
-
expectNoContent: true
|
|
683
|
+
expectNoContent: true,
|
|
684
|
+
headers
|
|
680
685
|
});
|
|
686
|
+
return { modified: response.headers.get("x-modified-at") };
|
|
681
687
|
}
|
|
682
688
|
/** Deletes a Canvas component definition */
|
|
683
689
|
async removeComposition(body) {
|
|
@@ -815,13 +821,19 @@ var _ContentClient = class _ContentClient extends ApiClient3 {
|
|
|
815
821
|
headers: opts.autogenerateDataTypes ? { "x-uniform-autogenerate-data-types": "true" } : {}
|
|
816
822
|
});
|
|
817
823
|
}
|
|
818
|
-
async upsertEntry(body) {
|
|
824
|
+
async upsertEntry(body, options) {
|
|
819
825
|
const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
|
|
820
|
-
|
|
826
|
+
const headers = {};
|
|
827
|
+
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
828
|
+
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
829
|
+
}
|
|
830
|
+
const { response } = await this.apiClientWithResponse(fetchUri, {
|
|
821
831
|
method: "PUT",
|
|
822
832
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
823
|
-
expectNoContent: true
|
|
833
|
+
expectNoContent: true,
|
|
834
|
+
headers
|
|
824
835
|
});
|
|
836
|
+
return { modified: response.headers.get("x-modified-at") };
|
|
825
837
|
}
|
|
826
838
|
async deleteContentType(body) {
|
|
827
839
|
const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
|
|
@@ -845,7 +857,7 @@ var _ContentClient = class _ContentClient extends ApiClient3 {
|
|
|
845
857
|
return {
|
|
846
858
|
projectId,
|
|
847
859
|
...params,
|
|
848
|
-
diagnostics:
|
|
860
|
+
diagnostics: typeof options.diagnostics === "boolean" ? options.diagnostics : options.diagnostics === "no-data" ? "no-data" : void 0
|
|
849
861
|
};
|
|
850
862
|
}
|
|
851
863
|
};
|
|
@@ -1075,6 +1087,7 @@ var CANVAS_EDITOR_STATE = 63;
|
|
|
1075
1087
|
var CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
|
|
1076
1088
|
var CANVAS_PERSONALIZATION_EVENT_NAME_PARAM = "trackingEventName";
|
|
1077
1089
|
var CANVAS_PERSONALIZATION_ALGORITHM_PARAM = "algorithm";
|
|
1090
|
+
var CANVAS_PERSONALIZATION_ALGORITHM_TYPE = "pzAlgorithm";
|
|
1078
1091
|
var CANVAS_PERSONALIZATION_TAKE_PARAM = "count";
|
|
1079
1092
|
var CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
|
|
1080
1093
|
var CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
|
|
@@ -2090,15 +2103,19 @@ function evaluateNodeVisibility({
|
|
|
2090
2103
|
function evaluateWalkTreeNodeVisibility({
|
|
2091
2104
|
rules,
|
|
2092
2105
|
showIndeterminate,
|
|
2106
|
+
rootNodeInvisibleHandling = "throw",
|
|
2093
2107
|
context
|
|
2094
2108
|
}) {
|
|
2095
|
-
const { type, node, actions } = context;
|
|
2109
|
+
const { type, node, actions, ancestorsAndSelf } = context;
|
|
2096
2110
|
if (type !== "component") {
|
|
2097
2111
|
return;
|
|
2098
2112
|
}
|
|
2099
2113
|
const result = evaluateNodeVisibility({ node, rules, simplifyCriteria: true });
|
|
2100
2114
|
if (result === null && !showIndeterminate || result === false) {
|
|
2101
|
-
|
|
2115
|
+
if (ancestorsAndSelf.length === 1 && rootNodeInvisibleHandling === "ignore") {
|
|
2116
|
+
} else {
|
|
2117
|
+
actions.remove();
|
|
2118
|
+
}
|
|
2102
2119
|
return false;
|
|
2103
2120
|
}
|
|
2104
2121
|
return true;
|
|
@@ -2334,25 +2351,24 @@ function extractLocales({ component }) {
|
|
|
2334
2351
|
function localize(options) {
|
|
2335
2352
|
const nodes = options.nodes;
|
|
2336
2353
|
const locale = options.locale;
|
|
2337
|
-
|
|
2338
|
-
|
|
2354
|
+
if (!locale) {
|
|
2355
|
+
return;
|
|
2356
|
+
}
|
|
2357
|
+
const vizControlLocaleRule = createLocaleVisibilityRule(locale);
|
|
2339
2358
|
walkNodeTree(nodes, (context) => {
|
|
2340
2359
|
const { type, node, actions } = context;
|
|
2341
2360
|
if (type !== "component") {
|
|
2342
|
-
|
|
2343
|
-
localizeProperties(node, locale, vizControlLocaleRule);
|
|
2344
|
-
}
|
|
2361
|
+
localizeProperties(node, locale, vizControlLocaleRule);
|
|
2345
2362
|
return;
|
|
2346
2363
|
}
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
}
|
|
2364
|
+
const result = evaluateWalkTreeNodeVisibility({
|
|
2365
|
+
context,
|
|
2366
|
+
rules: vizControlLocaleRule,
|
|
2367
|
+
showIndeterminate: true,
|
|
2368
|
+
rootNodeInvisibleHandling: "ignore"
|
|
2369
|
+
});
|
|
2370
|
+
if (!result) {
|
|
2371
|
+
return;
|
|
2356
2372
|
}
|
|
2357
2373
|
if (node.type === CANVAS_LOCALIZATION_TYPE) {
|
|
2358
2374
|
const locales = extractLocales({ component: node });
|
|
@@ -2363,9 +2379,7 @@ function localize(options) {
|
|
|
2363
2379
|
if (replaceComponent == null ? void 0 : replaceComponent.length) {
|
|
2364
2380
|
replaceComponent.forEach((component) => {
|
|
2365
2381
|
removeLocaleProperty(component);
|
|
2366
|
-
|
|
2367
|
-
localizeProperties(component, locale, vizControlLocaleRule);
|
|
2368
|
-
}
|
|
2382
|
+
localizeProperties(component, locale, vizControlLocaleRule);
|
|
2369
2383
|
});
|
|
2370
2384
|
const [first, ...rest] = replaceComponent;
|
|
2371
2385
|
actions.replace(first);
|
|
@@ -2375,7 +2389,7 @@ function localize(options) {
|
|
|
2375
2389
|
} else {
|
|
2376
2390
|
actions.remove();
|
|
2377
2391
|
}
|
|
2378
|
-
} else
|
|
2392
|
+
} else {
|
|
2379
2393
|
localizeProperties(node, locale, vizControlLocaleRule);
|
|
2380
2394
|
}
|
|
2381
2395
|
});
|
|
@@ -2499,10 +2513,55 @@ var EntityReleasesClient = class extends ApiClient6 {
|
|
|
2499
2513
|
}
|
|
2500
2514
|
};
|
|
2501
2515
|
|
|
2502
|
-
// src/
|
|
2516
|
+
// src/IntegrationPropertyEditorsClient.ts
|
|
2503
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";
|
|
2504
2563
|
var localesUrl = "/api/v1/locales";
|
|
2505
|
-
var LocaleClient = class extends
|
|
2564
|
+
var LocaleClient = class extends ApiClient8 {
|
|
2506
2565
|
constructor(options) {
|
|
2507
2566
|
super(options);
|
|
2508
2567
|
}
|
|
@@ -2587,6 +2646,9 @@ var isUpdatePreviewSettingsMessage = (message) => {
|
|
|
2587
2646
|
var isUpdateFeatureFlagsMessage = (message) => {
|
|
2588
2647
|
return message.type === "update-feature-flags";
|
|
2589
2648
|
};
|
|
2649
|
+
var isUpdateAiActionsMessage = (message) => {
|
|
2650
|
+
return message.type === "update-ai-actions";
|
|
2651
|
+
};
|
|
2590
2652
|
var isUpdateContextualEditingStateInternalMessage = (message) => {
|
|
2591
2653
|
return message.type === "update-contextual-editing-state-internal";
|
|
2592
2654
|
};
|
|
@@ -2635,17 +2697,19 @@ var createCanvasChannel = ({
|
|
|
2635
2697
|
postMessage(message);
|
|
2636
2698
|
};
|
|
2637
2699
|
const ready = (options) => {
|
|
2638
|
-
var _a, _b;
|
|
2700
|
+
var _a, _b, _c;
|
|
2639
2701
|
if (typeof window === "undefined") {
|
|
2640
2702
|
return;
|
|
2641
2703
|
}
|
|
2642
2704
|
const framework = (_a = window.__UNIFORM_CONTEXTUAL_EDITING__) == null ? void 0 : _a.framework;
|
|
2643
|
-
const
|
|
2705
|
+
const version2 = (_b = window.__UNIFORM_CONTEXTUAL_EDITING__) == null ? void 0 : _b.version;
|
|
2706
|
+
const canvasPackageVersion = (_c = window.__UNIFORM_CONTEXTUAL_EDITING__) == null ? void 0 : _c.canvasPackageVersion;
|
|
2644
2707
|
const message = {
|
|
2645
2708
|
type: "ready",
|
|
2646
2709
|
framework,
|
|
2647
|
-
version,
|
|
2648
|
-
rsc: options == null ? void 0 : options.rsc
|
|
2710
|
+
version: version2,
|
|
2711
|
+
rsc: options == null ? void 0 : options.rsc,
|
|
2712
|
+
canvasPackageVersion
|
|
2649
2713
|
};
|
|
2650
2714
|
postMessage(message);
|
|
2651
2715
|
};
|
|
@@ -2805,6 +2869,13 @@ var createCanvasChannel = ({
|
|
|
2805
2869
|
};
|
|
2806
2870
|
postMessage(message);
|
|
2807
2871
|
};
|
|
2872
|
+
const updateAiActions = (options) => {
|
|
2873
|
+
const message = {
|
|
2874
|
+
...options,
|
|
2875
|
+
type: "update-ai-actions"
|
|
2876
|
+
};
|
|
2877
|
+
postMessage(message);
|
|
2878
|
+
};
|
|
2808
2879
|
const contextStorageUpdated = (options) => {
|
|
2809
2880
|
const message = {
|
|
2810
2881
|
...options,
|
|
@@ -2854,6 +2925,7 @@ var createCanvasChannel = ({
|
|
|
2854
2925
|
triggerCompositionAction,
|
|
2855
2926
|
updatePreviewSettings,
|
|
2856
2927
|
updateFeatureFlags,
|
|
2928
|
+
updateAiActions,
|
|
2857
2929
|
updateContextualEditingStateInternal,
|
|
2858
2930
|
selectParameter,
|
|
2859
2931
|
openParameterEditor,
|
|
@@ -2869,10 +2941,10 @@ var createCanvasChannel = ({
|
|
|
2869
2941
|
};
|
|
2870
2942
|
|
|
2871
2943
|
// src/PreviewClient.ts
|
|
2872
|
-
import { ApiClient as
|
|
2944
|
+
import { ApiClient as ApiClient9 } from "@uniformdev/context/api";
|
|
2873
2945
|
var previewUrlsUrl = "/api/v1/preview-urls";
|
|
2874
2946
|
var previewViewportsUrl = "/api/v1/preview-viewports";
|
|
2875
|
-
var PreviewClient = class extends
|
|
2947
|
+
var PreviewClient = class extends ApiClient9 {
|
|
2876
2948
|
constructor(options) {
|
|
2877
2949
|
super(options);
|
|
2878
2950
|
}
|
|
@@ -2934,10 +3006,44 @@ var PreviewClient = class extends ApiClient8 {
|
|
|
2934
3006
|
}
|
|
2935
3007
|
};
|
|
2936
3008
|
|
|
3009
|
+
// src/ProjectClient.ts
|
|
3010
|
+
import { ApiClient as ApiClient10 } from "@uniformdev/context/api";
|
|
3011
|
+
var _url2;
|
|
3012
|
+
var _ProjectClient = class _ProjectClient extends ApiClient10 {
|
|
3013
|
+
constructor(options) {
|
|
3014
|
+
super({ ...options, bypassCache: true });
|
|
3015
|
+
}
|
|
3016
|
+
/** Fetches single Project */
|
|
3017
|
+
async get(options) {
|
|
3018
|
+
const fetchUri = this.createUrl(__privateGet(_ProjectClient, _url2), { ...options });
|
|
3019
|
+
return await this.apiClient(fetchUri);
|
|
3020
|
+
}
|
|
3021
|
+
/** Updates or creates (based on id) a Project */
|
|
3022
|
+
async upsert(body) {
|
|
3023
|
+
const fetchUri = this.createUrl(__privateGet(_ProjectClient, _url2));
|
|
3024
|
+
return await this.apiClient(fetchUri, {
|
|
3025
|
+
method: "PUT",
|
|
3026
|
+
body: JSON.stringify({ ...body })
|
|
3027
|
+
});
|
|
3028
|
+
}
|
|
3029
|
+
/** Deletes a Project */
|
|
3030
|
+
async delete(body) {
|
|
3031
|
+
const fetchUri = this.createUrl(__privateGet(_ProjectClient, _url2));
|
|
3032
|
+
await this.apiClient(fetchUri, {
|
|
3033
|
+
method: "DELETE",
|
|
3034
|
+
body: JSON.stringify({ ...body }),
|
|
3035
|
+
expectNoContent: true
|
|
3036
|
+
});
|
|
3037
|
+
}
|
|
3038
|
+
};
|
|
3039
|
+
_url2 = new WeakMap();
|
|
3040
|
+
__privateAdd(_ProjectClient, _url2, "/api/v1/project");
|
|
3041
|
+
var ProjectClient = _ProjectClient;
|
|
3042
|
+
|
|
2937
3043
|
// src/PromptClient.ts
|
|
2938
|
-
import { ApiClient as
|
|
3044
|
+
import { ApiClient as ApiClient11 } from "@uniformdev/context/api";
|
|
2939
3045
|
var PromptsUrl = "/api/v1/prompts";
|
|
2940
|
-
var PromptClient = class extends
|
|
3046
|
+
var PromptClient = class extends ApiClient11 {
|
|
2941
3047
|
constructor(options) {
|
|
2942
3048
|
super(options);
|
|
2943
3049
|
}
|
|
@@ -2968,9 +3074,9 @@ var PromptClient = class extends ApiClient9 {
|
|
|
2968
3074
|
};
|
|
2969
3075
|
|
|
2970
3076
|
// src/RelationshipClient.ts
|
|
2971
|
-
import { ApiClient as
|
|
3077
|
+
import { ApiClient as ApiClient12 } from "@uniformdev/context/api";
|
|
2972
3078
|
var RELATIONSHIPS_URL = "/api/v1/relationships";
|
|
2973
|
-
var RelationshipClient = class extends
|
|
3079
|
+
var RelationshipClient = class extends ApiClient12 {
|
|
2974
3080
|
constructor(options) {
|
|
2975
3081
|
super(options);
|
|
2976
3082
|
this.get = async (options) => {
|
|
@@ -2982,9 +3088,9 @@ var RelationshipClient = class extends ApiClient10 {
|
|
|
2982
3088
|
};
|
|
2983
3089
|
|
|
2984
3090
|
// src/ReleaseClient.ts
|
|
2985
|
-
import { ApiClient as
|
|
3091
|
+
import { ApiClient as ApiClient13 } from "@uniformdev/context/api";
|
|
2986
3092
|
var releasesUrl = "/api/v1/releases";
|
|
2987
|
-
var ReleaseClient = class extends
|
|
3093
|
+
var ReleaseClient = class extends ApiClient13 {
|
|
2988
3094
|
constructor(options) {
|
|
2989
3095
|
super(options);
|
|
2990
3096
|
}
|
|
@@ -3024,9 +3130,9 @@ var ReleaseClient = class extends ApiClient11 {
|
|
|
3024
3130
|
};
|
|
3025
3131
|
|
|
3026
3132
|
// src/ReleaseContentsClient.ts
|
|
3027
|
-
import { ApiClient as
|
|
3133
|
+
import { ApiClient as ApiClient14 } from "@uniformdev/context/api";
|
|
3028
3134
|
var releaseContentsUrl2 = "/api/v1/release-contents";
|
|
3029
|
-
var ReleaseContentsClient = class extends
|
|
3135
|
+
var ReleaseContentsClient = class extends ApiClient14 {
|
|
3030
3136
|
constructor(options) {
|
|
3031
3137
|
super(options);
|
|
3032
3138
|
}
|
|
@@ -3048,9 +3154,9 @@ var ReleaseContentsClient = class extends ApiClient12 {
|
|
|
3048
3154
|
};
|
|
3049
3155
|
|
|
3050
3156
|
// src/RouteClient.ts
|
|
3051
|
-
import { ApiClient as
|
|
3157
|
+
import { ApiClient as ApiClient15 } from "@uniformdev/context/api";
|
|
3052
3158
|
var ROUTE_URL = "/api/v1/route";
|
|
3053
|
-
var RouteClient = class extends
|
|
3159
|
+
var RouteClient = class extends ApiClient15 {
|
|
3054
3160
|
constructor(options) {
|
|
3055
3161
|
var _a;
|
|
3056
3162
|
if (!options.limitPolicy) {
|
|
@@ -3073,6 +3179,63 @@ var RouteClient = class extends ApiClient13 {
|
|
|
3073
3179
|
// src/types/locales.ts
|
|
3074
3180
|
var LOCALE_DYNAMIC_INPUT_NAME = "locale";
|
|
3075
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
|
+
|
|
3076
3239
|
// src/utils/createApiEnhancer.ts
|
|
3077
3240
|
var createUniformApiEnhancer = ({ apiUrl }) => {
|
|
3078
3241
|
return async (message) => {
|
|
@@ -3202,7 +3365,8 @@ function mapSlotToTestVariations(slot) {
|
|
|
3202
3365
|
return {
|
|
3203
3366
|
...v,
|
|
3204
3367
|
id,
|
|
3205
|
-
testDistribution: contextTag == null ? void 0 : contextTag.testDistribution
|
|
3368
|
+
testDistribution: contextTag == null ? void 0 : contextTag.testDistribution,
|
|
3369
|
+
control: contextTag == null ? void 0 : contextTag.control
|
|
3206
3370
|
};
|
|
3207
3371
|
});
|
|
3208
3372
|
}
|
|
@@ -3366,10 +3530,13 @@ function handleRichTextNodeBinding(object, options) {
|
|
|
3366
3530
|
// src/index.ts
|
|
3367
3531
|
import { ApiClientError as ApiClientError2 } from "@uniformdev/context/api";
|
|
3368
3532
|
|
|
3533
|
+
// src/.version.ts
|
|
3534
|
+
var version = "20.43.0";
|
|
3535
|
+
|
|
3369
3536
|
// src/WorkflowClient.ts
|
|
3370
|
-
import { ApiClient as
|
|
3537
|
+
import { ApiClient as ApiClient16 } from "@uniformdev/context/api";
|
|
3371
3538
|
var workflowsUrl = "/api/v1/workflows";
|
|
3372
|
-
var WorkflowClient = class extends
|
|
3539
|
+
var WorkflowClient = class extends ApiClient16 {
|
|
3373
3540
|
constructor(options) {
|
|
3374
3541
|
super(options);
|
|
3375
3542
|
}
|
|
@@ -3424,6 +3591,7 @@ export {
|
|
|
3424
3591
|
CANVAS_LOCALIZATION_SLOT,
|
|
3425
3592
|
CANVAS_LOCALIZATION_TYPE,
|
|
3426
3593
|
CANVAS_PERSONALIZATION_ALGORITHM_PARAM,
|
|
3594
|
+
CANVAS_PERSONALIZATION_ALGORITHM_TYPE,
|
|
3427
3595
|
CANVAS_PERSONALIZATION_EVENT_NAME_PARAM,
|
|
3428
3596
|
CANVAS_PERSONALIZATION_PARAM,
|
|
3429
3597
|
CANVAS_PERSONALIZATION_TAKE_PARAM,
|
|
@@ -3462,10 +3630,12 @@ export {
|
|
|
3462
3630
|
IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
|
|
3463
3631
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
|
3464
3632
|
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
|
3633
|
+
IntegrationPropertyEditorsClient,
|
|
3465
3634
|
LOCALE_DYNAMIC_INPUT_NAME,
|
|
3466
3635
|
LocaleClient,
|
|
3467
3636
|
PLACEHOLDER_ID,
|
|
3468
3637
|
PreviewClient,
|
|
3638
|
+
ProjectClient,
|
|
3469
3639
|
PromptClient,
|
|
3470
3640
|
RelationshipClient,
|
|
3471
3641
|
ReleaseClient,
|
|
@@ -3477,6 +3647,7 @@ export {
|
|
|
3477
3647
|
UncachedContentClient,
|
|
3478
3648
|
UniqueBatchEntries,
|
|
3479
3649
|
WorkflowClient,
|
|
3650
|
+
autoFixParameterGroups,
|
|
3480
3651
|
bindExpressionEscapeChars,
|
|
3481
3652
|
bindExpressionPrefix,
|
|
3482
3653
|
bindVariables,
|
|
@@ -3538,6 +3709,7 @@ export {
|
|
|
3538
3709
|
isSuggestComponentMessage,
|
|
3539
3710
|
isSystemComponentDefinition,
|
|
3540
3711
|
isTriggerCompositionActionMessage,
|
|
3712
|
+
isUpdateAiActionsMessage,
|
|
3541
3713
|
isUpdateComponentParameterMessage,
|
|
3542
3714
|
isUpdateComponentReferencesMessage,
|
|
3543
3715
|
isUpdateCompositionInternalMessage,
|
|
@@ -3548,9 +3720,11 @@ export {
|
|
|
3548
3720
|
localize,
|
|
3549
3721
|
mapSlotToPersonalizedVariations,
|
|
3550
3722
|
mapSlotToTestVariations,
|
|
3723
|
+
mergeAssetConfigWithDefaults,
|
|
3551
3724
|
nullLimitPolicy,
|
|
3552
3725
|
parseComponentPlaceholderId,
|
|
3553
3726
|
parseVariableExpression,
|
|
3727
|
+
version,
|
|
3554
3728
|
walkNodeTree,
|
|
3555
3729
|
walkPropertyValues
|
|
3556
3730
|
};
|