@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/LICENSE.txt +1 -1
- package/dist/index.d.mts +1878 -1168
- package/dist/index.d.ts +1878 -1168
- package/dist/index.esm.js +226 -48
- package/dist/index.js +239 -51
- package/dist/index.mjs +226 -48
- 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,18 +665,23 @@ 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
|
+
const headers = {};
|
|
677
|
+
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
678
|
+
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
679
|
+
}
|
|
676
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
|
});
|
|
681
686
|
return { modified: response.headers.get("x-modified-at") };
|
|
682
687
|
}
|
|
@@ -816,12 +821,17 @@ var _ContentClient = class _ContentClient extends ApiClient3 {
|
|
|
816
821
|
headers: opts.autogenerateDataTypes ? { "x-uniform-autogenerate-data-types": "true" } : {}
|
|
817
822
|
});
|
|
818
823
|
}
|
|
819
|
-
async upsertEntry(body) {
|
|
824
|
+
async upsertEntry(body, options) {
|
|
820
825
|
const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
|
|
826
|
+
const headers = {};
|
|
827
|
+
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
828
|
+
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
829
|
+
}
|
|
821
830
|
const { response } = await this.apiClientWithResponse(fetchUri, {
|
|
822
831
|
method: "PUT",
|
|
823
832
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
824
|
-
expectNoContent: true
|
|
833
|
+
expectNoContent: true,
|
|
834
|
+
headers
|
|
825
835
|
});
|
|
826
836
|
return { modified: response.headers.get("x-modified-at") };
|
|
827
837
|
}
|
|
@@ -847,7 +857,7 @@ var _ContentClient = class _ContentClient extends ApiClient3 {
|
|
|
847
857
|
return {
|
|
848
858
|
projectId,
|
|
849
859
|
...params,
|
|
850
|
-
diagnostics:
|
|
860
|
+
diagnostics: typeof options.diagnostics === "boolean" ? options.diagnostics : options.diagnostics === "no-data" ? "no-data" : void 0
|
|
851
861
|
};
|
|
852
862
|
}
|
|
853
863
|
};
|
|
@@ -1075,6 +1085,10 @@ var CANVAS_DRAFT_STATE = 0;
|
|
|
1075
1085
|
var CANVAS_PUBLISHED_STATE = 64;
|
|
1076
1086
|
var CANVAS_EDITOR_STATE = 63;
|
|
1077
1087
|
var CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
|
|
1088
|
+
var CANVAS_PERSONALIZATION_EVENT_NAME_PARAM = "trackingEventName";
|
|
1089
|
+
var CANVAS_PERSONALIZATION_ALGORITHM_PARAM = "algorithm";
|
|
1090
|
+
var CANVAS_PERSONALIZATION_ALGORITHM_TYPE = "pzAlgorithm";
|
|
1091
|
+
var CANVAS_PERSONALIZATION_TAKE_PARAM = "count";
|
|
1078
1092
|
var CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
|
|
1079
1093
|
var CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
|
|
1080
1094
|
var CANVAS_CONTEXTUAL_EDITING_PARAM = "$contextualEditing";
|
|
@@ -2089,15 +2103,19 @@ function evaluateNodeVisibility({
|
|
|
2089
2103
|
function evaluateWalkTreeNodeVisibility({
|
|
2090
2104
|
rules,
|
|
2091
2105
|
showIndeterminate,
|
|
2106
|
+
rootNodeInvisibleHandling = "throw",
|
|
2092
2107
|
context
|
|
2093
2108
|
}) {
|
|
2094
|
-
const { type, node, actions } = context;
|
|
2109
|
+
const { type, node, actions, ancestorsAndSelf } = context;
|
|
2095
2110
|
if (type !== "component") {
|
|
2096
2111
|
return;
|
|
2097
2112
|
}
|
|
2098
2113
|
const result = evaluateNodeVisibility({ node, rules, simplifyCriteria: true });
|
|
2099
2114
|
if (result === null && !showIndeterminate || result === false) {
|
|
2100
|
-
|
|
2115
|
+
if (ancestorsAndSelf.length === 1 && rootNodeInvisibleHandling === "ignore") {
|
|
2116
|
+
} else {
|
|
2117
|
+
actions.remove();
|
|
2118
|
+
}
|
|
2101
2119
|
return false;
|
|
2102
2120
|
}
|
|
2103
2121
|
return true;
|
|
@@ -2333,25 +2351,24 @@ function extractLocales({ component }) {
|
|
|
2333
2351
|
function localize(options) {
|
|
2334
2352
|
const nodes = options.nodes;
|
|
2335
2353
|
const locale = options.locale;
|
|
2336
|
-
|
|
2337
|
-
|
|
2354
|
+
if (!locale) {
|
|
2355
|
+
return;
|
|
2356
|
+
}
|
|
2357
|
+
const vizControlLocaleRule = createLocaleVisibilityRule(locale);
|
|
2338
2358
|
walkNodeTree(nodes, (context) => {
|
|
2339
2359
|
const { type, node, actions } = context;
|
|
2340
2360
|
if (type !== "component") {
|
|
2341
|
-
|
|
2342
|
-
localizeProperties(node, locale, vizControlLocaleRule);
|
|
2343
|
-
}
|
|
2361
|
+
localizeProperties(node, locale, vizControlLocaleRule);
|
|
2344
2362
|
return;
|
|
2345
2363
|
}
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
}
|
|
2364
|
+
const result = evaluateWalkTreeNodeVisibility({
|
|
2365
|
+
context,
|
|
2366
|
+
rules: vizControlLocaleRule,
|
|
2367
|
+
showIndeterminate: true,
|
|
2368
|
+
rootNodeInvisibleHandling: "ignore"
|
|
2369
|
+
});
|
|
2370
|
+
if (!result) {
|
|
2371
|
+
return;
|
|
2355
2372
|
}
|
|
2356
2373
|
if (node.type === CANVAS_LOCALIZATION_TYPE) {
|
|
2357
2374
|
const locales = extractLocales({ component: node });
|
|
@@ -2362,9 +2379,7 @@ function localize(options) {
|
|
|
2362
2379
|
if (replaceComponent == null ? void 0 : replaceComponent.length) {
|
|
2363
2380
|
replaceComponent.forEach((component) => {
|
|
2364
2381
|
removeLocaleProperty(component);
|
|
2365
|
-
|
|
2366
|
-
localizeProperties(component, locale, vizControlLocaleRule);
|
|
2367
|
-
}
|
|
2382
|
+
localizeProperties(component, locale, vizControlLocaleRule);
|
|
2368
2383
|
});
|
|
2369
2384
|
const [first, ...rest] = replaceComponent;
|
|
2370
2385
|
actions.replace(first);
|
|
@@ -2374,7 +2389,7 @@ function localize(options) {
|
|
|
2374
2389
|
} else {
|
|
2375
2390
|
actions.remove();
|
|
2376
2391
|
}
|
|
2377
|
-
} else
|
|
2392
|
+
} else {
|
|
2378
2393
|
localizeProperties(node, locale, vizControlLocaleRule);
|
|
2379
2394
|
}
|
|
2380
2395
|
});
|
|
@@ -2498,10 +2513,55 @@ var EntityReleasesClient = class extends ApiClient6 {
|
|
|
2498
2513
|
}
|
|
2499
2514
|
};
|
|
2500
2515
|
|
|
2501
|
-
// src/
|
|
2516
|
+
// src/IntegrationPropertyEditorsClient.ts
|
|
2502
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";
|
|
2503
2563
|
var localesUrl = "/api/v1/locales";
|
|
2504
|
-
var LocaleClient = class extends
|
|
2564
|
+
var LocaleClient = class extends ApiClient8 {
|
|
2505
2565
|
constructor(options) {
|
|
2506
2566
|
super(options);
|
|
2507
2567
|
}
|
|
@@ -2586,6 +2646,9 @@ var isUpdatePreviewSettingsMessage = (message) => {
|
|
|
2586
2646
|
var isUpdateFeatureFlagsMessage = (message) => {
|
|
2587
2647
|
return message.type === "update-feature-flags";
|
|
2588
2648
|
};
|
|
2649
|
+
var isUpdateAiActionsMessage = (message) => {
|
|
2650
|
+
return message.type === "update-ai-actions";
|
|
2651
|
+
};
|
|
2589
2652
|
var isUpdateContextualEditingStateInternalMessage = (message) => {
|
|
2590
2653
|
return message.type === "update-contextual-editing-state-internal";
|
|
2591
2654
|
};
|
|
@@ -2634,17 +2697,19 @@ var createCanvasChannel = ({
|
|
|
2634
2697
|
postMessage(message);
|
|
2635
2698
|
};
|
|
2636
2699
|
const ready = (options) => {
|
|
2637
|
-
var _a, _b;
|
|
2700
|
+
var _a, _b, _c;
|
|
2638
2701
|
if (typeof window === "undefined") {
|
|
2639
2702
|
return;
|
|
2640
2703
|
}
|
|
2641
2704
|
const framework = (_a = window.__UNIFORM_CONTEXTUAL_EDITING__) == null ? void 0 : _a.framework;
|
|
2642
|
-
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;
|
|
2643
2707
|
const message = {
|
|
2644
2708
|
type: "ready",
|
|
2645
2709
|
framework,
|
|
2646
|
-
version,
|
|
2647
|
-
rsc: options == null ? void 0 : options.rsc
|
|
2710
|
+
version: version2,
|
|
2711
|
+
rsc: options == null ? void 0 : options.rsc,
|
|
2712
|
+
canvasPackageVersion
|
|
2648
2713
|
};
|
|
2649
2714
|
postMessage(message);
|
|
2650
2715
|
};
|
|
@@ -2804,6 +2869,13 @@ var createCanvasChannel = ({
|
|
|
2804
2869
|
};
|
|
2805
2870
|
postMessage(message);
|
|
2806
2871
|
};
|
|
2872
|
+
const updateAiActions = (options) => {
|
|
2873
|
+
const message = {
|
|
2874
|
+
...options,
|
|
2875
|
+
type: "update-ai-actions"
|
|
2876
|
+
};
|
|
2877
|
+
postMessage(message);
|
|
2878
|
+
};
|
|
2807
2879
|
const contextStorageUpdated = (options) => {
|
|
2808
2880
|
const message = {
|
|
2809
2881
|
...options,
|
|
@@ -2853,6 +2925,7 @@ var createCanvasChannel = ({
|
|
|
2853
2925
|
triggerCompositionAction,
|
|
2854
2926
|
updatePreviewSettings,
|
|
2855
2927
|
updateFeatureFlags,
|
|
2928
|
+
updateAiActions,
|
|
2856
2929
|
updateContextualEditingStateInternal,
|
|
2857
2930
|
selectParameter,
|
|
2858
2931
|
openParameterEditor,
|
|
@@ -2868,10 +2941,10 @@ var createCanvasChannel = ({
|
|
|
2868
2941
|
};
|
|
2869
2942
|
|
|
2870
2943
|
// src/PreviewClient.ts
|
|
2871
|
-
import { ApiClient as
|
|
2944
|
+
import { ApiClient as ApiClient9 } from "@uniformdev/context/api";
|
|
2872
2945
|
var previewUrlsUrl = "/api/v1/preview-urls";
|
|
2873
2946
|
var previewViewportsUrl = "/api/v1/preview-viewports";
|
|
2874
|
-
var PreviewClient = class extends
|
|
2947
|
+
var PreviewClient = class extends ApiClient9 {
|
|
2875
2948
|
constructor(options) {
|
|
2876
2949
|
super(options);
|
|
2877
2950
|
}
|
|
@@ -2933,10 +3006,44 @@ var PreviewClient = class extends ApiClient8 {
|
|
|
2933
3006
|
}
|
|
2934
3007
|
};
|
|
2935
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
|
+
|
|
2936
3043
|
// src/PromptClient.ts
|
|
2937
|
-
import { ApiClient as
|
|
3044
|
+
import { ApiClient as ApiClient11 } from "@uniformdev/context/api";
|
|
2938
3045
|
var PromptsUrl = "/api/v1/prompts";
|
|
2939
|
-
var PromptClient = class extends
|
|
3046
|
+
var PromptClient = class extends ApiClient11 {
|
|
2940
3047
|
constructor(options) {
|
|
2941
3048
|
super(options);
|
|
2942
3049
|
}
|
|
@@ -2967,9 +3074,9 @@ var PromptClient = class extends ApiClient9 {
|
|
|
2967
3074
|
};
|
|
2968
3075
|
|
|
2969
3076
|
// src/RelationshipClient.ts
|
|
2970
|
-
import { ApiClient as
|
|
3077
|
+
import { ApiClient as ApiClient12 } from "@uniformdev/context/api";
|
|
2971
3078
|
var RELATIONSHIPS_URL = "/api/v1/relationships";
|
|
2972
|
-
var RelationshipClient = class extends
|
|
3079
|
+
var RelationshipClient = class extends ApiClient12 {
|
|
2973
3080
|
constructor(options) {
|
|
2974
3081
|
super(options);
|
|
2975
3082
|
this.get = async (options) => {
|
|
@@ -2981,9 +3088,9 @@ var RelationshipClient = class extends ApiClient10 {
|
|
|
2981
3088
|
};
|
|
2982
3089
|
|
|
2983
3090
|
// src/ReleaseClient.ts
|
|
2984
|
-
import { ApiClient as
|
|
3091
|
+
import { ApiClient as ApiClient13 } from "@uniformdev/context/api";
|
|
2985
3092
|
var releasesUrl = "/api/v1/releases";
|
|
2986
|
-
var ReleaseClient = class extends
|
|
3093
|
+
var ReleaseClient = class extends ApiClient13 {
|
|
2987
3094
|
constructor(options) {
|
|
2988
3095
|
super(options);
|
|
2989
3096
|
}
|
|
@@ -3023,9 +3130,9 @@ var ReleaseClient = class extends ApiClient11 {
|
|
|
3023
3130
|
};
|
|
3024
3131
|
|
|
3025
3132
|
// src/ReleaseContentsClient.ts
|
|
3026
|
-
import { ApiClient as
|
|
3133
|
+
import { ApiClient as ApiClient14 } from "@uniformdev/context/api";
|
|
3027
3134
|
var releaseContentsUrl2 = "/api/v1/release-contents";
|
|
3028
|
-
var ReleaseContentsClient = class extends
|
|
3135
|
+
var ReleaseContentsClient = class extends ApiClient14 {
|
|
3029
3136
|
constructor(options) {
|
|
3030
3137
|
super(options);
|
|
3031
3138
|
}
|
|
@@ -3047,9 +3154,9 @@ var ReleaseContentsClient = class extends ApiClient12 {
|
|
|
3047
3154
|
};
|
|
3048
3155
|
|
|
3049
3156
|
// src/RouteClient.ts
|
|
3050
|
-
import { ApiClient as
|
|
3157
|
+
import { ApiClient as ApiClient15 } from "@uniformdev/context/api";
|
|
3051
3158
|
var ROUTE_URL = "/api/v1/route";
|
|
3052
|
-
var RouteClient = class extends
|
|
3159
|
+
var RouteClient = class extends ApiClient15 {
|
|
3053
3160
|
constructor(options) {
|
|
3054
3161
|
var _a;
|
|
3055
3162
|
if (!options.limitPolicy) {
|
|
@@ -3072,6 +3179,63 @@ var RouteClient = class extends ApiClient13 {
|
|
|
3072
3179
|
// src/types/locales.ts
|
|
3073
3180
|
var LOCALE_DYNAMIC_INPUT_NAME = "locale";
|
|
3074
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
|
+
|
|
3075
3239
|
// src/utils/createApiEnhancer.ts
|
|
3076
3240
|
var createUniformApiEnhancer = ({ apiUrl }) => {
|
|
3077
3241
|
return async (message) => {
|
|
@@ -3201,7 +3365,8 @@ function mapSlotToTestVariations(slot) {
|
|
|
3201
3365
|
return {
|
|
3202
3366
|
...v,
|
|
3203
3367
|
id,
|
|
3204
|
-
testDistribution: contextTag == null ? void 0 : contextTag.testDistribution
|
|
3368
|
+
testDistribution: contextTag == null ? void 0 : contextTag.testDistribution,
|
|
3369
|
+
control: contextTag == null ? void 0 : contextTag.control
|
|
3205
3370
|
};
|
|
3206
3371
|
});
|
|
3207
3372
|
}
|
|
@@ -3365,10 +3530,13 @@ function handleRichTextNodeBinding(object, options) {
|
|
|
3365
3530
|
// src/index.ts
|
|
3366
3531
|
import { ApiClientError as ApiClientError2 } from "@uniformdev/context/api";
|
|
3367
3532
|
|
|
3533
|
+
// src/.version.ts
|
|
3534
|
+
var version = "20.43.0";
|
|
3535
|
+
|
|
3368
3536
|
// src/WorkflowClient.ts
|
|
3369
|
-
import { ApiClient as
|
|
3537
|
+
import { ApiClient as ApiClient16 } from "@uniformdev/context/api";
|
|
3370
3538
|
var workflowsUrl = "/api/v1/workflows";
|
|
3371
|
-
var WorkflowClient = class extends
|
|
3539
|
+
var WorkflowClient = class extends ApiClient16 {
|
|
3372
3540
|
constructor(options) {
|
|
3373
3541
|
super(options);
|
|
3374
3542
|
}
|
|
@@ -3422,7 +3590,11 @@ export {
|
|
|
3422
3590
|
CANVAS_LOCALE_TAG_PARAM,
|
|
3423
3591
|
CANVAS_LOCALIZATION_SLOT,
|
|
3424
3592
|
CANVAS_LOCALIZATION_TYPE,
|
|
3593
|
+
CANVAS_PERSONALIZATION_ALGORITHM_PARAM,
|
|
3594
|
+
CANVAS_PERSONALIZATION_ALGORITHM_TYPE,
|
|
3595
|
+
CANVAS_PERSONALIZATION_EVENT_NAME_PARAM,
|
|
3425
3596
|
CANVAS_PERSONALIZATION_PARAM,
|
|
3597
|
+
CANVAS_PERSONALIZATION_TAKE_PARAM,
|
|
3426
3598
|
CANVAS_PERSONALIZE_SLOT,
|
|
3427
3599
|
CANVAS_PERSONALIZE_TYPE,
|
|
3428
3600
|
CANVAS_PUBLISHED_STATE,
|
|
@@ -3458,10 +3630,12 @@ export {
|
|
|
3458
3630
|
IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
|
|
3459
3631
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
|
3460
3632
|
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
|
3633
|
+
IntegrationPropertyEditorsClient,
|
|
3461
3634
|
LOCALE_DYNAMIC_INPUT_NAME,
|
|
3462
3635
|
LocaleClient,
|
|
3463
3636
|
PLACEHOLDER_ID,
|
|
3464
3637
|
PreviewClient,
|
|
3638
|
+
ProjectClient,
|
|
3465
3639
|
PromptClient,
|
|
3466
3640
|
RelationshipClient,
|
|
3467
3641
|
ReleaseClient,
|
|
@@ -3473,6 +3647,7 @@ export {
|
|
|
3473
3647
|
UncachedContentClient,
|
|
3474
3648
|
UniqueBatchEntries,
|
|
3475
3649
|
WorkflowClient,
|
|
3650
|
+
autoFixParameterGroups,
|
|
3476
3651
|
bindExpressionEscapeChars,
|
|
3477
3652
|
bindExpressionPrefix,
|
|
3478
3653
|
bindVariables,
|
|
@@ -3534,6 +3709,7 @@ export {
|
|
|
3534
3709
|
isSuggestComponentMessage,
|
|
3535
3710
|
isSystemComponentDefinition,
|
|
3536
3711
|
isTriggerCompositionActionMessage,
|
|
3712
|
+
isUpdateAiActionsMessage,
|
|
3537
3713
|
isUpdateComponentParameterMessage,
|
|
3538
3714
|
isUpdateComponentReferencesMessage,
|
|
3539
3715
|
isUpdateCompositionInternalMessage,
|
|
@@ -3544,9 +3720,11 @@ export {
|
|
|
3544
3720
|
localize,
|
|
3545
3721
|
mapSlotToPersonalizedVariations,
|
|
3546
3722
|
mapSlotToTestVariations,
|
|
3723
|
+
mergeAssetConfigWithDefaults,
|
|
3547
3724
|
nullLimitPolicy,
|
|
3548
3725
|
parseComponentPlaceholderId,
|
|
3549
3726
|
parseVariableExpression,
|
|
3727
|
+
version,
|
|
3550
3728
|
walkNodeTree,
|
|
3551
3729
|
walkPropertyValues
|
|
3552
3730
|
};
|