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