@uniformdev/canvas 17.1.1-alpha.152 → 17.2.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/chunk-IQWDQAHE.mjs +4 -0
- package/dist/cli/cli.d.ts +1 -1
- package/dist/cli/cli.js +1 -1
- package/dist/cli/cli.mjs +1 -1
- package/dist/{createEventBus-b9cdb6ff.d.ts → createEventBus-3f3f7633.d.ts} +52 -49
- package/dist/index.d.ts +209 -65
- package/dist/index.esm.js +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
- package/dist/chunk-PFL3XEAQ.mjs +0 -4
package/dist/index.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { C as ComponentInstance, a as ComponentParameter, c as components, b as CompositionGetParameters, d as CompositionPutParameters, e as CompositionDeleteParameters, f as ComponentDefinitionGetParameters, g as ComponentDefinitionPutParameters, h as ComponentDefinitionDeleteParameters, P as PreviewEventBus } from './createEventBus-
|
2
|
-
export { H as CanvasDefinitions, I as ChannelSubscription,
|
1
|
+
import { C as ComponentInstance, a as ComponentParameter, c as components, b as CompositionGetParameters, d as CompositionPutParameters, e as CompositionDeleteParameters, f as ComponentDefinitionGetParameters, g as ComponentDefinitionPutParameters, h as ComponentDefinitionDeleteParameters, R as RootComponentInstance, P as PreviewEventBus, i as CompositionGetResponse } from './createEventBus-3f3f7633.js';
|
2
|
+
export { H as CanvasDefinitions, I as ChannelSubscription, t as ComponentDefinition, m as ComponentDefinitionAPIDeleteRequest, l as ComponentDefinitionAPIPutRequest, k as ComponentDefinitionAPIResponse, h as ComponentDefinitionDeleteParameters, f as ComponentDefinitionGetParameters, j as ComponentDefinitionGetResponse, n as ComponentDefinitionListAPIOptions, o as ComponentDefinitionParameter, s as ComponentDefinitionPermission, g as ComponentDefinitionPutParameters, r as ComponentDefinitionSlot, q as ComponentDefinitionSlugSettings, p as ComponentDefinitionVariant, C as ComponentInstance, a as ComponentParameter, D as ComponentParameterBinding, z as CompositionAPIDeleteRequest, B as CompositionAPIOptions, y as CompositionAPIResponse, G as CompositionDataDefinition, F as CompositionDataDefinitions, E as CompositionDataVariables, e as CompositionDeleteParameters, x as CompositionGetListResponse, v as CompositionGetOrderBy, b as CompositionGetParameters, i as CompositionGetResponse, A as CompositionListAPIResponse, d as CompositionPutParameters, w as CompositionUIStatus, u as CreatingComponentDefinition, P as PreviewEventBus, R as RootComponentInstance, J as createEventBus } from './createEventBus-3f3f7633.js';
|
3
3
|
import { Options } from 'p-throttle';
|
4
4
|
import { Options as Options$1 } from 'p-retry';
|
5
|
-
import {
|
5
|
+
import { ApiClient, ClientOptions, ExceptProject, ApiClientError } from '@uniformdev/context/api';
|
6
6
|
export { ApiClientError } from '@uniformdev/context/api';
|
7
7
|
import { PersonalizedVariant, TestVariant } from '@uniformdev/context';
|
8
8
|
import 'pusher-js';
|
@@ -273,11 +273,11 @@ interface external$2 {
|
|
273
273
|
roleId: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
|
274
274
|
/**
|
275
275
|
* @description Permission type for this permission ComponentDefinition:
|
276
|
-
* read | write | delete
|
276
|
+
* read | write | create | delete
|
277
277
|
*
|
278
278
|
* @enum {string}
|
279
279
|
*/
|
280
|
-
permission: "read" | "write" | "delete";
|
280
|
+
permission: "read" | "write" | "create" | "delete";
|
281
281
|
/** @description State of the component that this permission applies to */
|
282
282
|
state: number;
|
283
283
|
};
|
@@ -429,23 +429,23 @@ interface external$2 {
|
|
429
429
|
* @description An instance of an integration data connector (i.e. "Master environment of the stable space", "Yelp API", "Sanity dev dataset"). These are created in the UI and shared across a whole project.
|
430
430
|
*/
|
431
431
|
DataConnection: {
|
432
|
-
/** @description Public ID of the data
|
432
|
+
/** @description Public ID of the data connection */
|
433
433
|
id: string;
|
434
|
-
/** @description Display name of the data
|
434
|
+
/** @description Display name of the data connection */
|
435
435
|
displayName: string;
|
436
436
|
/** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
|
437
437
|
connectorType: string;
|
438
|
-
/** @description Base resource URL of the data
|
438
|
+
/** @description Base resource URL of the data connection. No trailing slash. */
|
439
439
|
baseUrl: string;
|
440
|
-
/** @description HTTP headers to pass with requests to the data
|
440
|
+
/** @description HTTP headers to pass with requests to the data connection */
|
441
441
|
headers?: {
|
442
442
|
[key: string]: string;
|
443
443
|
};
|
444
|
-
/** @description Query String parameters to pass with requests to the data
|
444
|
+
/** @description Query String parameters to pass with requests to the data connection */
|
445
445
|
parameters?: {
|
446
446
|
[key: string]: string;
|
447
447
|
};
|
448
|
-
/** @description Variables needed to make calls to the data
|
448
|
+
/** @description Variables needed to make calls to the data connection */
|
449
449
|
variables?: {
|
450
450
|
[key: string]: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
|
451
451
|
};
|
@@ -459,11 +459,11 @@ interface external$2 {
|
|
459
459
|
* @description A specific type of data that a Data Connection can provide (i.e. "Recipe", "Recipes List by Tag", "Yelp Reviews of My Restaurant"). These are created in the UI and shared a whole project.
|
460
460
|
*/
|
461
461
|
DataType: {
|
462
|
-
/** @description Public ID of the data
|
462
|
+
/** @description Public ID of the data type */
|
463
463
|
id: string;
|
464
|
-
/** @description Display name of the data
|
464
|
+
/** @description Display name of the data type */
|
465
465
|
displayName: string;
|
466
|
-
/** @description Public ID of the associated data
|
466
|
+
/** @description Public ID of the associated data connection */
|
467
467
|
connectionId: string;
|
468
468
|
/**
|
469
469
|
* @description A connector-specific archetype for this data type; used to select UI as well as perform any
|
@@ -471,25 +471,26 @@ interface external$2 {
|
|
471
471
|
* no special UI or processing is required.
|
472
472
|
*/
|
473
473
|
archetype?: string;
|
474
|
+
allowedOnComponents?: string[];
|
474
475
|
/** @description Resource path, appended to the data connection's baseUrl (e.g. baseUrl = https://base.url, path = /v1/endpoint -> final URL https://base.url/v1/endpoint). Must have leading slash. */
|
475
476
|
path: string;
|
476
|
-
/** @description HTTP headers to pass with requests to the data
|
477
|
+
/** @description HTTP headers to pass with requests to the data type. Merged with headers from the data connection, overriding identical keys. */
|
477
478
|
headers?: {
|
478
479
|
[key: string]: string;
|
479
480
|
};
|
480
|
-
/** @description Query String parameters to pass with requests to the data
|
481
|
+
/** @description Query String parameters to pass with requests to the data type. Merged with parameters from the data connection, overriding identical keys. */
|
481
482
|
parameters?: {
|
482
483
|
[key: string]: string;
|
483
484
|
};
|
484
|
-
/** @description Body to pass with requests to the data
|
485
|
+
/** @description Body to pass with requests to the data type (ignored unless method is POST) */
|
485
486
|
body?: string;
|
486
487
|
/**
|
487
|
-
* @description HTTP method to use with requests to the data
|
488
|
+
* @description HTTP method to use with requests to the data type.
|
488
489
|
* @default GET
|
489
490
|
* @enum {string}
|
490
491
|
*/
|
491
492
|
method: "GET" | "POST" | "HEAD";
|
492
|
-
/** @description Variables needed to make calls to the data
|
493
|
+
/** @description Variables needed to make calls to the data type. Merged with variables from the data connection, overriding identical keys. */
|
493
494
|
variables?: {
|
494
495
|
[key: string]: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
|
495
496
|
};
|
@@ -741,11 +742,11 @@ interface external$1 {
|
|
741
742
|
roleId: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
|
742
743
|
/**
|
743
744
|
* @description Permission type for this permission ComponentDefinition:
|
744
|
-
* read | write | delete
|
745
|
+
* read | write | create | delete
|
745
746
|
*
|
746
747
|
* @enum {string}
|
747
748
|
*/
|
748
|
-
permission: "read" | "write" | "delete";
|
749
|
+
permission: "read" | "write" | "create" | "delete";
|
749
750
|
/** @description State of the component that this permission applies to */
|
750
751
|
state: number;
|
751
752
|
};
|
@@ -897,23 +898,23 @@ interface external$1 {
|
|
897
898
|
* @description An instance of an integration data connector (i.e. "Master environment of the stable space", "Yelp API", "Sanity dev dataset"). These are created in the UI and shared across a whole project.
|
898
899
|
*/
|
899
900
|
DataConnection: {
|
900
|
-
/** @description Public ID of the data
|
901
|
+
/** @description Public ID of the data connection */
|
901
902
|
id: string;
|
902
|
-
/** @description Display name of the data
|
903
|
+
/** @description Display name of the data connection */
|
903
904
|
displayName: string;
|
904
905
|
/** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
|
905
906
|
connectorType: string;
|
906
|
-
/** @description Base resource URL of the data
|
907
|
+
/** @description Base resource URL of the data connection. No trailing slash. */
|
907
908
|
baseUrl: string;
|
908
|
-
/** @description HTTP headers to pass with requests to the data
|
909
|
+
/** @description HTTP headers to pass with requests to the data connection */
|
909
910
|
headers?: {
|
910
911
|
[key: string]: string;
|
911
912
|
};
|
912
|
-
/** @description Query String parameters to pass with requests to the data
|
913
|
+
/** @description Query String parameters to pass with requests to the data connection */
|
913
914
|
parameters?: {
|
914
915
|
[key: string]: string;
|
915
916
|
};
|
916
|
-
/** @description Variables needed to make calls to the data
|
917
|
+
/** @description Variables needed to make calls to the data connection */
|
917
918
|
variables?: {
|
918
919
|
[key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
|
919
920
|
};
|
@@ -927,11 +928,11 @@ interface external$1 {
|
|
927
928
|
* @description A specific type of data that a Data Connection can provide (i.e. "Recipe", "Recipes List by Tag", "Yelp Reviews of My Restaurant"). These are created in the UI and shared a whole project.
|
928
929
|
*/
|
929
930
|
DataType: {
|
930
|
-
/** @description Public ID of the data
|
931
|
+
/** @description Public ID of the data type */
|
931
932
|
id: string;
|
932
|
-
/** @description Display name of the data
|
933
|
+
/** @description Display name of the data type */
|
933
934
|
displayName: string;
|
934
|
-
/** @description Public ID of the associated data
|
935
|
+
/** @description Public ID of the associated data connection */
|
935
936
|
connectionId: string;
|
936
937
|
/**
|
937
938
|
* @description A connector-specific archetype for this data type; used to select UI as well as perform any
|
@@ -939,25 +940,26 @@ interface external$1 {
|
|
939
940
|
* no special UI or processing is required.
|
940
941
|
*/
|
941
942
|
archetype?: string;
|
943
|
+
allowedOnComponents?: string[];
|
942
944
|
/** @description Resource path, appended to the data connection's baseUrl (e.g. baseUrl = https://base.url, path = /v1/endpoint -> final URL https://base.url/v1/endpoint). Must have leading slash. */
|
943
945
|
path: string;
|
944
|
-
/** @description HTTP headers to pass with requests to the data
|
946
|
+
/** @description HTTP headers to pass with requests to the data type. Merged with headers from the data connection, overriding identical keys. */
|
945
947
|
headers?: {
|
946
948
|
[key: string]: string;
|
947
949
|
};
|
948
|
-
/** @description Query String parameters to pass with requests to the data
|
950
|
+
/** @description Query String parameters to pass with requests to the data type. Merged with parameters from the data connection, overriding identical keys. */
|
949
951
|
parameters?: {
|
950
952
|
[key: string]: string;
|
951
953
|
};
|
952
|
-
/** @description Body to pass with requests to the data
|
954
|
+
/** @description Body to pass with requests to the data type (ignored unless method is POST) */
|
953
955
|
body?: string;
|
954
956
|
/**
|
955
|
-
* @description HTTP method to use with requests to the data
|
957
|
+
* @description HTTP method to use with requests to the data type.
|
956
958
|
* @default GET
|
957
959
|
* @enum {string}
|
958
960
|
*/
|
959
961
|
method: "GET" | "POST" | "HEAD";
|
960
|
-
/** @description Variables needed to make calls to the data
|
962
|
+
/** @description Variables needed to make calls to the data type. Merged with variables from the data connection, overriding identical keys. */
|
961
963
|
variables?: {
|
962
964
|
[key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
|
963
965
|
};
|
@@ -1166,11 +1168,11 @@ interface external {
|
|
1166
1168
|
roleId: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
|
1167
1169
|
/**
|
1168
1170
|
* @description Permission type for this permission ComponentDefinition:
|
1169
|
-
* read | write | delete
|
1171
|
+
* read | write | create | delete
|
1170
1172
|
*
|
1171
1173
|
* @enum {string}
|
1172
1174
|
*/
|
1173
|
-
permission: "read" | "write" | "delete";
|
1175
|
+
permission: "read" | "write" | "create" | "delete";
|
1174
1176
|
/** @description State of the component that this permission applies to */
|
1175
1177
|
state: number;
|
1176
1178
|
};
|
@@ -1322,23 +1324,23 @@ interface external {
|
|
1322
1324
|
* @description An instance of an integration data connector (i.e. "Master environment of the stable space", "Yelp API", "Sanity dev dataset"). These are created in the UI and shared across a whole project.
|
1323
1325
|
*/
|
1324
1326
|
DataConnection: {
|
1325
|
-
/** @description Public ID of the data
|
1327
|
+
/** @description Public ID of the data connection */
|
1326
1328
|
id: string;
|
1327
|
-
/** @description Display name of the data
|
1329
|
+
/** @description Display name of the data connection */
|
1328
1330
|
displayName: string;
|
1329
1331
|
/** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
|
1330
1332
|
connectorType: string;
|
1331
|
-
/** @description Base resource URL of the data
|
1333
|
+
/** @description Base resource URL of the data connection. No trailing slash. */
|
1332
1334
|
baseUrl: string;
|
1333
|
-
/** @description HTTP headers to pass with requests to the data
|
1335
|
+
/** @description HTTP headers to pass with requests to the data connection */
|
1334
1336
|
headers?: {
|
1335
1337
|
[key: string]: string;
|
1336
1338
|
};
|
1337
|
-
/** @description Query String parameters to pass with requests to the data
|
1339
|
+
/** @description Query String parameters to pass with requests to the data connection */
|
1338
1340
|
parameters?: {
|
1339
1341
|
[key: string]: string;
|
1340
1342
|
};
|
1341
|
-
/** @description Variables needed to make calls to the data
|
1343
|
+
/** @description Variables needed to make calls to the data connection */
|
1342
1344
|
variables?: {
|
1343
1345
|
[key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
|
1344
1346
|
};
|
@@ -1352,11 +1354,11 @@ interface external {
|
|
1352
1354
|
* @description A specific type of data that a Data Connection can provide (i.e. "Recipe", "Recipes List by Tag", "Yelp Reviews of My Restaurant"). These are created in the UI and shared a whole project.
|
1353
1355
|
*/
|
1354
1356
|
DataType: {
|
1355
|
-
/** @description Public ID of the data
|
1357
|
+
/** @description Public ID of the data type */
|
1356
1358
|
id: string;
|
1357
|
-
/** @description Display name of the data
|
1359
|
+
/** @description Display name of the data type */
|
1358
1360
|
displayName: string;
|
1359
|
-
/** @description Public ID of the associated data
|
1361
|
+
/** @description Public ID of the associated data connection */
|
1360
1362
|
connectionId: string;
|
1361
1363
|
/**
|
1362
1364
|
* @description A connector-specific archetype for this data type; used to select UI as well as perform any
|
@@ -1364,25 +1366,26 @@ interface external {
|
|
1364
1366
|
* no special UI or processing is required.
|
1365
1367
|
*/
|
1366
1368
|
archetype?: string;
|
1369
|
+
allowedOnComponents?: string[];
|
1367
1370
|
/** @description Resource path, appended to the data connection's baseUrl (e.g. baseUrl = https://base.url, path = /v1/endpoint -> final URL https://base.url/v1/endpoint). Must have leading slash. */
|
1368
1371
|
path: string;
|
1369
|
-
/** @description HTTP headers to pass with requests to the data
|
1372
|
+
/** @description HTTP headers to pass with requests to the data type. Merged with headers from the data connection, overriding identical keys. */
|
1370
1373
|
headers?: {
|
1371
1374
|
[key: string]: string;
|
1372
1375
|
};
|
1373
|
-
/** @description Query String parameters to pass with requests to the data
|
1376
|
+
/** @description Query String parameters to pass with requests to the data type. Merged with parameters from the data connection, overriding identical keys. */
|
1374
1377
|
parameters?: {
|
1375
1378
|
[key: string]: string;
|
1376
1379
|
};
|
1377
|
-
/** @description Body to pass with requests to the data
|
1380
|
+
/** @description Body to pass with requests to the data type (ignored unless method is POST) */
|
1378
1381
|
body?: string;
|
1379
1382
|
/**
|
1380
|
-
* @description HTTP method to use with requests to the data
|
1383
|
+
* @description HTTP method to use with requests to the data type.
|
1381
1384
|
* @default GET
|
1382
1385
|
* @enum {string}
|
1383
1386
|
*/
|
1384
1387
|
method: "GET" | "POST" | "HEAD";
|
1385
|
-
/** @description Variables needed to make calls to the data
|
1388
|
+
/** @description Variables needed to make calls to the data type. Merged with variables from the data connection, overriding identical keys. */
|
1386
1389
|
variables?: {
|
1387
1390
|
[key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
|
1388
1391
|
};
|
@@ -1476,7 +1479,7 @@ declare type ComponentLocationReference = {
|
|
1476
1479
|
parentSlot?: string;
|
1477
1480
|
parentSlotIndex?: number;
|
1478
1481
|
};
|
1479
|
-
declare type WalkComponentTreeActions = {
|
1482
|
+
declare type WalkComponentTreeActions<TContext> = {
|
1480
1483
|
/** Replaces the component being visited with a new object */
|
1481
1484
|
replaceComponent: (replacementComponent: ComponentInstance) => void;
|
1482
1485
|
/** Removes the component being visited from the composition */
|
@@ -1485,9 +1488,17 @@ declare type WalkComponentTreeActions = {
|
|
1485
1488
|
insertAfter: (components: ComponentInstance | ComponentInstance[]) => void;
|
1486
1489
|
/** Aborts visitation of components that are in child slots of the current component */
|
1487
1490
|
stopProcessingDescendants: () => void;
|
1491
|
+
/**
|
1492
|
+
* Set a new traversal context for descendants of this node.
|
1493
|
+
* If this is not called, `context` will automatically pass through.
|
1494
|
+
*/
|
1495
|
+
setDescendantsContext: (context: TContext) => void;
|
1496
|
+
setChildContext: (child: ComponentInstance, context: TContext) => void;
|
1488
1497
|
};
|
1489
1498
|
/** Walks a composition's component tree, visiting each component instance depth-first, in order. */
|
1490
|
-
declare function walkComponentTree(component: ComponentInstance, visitor: (component: ComponentInstance, ancestorsAndSelf: Array<ComponentLocationReference>, actions: WalkComponentTreeActions
|
1499
|
+
declare function walkComponentTree<TContext = unknown>(component: ComponentInstance, visitor: (component: ComponentInstance, ancestorsAndSelf: Array<ComponentLocationReference>, actions: WalkComponentTreeActions<TContext>,
|
1500
|
+
/** Traversal context for this node */
|
1501
|
+
currentContext: TContext | undefined) => void, initialContext?: TContext): void;
|
1491
1502
|
declare function getComponentPath(ancestorsAndSelf: Array<ComponentLocationReference>): string;
|
1492
1503
|
|
1493
1504
|
/** A single entry in a batch of queued enhancements. */
|
@@ -1640,15 +1651,11 @@ declare function createLimitPolicy({ throttle, retry, }: {
|
|
1640
1651
|
}): LimitPolicy;
|
1641
1652
|
declare const nullLimitPolicy: LimitPolicy;
|
1642
1653
|
|
1643
|
-
declare
|
1644
|
-
|
1645
|
-
|
1646
|
-
};
|
1647
|
-
declare class CanvasClient extends ApiClient<CanvasClientOptions> {
|
1648
|
-
constructor(options: CanvasClientOptions);
|
1649
|
-
private get canvasUrl();
|
1654
|
+
declare class CanvasClient extends ApiClient<ClientOptions> {
|
1655
|
+
constructor(options: ClientOptions);
|
1656
|
+
private canvasUrl;
|
1650
1657
|
/** Fetches lists of Canvas compositions, optionally by type */
|
1651
|
-
getCompositionList(options?: Omit<CompositionGetParameters, 'projectId' | 'compositionId'>): Promise<{
|
1658
|
+
getCompositionList(options?: Omit<CompositionGetParameters, 'projectId' | 'compositionId' | 'slug'>): Promise<{
|
1652
1659
|
compositions: {
|
1653
1660
|
state: number;
|
1654
1661
|
uiStatus?: "Draft" | "Modified" | "Published" | "Orphan" | undefined;
|
@@ -1902,7 +1909,7 @@ declare class CanvasClient extends ApiClient<CanvasClientOptions> {
|
|
1902
1909
|
useTeamPermissions?: boolean | undefined;
|
1903
1910
|
permissions?: {
|
1904
1911
|
roleId: string;
|
1905
|
-
permission: "read" | "write" | "delete";
|
1912
|
+
permission: "read" | "write" | "create" | "delete";
|
1906
1913
|
state: number;
|
1907
1914
|
}[] | undefined;
|
1908
1915
|
slots?: {
|
@@ -1972,7 +1979,7 @@ declare class CanvasClient extends ApiClient<CanvasClientOptions> {
|
|
1972
1979
|
removeComponentDefinition(body: Omit<ComponentDefinitionDeleteParameters, 'projectId'>): Promise<void>;
|
1973
1980
|
}
|
1974
1981
|
declare class UncachedCanvasClient extends CanvasClient {
|
1975
|
-
constructor(options: Omit<
|
1982
|
+
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
1976
1983
|
}
|
1977
1984
|
|
1978
1985
|
/**
|
@@ -2061,6 +2068,8 @@ declare const CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
|
|
2061
2068
|
declare const CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
|
2062
2069
|
/** Public ID of the Uniform Context enrichment tag parameter on Canvas components */
|
2063
2070
|
declare const CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
|
2071
|
+
/** The name of the query string used to detect if we are in in-context editing mode */
|
2072
|
+
declare const IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
2064
2073
|
|
2065
2074
|
/** Determines if a given Canvas component type is a system-defined type */
|
2066
2075
|
declare const isSystemComponentDefinition: (componentType: string) => boolean;
|
@@ -2077,6 +2086,11 @@ declare function mapSlotToPersonalizedVariations(slot: ComponentInstance[] | und
|
|
2077
2086
|
*/
|
2078
2087
|
declare function mapSlotToTestVariations(slot: ComponentInstance[] | undefined): Array<ComponentInstance & TestVariant>;
|
2079
2088
|
|
2089
|
+
declare const generateHash: ({ composition, secret, }: {
|
2090
|
+
composition: RootComponentInstance;
|
2091
|
+
secret: string | undefined;
|
2092
|
+
}) => number | undefined;
|
2093
|
+
|
2080
2094
|
declare function getChannelName(projectId: string, compositionId: string, state: number): string;
|
2081
2095
|
|
2082
2096
|
declare type EventNames = 'updated';
|
@@ -2104,6 +2118,136 @@ declare function localize({ composition, locale, }: {
|
|
2104
2118
|
}) => string | undefined);
|
2105
2119
|
}): void;
|
2106
2120
|
|
2107
|
-
declare type
|
2121
|
+
declare type SelectComponentMessage = {
|
2122
|
+
type: 'select-component';
|
2123
|
+
id: string;
|
2124
|
+
};
|
2125
|
+
declare type ReadyMessage = {
|
2126
|
+
type: 'ready';
|
2127
|
+
};
|
2128
|
+
declare type UpdateCompositionMessage = {
|
2129
|
+
type: 'update-composition';
|
2130
|
+
composition: RootComponentInstance;
|
2131
|
+
hash: number | undefined;
|
2132
|
+
};
|
2133
|
+
declare type AddComponentMessage = {
|
2134
|
+
type: 'add-component';
|
2135
|
+
componentId: string;
|
2136
|
+
slotName: string;
|
2137
|
+
index: number;
|
2138
|
+
};
|
2139
|
+
declare type MoveComponentMessage = {
|
2140
|
+
type: 'move-component';
|
2141
|
+
componentId: string;
|
2142
|
+
slotName: string;
|
2143
|
+
index: number;
|
2144
|
+
};
|
2145
|
+
declare const isSelectComponentMessage: (message: ChannelMessage) => message is SelectComponentMessage;
|
2146
|
+
declare const isReadyMessage: (message: ChannelMessage) => message is ReadyMessage;
|
2147
|
+
declare const isUpdateCompositionMessage: (message: ChannelMessage) => message is UpdateCompositionMessage;
|
2148
|
+
declare const isAddComponentMessage: (message: ChannelMessage) => message is AddComponentMessage;
|
2149
|
+
declare const isMovingComponentMessage: (message: ChannelMessage) => message is MoveComponentMessage;
|
2150
|
+
declare type ChannelMessage = SelectComponentMessage | ReadyMessage | UpdateCompositionMessage | AddComponentMessage | MoveComponentMessage;
|
2151
|
+
declare type MessageHandler = (message: ChannelMessage, originalEvent: MessageEvent) => void;
|
2152
|
+
declare type Channel = {
|
2153
|
+
ready: () => void;
|
2154
|
+
destroy: () => void;
|
2155
|
+
selectComponent: (id: string) => void;
|
2156
|
+
updateComposition: (component: RootComponentInstance, secret?: string) => void;
|
2157
|
+
on: (types: ChannelMessage['type'][] | ChannelMessage['type'], handler: MessageHandler) => () => void;
|
2158
|
+
addComponent: (options: {
|
2159
|
+
componentId: string;
|
2160
|
+
slotName: string;
|
2161
|
+
index: number;
|
2162
|
+
}) => void;
|
2163
|
+
moveComponent: (options: {
|
2164
|
+
componentId: string;
|
2165
|
+
slotName: string;
|
2166
|
+
index: number;
|
2167
|
+
}) => void;
|
2168
|
+
};
|
2169
|
+
declare const createCanvasChannel: ({ listenTo, broadcastTo, }: {
|
2170
|
+
listenTo: Window[];
|
2171
|
+
broadcastTo: Window[];
|
2172
|
+
}) => Channel;
|
2173
|
+
|
2174
|
+
/** Types of issue that can occur when fetching composition data */
|
2175
|
+
declare type CompositionIssue = CompositionPatternIssue | CompositionDataIssue | CompositionBindingIssue | CompositionVariableIssue;
|
2176
|
+
declare type CompositionIssueCore = {
|
2177
|
+
componentPath: string;
|
2178
|
+
componentType: string;
|
2179
|
+
message: string;
|
2180
|
+
};
|
2181
|
+
/** An error that occured resolving a pattern that is referenced on the composition */
|
2182
|
+
declare type CompositionPatternIssue = CompositionIssueCore & {
|
2183
|
+
type: 'pattern';
|
2184
|
+
code: NonNullable<ComponentInstance['_patternError']>;
|
2185
|
+
};
|
2186
|
+
/** An error while binding a piece of data to a component parameter */
|
2187
|
+
declare type CompositionBindingIssue = CompositionIssueCore & {
|
2188
|
+
type: 'binding';
|
2189
|
+
parameterName: string;
|
2190
|
+
};
|
2191
|
+
/** An error that occurred fetching a data defined on the composition or a pattern within */
|
2192
|
+
declare type CompositionDataIssue = CompositionIssueCore & {
|
2193
|
+
type: 'data';
|
2194
|
+
dataName: string;
|
2195
|
+
dataType: string;
|
2196
|
+
};
|
2197
|
+
/** An issue that occurred while binding dynamic variables to composition data types */
|
2198
|
+
declare type CompositionVariableIssue = CompositionIssueCore & {
|
2199
|
+
type: 'variable';
|
2200
|
+
variableName: string;
|
2201
|
+
};
|
2202
|
+
/** Diagnostic data about the load performance of attached composition datas */
|
2203
|
+
declare type CompositionDataDiagnostic = {
|
2204
|
+
componentPath: string;
|
2205
|
+
dataType: string;
|
2206
|
+
dataName: string;
|
2207
|
+
performance: number;
|
2208
|
+
data: unknown;
|
2209
|
+
};
|
2210
|
+
declare type CommonCompositionGetParameters = Pick<CompositionGetParameters, 'state' | 'skipPatternResolution' | 'withComponentIDs' | 'withUIStatus'> & {
|
2211
|
+
/**
|
2212
|
+
* Adds additional diagnostics (`dataDiagnostics`) to the response containing timings and resolved datas for the composition.
|
2213
|
+
* Because this adds a lot of data to the response, we do not recommend using this unless diagnosing performance issues.
|
2214
|
+
*/
|
2215
|
+
dataDiagnostics?: boolean;
|
2216
|
+
/**
|
2217
|
+
* Pass dynamic variables to the composition that are required for resolving bindings and datas,
|
2218
|
+
* such as language, detail page ID, etc.
|
2219
|
+
*/
|
2220
|
+
dynamicVariables?: Record<string, string>;
|
2221
|
+
};
|
2222
|
+
/** @deprecated do not use */
|
2223
|
+
declare type EdgeCompositionGetResponse = CompositionGetResponse & {
|
2224
|
+
/**
|
2225
|
+
* Copies of resolved data and how long it took to resolve each data.
|
2226
|
+
* Only set when dataDiagnostics=true is passed to the options.
|
2227
|
+
*/
|
2228
|
+
dataDiagnostics?: Array<CompositionDataDiagnostic>;
|
2229
|
+
/**
|
2230
|
+
* Any failures to bind to data that occured on bindings marked 'must exist'.
|
2231
|
+
* If no failures occurred, this will be undefined.
|
2232
|
+
* NOTE: No exception will be thrown if this type of error occurs. You must inspect this property if you care to cause client errors.
|
2233
|
+
*/
|
2234
|
+
errors?: Array<CompositionIssue>;
|
2235
|
+
/**
|
2236
|
+
* Any failures to bind to data that occurred on optional bindings. In most cases, these are only informational (i.e. data is bound to a property that does not always exist)
|
2237
|
+
* If no failures occurred, this will be undefined.
|
2238
|
+
*/
|
2239
|
+
warnings?: Array<CompositionIssue>;
|
2240
|
+
};
|
2241
|
+
/** @deprecated do not use */
|
2242
|
+
declare class EdgeCanvasClient extends ApiClient<ClientOptions> {
|
2243
|
+
constructor(options: ClientOptions);
|
2244
|
+
private canvasUrl;
|
2245
|
+
/** Fetches a Canvas composition by string name (slug) */
|
2246
|
+
getCompositionBySlug(options: Pick<CompositionGetParameters, 'slug'> & CommonCompositionGetParameters): Promise<EdgeCompositionGetResponse>;
|
2247
|
+
/** Fetches a Canvas composition by its public UUID */
|
2248
|
+
getCompositionById(options: Pick<CompositionGetParameters, 'compositionId'> & CommonCompositionGetParameters): Promise<EdgeCompositionGetResponse>;
|
2249
|
+
}
|
2250
|
+
|
2251
|
+
declare const CanvasClientError: typeof ApiClientError;
|
2108
2252
|
|
2109
|
-
export { BatchEnhancer, BatchEntry, CANVAS_DRAFT_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError,
|
2253
|
+
export { AddComponentMessage, BatchEnhancer, BatchEntry, CANVAS_DRAFT_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, CanvasDataConnectionClient, CanvasDataTypeClient, Channel, ChannelMessage, ChildEnhancerBuilder, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentLocationReference, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions, CompositionBindingIssue, CompositionDataDiagnostic, CompositionDataIssue, CompositionIssue, CompositionPatternIssue, CompositionVariableIssue, DataConnection, DataConnectionDeleteParameters, DataConnectionGetParameters, DataConnectionGetResponse, DataConnectionInfo, DataConnectionPutParameters, DataConnectionsGetParameters, DataConnectionsGetResponse, DataType, DataTypeDeleteParameters, DataTypeGetParameters, DataTypeGetResponse, DataTypePutParameters, DataVariable, EdgeCanvasClient, EdgeCompositionGetResponse, EnhancerBuilder, EnhancerContext, EnhancerError, EventNames, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, LimitPolicy, MessageHandler, MoveComponentMessage, ReadyMessage, SelectComponentMessage, SubscribeToCompositionOptions, UncachedCanvasClient, UniqueBatchEntries, UnsubscribeCallback, UpdateCompositionMessage, WalkComponentTreeActions, compose, createBatchEnhancer, createCanvasChannel, createLimitPolicy, enhance, extractLocales, generateHash, getChannelName, getComponentPath, isAddComponentMessage, isMovingComponentMessage, isReadyMessage, isSelectComponentMessage, isSystemComponentDefinition, isUpdateCompositionMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, subscribeToComposition, walkComponentTree };
|
package/dist/index.esm.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{A as p,B as q,C as r,D as s,E as t,F as u,G as v,H as w,I as x,J as y,K as z,L as A,M as B,N as C,O as D,P as E,Q as F,R as G,S as H,T as I,U as J,l as a,m as b,n as c,o as d,p as e,q as f,r as g,s as h,t as i,u as j,v as k,w as l,x as m,y as n,z as o}from"./chunk-
|
1
|
+
import{$ as Q,A as p,B as q,C as r,D as s,E as t,F as u,G as v,H as w,I as x,J as y,K as z,L as A,M as B,N as C,O as D,P as E,Q as F,R as G,S as H,T as I,U as J,V as K,W as L,X as M,Y as N,Z as O,_ as P,aa as R,ba as S,ca as T,da as U,l as a,m as b,n as c,o as d,p as e,q as f,r as g,s as h,t as i,u as j,v as k,w as l,x as m,y as n,z as o}from"./chunk-IQWDQAHE.mjs";export{T as ApiClientError,f as BatchEntry,x as CANVAS_DRAFT_STATE,B as CANVAS_ENRICHMENT_TAG_PARAM,s as CANVAS_INTENT_TAG_PARAM,t as CANVAS_LOCALE_TAG_PARAM,w as CANVAS_LOCALIZATION_SLOT,r as CANVAS_LOCALIZATION_TYPE,z as CANVAS_PERSONALIZATION_PARAM,u as CANVAS_PERSONALIZE_SLOT,p as CANVAS_PERSONALIZE_TYPE,y as CANVAS_PUBLISHED_STATE,v as CANVAS_TEST_SLOT,q as CANVAS_TEST_TYPE,A as CANVAS_TEST_VARIANT_PARAM,l as CanvasClient,U as CanvasClientError,n as CanvasDataConnectionClient,o as CanvasDataTypeClient,d as ChildEnhancerBuilder,S as EdgeCanvasClient,e as EnhancerBuilder,C as IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,m as UncachedCanvasClient,c as UniqueBatchEntries,k as compose,g as createBatchEnhancer,R as createCanvasChannel,H as createEventBus,h as createLimitPolicy,j as enhance,K as extractLocales,G as generateHash,I as getChannelName,b as getComponentPath,P as isAddComponentMessage,Q as isMovingComponentMessage,N as isReadyMessage,M as isSelectComponentMessage,D as isSystemComponentDefinition,O as isUpdateCompositionMessage,L as localize,E as mapSlotToPersonalizedVariations,F as mapSlotToTestVariations,i as nullLimitPolicy,J as subscribeToComposition,a as walkComponentTree};
|