@uniformdev/canvas 17.3.1-alpha.194 → 17.4.1-alpha.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/README.md +14 -2
- package/dist/chunk-YWIQN37J.mjs +4 -0
- package/dist/cli/cli.d.ts +1 -1
- package/dist/cli/cli.js +58 -58
- package/dist/cli/cli.mjs +45 -45
- package/dist/{createEventBus-33bac5ac.d.ts → createEventBus-f298dcef.d.ts} +110 -7
- package/dist/index.d.ts +39 -398
- package/dist/index.esm.js +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
- package/dist/chunk-IK3FODEI.mjs +0 -4
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { C as ComponentInstance, a as ComponentParameter, b as CompositionGetParameters, c as
|
2
|
-
export {
|
1
|
+
import { C as ComponentInstance, a as ComponentParameter, b as CompositionGetParameters, c as CompositionGetByNodePathParameters, D as DataResolutionOptionNegative, d as CompositionGetResponse, e as DataResolutionOptionPositive, f as DataResolutionParameters, g as CompositionResolvedGetResponse, h as CompositionGetValidResponses, i as DataResolutionOption, j as CompositionGetByNodeIdParameters, k as CompositionGetBySlugParameters, l as CompositionGetByIdParameters, m as CompositionPutParameters, n as CompositionDeleteParameters, o as ComponentDefinitionGetParameters, p as ComponentDefinitionPutParameters, q as ComponentDefinitionDeleteParameters, r as DataSourceGetParameters, s as DataSourcesGetParameters, t as DataSourcePutParameters, u as DataSourceDeleteParameters, v as DataTypeGetParameters, w as DataTypeGetResponse, x as DataTypePutParameters, y as DataTypeDeleteParameters, R as RootComponentInstance, P as PreviewEventBus } from './createEventBus-f298dcef.js';
|
2
|
+
export { _ as CanvasDefinitions, ab as ChannelSubscription, L as ComponentDefinition, E as ComponentDefinitionAPIDeleteRequest, B as ComponentDefinitionAPIPutRequest, A as ComponentDefinitionAPIResponse, q as ComponentDefinitionDeleteParameters, o as ComponentDefinitionGetParameters, z as ComponentDefinitionGetResponse, F as ComponentDefinitionListAPIOptions, G as ComponentDefinitionParameter, K as ComponentDefinitionPermission, p as ComponentDefinitionPutParameters, J as ComponentDefinitionSlot, I as ComponentDefinitionSlugSettings, H as ComponentDefinitionVariant, C as ComponentInstance, a as ComponentParameter, T as CompositionAPIDeleteRequest, V as CompositionAPIOptions, S as CompositionAPIResponse, a4 as CompositionDataDiagnostic, n as CompositionDeleteParameters, l as CompositionGetByIdParameters, j as CompositionGetByNodeIdParameters, c as CompositionGetByNodePathParameters, k as CompositionGetBySlugParameters, Q as CompositionGetListResponse, N as CompositionGetOrderBy, b as CompositionGetParameters, d as CompositionGetResponse, h as CompositionGetValidResponses, $ as CompositionIssue, U as CompositionListAPIResponse, a0 as CompositionPatternIssue, m as CompositionPutParameters, g as CompositionResolvedGetResponse, O as CompositionUIStatus, M as CreatingComponentDefinition, a1 as DataElementBindingIssue, W as DataElementConnectionDefinition, i as DataResolutionOption, D as DataResolutionOptionNegative, e as DataResolutionOptionPositive, f as DataResolutionParameters, Z as DataResourceDefinition, Y as DataResourceDefinitions, a2 as DataResourceIssue, a3 as DataResourceVariableIssue, X as DataResourceVariables, a8 as DataSource, u as DataSourceDeleteParameters, r as DataSourceGetParameters, a5 as DataSourceGetResponse, a9 as DataSourceInfo, t as DataSourcePutParameters, s as DataSourcesGetParameters, a6 as DataSourcesGetResponse, a7 as DataType, y as DataTypeDeleteParameters, v as DataTypeGetParameters, w as DataTypeGetResponse, x as DataTypePutParameters, aa as DataVariableDefinition, P as PreviewEventBus, R as RootComponentInstance, ac as createEventBus } from './createEventBus-f298dcef.js';
|
3
3
|
import { Options } from 'p-throttle';
|
4
4
|
import { Options as Options$1 } from 'p-retry';
|
5
5
|
import { ApiClient, ClientOptions, ExceptProject, ApiClientError } from '@uniformdev/context/api';
|
@@ -111,6 +111,10 @@ declare function walkComponentTree<TContext = unknown>(component: ComponentInsta
|
|
111
111
|
/** Traversal context for this node */
|
112
112
|
currentContext: TContext | undefined) => void, initialContext?: TContext): void;
|
113
113
|
declare function getComponentPath(ancestorsAndSelf: Array<ComponentLocationReference>): string;
|
114
|
+
/** Returns the JSON pointer of a component based on its location */
|
115
|
+
declare function getComponentJsonPointer(ancestorsAndSelf: Array<ComponentLocationReference>, { withSlots }?: {
|
116
|
+
withSlots?: boolean | undefined;
|
117
|
+
}): string;
|
114
118
|
|
115
119
|
/** A single entry in a batch of queued enhancements. */
|
116
120
|
declare class BatchEntry<TArgs, TResult> {
|
@@ -345,312 +349,23 @@ declare class CanvasClient extends ApiClient<ClientOptions> {
|
|
345
349
|
}[];
|
346
350
|
totalCount?: number | undefined;
|
347
351
|
}>;
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
} | undefined;
|
366
|
-
};
|
367
|
-
} | undefined;
|
368
|
-
variant?: string | undefined;
|
369
|
-
slots?: {
|
370
|
-
[key: string]: {
|
371
|
-
type: string;
|
372
|
-
parameters?: {
|
373
|
-
[key: string]: {
|
374
|
-
value: unknown;
|
375
|
-
type: string;
|
376
|
-
connectedData?: {
|
377
|
-
pointer: string;
|
378
|
-
syntax: "jptr";
|
379
|
-
required?: boolean | undefined;
|
380
|
-
} | undefined;
|
381
|
-
};
|
382
|
-
} | undefined;
|
383
|
-
variant?: string | undefined;
|
384
|
-
slots?: {
|
385
|
-
[key: string]: any[];
|
386
|
-
} | undefined;
|
387
|
-
_id?: string | undefined;
|
388
|
-
_pattern?: string | undefined;
|
389
|
-
_dataResources?: {
|
390
|
-
[key: string]: {
|
391
|
-
type: string;
|
392
|
-
isPatternParameter?: boolean | undefined;
|
393
|
-
variables?: {
|
394
|
-
[key: string]: string;
|
395
|
-
} | undefined;
|
396
|
-
};
|
397
|
-
} | undefined;
|
398
|
-
_patternDataResources?: {
|
399
|
-
[key: string]: {
|
400
|
-
type: string;
|
401
|
-
isPatternParameter?: boolean | undefined;
|
402
|
-
variables?: {
|
403
|
-
[key: string]: string;
|
404
|
-
} | undefined;
|
405
|
-
};
|
406
|
-
} | undefined;
|
407
|
-
_patternError?: "NOTFOUND" | "CYCLIC" | undefined;
|
408
|
-
}[];
|
409
|
-
} | undefined;
|
410
|
-
_id: string;
|
411
|
-
_slug?: string | null | undefined;
|
412
|
-
_name: string;
|
413
|
-
_dataResources?: {
|
414
|
-
[key: string]: {
|
415
|
-
type: string;
|
416
|
-
isPatternParameter?: boolean | undefined;
|
417
|
-
variables?: {
|
418
|
-
[key: string]: string;
|
419
|
-
} | undefined;
|
420
|
-
};
|
421
|
-
} | undefined;
|
422
|
-
};
|
423
|
-
}>;
|
424
|
-
getCompositionBySitemapNodeId(options: Pick<CompositionGetParameters, 'sitemapNodeId' | 'sitemapId' | 'state' | 'skipEnhance' | 'skipPatternResolution' | 'withComponentIDs' | 'withUIStatus' | 'withTotalCount'>): Promise<{
|
425
|
-
state: number;
|
426
|
-
uiStatus?: "Draft" | "Modified" | "Published" | "Orphan" | undefined;
|
427
|
-
projectId: string;
|
428
|
-
created: string;
|
429
|
-
modified: string;
|
430
|
-
pattern: boolean;
|
431
|
-
composition: {
|
432
|
-
type: string;
|
433
|
-
parameters?: {
|
434
|
-
[key: string]: {
|
435
|
-
value: unknown;
|
436
|
-
type: string;
|
437
|
-
connectedData?: {
|
438
|
-
pointer: string;
|
439
|
-
syntax: "jptr";
|
440
|
-
required?: boolean | undefined;
|
441
|
-
} | undefined;
|
442
|
-
};
|
443
|
-
} | undefined;
|
444
|
-
variant?: string | undefined;
|
445
|
-
slots?: {
|
446
|
-
[key: string]: {
|
447
|
-
type: string;
|
448
|
-
parameters?: {
|
449
|
-
[key: string]: {
|
450
|
-
value: unknown;
|
451
|
-
type: string;
|
452
|
-
connectedData?: {
|
453
|
-
pointer: string;
|
454
|
-
syntax: "jptr";
|
455
|
-
required?: boolean | undefined;
|
456
|
-
} | undefined;
|
457
|
-
};
|
458
|
-
} | undefined;
|
459
|
-
variant?: string | undefined;
|
460
|
-
slots?: {
|
461
|
-
[key: string]: any[];
|
462
|
-
} | undefined;
|
463
|
-
_id?: string | undefined;
|
464
|
-
_pattern?: string | undefined;
|
465
|
-
_dataResources?: {
|
466
|
-
[key: string]: {
|
467
|
-
type: string;
|
468
|
-
isPatternParameter?: boolean | undefined;
|
469
|
-
variables?: {
|
470
|
-
[key: string]: string;
|
471
|
-
} | undefined;
|
472
|
-
};
|
473
|
-
} | undefined;
|
474
|
-
_patternDataResources?: {
|
475
|
-
[key: string]: {
|
476
|
-
type: string;
|
477
|
-
isPatternParameter?: boolean | undefined;
|
478
|
-
variables?: {
|
479
|
-
[key: string]: string;
|
480
|
-
} | undefined;
|
481
|
-
};
|
482
|
-
} | undefined;
|
483
|
-
_patternError?: "NOTFOUND" | "CYCLIC" | undefined;
|
484
|
-
}[];
|
485
|
-
} | undefined;
|
486
|
-
_id: string;
|
487
|
-
_slug?: string | null | undefined;
|
488
|
-
_name: string;
|
489
|
-
_dataResources?: {
|
490
|
-
[key: string]: {
|
491
|
-
type: string;
|
492
|
-
isPatternParameter?: boolean | undefined;
|
493
|
-
variables?: {
|
494
|
-
[key: string]: string;
|
495
|
-
} | undefined;
|
496
|
-
};
|
497
|
-
} | undefined;
|
498
|
-
};
|
499
|
-
}>;
|
500
|
-
/** Fetches a Canvas composition by string name (slug) */
|
501
|
-
getCompositionBySlug(options: Pick<CompositionGetParameters, 'slug' | 'state' | 'skipEnhance' | 'skipPatternResolution' | 'withComponentIDs' | 'withUIStatus' | 'withTotalCount'>): Promise<{
|
502
|
-
state: number;
|
503
|
-
uiStatus?: "Draft" | "Modified" | "Published" | "Orphan" | undefined;
|
504
|
-
projectId: string;
|
505
|
-
created: string;
|
506
|
-
modified: string;
|
507
|
-
pattern: boolean;
|
508
|
-
composition: {
|
509
|
-
type: string;
|
510
|
-
parameters?: {
|
511
|
-
[key: string]: {
|
512
|
-
value: unknown;
|
513
|
-
type: string;
|
514
|
-
connectedData?: {
|
515
|
-
pointer: string;
|
516
|
-
syntax: "jptr";
|
517
|
-
required?: boolean | undefined;
|
518
|
-
} | undefined;
|
519
|
-
};
|
520
|
-
} | undefined;
|
521
|
-
variant?: string | undefined;
|
522
|
-
slots?: {
|
523
|
-
[key: string]: {
|
524
|
-
type: string;
|
525
|
-
parameters?: {
|
526
|
-
[key: string]: {
|
527
|
-
value: unknown;
|
528
|
-
type: string;
|
529
|
-
connectedData?: {
|
530
|
-
pointer: string;
|
531
|
-
syntax: "jptr";
|
532
|
-
required?: boolean | undefined;
|
533
|
-
} | undefined;
|
534
|
-
};
|
535
|
-
} | undefined;
|
536
|
-
variant?: string | undefined;
|
537
|
-
slots?: {
|
538
|
-
[key: string]: any[];
|
539
|
-
} | undefined;
|
540
|
-
_id?: string | undefined;
|
541
|
-
_pattern?: string | undefined;
|
542
|
-
_dataResources?: {
|
543
|
-
[key: string]: {
|
544
|
-
type: string;
|
545
|
-
isPatternParameter?: boolean | undefined;
|
546
|
-
variables?: {
|
547
|
-
[key: string]: string;
|
548
|
-
} | undefined;
|
549
|
-
};
|
550
|
-
} | undefined;
|
551
|
-
_patternDataResources?: {
|
552
|
-
[key: string]: {
|
553
|
-
type: string;
|
554
|
-
isPatternParameter?: boolean | undefined;
|
555
|
-
variables?: {
|
556
|
-
[key: string]: string;
|
557
|
-
} | undefined;
|
558
|
-
};
|
559
|
-
} | undefined;
|
560
|
-
_patternError?: "NOTFOUND" | "CYCLIC" | undefined;
|
561
|
-
}[];
|
562
|
-
} | undefined;
|
563
|
-
_id: string;
|
564
|
-
_slug?: string | null | undefined;
|
565
|
-
_name: string;
|
566
|
-
_dataResources?: {
|
567
|
-
[key: string]: {
|
568
|
-
type: string;
|
569
|
-
isPatternParameter?: boolean | undefined;
|
570
|
-
variables?: {
|
571
|
-
[key: string]: string;
|
572
|
-
} | undefined;
|
573
|
-
};
|
574
|
-
} | undefined;
|
575
|
-
};
|
576
|
-
}>;
|
577
|
-
/** Fetches a Canvas composition by its public UUID */
|
578
|
-
getCompositionById(options: Pick<CompositionGetParameters, 'compositionId' | 'state' | 'skipEnhance' | 'skipPatternResolution' | 'withComponentIDs' | 'withUIStatus' | 'withTotalCount'>): Promise<{
|
579
|
-
state: number;
|
580
|
-
uiStatus?: "Draft" | "Modified" | "Published" | "Orphan" | undefined;
|
581
|
-
projectId: string;
|
582
|
-
created: string;
|
583
|
-
modified: string;
|
584
|
-
pattern: boolean;
|
585
|
-
composition: {
|
586
|
-
type: string;
|
587
|
-
parameters?: {
|
588
|
-
[key: string]: {
|
589
|
-
value: unknown;
|
590
|
-
type: string;
|
591
|
-
connectedData?: {
|
592
|
-
pointer: string;
|
593
|
-
syntax: "jptr";
|
594
|
-
required?: boolean | undefined;
|
595
|
-
} | undefined;
|
596
|
-
};
|
597
|
-
} | undefined;
|
598
|
-
variant?: string | undefined;
|
599
|
-
slots?: {
|
600
|
-
[key: string]: {
|
601
|
-
type: string;
|
602
|
-
parameters?: {
|
603
|
-
[key: string]: {
|
604
|
-
value: unknown;
|
605
|
-
type: string;
|
606
|
-
connectedData?: {
|
607
|
-
pointer: string;
|
608
|
-
syntax: "jptr";
|
609
|
-
required?: boolean | undefined;
|
610
|
-
} | undefined;
|
611
|
-
};
|
612
|
-
} | undefined;
|
613
|
-
variant?: string | undefined;
|
614
|
-
slots?: {
|
615
|
-
[key: string]: any[];
|
616
|
-
} | undefined;
|
617
|
-
_id?: string | undefined;
|
618
|
-
_pattern?: string | undefined;
|
619
|
-
_dataResources?: {
|
620
|
-
[key: string]: {
|
621
|
-
type: string;
|
622
|
-
isPatternParameter?: boolean | undefined;
|
623
|
-
variables?: {
|
624
|
-
[key: string]: string;
|
625
|
-
} | undefined;
|
626
|
-
};
|
627
|
-
} | undefined;
|
628
|
-
_patternDataResources?: {
|
629
|
-
[key: string]: {
|
630
|
-
type: string;
|
631
|
-
isPatternParameter?: boolean | undefined;
|
632
|
-
variables?: {
|
633
|
-
[key: string]: string;
|
634
|
-
} | undefined;
|
635
|
-
};
|
636
|
-
} | undefined;
|
637
|
-
_patternError?: "NOTFOUND" | "CYCLIC" | undefined;
|
638
|
-
}[];
|
639
|
-
} | undefined;
|
640
|
-
_id: string;
|
641
|
-
_slug?: string | null | undefined;
|
642
|
-
_name: string;
|
643
|
-
_dataResources?: {
|
644
|
-
[key: string]: {
|
645
|
-
type: string;
|
646
|
-
isPatternParameter?: boolean | undefined;
|
647
|
-
variables?: {
|
648
|
-
[key: string]: string;
|
649
|
-
} | undefined;
|
650
|
-
};
|
651
|
-
} | undefined;
|
652
|
-
};
|
653
|
-
}>;
|
352
|
+
/** Fetches one composition by its project map node path */
|
353
|
+
getCompositionByNodePath(options: CompositionGetByNodePathParameters & DataResolutionOptionNegative): Promise<CompositionGetResponse>;
|
354
|
+
getCompositionByNodePath(options: CompositionGetByNodePathParameters & DataResolutionOptionPositive & DataResolutionParameters): Promise<CompositionResolvedGetResponse>;
|
355
|
+
getCompositionByNodePath<T extends CompositionGetResponse = CompositionGetValidResponses>(options: CompositionGetByNodePathParameters & DataResolutionOption & DataResolutionParameters): Promise<T>;
|
356
|
+
/** Fetches one composition by its project map node ID */
|
357
|
+
getCompositionByNodeId(options: CompositionGetByNodeIdParameters & DataResolutionOptionNegative): Promise<CompositionGetResponse>;
|
358
|
+
getCompositionByNodeId(options: CompositionGetByNodeIdParameters & DataResolutionOptionPositive & DataResolutionParameters): Promise<CompositionResolvedGetResponse>;
|
359
|
+
getCompositionByNodeId<T extends CompositionGetResponse = CompositionGetValidResponses>(options: CompositionGetByNodeIdParameters & DataResolutionOption & DataResolutionParameters): Promise<T>;
|
360
|
+
/** Fetches one composition by its slug */
|
361
|
+
getCompositionBySlug(options: CompositionGetBySlugParameters & DataResolutionOptionNegative): Promise<CompositionGetResponse>;
|
362
|
+
getCompositionBySlug(options: CompositionGetBySlugParameters & DataResolutionOptionPositive & DataResolutionParameters): Promise<CompositionResolvedGetResponse>;
|
363
|
+
getCompositionBySlug<T extends CompositionGetResponse = CompositionGetValidResponses>(options: CompositionGetBySlugParameters & DataResolutionOption & DataResolutionParameters): Promise<T>;
|
364
|
+
/** Fetches one composition by its ID */
|
365
|
+
getCompositionById(options: CompositionGetByIdParameters & DataResolutionOptionNegative): Promise<CompositionGetResponse>;
|
366
|
+
getCompositionById(options: CompositionGetByIdParameters & DataResolutionOptionPositive & DataResolutionParameters): Promise<CompositionResolvedGetResponse>;
|
367
|
+
getCompositionById<T extends CompositionGetResponse = CompositionGetValidResponses>(options: CompositionGetByIdParameters & DataResolutionOption & DataResolutionParameters): Promise<T>;
|
368
|
+
private getOneComposition;
|
654
369
|
/** Updates or creates a Canvas component definition */
|
655
370
|
updateComposition(body: Omit<CompositionPutParameters, 'projectId'>): Promise<void>;
|
656
371
|
/** Deletes a Canvas component definition */
|
@@ -664,6 +379,7 @@ declare class CanvasClient extends ApiClient<ClientOptions> {
|
|
664
379
|
titleParameter?: string | null | undefined;
|
665
380
|
canBeComposition?: boolean | undefined;
|
666
381
|
parameters?: {
|
382
|
+
/** Updates or creates a Canvas component definition */
|
667
383
|
id: string;
|
668
384
|
name: string;
|
669
385
|
helpText?: string | undefined;
|
@@ -776,6 +492,7 @@ declare class DataSourceClient extends ApiClient {
|
|
776
492
|
type: string;
|
777
493
|
default: string;
|
778
494
|
setBy: "static" | "dynamic";
|
495
|
+
order?: number | undefined;
|
779
496
|
};
|
780
497
|
} | undefined;
|
781
498
|
custom?: {
|
@@ -840,6 +557,8 @@ declare const CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
|
|
840
557
|
declare const CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
|
841
558
|
/** The name of the query string used to detect if we are in in-context editing mode */
|
842
559
|
declare const IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
560
|
+
/** The name of the query string used to detect if we are in in-context editing mode */
|
561
|
+
declare const IN_CONTEXT_EDITOR_COMPONENT_START_ROLE = "uniform-component-start";
|
843
562
|
|
844
563
|
/** Determines if a given Canvas component type is a system-defined type */
|
845
564
|
declare const isSystemComponentDefinition: (componentType: string) => boolean;
|
@@ -902,7 +621,7 @@ declare type UpdateCompositionMessage = {
|
|
902
621
|
};
|
903
622
|
declare type AddComponentMessage = {
|
904
623
|
type: 'add-component';
|
905
|
-
|
624
|
+
parentId: string;
|
906
625
|
slotName: string;
|
907
626
|
index: number;
|
908
627
|
};
|
@@ -912,12 +631,18 @@ declare type MoveComponentMessage = {
|
|
912
631
|
slotName: string;
|
913
632
|
index: number;
|
914
633
|
};
|
634
|
+
declare type DismissPlaceholderMessage = {
|
635
|
+
type: 'dismiss-placeholder';
|
636
|
+
parentId: string;
|
637
|
+
slotName: string;
|
638
|
+
};
|
639
|
+
declare type ChannelMessage = SelectComponentMessage | ReadyMessage | UpdateCompositionMessage | AddComponentMessage | MoveComponentMessage | DismissPlaceholderMessage;
|
915
640
|
declare const isSelectComponentMessage: (message: ChannelMessage) => message is SelectComponentMessage;
|
916
641
|
declare const isReadyMessage: (message: ChannelMessage) => message is ReadyMessage;
|
917
642
|
declare const isUpdateCompositionMessage: (message: ChannelMessage) => message is UpdateCompositionMessage;
|
918
643
|
declare const isAddComponentMessage: (message: ChannelMessage) => message is AddComponentMessage;
|
919
644
|
declare const isMovingComponentMessage: (message: ChannelMessage) => message is MoveComponentMessage;
|
920
|
-
declare
|
645
|
+
declare const isDismissPlaceholderMessage: (message: ChannelMessage) => message is DismissPlaceholderMessage;
|
921
646
|
declare type MessageHandler = (message: ChannelMessage, originalEvent: MessageEvent) => void;
|
922
647
|
declare type Channel = {
|
923
648
|
ready: () => void;
|
@@ -925,99 +650,15 @@ declare type Channel = {
|
|
925
650
|
selectComponent: (id: string) => void;
|
926
651
|
updateComposition: (component: RootComponentInstance, secret?: string) => void;
|
927
652
|
on: (types: ChannelMessage['type'][] | ChannelMessage['type'], handler: MessageHandler) => () => void;
|
928
|
-
addComponent: (options:
|
929
|
-
|
930
|
-
|
931
|
-
index: number;
|
932
|
-
}) => void;
|
933
|
-
moveComponent: (options: {
|
934
|
-
componentId: string;
|
935
|
-
slotName: string;
|
936
|
-
index: number;
|
937
|
-
}) => void;
|
653
|
+
addComponent: (options: Omit<AddComponentMessage, 'type'>) => void;
|
654
|
+
moveComponent: (options: Omit<MoveComponentMessage, 'type'>) => void;
|
655
|
+
dismissPlaceholder: (options: Omit<DismissPlaceholderMessage, 'type'>) => void;
|
938
656
|
};
|
939
657
|
declare const createCanvasChannel: ({ listenTo, broadcastTo, }: {
|
940
658
|
listenTo: Window[];
|
941
659
|
broadcastTo: Window[];
|
942
660
|
}) => Channel;
|
943
661
|
|
944
|
-
/** Types of issue that can occur when fetching composition data */
|
945
|
-
declare type CompositionIssue = CompositionPatternIssue | DataResourceIssue | DataElementBindingIssue | DataResourceVariableIssue;
|
946
|
-
declare type CompositionIssueCore = {
|
947
|
-
componentPath: string;
|
948
|
-
componentType: string;
|
949
|
-
message: string;
|
950
|
-
};
|
951
|
-
/** An error that occured resolving a pattern that is referenced on the composition */
|
952
|
-
declare type CompositionPatternIssue = CompositionIssueCore & {
|
953
|
-
type: 'pattern';
|
954
|
-
code: NonNullable<ComponentInstance['_patternError']>;
|
955
|
-
};
|
956
|
-
/** An error while binding a data element from a data resource to a component parameter (i.e. a missing property in the data resource) */
|
957
|
-
declare type DataElementBindingIssue = CompositionIssueCore & {
|
958
|
-
type: 'binding';
|
959
|
-
parameterName: string;
|
960
|
-
};
|
961
|
-
/** An error that occurred fetching a data defined on the composition or a pattern within */
|
962
|
-
declare type DataResourceIssue = CompositionIssueCore & {
|
963
|
-
type: 'data';
|
964
|
-
dataName: string;
|
965
|
-
dataType: string;
|
966
|
-
};
|
967
|
-
/** An issue that occurred while binding dynamic variables to composition data resources */
|
968
|
-
declare type DataResourceVariableIssue = CompositionIssueCore & {
|
969
|
-
type: 'variable';
|
970
|
-
variableName: string;
|
971
|
-
};
|
972
|
-
/** Diagnostic data about the load performance of attached composition datas */
|
973
|
-
declare type CompositionDataDiagnostic = {
|
974
|
-
componentPath: string;
|
975
|
-
dataType: string;
|
976
|
-
dataName: string;
|
977
|
-
performance: number;
|
978
|
-
data: unknown;
|
979
|
-
};
|
980
|
-
declare type CommonCompositionGetParameters = Pick<CompositionGetParameters, 'state' | 'skipPatternResolution' | 'withComponentIDs' | 'withUIStatus'> & {
|
981
|
-
/**
|
982
|
-
* Adds additional diagnostics (`dataDiagnostics`) to the response containing timings and resolved datas for the composition.
|
983
|
-
* Because this adds a lot of data to the response, we do not recommend using this unless diagnosing performance issues.
|
984
|
-
*/
|
985
|
-
dataDiagnostics?: boolean;
|
986
|
-
/**
|
987
|
-
* Pass dynamic variables to the composition that are required for resolving bindings and datas,
|
988
|
-
* such as language, detail page ID, etc.
|
989
|
-
*/
|
990
|
-
dynamicVariables?: Record<string, string>;
|
991
|
-
};
|
992
|
-
/** @deprecated do not use */
|
993
|
-
declare type EdgeCompositionGetResponse = CompositionGetResponse & {
|
994
|
-
/**
|
995
|
-
* Copies of resolved data and how long it took to resolve each data.
|
996
|
-
* Only set when dataDiagnostics=true is passed to the options.
|
997
|
-
*/
|
998
|
-
dataDiagnostics?: Array<CompositionDataDiagnostic>;
|
999
|
-
/**
|
1000
|
-
* Any failures to bind to data that occured on bindings marked 'must exist'.
|
1001
|
-
* If no failures occurred, this will be undefined.
|
1002
|
-
* NOTE: No exception will be thrown if this type of error occurs. You must inspect this property if you care to cause client errors.
|
1003
|
-
*/
|
1004
|
-
errors?: Array<CompositionIssue>;
|
1005
|
-
/**
|
1006
|
-
* 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)
|
1007
|
-
* If no failures occurred, this will be undefined.
|
1008
|
-
*/
|
1009
|
-
warnings?: Array<CompositionIssue>;
|
1010
|
-
};
|
1011
|
-
/** @deprecated do not use */
|
1012
|
-
declare class EdgeCanvasClient extends ApiClient<ClientOptions> {
|
1013
|
-
constructor(options: ClientOptions);
|
1014
|
-
private canvasUrl;
|
1015
|
-
/** Fetches a Canvas composition by string name (slug) */
|
1016
|
-
getCompositionBySlug(options: Pick<CompositionGetParameters, 'slug'> & CommonCompositionGetParameters): Promise<EdgeCompositionGetResponse>;
|
1017
|
-
/** Fetches a Canvas composition by its public UUID */
|
1018
|
-
getCompositionById(options: Pick<CompositionGetParameters, 'compositionId'> & CommonCompositionGetParameters): Promise<EdgeCompositionGetResponse>;
|
1019
|
-
}
|
1020
|
-
|
1021
662
|
declare const CanvasClientError: typeof ApiClientError;
|
1022
663
|
|
1023
|
-
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, Channel, ChannelMessage, ChildEnhancerBuilder, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentLocationReference, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions,
|
664
|
+
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, Channel, ChannelMessage, ChildEnhancerBuilder, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentLocationReference, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions, DataSourceClient, DataTypeClient, DismissPlaceholderMessage, EnhancerBuilder, EnhancerContext, EnhancerError, EventNames, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, 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, getComponentJsonPointer, getComponentPath, isAddComponentMessage, isDismissPlaceholderMessage, isMovingComponentMessage, isReadyMessage, isSelectComponentMessage, isSystemComponentDefinition, isUpdateCompositionMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, subscribeToComposition, walkComponentTree };
|
package/dist/index.esm.js
CHANGED
@@ -1 +1 @@
|
|
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-
|
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,ea as V,fa as W,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-YWIQN37J.mjs";export{V as ApiClientError,g as BatchEntry,y as CANVAS_DRAFT_STATE,C as CANVAS_ENRICHMENT_TAG_PARAM,t as CANVAS_INTENT_TAG_PARAM,u as CANVAS_LOCALE_TAG_PARAM,x as CANVAS_LOCALIZATION_SLOT,s as CANVAS_LOCALIZATION_TYPE,A as CANVAS_PERSONALIZATION_PARAM,v as CANVAS_PERSONALIZE_SLOT,q as CANVAS_PERSONALIZE_TYPE,z as CANVAS_PUBLISHED_STATE,w as CANVAS_TEST_SLOT,r as CANVAS_TEST_TYPE,B as CANVAS_TEST_VARIANT_PARAM,m as CanvasClient,W as CanvasClientError,e as ChildEnhancerBuilder,o as DataSourceClient,p as DataTypeClient,f as EnhancerBuilder,E as IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,D as IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,n as UncachedCanvasClient,d as UniqueBatchEntries,l as compose,h as createBatchEnhancer,U as createCanvasChannel,J as createEventBus,i as createLimitPolicy,k as enhance,M as extractLocales,I as generateHash,K as getChannelName,c as getComponentJsonPointer,b as getComponentPath,R as isAddComponentMessage,T as isDismissPlaceholderMessage,S as isMovingComponentMessage,P as isReadyMessage,O as isSelectComponentMessage,F as isSystemComponentDefinition,Q as isUpdateCompositionMessage,N as localize,G as mapSlotToPersonalizedVariations,H as mapSlotToTestVariations,j as nullLimitPolicy,L as subscribeToComposition,a as walkComponentTree};
|