@uniformdev/canvas 19.162.2-alpha.11 → 19.165.0
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.d.mts +1797 -1682
- package/dist/index.d.ts +1797 -1682
- package/dist/index.esm.js +34 -56
- package/dist/index.js +38 -62
- package/dist/index.mjs +34 -56
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
@@ -1776,30 +1776,6 @@ function createLocaleVisibilityRule(currentLocale) {
|
|
1776
1776
|
};
|
1777
1777
|
}
|
1778
1778
|
|
1779
|
-
// src/enhancement/visibility/rules/quirksRule.ts
|
1780
|
-
var quirksVisibilityOperators = /* @__PURE__ */ new Set([
|
1781
|
-
"is",
|
1782
|
-
"!is",
|
1783
|
-
"has",
|
1784
|
-
"!has",
|
1785
|
-
"startswith",
|
1786
|
-
"!startswith",
|
1787
|
-
"endswith",
|
1788
|
-
"!endswith",
|
1789
|
-
"empty",
|
1790
|
-
"!empty"
|
1791
|
-
]);
|
1792
|
-
var CANVAS_VIZ_QUIRKS_RULE = "$qk";
|
1793
|
-
function createQuirksVisibilityRule(quirks) {
|
1794
|
-
return {
|
1795
|
-
[CANVAS_VIZ_QUIRKS_RULE]: (criterion) => {
|
1796
|
-
const { source } = criterion;
|
1797
|
-
const quirkValue = source ? quirks[source] : void 0;
|
1798
|
-
return evaluateStringMatch(criterion, quirkValue != null ? quirkValue : "", quirksVisibilityOperators);
|
1799
|
-
}
|
1800
|
-
};
|
1801
|
-
}
|
1802
|
-
|
1803
1779
|
// src/enhancement/localize.ts
|
1804
1780
|
function extractLocales({ component }) {
|
1805
1781
|
var _a;
|
@@ -2045,10 +2021,25 @@ function walkComponentTree(component, visitor, initialContext) {
|
|
2045
2021
|
} while (componentQueue.length > 0);
|
2046
2022
|
}
|
2047
2023
|
|
2048
|
-
// src/
|
2024
|
+
// src/EntityReleasesClient.ts
|
2049
2025
|
import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
|
2026
|
+
var releaseContentsUrl = "/api/v1/entity-releases";
|
2027
|
+
var EntityReleasesClient = class extends ApiClient6 {
|
2028
|
+
constructor(options) {
|
2029
|
+
super(options);
|
2030
|
+
}
|
2031
|
+
/** Fetches entity across all releases (and base) */
|
2032
|
+
async get(options) {
|
2033
|
+
const { projectId } = this.options;
|
2034
|
+
const fetchUri = this.createUrl(releaseContentsUrl, { ...options, projectId });
|
2035
|
+
return await this.apiClient(fetchUri);
|
2036
|
+
}
|
2037
|
+
};
|
2038
|
+
|
2039
|
+
// src/LocaleClient.ts
|
2040
|
+
import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
|
2050
2041
|
var localesUrl = "/api/v1/locales";
|
2051
|
-
var LocaleClient = class extends
|
2042
|
+
var LocaleClient = class extends ApiClient7 {
|
2052
2043
|
constructor(options) {
|
2053
2044
|
super(options);
|
2054
2045
|
}
|
@@ -2154,9 +2145,6 @@ var isRequestComponentSuggestionMessage = (message) => {
|
|
2154
2145
|
var isSuggestComponentMessage = (message) => {
|
2155
2146
|
return message.type === "suggest-component";
|
2156
2147
|
};
|
2157
|
-
var isContextStorageUpdatedMessage = (message) => {
|
2158
|
-
return message.type === "context-storage-command-executed";
|
2159
|
-
};
|
2160
2148
|
var createCanvasChannel = ({
|
2161
2149
|
listenTo,
|
2162
2150
|
broadcastTo
|
@@ -2337,13 +2325,6 @@ var createCanvasChannel = ({
|
|
2337
2325
|
};
|
2338
2326
|
postMessage(message);
|
2339
2327
|
};
|
2340
|
-
const contextStorageUpdated = (options) => {
|
2341
|
-
const message = {
|
2342
|
-
...options,
|
2343
|
-
type: "context-storage-command-executed"
|
2344
|
-
};
|
2345
|
-
postMessage(message);
|
2346
|
-
};
|
2347
2328
|
const messageEventListener = (event) => {
|
2348
2329
|
if (typeof event.data !== "string") {
|
2349
2330
|
return;
|
@@ -2393,8 +2374,7 @@ var createCanvasChannel = ({
|
|
2393
2374
|
editorStateUpdated,
|
2394
2375
|
updateComponentReferences,
|
2395
2376
|
requestComponentSuggestion,
|
2396
|
-
suggestComponent
|
2397
|
-
contextStorageUpdated
|
2377
|
+
suggestComponent
|
2398
2378
|
};
|
2399
2379
|
};
|
2400
2380
|
|
@@ -2477,9 +2457,9 @@ function subscribeToComposition({
|
|
2477
2457
|
}
|
2478
2458
|
|
2479
2459
|
// src/PromptClient.ts
|
2480
|
-
import { ApiClient as
|
2460
|
+
import { ApiClient as ApiClient8 } from "@uniformdev/context/api";
|
2481
2461
|
var PromptsUrl = "/api/v1/prompts";
|
2482
|
-
var PromptClient = class extends
|
2462
|
+
var PromptClient = class extends ApiClient8 {
|
2483
2463
|
constructor(options) {
|
2484
2464
|
super(options);
|
2485
2465
|
}
|
@@ -2510,9 +2490,9 @@ var PromptClient = class extends ApiClient7 {
|
|
2510
2490
|
};
|
2511
2491
|
|
2512
2492
|
// src/RelationshipClient.ts
|
2513
|
-
import { ApiClient as
|
2493
|
+
import { ApiClient as ApiClient9 } from "@uniformdev/context/api";
|
2514
2494
|
var RELATIONSHIPS_URL = "/api/v1/relationships";
|
2515
|
-
var RelationshipClient = class extends
|
2495
|
+
var RelationshipClient = class extends ApiClient9 {
|
2516
2496
|
constructor(options) {
|
2517
2497
|
super(options);
|
2518
2498
|
this.get = async (options) => {
|
@@ -2524,9 +2504,9 @@ var RelationshipClient = class extends ApiClient8 {
|
|
2524
2504
|
};
|
2525
2505
|
|
2526
2506
|
// src/ReleaseClient.ts
|
2527
|
-
import { ApiClient as
|
2507
|
+
import { ApiClient as ApiClient10 } from "@uniformdev/context/api";
|
2528
2508
|
var releasesUrl = "/api/v1/releases";
|
2529
|
-
var ReleaseClient = class extends
|
2509
|
+
var ReleaseClient = class extends ApiClient10 {
|
2530
2510
|
constructor(options) {
|
2531
2511
|
super(options);
|
2532
2512
|
}
|
@@ -2566,21 +2546,21 @@ var ReleaseClient = class extends ApiClient9 {
|
|
2566
2546
|
};
|
2567
2547
|
|
2568
2548
|
// src/ReleaseContentsClient.ts
|
2569
|
-
import { ApiClient as
|
2570
|
-
var
|
2571
|
-
var ReleaseContentsClient = class extends
|
2549
|
+
import { ApiClient as ApiClient11 } from "@uniformdev/context/api";
|
2550
|
+
var releaseContentsUrl2 = "/api/v1/release-contents";
|
2551
|
+
var ReleaseContentsClient = class extends ApiClient11 {
|
2572
2552
|
constructor(options) {
|
2573
2553
|
super(options);
|
2574
2554
|
}
|
2575
2555
|
/** Fetches all entities added to a release */
|
2576
2556
|
async get(options) {
|
2577
2557
|
const { projectId } = this.options;
|
2578
|
-
const fetchUri = this.createUrl(
|
2558
|
+
const fetchUri = this.createUrl(releaseContentsUrl2, { ...options, projectId });
|
2579
2559
|
return await this.apiClient(fetchUri);
|
2580
2560
|
}
|
2581
2561
|
/** Removes a release content from a release */
|
2582
2562
|
async remove(body) {
|
2583
|
-
const fetchUri = this.createUrl(
|
2563
|
+
const fetchUri = this.createUrl(releaseContentsUrl2);
|
2584
2564
|
await this.apiClient(fetchUri, {
|
2585
2565
|
method: "DELETE",
|
2586
2566
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
@@ -2590,9 +2570,9 @@ var ReleaseContentsClient = class extends ApiClient10 {
|
|
2590
2570
|
};
|
2591
2571
|
|
2592
2572
|
// src/RouteClient.ts
|
2593
|
-
import { ApiClient as
|
2573
|
+
import { ApiClient as ApiClient12 } from "@uniformdev/context/api";
|
2594
2574
|
var ROUTE_URL = "/api/v1/route";
|
2595
|
-
var RouteClient = class extends
|
2575
|
+
var RouteClient = class extends ApiClient12 {
|
2596
2576
|
constructor(options) {
|
2597
2577
|
var _a;
|
2598
2578
|
if (!options.limitPolicy) {
|
@@ -2962,9 +2942,9 @@ function handleRichTextNodeBinding(object, options) {
|
|
2962
2942
|
import { ApiClientError as ApiClientError2 } from "@uniformdev/context/api";
|
2963
2943
|
|
2964
2944
|
// src/WorkflowClient.ts
|
2965
|
-
import { ApiClient as
|
2945
|
+
import { ApiClient as ApiClient13 } from "@uniformdev/context/api";
|
2966
2946
|
var workflowsUrl = "/api/v1/workflows";
|
2967
|
-
var WorkflowClient = class extends
|
2947
|
+
var WorkflowClient = class extends ApiClient13 {
|
2968
2948
|
constructor(options) {
|
2969
2949
|
super(options);
|
2970
2950
|
}
|
@@ -3028,7 +3008,6 @@ export {
|
|
3028
3008
|
CANVAS_VIZ_CONTROL_PARAM,
|
3029
3009
|
CANVAS_VIZ_DI_RULE,
|
3030
3010
|
CANVAS_VIZ_LOCALE_RULE,
|
3031
|
-
CANVAS_VIZ_QUIRKS_RULE,
|
3032
3011
|
CanvasClient,
|
3033
3012
|
CanvasClientError,
|
3034
3013
|
CategoryClient,
|
@@ -3042,6 +3021,7 @@ export {
|
|
3042
3021
|
EDGE_MIN_CACHE_TTL,
|
3043
3022
|
EMPTY_COMPOSITION,
|
3044
3023
|
EnhancerBuilder,
|
3024
|
+
EntityReleasesClient,
|
3045
3025
|
IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
|
3046
3026
|
IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
3047
3027
|
IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM,
|
@@ -3074,7 +3054,6 @@ export {
|
|
3074
3054
|
createEventBus,
|
3075
3055
|
createLimitPolicy,
|
3076
3056
|
createLocaleVisibilityRule,
|
3077
|
-
createQuirksVisibilityRule,
|
3078
3057
|
createUniformApiEnhancer,
|
3079
3058
|
createVariableReference,
|
3080
3059
|
enhance,
|
@@ -3101,7 +3080,6 @@ export {
|
|
3101
3080
|
isAssetParamValueItem,
|
3102
3081
|
isComponentActionMessage,
|
3103
3082
|
isComponentPlaceholderId,
|
3104
|
-
isContextStorageUpdatedMessage,
|
3105
3083
|
isDismissPlaceholderMessage,
|
3106
3084
|
isEntryData,
|
3107
3085
|
isMovingComponentMessage,
|
package/dist/index.js
CHANGED
@@ -286,7 +286,7 @@ __export(src_exports, {
|
|
286
286
|
ATTRIBUTE_PARAMETER_TYPE: () => ATTRIBUTE_PARAMETER_TYPE,
|
287
287
|
ATTRIBUTE_PARAMETER_VALUE: () => ATTRIBUTE_PARAMETER_VALUE,
|
288
288
|
ATTRIBUTE_PLACEHOLDER: () => ATTRIBUTE_PLACEHOLDER,
|
289
|
-
ApiClientError: () =>
|
289
|
+
ApiClientError: () => import_api15.ApiClientError,
|
290
290
|
BatchEntry: () => BatchEntry,
|
291
291
|
CANVAS_BLOCK_PARAM_TYPE: () => CANVAS_BLOCK_PARAM_TYPE,
|
292
292
|
CANVAS_DRAFT_STATE: () => CANVAS_DRAFT_STATE,
|
@@ -308,7 +308,6 @@ __export(src_exports, {
|
|
308
308
|
CANVAS_VIZ_CONTROL_PARAM: () => CANVAS_VIZ_CONTROL_PARAM,
|
309
309
|
CANVAS_VIZ_DI_RULE: () => CANVAS_VIZ_DI_RULE,
|
310
310
|
CANVAS_VIZ_LOCALE_RULE: () => CANVAS_VIZ_LOCALE_RULE,
|
311
|
-
CANVAS_VIZ_QUIRKS_RULE: () => CANVAS_VIZ_QUIRKS_RULE,
|
312
311
|
CanvasClient: () => CanvasClient,
|
313
312
|
CanvasClientError: () => CanvasClientError,
|
314
313
|
CategoryClient: () => CategoryClient,
|
@@ -322,6 +321,7 @@ __export(src_exports, {
|
|
322
321
|
EDGE_MIN_CACHE_TTL: () => EDGE_MIN_CACHE_TTL,
|
323
322
|
EMPTY_COMPOSITION: () => EMPTY_COMPOSITION,
|
324
323
|
EnhancerBuilder: () => EnhancerBuilder,
|
324
|
+
EntityReleasesClient: () => EntityReleasesClient,
|
325
325
|
IN_CONTEXT_EDITOR_COMPONENT_END_ROLE: () => IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
|
326
326
|
IN_CONTEXT_EDITOR_COMPONENT_START_ROLE: () => IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
327
327
|
IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM: () => IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM,
|
@@ -354,7 +354,6 @@ __export(src_exports, {
|
|
354
354
|
createEventBus: () => createEventBus,
|
355
355
|
createLimitPolicy: () => createLimitPolicy,
|
356
356
|
createLocaleVisibilityRule: () => createLocaleVisibilityRule,
|
357
|
-
createQuirksVisibilityRule: () => createQuirksVisibilityRule,
|
358
357
|
createUniformApiEnhancer: () => createUniformApiEnhancer,
|
359
358
|
createVariableReference: () => createVariableReference,
|
360
359
|
enhance: () => enhance,
|
@@ -381,7 +380,6 @@ __export(src_exports, {
|
|
381
380
|
isAssetParamValueItem: () => isAssetParamValueItem,
|
382
381
|
isComponentActionMessage: () => isComponentActionMessage,
|
383
382
|
isComponentPlaceholderId: () => isComponentPlaceholderId,
|
384
|
-
isContextStorageUpdatedMessage: () => isContextStorageUpdatedMessage,
|
385
383
|
isDismissPlaceholderMessage: () => isDismissPlaceholderMessage,
|
386
384
|
isEntryData: () => isEntryData,
|
387
385
|
isMovingComponentMessage: () => isMovingComponentMessage,
|
@@ -1923,30 +1921,6 @@ function createLocaleVisibilityRule(currentLocale) {
|
|
1923
1921
|
};
|
1924
1922
|
}
|
1925
1923
|
|
1926
|
-
// src/enhancement/visibility/rules/quirksRule.ts
|
1927
|
-
var quirksVisibilityOperators = /* @__PURE__ */ new Set([
|
1928
|
-
"is",
|
1929
|
-
"!is",
|
1930
|
-
"has",
|
1931
|
-
"!has",
|
1932
|
-
"startswith",
|
1933
|
-
"!startswith",
|
1934
|
-
"endswith",
|
1935
|
-
"!endswith",
|
1936
|
-
"empty",
|
1937
|
-
"!empty"
|
1938
|
-
]);
|
1939
|
-
var CANVAS_VIZ_QUIRKS_RULE = "$qk";
|
1940
|
-
function createQuirksVisibilityRule(quirks) {
|
1941
|
-
return {
|
1942
|
-
[CANVAS_VIZ_QUIRKS_RULE]: (criterion) => {
|
1943
|
-
const { source } = criterion;
|
1944
|
-
const quirkValue = source ? quirks[source] : void 0;
|
1945
|
-
return evaluateStringMatch(criterion, quirkValue != null ? quirkValue : "", quirksVisibilityOperators);
|
1946
|
-
}
|
1947
|
-
};
|
1948
|
-
}
|
1949
|
-
|
1950
1924
|
// src/enhancement/localize.ts
|
1951
1925
|
function extractLocales({ component }) {
|
1952
1926
|
var _a;
|
@@ -2192,10 +2166,25 @@ function walkComponentTree(component, visitor, initialContext) {
|
|
2192
2166
|
} while (componentQueue.length > 0);
|
2193
2167
|
}
|
2194
2168
|
|
2195
|
-
// src/
|
2169
|
+
// src/EntityReleasesClient.ts
|
2196
2170
|
var import_api7 = require("@uniformdev/context/api");
|
2171
|
+
var releaseContentsUrl = "/api/v1/entity-releases";
|
2172
|
+
var EntityReleasesClient = class extends import_api7.ApiClient {
|
2173
|
+
constructor(options) {
|
2174
|
+
super(options);
|
2175
|
+
}
|
2176
|
+
/** Fetches entity across all releases (and base) */
|
2177
|
+
async get(options) {
|
2178
|
+
const { projectId } = this.options;
|
2179
|
+
const fetchUri = this.createUrl(releaseContentsUrl, { ...options, projectId });
|
2180
|
+
return await this.apiClient(fetchUri);
|
2181
|
+
}
|
2182
|
+
};
|
2183
|
+
|
2184
|
+
// src/LocaleClient.ts
|
2185
|
+
var import_api8 = require("@uniformdev/context/api");
|
2197
2186
|
var localesUrl = "/api/v1/locales";
|
2198
|
-
var LocaleClient = class extends
|
2187
|
+
var LocaleClient = class extends import_api8.ApiClient {
|
2199
2188
|
constructor(options) {
|
2200
2189
|
super(options);
|
2201
2190
|
}
|
@@ -2301,9 +2290,6 @@ var isRequestComponentSuggestionMessage = (message) => {
|
|
2301
2290
|
var isSuggestComponentMessage = (message) => {
|
2302
2291
|
return message.type === "suggest-component";
|
2303
2292
|
};
|
2304
|
-
var isContextStorageUpdatedMessage = (message) => {
|
2305
|
-
return message.type === "context-storage-command-executed";
|
2306
|
-
};
|
2307
2293
|
var createCanvasChannel = ({
|
2308
2294
|
listenTo,
|
2309
2295
|
broadcastTo
|
@@ -2484,13 +2470,6 @@ var createCanvasChannel = ({
|
|
2484
2470
|
};
|
2485
2471
|
postMessage(message);
|
2486
2472
|
};
|
2487
|
-
const contextStorageUpdated = (options) => {
|
2488
|
-
const message = {
|
2489
|
-
...options,
|
2490
|
-
type: "context-storage-command-executed"
|
2491
|
-
};
|
2492
|
-
postMessage(message);
|
2493
|
-
};
|
2494
2473
|
const messageEventListener = (event) => {
|
2495
2474
|
if (typeof event.data !== "string") {
|
2496
2475
|
return;
|
@@ -2540,8 +2519,7 @@ var createCanvasChannel = ({
|
|
2540
2519
|
editorStateUpdated,
|
2541
2520
|
updateComponentReferences,
|
2542
2521
|
requestComponentSuggestion,
|
2543
|
-
suggestComponent
|
2544
|
-
contextStorageUpdated
|
2522
|
+
suggestComponent
|
2545
2523
|
};
|
2546
2524
|
};
|
2547
2525
|
|
@@ -2624,9 +2602,9 @@ function subscribeToComposition({
|
|
2624
2602
|
}
|
2625
2603
|
|
2626
2604
|
// src/PromptClient.ts
|
2627
|
-
var
|
2605
|
+
var import_api9 = require("@uniformdev/context/api");
|
2628
2606
|
var PromptsUrl = "/api/v1/prompts";
|
2629
|
-
var PromptClient = class extends
|
2607
|
+
var PromptClient = class extends import_api9.ApiClient {
|
2630
2608
|
constructor(options) {
|
2631
2609
|
super(options);
|
2632
2610
|
}
|
@@ -2657,9 +2635,9 @@ var PromptClient = class extends import_api8.ApiClient {
|
|
2657
2635
|
};
|
2658
2636
|
|
2659
2637
|
// src/RelationshipClient.ts
|
2660
|
-
var
|
2638
|
+
var import_api10 = require("@uniformdev/context/api");
|
2661
2639
|
var RELATIONSHIPS_URL = "/api/v1/relationships";
|
2662
|
-
var RelationshipClient = class extends
|
2640
|
+
var RelationshipClient = class extends import_api10.ApiClient {
|
2663
2641
|
constructor(options) {
|
2664
2642
|
super(options);
|
2665
2643
|
this.get = async (options) => {
|
@@ -2671,9 +2649,9 @@ var RelationshipClient = class extends import_api9.ApiClient {
|
|
2671
2649
|
};
|
2672
2650
|
|
2673
2651
|
// src/ReleaseClient.ts
|
2674
|
-
var
|
2652
|
+
var import_api11 = require("@uniformdev/context/api");
|
2675
2653
|
var releasesUrl = "/api/v1/releases";
|
2676
|
-
var ReleaseClient = class extends
|
2654
|
+
var ReleaseClient = class extends import_api11.ApiClient {
|
2677
2655
|
constructor(options) {
|
2678
2656
|
super(options);
|
2679
2657
|
}
|
@@ -2713,21 +2691,21 @@ var ReleaseClient = class extends import_api10.ApiClient {
|
|
2713
2691
|
};
|
2714
2692
|
|
2715
2693
|
// src/ReleaseContentsClient.ts
|
2716
|
-
var
|
2717
|
-
var
|
2718
|
-
var ReleaseContentsClient = class extends
|
2694
|
+
var import_api12 = require("@uniformdev/context/api");
|
2695
|
+
var releaseContentsUrl2 = "/api/v1/release-contents";
|
2696
|
+
var ReleaseContentsClient = class extends import_api12.ApiClient {
|
2719
2697
|
constructor(options) {
|
2720
2698
|
super(options);
|
2721
2699
|
}
|
2722
2700
|
/** Fetches all entities added to a release */
|
2723
2701
|
async get(options) {
|
2724
2702
|
const { projectId } = this.options;
|
2725
|
-
const fetchUri = this.createUrl(
|
2703
|
+
const fetchUri = this.createUrl(releaseContentsUrl2, { ...options, projectId });
|
2726
2704
|
return await this.apiClient(fetchUri);
|
2727
2705
|
}
|
2728
2706
|
/** Removes a release content from a release */
|
2729
2707
|
async remove(body) {
|
2730
|
-
const fetchUri = this.createUrl(
|
2708
|
+
const fetchUri = this.createUrl(releaseContentsUrl2);
|
2731
2709
|
await this.apiClient(fetchUri, {
|
2732
2710
|
method: "DELETE",
|
2733
2711
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
@@ -2737,9 +2715,9 @@ var ReleaseContentsClient = class extends import_api11.ApiClient {
|
|
2737
2715
|
};
|
2738
2716
|
|
2739
2717
|
// src/RouteClient.ts
|
2740
|
-
var
|
2718
|
+
var import_api13 = require("@uniformdev/context/api");
|
2741
2719
|
var ROUTE_URL = "/api/v1/route";
|
2742
|
-
var RouteClient = class extends
|
2720
|
+
var RouteClient = class extends import_api13.ApiClient {
|
2743
2721
|
constructor(options) {
|
2744
2722
|
var _a;
|
2745
2723
|
if (!options.limitPolicy) {
|
@@ -3106,12 +3084,12 @@ function handleRichTextNodeBinding(object, options) {
|
|
3106
3084
|
}
|
3107
3085
|
|
3108
3086
|
// src/index.ts
|
3109
|
-
var
|
3087
|
+
var import_api15 = require("@uniformdev/context/api");
|
3110
3088
|
|
3111
3089
|
// src/WorkflowClient.ts
|
3112
|
-
var
|
3090
|
+
var import_api14 = require("@uniformdev/context/api");
|
3113
3091
|
var workflowsUrl = "/api/v1/workflows";
|
3114
|
-
var WorkflowClient = class extends
|
3092
|
+
var WorkflowClient = class extends import_api14.ApiClient {
|
3115
3093
|
constructor(options) {
|
3116
3094
|
super(options);
|
3117
3095
|
}
|
@@ -3142,7 +3120,7 @@ var WorkflowClient = class extends import_api13.ApiClient {
|
|
3142
3120
|
};
|
3143
3121
|
|
3144
3122
|
// src/index.ts
|
3145
|
-
var CanvasClientError =
|
3123
|
+
var CanvasClientError = import_api15.ApiClientError;
|
3146
3124
|
// Annotate the CommonJS export names for ESM import in node:
|
3147
3125
|
0 && (module.exports = {
|
3148
3126
|
ASSETS_SOURCE_CUSTOM_URL,
|
@@ -3176,7 +3154,6 @@ var CanvasClientError = import_api14.ApiClientError;
|
|
3176
3154
|
CANVAS_VIZ_CONTROL_PARAM,
|
3177
3155
|
CANVAS_VIZ_DI_RULE,
|
3178
3156
|
CANVAS_VIZ_LOCALE_RULE,
|
3179
|
-
CANVAS_VIZ_QUIRKS_RULE,
|
3180
3157
|
CanvasClient,
|
3181
3158
|
CanvasClientError,
|
3182
3159
|
CategoryClient,
|
@@ -3190,6 +3167,7 @@ var CanvasClientError = import_api14.ApiClientError;
|
|
3190
3167
|
EDGE_MIN_CACHE_TTL,
|
3191
3168
|
EMPTY_COMPOSITION,
|
3192
3169
|
EnhancerBuilder,
|
3170
|
+
EntityReleasesClient,
|
3193
3171
|
IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
|
3194
3172
|
IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
3195
3173
|
IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM,
|
@@ -3222,7 +3200,6 @@ var CanvasClientError = import_api14.ApiClientError;
|
|
3222
3200
|
createEventBus,
|
3223
3201
|
createLimitPolicy,
|
3224
3202
|
createLocaleVisibilityRule,
|
3225
|
-
createQuirksVisibilityRule,
|
3226
3203
|
createUniformApiEnhancer,
|
3227
3204
|
createVariableReference,
|
3228
3205
|
enhance,
|
@@ -3249,7 +3226,6 @@ var CanvasClientError = import_api14.ApiClientError;
|
|
3249
3226
|
isAssetParamValueItem,
|
3250
3227
|
isComponentActionMessage,
|
3251
3228
|
isComponentPlaceholderId,
|
3252
|
-
isContextStorageUpdatedMessage,
|
3253
3229
|
isDismissPlaceholderMessage,
|
3254
3230
|
isEntryData,
|
3255
3231
|
isMovingComponentMessage,
|
package/dist/index.mjs
CHANGED
@@ -1776,30 +1776,6 @@ function createLocaleVisibilityRule(currentLocale) {
|
|
1776
1776
|
};
|
1777
1777
|
}
|
1778
1778
|
|
1779
|
-
// src/enhancement/visibility/rules/quirksRule.ts
|
1780
|
-
var quirksVisibilityOperators = /* @__PURE__ */ new Set([
|
1781
|
-
"is",
|
1782
|
-
"!is",
|
1783
|
-
"has",
|
1784
|
-
"!has",
|
1785
|
-
"startswith",
|
1786
|
-
"!startswith",
|
1787
|
-
"endswith",
|
1788
|
-
"!endswith",
|
1789
|
-
"empty",
|
1790
|
-
"!empty"
|
1791
|
-
]);
|
1792
|
-
var CANVAS_VIZ_QUIRKS_RULE = "$qk";
|
1793
|
-
function createQuirksVisibilityRule(quirks) {
|
1794
|
-
return {
|
1795
|
-
[CANVAS_VIZ_QUIRKS_RULE]: (criterion) => {
|
1796
|
-
const { source } = criterion;
|
1797
|
-
const quirkValue = source ? quirks[source] : void 0;
|
1798
|
-
return evaluateStringMatch(criterion, quirkValue != null ? quirkValue : "", quirksVisibilityOperators);
|
1799
|
-
}
|
1800
|
-
};
|
1801
|
-
}
|
1802
|
-
|
1803
1779
|
// src/enhancement/localize.ts
|
1804
1780
|
function extractLocales({ component }) {
|
1805
1781
|
var _a;
|
@@ -2045,10 +2021,25 @@ function walkComponentTree(component, visitor, initialContext) {
|
|
2045
2021
|
} while (componentQueue.length > 0);
|
2046
2022
|
}
|
2047
2023
|
|
2048
|
-
// src/
|
2024
|
+
// src/EntityReleasesClient.ts
|
2049
2025
|
import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
|
2026
|
+
var releaseContentsUrl = "/api/v1/entity-releases";
|
2027
|
+
var EntityReleasesClient = class extends ApiClient6 {
|
2028
|
+
constructor(options) {
|
2029
|
+
super(options);
|
2030
|
+
}
|
2031
|
+
/** Fetches entity across all releases (and base) */
|
2032
|
+
async get(options) {
|
2033
|
+
const { projectId } = this.options;
|
2034
|
+
const fetchUri = this.createUrl(releaseContentsUrl, { ...options, projectId });
|
2035
|
+
return await this.apiClient(fetchUri);
|
2036
|
+
}
|
2037
|
+
};
|
2038
|
+
|
2039
|
+
// src/LocaleClient.ts
|
2040
|
+
import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
|
2050
2041
|
var localesUrl = "/api/v1/locales";
|
2051
|
-
var LocaleClient = class extends
|
2042
|
+
var LocaleClient = class extends ApiClient7 {
|
2052
2043
|
constructor(options) {
|
2053
2044
|
super(options);
|
2054
2045
|
}
|
@@ -2154,9 +2145,6 @@ var isRequestComponentSuggestionMessage = (message) => {
|
|
2154
2145
|
var isSuggestComponentMessage = (message) => {
|
2155
2146
|
return message.type === "suggest-component";
|
2156
2147
|
};
|
2157
|
-
var isContextStorageUpdatedMessage = (message) => {
|
2158
|
-
return message.type === "context-storage-command-executed";
|
2159
|
-
};
|
2160
2148
|
var createCanvasChannel = ({
|
2161
2149
|
listenTo,
|
2162
2150
|
broadcastTo
|
@@ -2337,13 +2325,6 @@ var createCanvasChannel = ({
|
|
2337
2325
|
};
|
2338
2326
|
postMessage(message);
|
2339
2327
|
};
|
2340
|
-
const contextStorageUpdated = (options) => {
|
2341
|
-
const message = {
|
2342
|
-
...options,
|
2343
|
-
type: "context-storage-command-executed"
|
2344
|
-
};
|
2345
|
-
postMessage(message);
|
2346
|
-
};
|
2347
2328
|
const messageEventListener = (event) => {
|
2348
2329
|
if (typeof event.data !== "string") {
|
2349
2330
|
return;
|
@@ -2393,8 +2374,7 @@ var createCanvasChannel = ({
|
|
2393
2374
|
editorStateUpdated,
|
2394
2375
|
updateComponentReferences,
|
2395
2376
|
requestComponentSuggestion,
|
2396
|
-
suggestComponent
|
2397
|
-
contextStorageUpdated
|
2377
|
+
suggestComponent
|
2398
2378
|
};
|
2399
2379
|
};
|
2400
2380
|
|
@@ -2477,9 +2457,9 @@ function subscribeToComposition({
|
|
2477
2457
|
}
|
2478
2458
|
|
2479
2459
|
// src/PromptClient.ts
|
2480
|
-
import { ApiClient as
|
2460
|
+
import { ApiClient as ApiClient8 } from "@uniformdev/context/api";
|
2481
2461
|
var PromptsUrl = "/api/v1/prompts";
|
2482
|
-
var PromptClient = class extends
|
2462
|
+
var PromptClient = class extends ApiClient8 {
|
2483
2463
|
constructor(options) {
|
2484
2464
|
super(options);
|
2485
2465
|
}
|
@@ -2510,9 +2490,9 @@ var PromptClient = class extends ApiClient7 {
|
|
2510
2490
|
};
|
2511
2491
|
|
2512
2492
|
// src/RelationshipClient.ts
|
2513
|
-
import { ApiClient as
|
2493
|
+
import { ApiClient as ApiClient9 } from "@uniformdev/context/api";
|
2514
2494
|
var RELATIONSHIPS_URL = "/api/v1/relationships";
|
2515
|
-
var RelationshipClient = class extends
|
2495
|
+
var RelationshipClient = class extends ApiClient9 {
|
2516
2496
|
constructor(options) {
|
2517
2497
|
super(options);
|
2518
2498
|
this.get = async (options) => {
|
@@ -2524,9 +2504,9 @@ var RelationshipClient = class extends ApiClient8 {
|
|
2524
2504
|
};
|
2525
2505
|
|
2526
2506
|
// src/ReleaseClient.ts
|
2527
|
-
import { ApiClient as
|
2507
|
+
import { ApiClient as ApiClient10 } from "@uniformdev/context/api";
|
2528
2508
|
var releasesUrl = "/api/v1/releases";
|
2529
|
-
var ReleaseClient = class extends
|
2509
|
+
var ReleaseClient = class extends ApiClient10 {
|
2530
2510
|
constructor(options) {
|
2531
2511
|
super(options);
|
2532
2512
|
}
|
@@ -2566,21 +2546,21 @@ var ReleaseClient = class extends ApiClient9 {
|
|
2566
2546
|
};
|
2567
2547
|
|
2568
2548
|
// src/ReleaseContentsClient.ts
|
2569
|
-
import { ApiClient as
|
2570
|
-
var
|
2571
|
-
var ReleaseContentsClient = class extends
|
2549
|
+
import { ApiClient as ApiClient11 } from "@uniformdev/context/api";
|
2550
|
+
var releaseContentsUrl2 = "/api/v1/release-contents";
|
2551
|
+
var ReleaseContentsClient = class extends ApiClient11 {
|
2572
2552
|
constructor(options) {
|
2573
2553
|
super(options);
|
2574
2554
|
}
|
2575
2555
|
/** Fetches all entities added to a release */
|
2576
2556
|
async get(options) {
|
2577
2557
|
const { projectId } = this.options;
|
2578
|
-
const fetchUri = this.createUrl(
|
2558
|
+
const fetchUri = this.createUrl(releaseContentsUrl2, { ...options, projectId });
|
2579
2559
|
return await this.apiClient(fetchUri);
|
2580
2560
|
}
|
2581
2561
|
/** Removes a release content from a release */
|
2582
2562
|
async remove(body) {
|
2583
|
-
const fetchUri = this.createUrl(
|
2563
|
+
const fetchUri = this.createUrl(releaseContentsUrl2);
|
2584
2564
|
await this.apiClient(fetchUri, {
|
2585
2565
|
method: "DELETE",
|
2586
2566
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
@@ -2590,9 +2570,9 @@ var ReleaseContentsClient = class extends ApiClient10 {
|
|
2590
2570
|
};
|
2591
2571
|
|
2592
2572
|
// src/RouteClient.ts
|
2593
|
-
import { ApiClient as
|
2573
|
+
import { ApiClient as ApiClient12 } from "@uniformdev/context/api";
|
2594
2574
|
var ROUTE_URL = "/api/v1/route";
|
2595
|
-
var RouteClient = class extends
|
2575
|
+
var RouteClient = class extends ApiClient12 {
|
2596
2576
|
constructor(options) {
|
2597
2577
|
var _a;
|
2598
2578
|
if (!options.limitPolicy) {
|
@@ -2962,9 +2942,9 @@ function handleRichTextNodeBinding(object, options) {
|
|
2962
2942
|
import { ApiClientError as ApiClientError2 } from "@uniformdev/context/api";
|
2963
2943
|
|
2964
2944
|
// src/WorkflowClient.ts
|
2965
|
-
import { ApiClient as
|
2945
|
+
import { ApiClient as ApiClient13 } from "@uniformdev/context/api";
|
2966
2946
|
var workflowsUrl = "/api/v1/workflows";
|
2967
|
-
var WorkflowClient = class extends
|
2947
|
+
var WorkflowClient = class extends ApiClient13 {
|
2968
2948
|
constructor(options) {
|
2969
2949
|
super(options);
|
2970
2950
|
}
|
@@ -3028,7 +3008,6 @@ export {
|
|
3028
3008
|
CANVAS_VIZ_CONTROL_PARAM,
|
3029
3009
|
CANVAS_VIZ_DI_RULE,
|
3030
3010
|
CANVAS_VIZ_LOCALE_RULE,
|
3031
|
-
CANVAS_VIZ_QUIRKS_RULE,
|
3032
3011
|
CanvasClient,
|
3033
3012
|
CanvasClientError,
|
3034
3013
|
CategoryClient,
|
@@ -3042,6 +3021,7 @@ export {
|
|
3042
3021
|
EDGE_MIN_CACHE_TTL,
|
3043
3022
|
EMPTY_COMPOSITION,
|
3044
3023
|
EnhancerBuilder,
|
3024
|
+
EntityReleasesClient,
|
3045
3025
|
IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
|
3046
3026
|
IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
3047
3027
|
IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM,
|
@@ -3074,7 +3054,6 @@ export {
|
|
3074
3054
|
createEventBus,
|
3075
3055
|
createLimitPolicy,
|
3076
3056
|
createLocaleVisibilityRule,
|
3077
|
-
createQuirksVisibilityRule,
|
3078
3057
|
createUniformApiEnhancer,
|
3079
3058
|
createVariableReference,
|
3080
3059
|
enhance,
|
@@ -3101,7 +3080,6 @@ export {
|
|
3101
3080
|
isAssetParamValueItem,
|
3102
3081
|
isComponentActionMessage,
|
3103
3082
|
isComponentPlaceholderId,
|
3104
|
-
isContextStorageUpdatedMessage,
|
3105
3083
|
isDismissPlaceholderMessage,
|
3106
3084
|
isEntryData,
|
3107
3085
|
isMovingComponentMessage,
|