@uniformdev/canvas 17.7.0 → 17.7.1-alpha.140
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-PVRSC7Y6.mjs → chunk-TN3WBMTA.mjs} +1 -1
- package/dist/cli/cli.d.ts +2 -2
- package/dist/cli/cli.js +1 -1
- package/dist/cli/cli.mjs +1 -1
- package/dist/{createEventBus-bb2f5866.d.ts → createEventBus-025f310c.d.ts} +91 -133
- package/dist/index.d.ts +31 -39
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ApiClient, ClientOptions, ExceptProject, ApiClientError } from '@uniformdev/context/api';
|
2
2
|
export { ApiClientError } from '@uniformdev/context/api';
|
3
|
-
import { C as CompositionGetParameters, a as CompositionGetByNodePathParameters, D as DataResolutionOptionNegative, b as CompositionGetResponse, c as DataResolutionOptionPositive, d as DataResolutionParameters, e as CompositionResolvedGetResponse, f as CompositionGetValidResponses, g as DataResolutionOption, h as CompositionGetByNodeIdParameters, i as CompositionGetBySlugParameters, j as CompositionGetByIdParameters, k as CompositionPutParameters, l as CompositionDeleteParameters, m as ComponentDefinitionGetParameters, n as ComponentDefinitionPutParameters, o as ComponentDefinitionDeleteParameters, p as ComponentInstance, q as ComponentParameter, r as components, s as DataSourceGetParameters, t as DataSourcesGetParameters, u as DataSourcePutParameters, v as DataSourceDeleteParameters, w as DataTypeGetParameters, x as DataTypeGetResponse, y as DataTypePutParameters, z as DataTypeDeleteParameters, R as RootComponentInstance, P as PreviewEventBus } from './createEventBus-
|
4
|
-
export { a1 as CanvasDefinitions, A as ChannelSubscription, O as ComponentDefinition, H as ComponentDefinitionAPIDeleteRequest, G as ComponentDefinitionAPIPutRequest, F as ComponentDefinitionAPIResponse, o as ComponentDefinitionDeleteParameters, m as ComponentDefinitionGetParameters, E as ComponentDefinitionGetResponse, I as ComponentDefinitionListAPIOptions, J as ComponentDefinitionParameter, N as ComponentDefinitionPermission, n as ComponentDefinitionPutParameters, M as ComponentDefinitionSlot, L as ComponentDefinitionSlugSettings, K as ComponentDefinitionVariant, p as ComponentInstance, q as ComponentParameter, W as CompositionAPIDeleteRequest, Y as CompositionAPIOptions, V as CompositionAPIResponse, a8 as CompositionDataDiagnostic, l as CompositionDeleteParameters, j as CompositionGetByIdParameters, h as CompositionGetByNodeIdParameters, a as CompositionGetByNodePathParameters, i as CompositionGetBySlugParameters, U as CompositionGetListResponse, S as CompositionGetOrderBy, C as CompositionGetParameters, b as CompositionGetResponse, f as CompositionGetValidResponses, a2 as CompositionIssue, X as CompositionListAPIResponse, a3 as CompositionPatternIssue, k as CompositionPutParameters, e as CompositionResolvedGetResponse, T as CompositionUIStatus, Q as CreatingComponentDefinition, a4 as DataElementBindingIssue, Z as DataElementConnectionDefinition, a7 as DataResolutionConfigIssue, g as DataResolutionOption, D as DataResolutionOptionNegative, c as DataResolutionOptionPositive, d as DataResolutionParameters, a0 as DataResourceDefinition, $ as DataResourceDefinitions, a5 as DataResourceIssue, a6 as DataResourceVariableIssue, _ as DataResourceVariables, ac as DataSource, v as DataSourceDeleteParameters, s as DataSourceGetParameters, a9 as DataSourceGetResponse, u as DataSourcePutParameters, t as DataSourcesGetParameters, aa as DataSourcesGetResponse, ab as DataType, z as DataTypeDeleteParameters, w as DataTypeGetParameters, x as DataTypeGetResponse, y as DataTypePutParameters, ad as DataVariableDefinition, P as PreviewEventBus, R as RootComponentInstance, B as createEventBus } from './createEventBus-
|
3
|
+
import { C as CompositionGetParameters, a as CompositionGetByNodePathParameters, D as DataResolutionOptionNegative, b as CompositionGetResponse, c as DataResolutionOptionPositive, d as DataResolutionParameters, e as CompositionResolvedGetResponse, f as CompositionGetValidResponses, g as DataResolutionOption, h as CompositionGetByNodeIdParameters, i as CompositionGetBySlugParameters, j as CompositionGetByIdParameters, k as CompositionPutParameters, l as CompositionDeleteParameters, m as ComponentDefinitionGetParameters, n as ComponentDefinitionPutParameters, o as ComponentDefinitionDeleteParameters, p as ComponentInstance, q as ComponentParameter, r as components, s as DataSourceGetParameters, t as DataSourcesGetParameters, u as DataSourcePutParameters, v as DataSourceDeleteParameters, w as DataTypeGetParameters, x as DataTypeGetResponse, y as DataTypePutParameters, z as DataTypeDeleteParameters, R as RootComponentInstance, P as PreviewEventBus } from './createEventBus-025f310c.js';
|
4
|
+
export { a1 as CanvasDefinitions, A as ChannelSubscription, O as ComponentDefinition, H as ComponentDefinitionAPIDeleteRequest, G as ComponentDefinitionAPIPutRequest, F as ComponentDefinitionAPIResponse, o as ComponentDefinitionDeleteParameters, m as ComponentDefinitionGetParameters, E as ComponentDefinitionGetResponse, I as ComponentDefinitionListAPIOptions, J as ComponentDefinitionParameter, N as ComponentDefinitionPermission, n as ComponentDefinitionPutParameters, M as ComponentDefinitionSlot, L as ComponentDefinitionSlugSettings, K as ComponentDefinitionVariant, p as ComponentInstance, q as ComponentParameter, W as CompositionAPIDeleteRequest, Y as CompositionAPIOptions, V as CompositionAPIResponse, a8 as CompositionDataDiagnostic, l as CompositionDeleteParameters, j as CompositionGetByIdParameters, h as CompositionGetByNodeIdParameters, a as CompositionGetByNodePathParameters, i as CompositionGetBySlugParameters, U as CompositionGetListResponse, S as CompositionGetOrderBy, C as CompositionGetParameters, b as CompositionGetResponse, f as CompositionGetValidResponses, a2 as CompositionIssue, X as CompositionListAPIResponse, a3 as CompositionPatternIssue, k as CompositionPutParameters, e as CompositionResolvedGetResponse, T as CompositionUIStatus, Q as CreatingComponentDefinition, a4 as DataElementBindingIssue, Z as DataElementConnectionDefinition, a7 as DataResolutionConfigIssue, g as DataResolutionOption, D as DataResolutionOptionNegative, c as DataResolutionOptionPositive, d as DataResolutionParameters, a0 as DataResourceDefinition, $ as DataResourceDefinitions, a5 as DataResourceIssue, a6 as DataResourceVariableIssue, _ as DataResourceVariables, ac as DataSource, v as DataSourceDeleteParameters, s as DataSourceGetParameters, a9 as DataSourceGetResponse, u as DataSourcePutParameters, t as DataSourcesGetParameters, aa as DataSourcesGetResponse, ab as DataType, z as DataTypeDeleteParameters, w as DataTypeGetParameters, x as DataTypeGetResponse, y as DataTypePutParameters, ad as DataVariableDefinition, P as PreviewEventBus, R as RootComponentInstance, B as createEventBus } from './createEventBus-025f310c.js';
|
5
5
|
import { Options as Options$1 } from 'p-retry';
|
6
6
|
import { Options } from 'p-throttle';
|
7
7
|
import { PersonalizedVariant, TestVariant } from '@uniformdev/context';
|
@@ -142,7 +142,7 @@ declare class CanvasClient extends ApiClient<ClientOptions> {
|
|
142
142
|
}[] | undefined;
|
143
143
|
slugSettings?: {
|
144
144
|
required?: "no" | "yes" | "disabled" | undefined;
|
145
|
-
unique?: "
|
145
|
+
unique?: "no" | "local" | "global" | undefined;
|
146
146
|
regularExpression?: string | undefined;
|
147
147
|
regularExpressionMessage?: string | undefined;
|
148
148
|
} | undefined;
|
@@ -202,11 +202,11 @@ declare class UncachedCanvasClient extends CanvasClient {
|
|
202
202
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
203
203
|
}
|
204
204
|
|
205
|
-
|
205
|
+
type EnhancerContext = {
|
206
206
|
preview?: boolean;
|
207
207
|
};
|
208
208
|
/** Options passed to a ComponentEnhancer function */
|
209
|
-
|
209
|
+
type ComponentEnhancerOptions<TContext extends EnhancerContext = EnhancerContext> = {
|
210
210
|
component: Readonly<ComponentInstance>;
|
211
211
|
context: TContext;
|
212
212
|
};
|
@@ -222,13 +222,13 @@ declare type ComponentEnhancerOptions<TContext extends EnhancerContext = Enhance
|
|
222
222
|
* TValue - sets the configured key in the component's data value to this value
|
223
223
|
* undefined - do not set the component's data key
|
224
224
|
*/
|
225
|
-
|
225
|
+
type ComponentEnhancerFunction<TValue = unknown, TContext extends EnhancerContext = EnhancerContext> = (options: ComponentEnhancerOptions<TContext>) => Promise<TValue | undefined> | TValue | undefined;
|
226
226
|
/**
|
227
227
|
* Defines logic to add arbitrary async data to a component's `data` property.
|
228
228
|
* Used to enhance layout data with information from other platforms, such as private APIs,
|
229
229
|
* where the value is not tied to a parameter and is intrinsic to the component itself.
|
230
230
|
*/
|
231
|
-
|
231
|
+
type ComponentEnhancer<TValue = unknown, TContext extends EnhancerContext = EnhancerContext> = {
|
232
232
|
/** Function called to enhance a single component in a composition. */
|
233
233
|
enhanceOne: ComponentEnhancerFunction<TValue, TContext>;
|
234
234
|
/**
|
@@ -241,7 +241,7 @@ declare type ComponentEnhancer<TValue = unknown, TContext extends EnhancerContex
|
|
241
241
|
completeAll?: () => Promise<void>;
|
242
242
|
};
|
243
243
|
/** Options passed to a ComponentParameterEnhancer function */
|
244
|
-
|
244
|
+
type ComponentParameterEnhancerOptions<TRawValue = unknown, TContext extends EnhancerContext = EnhancerContext> = {
|
245
245
|
parameter: Readonly<ComponentParameter<TRawValue>>;
|
246
246
|
parameterName: string;
|
247
247
|
component: Readonly<ComponentInstance>;
|
@@ -256,13 +256,13 @@ declare type ComponentParameterEnhancerOptions<TRawValue = unknown, TContext ext
|
|
256
256
|
* undefined - do not change the original parameter value
|
257
257
|
* null - sets the parameter value to null, replacing any existing value (i.e. if its value could not be resolved in an external system)
|
258
258
|
*/
|
259
|
-
|
259
|
+
type ComponentParameterEnhancerFunction<TRawValue = unknown, TOutputValue = unknown, TContext extends EnhancerContext = EnhancerContext> = (options: ComponentParameterEnhancerOptions<TRawValue, TContext>) => Promise<TOutputValue | undefined | null> | TOutputValue | undefined | null;
|
260
260
|
/**
|
261
261
|
* Defines logic to replace the value of a component parameter with arbitrary async data.
|
262
262
|
* Used to enhance layout data with information from other platforms, such as CMS, commerce, indexing, etc,
|
263
263
|
* where that data is directly expandable from a parameter value.
|
264
264
|
*/
|
265
|
-
|
265
|
+
type ComponentParameterEnhancer<TRawValue = unknown, TOutputValue = unknown, TContext extends EnhancerContext = EnhancerContext> = {
|
266
266
|
/** Function called to enhance a single parameter to be enhanced. */
|
267
267
|
enhanceOne: ComponentParameterEnhancerFunction<TRawValue, TOutputValue, TContext>;
|
268
268
|
/**
|
@@ -280,10 +280,10 @@ declare type ComponentParameterEnhancer<TRawValue = unknown, TOutputValue = unkn
|
|
280
280
|
completeAll?: () => Promise<number>;
|
281
281
|
};
|
282
282
|
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
283
|
+
type schemas = components['schemas'];
|
284
|
+
type InvalidationPayload = schemas['InvalidationPayload'];
|
285
|
+
type InvalidationResult = schemas['InvalidationResult'];
|
286
|
+
type InvalidationInput = InvalidationResult['input'];
|
287
287
|
|
288
288
|
/**
|
289
289
|
* @deprecated
|
@@ -298,14 +298,10 @@ declare class DataSourceClient extends ApiClient {
|
|
298
298
|
connectorType: string;
|
299
299
|
baseUrl: string;
|
300
300
|
headers?: {
|
301
|
-
[key: string]: string;
|
302
|
-
} | {
|
303
301
|
key: string;
|
304
302
|
value: string;
|
305
303
|
}[] | undefined;
|
306
304
|
parameters?: {
|
307
|
-
[key: string]: string;
|
308
|
-
} | {
|
309
305
|
key: string;
|
310
306
|
value: string;
|
311
307
|
}[] | undefined;
|
@@ -331,14 +327,10 @@ declare class DataSourceClient extends ApiClient {
|
|
331
327
|
connectorType: string;
|
332
328
|
baseUrl: string;
|
333
329
|
headers?: {
|
334
|
-
[key: string]: string;
|
335
|
-
} | {
|
336
330
|
key: string;
|
337
331
|
value: string;
|
338
332
|
}[] | undefined;
|
339
333
|
parameters?: {
|
340
|
-
[key: string]: string;
|
341
|
-
} | {
|
342
334
|
key: string;
|
343
335
|
value: string;
|
344
336
|
}[] | undefined;
|
@@ -395,7 +387,7 @@ declare class BatchEntry<TArgs, TResult> {
|
|
395
387
|
* and once all enhancements have been queued handles them all in a batch.
|
396
388
|
* Note: this type is adaptable to both ComponentParameterEnhancer and ComponentEnhancer types.
|
397
389
|
*/
|
398
|
-
|
390
|
+
type BatchEnhancer<TArgs, TResult> = {
|
399
391
|
/** Adds a promise to the enhancement queue. */
|
400
392
|
enhanceOne: (args: TArgs) => Promise<TResult | undefined>;
|
401
393
|
/** Calls the batch enhancer function for all queued promises and resolves them. Returns number of processed items. */
|
@@ -421,7 +413,7 @@ declare function createBatchEnhancer<TArgs, TResult>({ handleBatch, shouldQueue,
|
|
421
413
|
*/
|
422
414
|
declare const compose: (input: ComponentParameterEnhancer<any, any> | ComponentParameterEnhancerFunction<any>, ...composers: ReadonlyArray<ComponentParameterEnhancer<any, any> | ComponentParameterEnhancerFunction<any>>) => ComponentParameterEnhancer<any, any>;
|
423
415
|
|
424
|
-
|
416
|
+
type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
|
425
417
|
declare function createLimitPolicy({ throttle, retry, }: {
|
426
418
|
throttle?: Options | false;
|
427
419
|
retry?: Options$1 | false;
|
@@ -493,7 +485,7 @@ declare class EnhancerBuilder {
|
|
493
485
|
resolveComponentEnhancers(component: ComponentInstance): Map<string, ComponentEnhancer<unknown, EnhancerContext>>;
|
494
486
|
}
|
495
487
|
|
496
|
-
|
488
|
+
type EnhancerError = {
|
497
489
|
message: string;
|
498
490
|
error: Error | string;
|
499
491
|
};
|
@@ -537,12 +529,12 @@ declare class UniqueBatchEntries<TArgs, TResult> {
|
|
537
529
|
resolveRemaining(value: TResult): void;
|
538
530
|
}
|
539
531
|
|
540
|
-
|
532
|
+
type ComponentLocationReference = {
|
541
533
|
component: ComponentInstance;
|
542
534
|
parentSlot?: string;
|
543
535
|
parentSlotIndex?: number;
|
544
536
|
};
|
545
|
-
|
537
|
+
type WalkComponentTreeActions<TContext> = {
|
546
538
|
/** Replaces the component being visited with a new object */
|
547
539
|
replaceComponent: (replacementComponent: ComponentInstance) => void;
|
548
540
|
/** Removes the component being visited from the composition */
|
@@ -568,44 +560,44 @@ declare function getComponentJsonPointer(ancestorsAndSelf: Array<ComponentLocati
|
|
568
560
|
withSlots?: boolean | undefined;
|
569
561
|
}): string;
|
570
562
|
|
571
|
-
|
563
|
+
type SelectComponentMessage = {
|
572
564
|
type: 'select-component';
|
573
565
|
id: string;
|
574
566
|
};
|
575
|
-
|
567
|
+
type ReadyMessage = {
|
576
568
|
type: 'ready';
|
577
569
|
};
|
578
|
-
|
570
|
+
type UpdateCompositionMessage = {
|
579
571
|
type: 'update-composition';
|
580
572
|
composition: RootComponentInstance;
|
581
573
|
hash: number | undefined;
|
582
574
|
};
|
583
|
-
|
575
|
+
type AddComponentMessage = {
|
584
576
|
type: 'add-component';
|
585
577
|
parentId: string;
|
586
578
|
slotName: string;
|
587
579
|
index: number;
|
588
580
|
};
|
589
|
-
|
581
|
+
type MoveComponentMessage = {
|
590
582
|
type: 'move-component';
|
591
583
|
componentId: string;
|
592
584
|
slotName: string;
|
593
585
|
index: number;
|
594
586
|
};
|
595
|
-
|
587
|
+
type DismissPlaceholderMessage = {
|
596
588
|
type: 'dismiss-placeholder';
|
597
589
|
parentId: string;
|
598
590
|
slotName: string;
|
599
591
|
};
|
600
|
-
|
592
|
+
type ChannelMessage = SelectComponentMessage | ReadyMessage | UpdateCompositionMessage | AddComponentMessage | MoveComponentMessage | DismissPlaceholderMessage;
|
601
593
|
declare const isSelectComponentMessage: (message: ChannelMessage) => message is SelectComponentMessage;
|
602
594
|
declare const isReadyMessage: (message: ChannelMessage) => message is ReadyMessage;
|
603
595
|
declare const isUpdateCompositionMessage: (message: ChannelMessage) => message is UpdateCompositionMessage;
|
604
596
|
declare const isAddComponentMessage: (message: ChannelMessage) => message is AddComponentMessage;
|
605
597
|
declare const isMovingComponentMessage: (message: ChannelMessage) => message is MoveComponentMessage;
|
606
598
|
declare const isDismissPlaceholderMessage: (message: ChannelMessage) => message is DismissPlaceholderMessage;
|
607
|
-
|
608
|
-
|
599
|
+
type MessageHandler = (message: ChannelMessage, originalEvent: MessageEvent) => void;
|
600
|
+
type Channel = {
|
609
601
|
ready: () => void;
|
610
602
|
destroy: () => void;
|
611
603
|
selectComponent: (id: string) => void;
|
@@ -620,11 +612,11 @@ declare const createCanvasChannel: ({ listenTo, broadcastTo, }: {
|
|
620
612
|
broadcastTo: Window[];
|
621
613
|
}) => Channel;
|
622
614
|
|
623
|
-
|
615
|
+
type EventNames = 'updated';
|
624
616
|
|
625
617
|
declare function getChannelName(projectId: string, compositionId: string, state: number): string;
|
626
618
|
|
627
|
-
|
619
|
+
type SubscribeToCompositionOptions = {
|
628
620
|
projectId: string;
|
629
621
|
compositionId: string;
|
630
622
|
compositionState: number;
|
@@ -632,7 +624,7 @@ declare type SubscribeToCompositionOptions = {
|
|
632
624
|
eventBus: PreviewEventBus;
|
633
625
|
event: EventNames;
|
634
626
|
};
|
635
|
-
|
627
|
+
type UnsubscribeCallback = () => void;
|
636
628
|
/** Subscribes to a composition event */
|
637
629
|
declare function subscribeToComposition({ projectId, compositionId, compositionState, eventBus: { subscribe }, callback, event, }: SubscribeToCompositionOptions): UnsubscribeCallback;
|
638
630
|
|
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,fa as W,ga as X,ha as Y,ia as Z,ja as _,ka as $,l as a,la as aa,m as b,ma as ba,n as c,na as ca,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,ha as Y,ia as Z,ja as _,ka as $,l as a,la as aa,m as b,ma as ba,n as c,na as ca,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-TN3WBMTA.mjs";export{ba as ApiClientError,g 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,c as CanvasClient,ca as CanvasClientError,n as ChildEnhancerBuilder,e as DataSourceClient,f as DataTypeClient,I as EDGE_CACHE_DISABLED,H as EDGE_DEFAULT_CACHE_TTL,L as EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS,G as EDGE_MAX_CACHE_TTL,K as EDGE_MAX_L2_CACHE_TTL_IN_HOURS,F as EDGE_MIN_CACHE_TTL,J as EDGE_MIN_L2_CACHE_TTL_IN_HOURS,o as EnhancerBuilder,D as IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,C as IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,E as PLACEHOLDER_ID,d as UncachedCanvasClient,O as UniqueBatchEntries,i as compose,h as createBatchEnhancer,W as createCanvasChannel,X as createEventBus,a as createLimitPolicy,m as enhance,M as extractLocales,P as generateHash,Y as getChannelName,l as getComponentJsonPointer,k as getComponentPath,T as isAddComponentMessage,V as isDismissPlaceholderMessage,U as isMovingComponentMessage,R as isReadyMessage,Q as isSelectComponentMessage,_ as isSystemComponentDefinition,S as isUpdateCompositionMessage,N as localize,$ as mapSlotToPersonalizedVariations,aa as mapSlotToTestVariations,b as nullLimitPolicy,Z as subscribeToComposition,j as walkComponentTree};
|
package/dist/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";var le=Object.create;var A=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var he=Object.getPrototypeOf,fe=Object.prototype.hasOwnProperty;var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ye=(t,e)=>{for(var n in e)A(t,n,{get:e[n],enumerable:!0})},Q=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of de(e))!fe.call(t,r)&&r!==n&&A(t,r,{get:()=>e[r],enumerable:!(o=ue(e,r))||o.enumerable});return t};var Ce=(t,e,n)=>(n=t!=null?le(he(t)):{},Q(e||!t||!t.__esModule?A(n,"default",{value:t,enumerable:!0}):n,t)),ge=t=>Q(A({},"__esModule",{value:!0}),t);var Pe=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var R=(t,e,n)=>(Pe(t,e,"read from private field"),n?n.call(t):e.get(t)),X=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)};var ee=D((rt,K)=>{function g(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}K.exports=g;g.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};g.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};g.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var o=this;return this._timer=setTimeout(function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout(function(){o._operationTimeoutCb(o._attempts)},o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._attempts)},n),this._options.unref&&this._timer.unref(),!0};g.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};g.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};g.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};g.prototype.start=g.prototype.try;g.prototype.errors=function(){return this._errors};g.prototype.attempts=function(){return this._attempts};g.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,n=0,o=0;o<this._errors.length;o++){var r=this._errors[o],s=r.message,i=(t[s]||0)+1;t[s]=i,i>=n&&(e=r,n=i)}return e}});var te=D(E=>{var Ee=ee();E.operation=function(t){var e=E.timeouts(t);return new Ee(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};E.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in t)e[n]=t[n];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],r=0;r<e.retries;r++)o.push(this.createTimeout(r,e));return t&&t.forever&&!o.length&&o.push(this.createTimeout(r,e)),o.sort(function(s,i){return s-i}),o};E.createTimeout=function(t,e){var n=e.randomize?Math.random()+1:1,o=Math.round(n*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return o=Math.min(o,e.maxTimeout),o};E.wrap=function(t,e,n){if(e instanceof Array&&(n=e,e=null),!n){n=[];for(var o in t)typeof t[o]=="function"&&n.push(o)}for(var r=0;r<n.length;r++){var s=n[r],i=t[s];t[s]=function(a){var d=E.operation(e),l=Array.prototype.slice.call(arguments,1),c=l.pop();l.push(function(u){d.retry(u)||(u&&(arguments[0]=d.mainError()),c.apply(this,arguments))}),d.attempt(function(){a.apply(t,l)})}.bind(t,i),t[s].options=e}}});var oe=D((it,ne)=>{ne.exports=te()});var nt={};ye(nt,{ApiClientError:()=>Y.ApiClientError,BatchEntry:()=>S,CANVAS_DRAFT_STATE:()=>bt,CANVAS_ENRICHMENT_TAG_PARAM:()=>Le,CANVAS_INTENT_TAG_PARAM:()=>Ne,CANVAS_LOCALE_TAG_PARAM:()=>F,CANVAS_LOCALIZATION_SLOT:()=>k,CANVAS_LOCALIZATION_TYPE:()=>$,CANVAS_PERSONALIZATION_PARAM:()=>H,CANVAS_PERSONALIZE_SLOT:()=>Ge,CANVAS_PERSONALIZE_TYPE:()=>be,CANVAS_PUBLISHED_STATE:()=>Mt,CANVAS_TEST_SLOT:()=>Be,CANVAS_TEST_TYPE:()=>Me,CANVAS_TEST_VARIANT_PARAM:()=>J,CanvasClient:()=>I,CanvasClientError:()=>tt,ChildEnhancerBuilder:()=>v,DataSourceClient:()=>j,DataTypeClient:()=>w,EDGE_CACHE_DISABLED:()=>Lt,EDGE_DEFAULT_CACHE_TTL:()=>Bt,EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS:()=>Vt,EDGE_MAX_CACHE_TTL:()=>Gt,EDGE_MAX_L2_CACHE_TTL_IN_HOURS:()=>jt,EDGE_MIN_CACHE_TTL:()=>Nt,EDGE_MIN_L2_CACHE_TTL_IN_HOURS:()=>Ut,EnhancerBuilder:()=>V,IN_CONTEXT_EDITOR_COMPONENT_START_ROLE:()=>je,IN_CONTEXT_EDITOR_QUERY_STRING_PARAM:()=>Ue,PLACEHOLDER_ID:()=>Ve,UncachedCanvasClient:()=>L,UniqueBatchEntries:()=>z,compose:()=>Re,createBatchEnhancer:()=>Ae,createCanvasChannel:()=>Ze,createEventBus:()=>qe,createLimitPolicy:()=>B,enhance:()=>Se,extractLocales:()=>ce,generateHash:()=>W,getChannelName:()=>Z,getComponentJsonPointer:()=>we,getComponentPath:()=>O,isAddComponentMessage:()=>Je,isDismissPlaceholderMessage:()=>We,isMovingComponentMessage:()=>ze,isReadyMessage:()=>ke,isSelectComponentMessage:()=>Fe,isSystemComponentDefinition:()=>Xe,isUpdateCompositionMessage:()=>He,localize:()=>$e,mapSlotToPersonalizedVariations:()=>Ke,mapSlotToTestVariations:()=>et,nullLimitPolicy:()=>P,subscribeToComposition:()=>Qe,walkComponentTree:()=>x});module.exports=ge(nt);var ie=require("@uniformdev/context/api");var se=Ce(oe(),1),Te=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"]),b=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},_e=(t,e,n)=>{let o=n.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=o,t},xe=t=>Te.has(t),re=t=>globalThis.DOMException===void 0?new Error(t):new DOMException(t);async function M(t,e){return new Promise((n,o)=>{e={onFailedAttempt(){},retries:10,...e};let r=se.default.operation(e);r.attempt(async s=>{try{n(await t(s))}catch(i){if(!(i instanceof Error)){o(new TypeError(`Non-error was thrown: "${i}". You should only throw errors.`));return}if(i instanceof b)r.stop(),o(i.originalError);else if(i instanceof TypeError&&!xe(i.message))r.stop(),o(i);else{_e(i,s,e);try{await e.onFailedAttempt(i)}catch(p){o(p);return}r.retry(i)||o(r.mainError())}}}),e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",()=>{r.stop();let s=e.signal.reason===void 0?re("The operation was aborted."):e.signal.reason;o(s instanceof Error?s:re(s))},{once:!0})})}var N=class extends Error{constructor(){super("Throttled function aborted"),this.name="AbortError"}};function G({limit:t,interval:e,strict:n}){if(!Number.isFinite(t))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(e))throw new TypeError("Expected `interval` to be a finite number");let o=new Map,r=0,s=0;function i(){let l=Date.now();return l-r>e?(s=1,r=l,0):(s<t?s++:(r+=e,s=1),r-l)}let p=[];function a(){let l=Date.now();if(p.length<t)return p.push(l),0;let c=p.shift()+e;return l>=c?(p.push(l),0):(p.push(c),c-l)}let d=n?a:i;return l=>{let c=function(...u){if(!c.isEnabled)return(async()=>l.apply(this,u))();let f;return new Promise((C,m)=>{f=setTimeout(()=>{C(l.apply(this,u)),o.delete(f)},d()),o.set(f,m)})};return c.abort=()=>{for(let u of o.keys())clearTimeout(u),o.get(u)(new N);o.clear(),p.splice(0,p.length)},c.isEnabled=!0,c}}function B({throttle:t={interval:1e3,limit:10},retry:e={retries:1,factor:1.66}}){let n=t?G(t):null;return function(r){let s=async()=>await r();if(n&&(s=n(s)),e){let i=s;s=()=>M(i,e)}return s()}}var P=async t=>await t();var I=class extends ie.ApiClient{constructor(n){n.limitPolicy||(n.limitPolicy=B({}));super(n);this.canvasUrl="/api/v1/canvas"}async getCompositionList(n){let{projectId:o}=this.options,r=this.createUrl(this.canvasUrl,{...n,projectId:o});return await this.apiClient(r)}unstable_getCompositionByNodePath(n){return this.getOneComposition(n)}unstable_getCompositionByNodeId(n){return this.getOneComposition(n)}getCompositionBySlug(n){return this.getOneComposition(n)}getCompositionById(n){return this.getOneComposition(n)}getOneComposition({unstable_resolveData:n,unstable_dynamicVariables:o,unstable_dataDiagnostics:r,...s}){let{projectId:i}=this.options,p=n?"/api/edge/v1/composition":this.canvasUrl,a={};return n&&(o&&(a.dynamicVariables=JSON.stringify(o)),r&&(a.dataDiagnostics="true")),this.apiClient(this.createUrl(p,{...s,...a,projectId:i}))}async updateComposition(n){let o=this.createUrl("/api/v1/canvas");await this.apiClient(o,{method:"PUT",body:JSON.stringify({...n,projectId:this.options.projectId}),expectNoContent:!0})}async removeComposition(n){let o=this.createUrl("/api/v1/canvas"),{projectId:r}=this.options;await this.apiClient(o,{method:"DELETE",body:JSON.stringify({...n,projectId:r}),expectNoContent:!0})}async getComponentDefinitions(n){let{projectId:o}=this.options,r=this.createUrl("/api/v1/canvas-definitions",{...n,projectId:o});return await this.apiClient(r)}async updateComponentDefinition(n){let o=this.createUrl("/api/v1/canvas-definitions");await this.apiClient(o,{method:"PUT",body:JSON.stringify({...n,projectId:this.options.projectId}),expectNoContent:!0})}async removeComponentDefinition(n){let o=this.createUrl("/api/v1/canvas-definitions");await this.apiClient(o,{method:"DELETE",body:JSON.stringify({...n,projectId:this.options.projectId}),expectNoContent:!0})}},L=class extends I{constructor(e){super({...e,bypassCache:!0})}};var ae=require("@uniformdev/context/api"),U="/api/v1/data-source",ve="/api/v1/data-sources",j=class extends ae.ApiClient{constructor(e){super(e)}async get(e){let{projectId:n}=this.options,o=this.createUrl(U,{...e,projectId:n});return await this.apiClient(o)}async getList(e){let{projectId:n}=this.options,o=this.createUrl(ve,{...e,projectId:n});return await this.apiClient(o)}async upsert(e){let n=this.createUrl(U);await this.apiClient(n,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let n=this.createUrl(U);await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}};var pe=require("@uniformdev/context/api");var T,_=class extends pe.ApiClient{constructor(e){super(e)}async get(e){let{projectId:n}=this.options,o=this.createUrl(R(_,T),{...e,projectId:n});return await this.apiClient(o)}async upsert(e){let n=this.createUrl(R(_,T));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let n=this.createUrl(R(_,T));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},w=_;T=new WeakMap,X(w,T,"/api/v1/data-types");var S=class{constructor(e,n,o){this._resolve=e;this._reject=n;this.args=o;this._isCompleted=!1}resolve(e){this._resolve(e),this._isCompleted=!0}reject(e){this._reject(e),this._isCompleted=!0}get isCompleted(){return this._isCompleted}};function Ae({handleBatch:t,shouldQueue:e,limitPolicy:n}){let o=[];return{enhanceOne:async i=>{if(!e||e(i))return new Promise((p,a)=>{o.push(new S(p,a,i))})},completeAll:async()=>{if(o.length>0){try{await t(o)}catch(p){o.forEach(a=>a.reject(p))}if(o.some(p=>!p.isCompleted))throw new Error("The completeAll() function failed to resolve or reject all promises in the batch!")}let i=o.length;return o=[],i},limitPolicy:n}}var Re=(t,...e)=>({enhanceOne:o=>{let r="enhanceOne"in t?t.enhanceOne(o):t(o);for(let s of e){let i=Ie(r)?r:Promise.resolve(r),p="enhanceOne"in s?s.enhanceOne:s;r=i.then(a=>p({...o,parameter:{type:o.parameter.type,value:a}}))}return r},completeAll:async()=>{var o,r;for(let s of e)if("completeAll"in s)throw new Error("Only the first enhancer in a compose chain can use the completeAll function (batching)");return(r="completeAll"in t?(o=t.completeAll)==null?void 0:o.call(t):0)!=null?r:0}});function Ie(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function x(t,e,n){var s;let o=[{ancestorsAndSelf:[{component:t,parentSlot:void 0,parentSlotIndex:void 0}],context:n}],r=new Map;do{let i=o.pop();if(!i)continue;let p=i.ancestorsAndSelf[0],a=!0,d=(s=r.get(p.component))!=null?s:i.context;e(p.component,i.ancestorsAndSelf,{replaceComponent:c=>{Object.assign(p.component,c),["parameters","variant","slots","data","_pattern","_patternError"].forEach(f=>{c[f]||delete p.component[f]})},removeComponent:()=>{let{parentSlot:c,parentSlotIndex:u}=i.ancestorsAndSelf[0],f=i.ancestorsAndSelf[1];if(c&&typeof u!="undefined")f.component.slots[c].splice(u,1);else throw new Error("Unable to delete composition.")},insertAfter:c=>{let u=Array.isArray(c)?c:[c],{parentSlot:f,parentSlotIndex:C}=i.ancestorsAndSelf[0],m=i.ancestorsAndSelf[1];if(f&&typeof C!="undefined")m.component.slots[f].splice(C+1,0,...u),o.unshift(...u.map(h=>({ancestorsAndSelf:[{component:h,parentSlot:f,get parentSlotIndex(){return m.component.slots[f].findIndex(y=>y===h)}},...i.ancestorsAndSelf],context:d})));else throw new Error("Unable to insert after a component not in a slot.")},stopProcessingDescendants(){a=!1},setDescendantsContext(c){d=c},setChildContext(c,u){r.set(c,u)}},d);let l=p.component.slots;if(a&&l){let c=Object.keys(l);for(let u=c.length-1;u>=0;u--){let f=c[u],C=l[f];for(let m=C.length-1;m>=0;m--){let h=C[m];o.push({ancestorsAndSelf:[{component:h,parentSlot:f,get parentSlotIndex(){return p.component.slots[f].findIndex(y=>y===h)}},...i.ancestorsAndSelf],context:d})}}}}while(o.length>0)}function O(t){let e=[];for(let n=t.length-1;n>=0;n--){let{parentSlot:o,parentSlotIndex:r}=t[n];o&&r!==void 0&&e.push(`${o}[${r}]`)}return`.${e.join(".")}`}function we(t,{withSlots:e=!1}={}){let n=[];for(let o=t.length-1;o>=0;o--){let{parentSlot:r,parentSlotIndex:s}=t[o];r&&s!==void 0&&n.push(`${r}/${s}`)}return e?`/slots/${n.join("/slots/")}`:`/${n.join("/")}`}async function Se({composition:t,enhancers:e,context:n,onErrors:o=r=>{throw new Error(r.map(s=>`${s.message}
|
1
|
+
"use strict";var le=Object.create;var A=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var he=Object.getPrototypeOf,fe=Object.prototype.hasOwnProperty;var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ye=(t,e)=>{for(var n in e)A(t,n,{get:e[n],enumerable:!0})},Q=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of de(e))!fe.call(t,r)&&r!==n&&A(t,r,{get:()=>e[r],enumerable:!(o=ue(e,r))||o.enumerable});return t};var Ce=(t,e,n)=>(n=t!=null?le(he(t)):{},Q(e||!t||!t.__esModule?A(n,"default",{value:t,enumerable:!0}):n,t)),ge=t=>Q(A({},"__esModule",{value:!0}),t);var Pe=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var R=(t,e,n)=>(Pe(t,e,"read from private field"),n?n.call(t):e.get(t)),X=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)};var ee=D((rt,K)=>{function g(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}K.exports=g;g.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};g.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};g.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var o=this;return this._timer=setTimeout(function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout(function(){o._operationTimeoutCb(o._attempts)},o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._attempts)},n),this._options.unref&&this._timer.unref(),!0};g.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};g.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};g.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};g.prototype.start=g.prototype.try;g.prototype.errors=function(){return this._errors};g.prototype.attempts=function(){return this._attempts};g.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,n=0,o=0;o<this._errors.length;o++){var r=this._errors[o],s=r.message,i=(t[s]||0)+1;t[s]=i,i>=n&&(e=r,n=i)}return e}});var te=D(E=>{var Ee=ee();E.operation=function(t){var e=E.timeouts(t);return new Ee(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};E.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in t)e[n]=t[n];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],r=0;r<e.retries;r++)o.push(this.createTimeout(r,e));return t&&t.forever&&!o.length&&o.push(this.createTimeout(r,e)),o.sort(function(s,i){return s-i}),o};E.createTimeout=function(t,e){var n=e.randomize?Math.random()+1:1,o=Math.round(n*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return o=Math.min(o,e.maxTimeout),o};E.wrap=function(t,e,n){if(e instanceof Array&&(n=e,e=null),!n){n=[];for(var o in t)typeof t[o]=="function"&&n.push(o)}for(var r=0;r<n.length;r++){var s=n[r],i=t[s];t[s]=function(a){var d=E.operation(e),l=Array.prototype.slice.call(arguments,1),c=l.pop();l.push(function(u){d.retry(u)||(u&&(arguments[0]=d.mainError()),c.apply(this,arguments))}),d.attempt(function(){a.apply(t,l)})}.bind(t,i),t[s].options=e}}});var oe=D((it,ne)=>{ne.exports=te()});var nt={};ye(nt,{ApiClientError:()=>Y.ApiClientError,BatchEntry:()=>S,CANVAS_DRAFT_STATE:()=>bt,CANVAS_ENRICHMENT_TAG_PARAM:()=>Le,CANVAS_INTENT_TAG_PARAM:()=>Ne,CANVAS_LOCALE_TAG_PARAM:()=>F,CANVAS_LOCALIZATION_SLOT:()=>k,CANVAS_LOCALIZATION_TYPE:()=>$,CANVAS_PERSONALIZATION_PARAM:()=>H,CANVAS_PERSONALIZE_SLOT:()=>Ge,CANVAS_PERSONALIZE_TYPE:()=>be,CANVAS_PUBLISHED_STATE:()=>Mt,CANVAS_TEST_SLOT:()=>Be,CANVAS_TEST_TYPE:()=>Me,CANVAS_TEST_VARIANT_PARAM:()=>J,CanvasClient:()=>I,CanvasClientError:()=>tt,ChildEnhancerBuilder:()=>v,DataSourceClient:()=>j,DataTypeClient:()=>w,EDGE_CACHE_DISABLED:()=>Lt,EDGE_DEFAULT_CACHE_TTL:()=>Bt,EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS:()=>Vt,EDGE_MAX_CACHE_TTL:()=>Gt,EDGE_MAX_L2_CACHE_TTL_IN_HOURS:()=>jt,EDGE_MIN_CACHE_TTL:()=>Nt,EDGE_MIN_L2_CACHE_TTL_IN_HOURS:()=>Ut,EnhancerBuilder:()=>V,IN_CONTEXT_EDITOR_COMPONENT_START_ROLE:()=>je,IN_CONTEXT_EDITOR_QUERY_STRING_PARAM:()=>Ue,PLACEHOLDER_ID:()=>Ve,UncachedCanvasClient:()=>L,UniqueBatchEntries:()=>z,compose:()=>Re,createBatchEnhancer:()=>Ae,createCanvasChannel:()=>Ze,createEventBus:()=>qe,createLimitPolicy:()=>B,enhance:()=>Se,extractLocales:()=>ce,generateHash:()=>W,getChannelName:()=>Z,getComponentJsonPointer:()=>we,getComponentPath:()=>O,isAddComponentMessage:()=>Je,isDismissPlaceholderMessage:()=>We,isMovingComponentMessage:()=>ze,isReadyMessage:()=>ke,isSelectComponentMessage:()=>Fe,isSystemComponentDefinition:()=>Xe,isUpdateCompositionMessage:()=>He,localize:()=>$e,mapSlotToPersonalizedVariations:()=>Ke,mapSlotToTestVariations:()=>et,nullLimitPolicy:()=>P,subscribeToComposition:()=>Qe,walkComponentTree:()=>x});module.exports=ge(nt);var ie=require("@uniformdev/context/api");var se=Ce(oe(),1),Te=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed"]),b=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},_e=(t,e,n)=>{let o=n.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=o,t},xe=t=>Te.has(t),re=t=>globalThis.DOMException===void 0?new Error(t):new DOMException(t);async function M(t,e){return new Promise((n,o)=>{e={onFailedAttempt(){},retries:10,...e};let r=se.default.operation(e);r.attempt(async s=>{try{n(await t(s))}catch(i){if(!(i instanceof Error)){o(new TypeError(`Non-error was thrown: "${i}". You should only throw errors.`));return}if(i instanceof b)r.stop(),o(i.originalError);else if(i instanceof TypeError&&!xe(i.message))r.stop(),o(i);else{_e(i,s,e);try{await e.onFailedAttempt(i)}catch(p){o(p);return}r.retry(i)||o(r.mainError())}}}),e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",()=>{r.stop();let s=e.signal.reason===void 0?re("The operation was aborted."):e.signal.reason;o(s instanceof Error?s:re(s))},{once:!0})})}var N=class extends Error{constructor(){super("Throttled function aborted"),this.name="AbortError"}};function G({limit:t,interval:e,strict:n}){if(!Number.isFinite(t))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(e))throw new TypeError("Expected `interval` to be a finite number");let o=new Map,r=0,s=0;function i(){let l=Date.now();return l-r>e?(s=1,r=l,0):(s<t?s++:(r+=e,s=1),r-l)}let p=[];function a(){let l=Date.now();if(p.length<t)return p.push(l),0;let c=p.shift()+e;return l>=c?(p.push(l),0):(p.push(c),c-l)}let d=n?a:i;return l=>{let c=function(...u){if(!c.isEnabled)return(async()=>l.apply(this,u))();let f;return new Promise((C,m)=>{f=setTimeout(()=>{C(l.apply(this,u)),o.delete(f)},d()),o.set(f,m)})};return c.abort=()=>{for(let u of o.keys())clearTimeout(u),o.get(u)(new N);o.clear(),p.splice(0,p.length)},c.isEnabled=!0,c}}function B({throttle:t={interval:1e3,limit:10},retry:e={retries:1,factor:1.66}}){let n=t?G(t):null;return function(r){let s=async()=>await r();if(n&&(s=n(s)),e){let i=s;s=()=>M(i,e)}return s()}}var P=async t=>await t();var I=class extends ie.ApiClient{constructor(n){n.limitPolicy||(n.limitPolicy=B({}));super(n);this.canvasUrl="/api/v1/canvas"}async getCompositionList(n){let{projectId:o}=this.options,r=this.createUrl(this.canvasUrl,{...n,projectId:o});return await this.apiClient(r)}unstable_getCompositionByNodePath(n){return this.getOneComposition(n)}unstable_getCompositionByNodeId(n){return this.getOneComposition(n)}getCompositionBySlug(n){return this.getOneComposition(n)}getCompositionById(n){return this.getOneComposition(n)}getOneComposition({unstable_resolveData:n,unstable_dynamicVariables:o,unstable_dataDiagnostics:r,...s}){let{projectId:i}=this.options,p=n?"/api/edge/v1/composition":this.canvasUrl,a={};return n&&(o&&(a.dynamicVariables=JSON.stringify(o)),r&&(a.dataDiagnostics="true")),this.apiClient(this.createUrl(p,{...s,...a,projectId:i}))}async updateComposition(n){let o=this.createUrl("/api/v1/canvas");await this.apiClient(o,{method:"PUT",body:JSON.stringify({...n,projectId:this.options.projectId}),expectNoContent:!0})}async removeComposition(n){let o=this.createUrl("/api/v1/canvas"),{projectId:r}=this.options;await this.apiClient(o,{method:"DELETE",body:JSON.stringify({...n,projectId:r}),expectNoContent:!0})}async getComponentDefinitions(n){let{projectId:o}=this.options,r=this.createUrl("/api/v1/canvas-definitions",{...n,projectId:o});return await this.apiClient(r)}async updateComponentDefinition(n){let o=this.createUrl("/api/v1/canvas-definitions");await this.apiClient(o,{method:"PUT",body:JSON.stringify({...n,projectId:this.options.projectId}),expectNoContent:!0})}async removeComponentDefinition(n){let o=this.createUrl("/api/v1/canvas-definitions");await this.apiClient(o,{method:"DELETE",body:JSON.stringify({...n,projectId:this.options.projectId}),expectNoContent:!0})}},L=class extends I{constructor(e){super({...e,bypassCache:!0})}};var ae=require("@uniformdev/context/api"),U="/api/v1/data-source",ve="/api/v1/data-sources",j=class extends ae.ApiClient{constructor(e){super(e)}async get(e){let{projectId:n}=this.options,o=this.createUrl(U,{...e,projectId:n});return await this.apiClient(o)}async getList(e){let{projectId:n}=this.options,o=this.createUrl(ve,{...e,projectId:n});return await this.apiClient(o)}async upsert(e){let n=this.createUrl(U);await this.apiClient(n,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let n=this.createUrl(U);await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}};var pe=require("@uniformdev/context/api");var T,_=class extends pe.ApiClient{constructor(e){super(e)}async get(e){let{projectId:n}=this.options,o=this.createUrl(R(_,T),{...e,projectId:n});return await this.apiClient(o)}async upsert(e){let n=this.createUrl(R(_,T));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let n=this.createUrl(R(_,T));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},w=_;T=new WeakMap,X(w,T,"/api/v1/data-types");var S=class{constructor(e,n,o){this._resolve=e;this._reject=n;this.args=o;this._isCompleted=!1}resolve(e){this._resolve(e),this._isCompleted=!0}reject(e){this._reject(e),this._isCompleted=!0}get isCompleted(){return this._isCompleted}};function Ae({handleBatch:t,shouldQueue:e,limitPolicy:n}){let o=[];return{enhanceOne:async i=>{if(!e||e(i))return new Promise((p,a)=>{o.push(new S(p,a,i))})},completeAll:async()=>{if(o.length>0){try{await t(o)}catch(p){o.forEach(a=>a.reject(p))}if(o.some(p=>!p.isCompleted))throw new Error("The completeAll() function failed to resolve or reject all promises in the batch!")}let i=o.length;return o=[],i},limitPolicy:n}}var Re=(t,...e)=>({enhanceOne:o=>{let r="enhanceOne"in t?t.enhanceOne(o):t(o);for(let s of e){let i=Ie(r)?r:Promise.resolve(r),p="enhanceOne"in s?s.enhanceOne:s;r=i.then(a=>p({...o,parameter:{type:o.parameter.type,value:a}}))}return r},completeAll:async()=>{var o,r;for(let s of e)if("completeAll"in s)throw new Error("Only the first enhancer in a compose chain can use the completeAll function (batching)");return(r="completeAll"in t?(o=t.completeAll)==null?void 0:o.call(t):0)!=null?r:0}});function Ie(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function x(t,e,n){var s;let o=[{ancestorsAndSelf:[{component:t,parentSlot:void 0,parentSlotIndex:void 0}],context:n}],r=new Map;do{let i=o.pop();if(!i)continue;let p=i.ancestorsAndSelf[0],a=!0,d=(s=r.get(p.component))!=null?s:i.context;e(p.component,i.ancestorsAndSelf,{replaceComponent:c=>{Object.assign(p.component,c),["parameters","variant","slots","data","_pattern","_patternError"].forEach(f=>{c[f]||delete p.component[f]})},removeComponent:()=>{let{parentSlot:c,parentSlotIndex:u}=i.ancestorsAndSelf[0],f=i.ancestorsAndSelf[1];if(c&&typeof u!="undefined")f.component.slots[c].splice(u,1);else throw new Error("Unable to delete composition.")},insertAfter:c=>{let u=Array.isArray(c)?c:[c],{parentSlot:f,parentSlotIndex:C}=i.ancestorsAndSelf[0],m=i.ancestorsAndSelf[1];if(f&&typeof C!="undefined")m.component.slots[f].splice(C+1,0,...u),o.unshift(...u.map(h=>({ancestorsAndSelf:[{component:h,parentSlot:f,get parentSlotIndex(){return m.component.slots[f].findIndex(y=>y===h)}},...i.ancestorsAndSelf],context:d})));else throw new Error("Unable to insert after a component not in a slot.")},stopProcessingDescendants(){a=!1},setDescendantsContext(c){d=c},setChildContext(c,u){r.set(c,u)}},d);let l=p.component.slots;if(a&&l){let c=Object.keys(l);for(let u=c.length-1;u>=0;u--){let f=c[u],C=l[f];for(let m=C.length-1;m>=0;m--){let h=C[m];o.push({ancestorsAndSelf:[{component:h,parentSlot:f,get parentSlotIndex(){return p.component.slots[f].findIndex(y=>y===h)}},...i.ancestorsAndSelf],context:d})}}}}while(o.length>0)}function O(t){let e=[];for(let n=t.length-1;n>=0;n--){let{parentSlot:o,parentSlotIndex:r}=t[n];o&&r!==void 0&&e.push(`${o}[${r}]`)}return`.${e.join(".")}`}function we(t,{withSlots:e=!1}={}){let n=[];for(let o=t.length-1;o>=0;o--){let{parentSlot:r,parentSlotIndex:s}=t[o];r&&s!==void 0&&n.push(`${r}/${s}`)}return e?`/slots/${n.join("/slots/")}`:`/${n.join("/")}`}async function Se({composition:t,enhancers:e,context:n,onErrors:o=r=>{throw new Error(r.map(s=>`${s.message}
|
2
2
|
${typeof s.error=="object"&&"stack"in s.error?s.error.stack:s.error}`).join(`
|
3
3
|
|
4
4
|
`))}}){let r=[],s=new Set,i=new Set;x(t,(a,d)=>{var c;Object.entries((c=a.parameters)!=null?c:{}).forEach(([u,f])=>{let C=e.resolveParameterEnhancer(a,u,f);C&&(i.add(C),r.push(De(a,d,u,f,C,n)))});let l=e.resolveComponentEnhancers(a);r.push(Oe(a,d,l,n)),s.add(l)}),r.push(...Array.from(s).flatMap(a=>Array.from(a).map(async([,d])=>{var l;try{d.completeAll&&await((l=d.limitPolicy)!=null?l:P)(()=>d.completeAll())}catch(c){return{error:c,message:"Batch component enhancer failed. Individual failed components should receive their own rejections."}}}))),r.push(...Array.from(i).map(async a=>{var d;try{a.completeAll&&await((d=a.limitPolicy)!=null?d:P)(()=>a.completeAll())}catch(l){return{error:l,message:"Batch parameter enhancer failed. Individual failed parameters should receive their own rejections."}}}));let p=(await Promise.all(r)).flatMap(a=>Array.isArray(a)?a:[a]).filter(a=>a);p.length&&o(p)}async function Oe(t,e,n,o){return n.size&&(t.data={}),await Promise.all(Array.from(n).map(async([r,s])=>{var i;try{let a=await(s.completeAll?P:(i=s.limitPolicy)!=null?i:P)(async()=>s.enhanceOne({component:t,context:o}));a!=null&&(t.data[r]=a)}catch(p){let a=`Component ${O(e)} (type: ${t.type}): data.${r} enhancer threw exception. Data key will not be present.`;return delete t.data[r],{message:a,error:p}}}))}async function De(t,e,n,o,r,s){var i;try{let a=await(r.completeAll?P:(i=r.limitPolicy)!=null?i:P)(async()=>r.enhanceOne({parameter:o,parameterName:n,component:t,context:s}));a===null?delete t.parameters[n]:typeof a=="undefined"?t.parameters[n]={...o,value:o.value}:t.parameters[n]={...o,value:a}}catch(p){let a=`Component ${O(e)} (type: ${t.type}): enhancing parameter ${n} (type: ${o.type}) threw exception. Parameter will be removed.`;return delete t.parameters[n],{message:a,error:p}}}var v=class{constructor(){this._paramMatches=Array();this._dataMatches=new Map}parameter(e){return this._paramMatches.push({enhancer:this._resolveParameterEnhancer(e)}),this}parameterName(e,n){return(Array.isArray(e)?e:[e]).forEach(r=>this._paramMatches.push({name:r,enhancer:this._resolveParameterEnhancer(n)})),this}parameterType(e,n){return(Array.isArray(e)?e:[e]).forEach(r=>this._paramMatches.push({type:r,enhancer:this._resolveParameterEnhancer(n)})),this}data(e,n){if(this._dataMatches.has(e))throw new Error(`${e} enhancer data key has been used more than once. This will cause data loss.`);return this._dataMatches.set(e,typeof n=="function"?{enhanceOne:n}:n),this}resolveParameterEnhancer(e,n){var o;return(o=this._paramMatches.find(r=>r.name&&r.name===e||r.type&&r.type===n.type||!r.type&&!r.name))==null?void 0:o.enhancer}resolveComponentEnhancers(){return this._dataMatches}_resolveParameterEnhancer(e){return typeof e=="function"?{enhanceOne:e}:e}},V=class{constructor(){this._componentIndex={};this._rootBuilder=new v}parameter(e){return this._rootBuilder.parameter(e),this}parameterName(e,n){return this._rootBuilder.parameterName(e,n),this}parameterType(e,n){return this._rootBuilder.parameterType(e,n),this}data(e,n){return this._rootBuilder.data(e,n),this}component(e,n){return(Array.isArray(e)?e:[e]).forEach(r=>{this._componentIndex[r]=this._componentIndex[r]||new v,n(this._componentIndex[r])}),this}resolveParameterEnhancer(e,n,o){let r=this._componentIndex[e.type];if(r){let s=r.resolveParameterEnhancer(n,o);if(s)return s}return this._rootBuilder.resolveParameterEnhancer(n,o)}resolveComponentEnhancers(e){let n=this._rootBuilder.resolveComponentEnhancers(),o=this._componentIndex[e.type];if(o){n=new Map(n);for(let[r,s]of o.resolveComponentEnhancers())n.set(r,s)}return n}};var be="$personalization",Me="$test",$="$localization",Ne="intentTag",F="locale",Ge="pz",Be="test",k="localized",bt=0,Mt=64,H="$pzCrit",J="$tstVrnt",Le="$enr",Ue="is_incontext_editing_mode",je="uniform-component-start",Ve="placeholder",Nt=15,Gt=600,Bt=30,Lt=-1,Ut=1,jt=672,Vt=24;function ce({component:t}){var o;let e={},n=(o=t.slots)==null?void 0:o[k];return n==null||n.forEach(r=>{var i;let s=(i=r.parameters)==null?void 0:i[F];(s==null?void 0:s.value)&&typeof s.value=="string"&&(e[s.value]=e[s.value]||[],e[s.value].push(r))}),e}function $e({composition:t,locale:e}){x(t,(n,o,r)=>{if(n.type===$){let s=ce({component:n}),i=typeof e=="string"?e:e({component:n,locales:s}),p;if(i&&(p=s[i]),p!=null&&p.length){let[a,...d]=p;r.replaceComponent(a),d.length&&r.insertAfter(d)}else r.removeComponent()}})}var z=class{constructor(e,n){this.groups=e.reduce((o,r)=>{var i;let s=n(r.args);return o[s]=(i=o[s])!=null?i:[],o[s].push(r),o},{})}resolveKey(e,n){this.groups[e].forEach(o=>o.resolve(n))}resolveRemaining(e){Object.keys(this.groups).forEach(n=>{this.groups[n].forEach(o=>{o.isCompleted||o.resolve(e)})})}};var W=({composition:t,secret:e})=>{if(!e)return;let n=`${JSON.stringify(t)}-${e}`,o=0;for(let r=0;r<n.length;r++){let s=n.charCodeAt(r);o=(o<<5)-o+s,o|=0}return o};var Fe=t=>t.type==="select-component"&&t.id!==void 0,ke=t=>t.type==="ready",He=t=>t.type==="update-composition",Je=t=>t.type==="add-component",ze=t=>t.type==="move-component",We=t=>t.type==="dismiss-placeholder",Ze=({listenTo:t,broadcastTo:e})=>{let n=0,o={},r=[...e],s=m=>{r.forEach(h=>h.postMessage(JSON.stringify(m),"*"))},i=m=>{s({type:"select-component",id:m})},p=()=>{s({type:"ready"})},a=(m,h)=>{let y=++n;return o[y]={types:Array.isArray(m)?m:[m],handler:h},()=>{delete o[y]}},d=(m,h)=>{let y={type:"update-composition",composition:m,hash:W({composition:m,secret:h})};s(y)},l=m=>{let h={...m,type:"add-component"};s(h)},c=m=>{let h={...m,type:"move-component"};s(h)},u=m=>{let h={...m,type:"dismiss-placeholder"};s(h)},f=m=>{if(typeof m.data!="string"||m.source===window)return;let h=null;try{let y=JSON.parse(m.data);Object.hasOwn(y,"type")&&(h=y)}catch(y){}if(!!h)for(let y in o){let q=o[y];q.types.includes(h.type)&&q.handler(h,m)}};return t.forEach(m=>m.addEventListener("message",f)),{ready:p,destroy:()=>{t.forEach(m=>m.removeEventListener("message",f))},selectComponent:i,updateComposition:d,on:a,addComponent:l,moveComponent:c,dismissPlaceholder:u}};var me="https://js.pusher.com/7.0.3/pusher.min.js";async function Ye(){if(!(typeof document=="undefined"||typeof window=="undefined"))return window.Pusher?window.Pusher:new Promise((t,e)=>{let n=setTimeout(()=>{window.Pusher&&t(window.Pusher),e(`Unable to load pusher.js; Uniform Canvas live preview disabled. Consider adding <script src="${me}"><\/script> manually.`)},5e3),o=document.createElement("script");o.src=me,o.addEventListener("load",()=>{clearTimeout(n),t(window.Pusher)}),document.head.appendChild(o)})}async function qe(){let t=await Ye();if(!t)return;let e=window.__UNIFORM_EVENT_BUS__;if(!e){let n=new t("7b5f5abd160fea549ffe",{cluster:"mt1"});n.connect(),console.log("[canvas] \u{1F525} preview connected"),e=window.__UNIFORM_EVENT_BUS__={subscribe:o=>{let r=n.subscribe(o);return{unsubscribe:()=>n.unsubscribe(o),addEventHandler:(s,i)=>(r.bind(s,i),()=>r.unbind(s,i))}}}}return e}function Z(t,e,n){return`${t}.${e}@${n}`}function Qe({projectId:t,compositionId:e,compositionState:n=0,eventBus:{subscribe:o},callback:r,event:s="updated"}){let i=Z(t,e,n),p=o(i),a=p.addEventHandler(s,r);return()=>{a(),p.unsubscribe()}}var Xe=t=>t.startsWith("$");function Ke(t){return t?t.map((e,n)=>{var s,i;let o=(i=(s=e.parameters)==null?void 0:s[H])==null?void 0:i.value,r=(o==null?void 0:o.name)||`pz-${n}-${e.type}`;return{...e,id:r,pz:o}}):[]}function et(t){return t?t.map((e,n)=>{var s,i,p;let o=(i=(s=e.parameters)==null?void 0:s[J])==null?void 0:i.value,r=(p=o==null?void 0:o.id)!=null?p:"testId"in e?e.testId:`ab-${n}-${e.type}`;return{...e,id:r}}):[]}var Y=require("@uniformdev/context/api"),tt=Y.ApiClientError;0&&(module.exports={ApiClientError,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,ChildEnhancerBuilder,DataSourceClient,DataTypeClient,EDGE_CACHE_DISABLED,EDGE_DEFAULT_CACHE_TTL,EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS,EDGE_MAX_CACHE_TTL,EDGE_MAX_L2_CACHE_TTL_IN_HOURS,EDGE_MIN_CACHE_TTL,EDGE_MIN_L2_CACHE_TTL_IN_HOURS,EnhancerBuilder,IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,PLACEHOLDER_ID,UncachedCanvasClient,UniqueBatchEntries,compose,createBatchEnhancer,createCanvasChannel,createEventBus,createLimitPolicy,enhance,extractLocales,generateHash,getChannelName,getComponentJsonPointer,getComponentPath,isAddComponentMessage,isDismissPlaceholderMessage,isMovingComponentMessage,isReadyMessage,isSelectComponentMessage,isSystemComponentDefinition,isUpdateCompositionMessage,localize,mapSlotToPersonalizedVariations,mapSlotToTestVariations,nullLimitPolicy,subscribeToComposition,walkComponentTree});
|
package/dist/index.mjs
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,fa as W,ga as X,ha as Y,ia as Z,ja as _,ka as $,l as a,la as aa,m as b,ma as ba,n as c,na as ca,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,ha as Y,ia as Z,ja as _,ka as $,l as a,la as aa,m as b,ma as ba,n as c,na as ca,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-TN3WBMTA.mjs";export{ba as ApiClientError,g 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,c as CanvasClient,ca as CanvasClientError,n as ChildEnhancerBuilder,e as DataSourceClient,f as DataTypeClient,I as EDGE_CACHE_DISABLED,H as EDGE_DEFAULT_CACHE_TTL,L as EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS,G as EDGE_MAX_CACHE_TTL,K as EDGE_MAX_L2_CACHE_TTL_IN_HOURS,F as EDGE_MIN_CACHE_TTL,J as EDGE_MIN_L2_CACHE_TTL_IN_HOURS,o as EnhancerBuilder,D as IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,C as IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,E as PLACEHOLDER_ID,d as UncachedCanvasClient,O as UniqueBatchEntries,i as compose,h as createBatchEnhancer,W as createCanvasChannel,X as createEventBus,a as createLimitPolicy,m as enhance,M as extractLocales,P as generateHash,Y as getChannelName,l as getComponentJsonPointer,k as getComponentPath,T as isAddComponentMessage,V as isDismissPlaceholderMessage,U as isMovingComponentMessage,R as isReadyMessage,Q as isSelectComponentMessage,_ as isSystemComponentDefinition,S as isUpdateCompositionMessage,N as localize,$ as mapSlotToPersonalizedVariations,aa as mapSlotToTestVariations,b as nullLimitPolicy,Z as subscribeToComposition,j as walkComponentTree};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/canvas",
|
3
|
-
"version": "17.7.
|
3
|
+
"version": "17.7.1-alpha.140+80ab6baf9",
|
4
4
|
"description": "Common functionality and types for Uniform Canvas",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
6
6
|
"main": "./dist/index.js",
|
@@ -48,16 +48,16 @@
|
|
48
48
|
},
|
49
49
|
"devDependencies": {
|
50
50
|
"@types/retry": "0.12.1",
|
51
|
-
"@types/yargs": "17.0.
|
52
|
-
"@uniformdev/cli": "^17.7.
|
51
|
+
"@types/yargs": "17.0.19",
|
52
|
+
"@uniformdev/cli": "^17.7.1-alpha.140+80ab6baf9",
|
53
53
|
"p-limit": "4.0.0",
|
54
|
-
"p-retry": "5.1.
|
54
|
+
"p-retry": "5.1.2",
|
55
55
|
"p-throttle": "5.0.0",
|
56
|
-
"pusher-js": "
|
56
|
+
"pusher-js": "8.0.0",
|
57
57
|
"yargs": "17.6.2"
|
58
58
|
},
|
59
59
|
"dependencies": {
|
60
|
-
"@uniformdev/context": "^17.7.
|
60
|
+
"@uniformdev/context": "^17.7.1-alpha.140+80ab6baf9"
|
61
61
|
},
|
62
62
|
"files": [
|
63
63
|
"/dist"
|
@@ -65,5 +65,5 @@
|
|
65
65
|
"publishConfig": {
|
66
66
|
"access": "public"
|
67
67
|
},
|
68
|
-
"gitHead": "
|
68
|
+
"gitHead": "80ab6baf9edea6b520738bd3dff5c6afc882bf77"
|
69
69
|
}
|