@uniformdev/canvas 12.2.0 → 12.2.1-alpha.107

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.
Files changed (196) hide show
  1. package/LICENSE.txt +1 -1
  2. package/README.md +5 -5
  3. package/dist/chunk-FS5XXLSV.mjs +2 -0
  4. package/dist/cli/cli.d.ts +14 -0
  5. package/dist/cli/cli.js +4 -0
  6. package/dist/cli/cli.mjs +3 -0
  7. package/dist/createEventBus-39df132f.d.ts +253 -0
  8. package/dist/index.d.ts +361 -0
  9. package/dist/index.esm.js +4 -0
  10. package/dist/index.js +5 -0
  11. package/dist/index.mjs +4 -0
  12. package/package.json +33 -33
  13. package/dist/cjs/CanvasClient.d.ts +0 -50
  14. package/dist/cjs/CanvasClient.js +0 -1
  15. package/dist/cjs/cli/arraySyncEngineDataSource.d.ts +0 -10
  16. package/dist/cjs/cli/arraySyncEngineDataSource.js +0 -1
  17. package/dist/cjs/cli/cli.d.ts +0 -3
  18. package/dist/cjs/cli/cli.js +0 -1
  19. package/dist/cjs/cli/commands/component/_util.d.ts +0 -3
  20. package/dist/cjs/cli/commands/component/_util.js +0 -1
  21. package/dist/cjs/cli/commands/component/get.d.ts +0 -7
  22. package/dist/cjs/cli/commands/component/get.js +0 -1
  23. package/dist/cjs/cli/commands/component/list.d.ts +0 -6
  24. package/dist/cjs/cli/commands/component/list.js +0 -1
  25. package/dist/cjs/cli/commands/component/pull.d.ts +0 -10
  26. package/dist/cjs/cli/commands/component/pull.js +0 -1
  27. package/dist/cjs/cli/commands/component/push.d.ts +0 -9
  28. package/dist/cjs/cli/commands/component/push.js +0 -1
  29. package/dist/cjs/cli/commands/component/remove.d.ts +0 -7
  30. package/dist/cjs/cli/commands/component/remove.js +0 -1
  31. package/dist/cjs/cli/commands/component/update.d.ts +0 -7
  32. package/dist/cjs/cli/commands/component/update.js +0 -1
  33. package/dist/cjs/cli/commands/component.d.ts +0 -2
  34. package/dist/cjs/cli/commands/component.js +0 -1
  35. package/dist/cjs/cli/commands/composition/_util.d.ts +0 -3
  36. package/dist/cjs/cli/commands/composition/_util.js +0 -1
  37. package/dist/cjs/cli/commands/composition/get.d.ts +0 -8
  38. package/dist/cjs/cli/commands/composition/get.js +0 -1
  39. package/dist/cjs/cli/commands/composition/list.d.ts +0 -8
  40. package/dist/cjs/cli/commands/composition/list.js +0 -1
  41. package/dist/cjs/cli/commands/composition/pull.d.ts +0 -10
  42. package/dist/cjs/cli/commands/composition/pull.js +0 -1
  43. package/dist/cjs/cli/commands/composition/push.d.ts +0 -9
  44. package/dist/cjs/cli/commands/composition/push.js +0 -1
  45. package/dist/cjs/cli/commands/composition/remove.d.ts +0 -7
  46. package/dist/cjs/cli/commands/composition/remove.js +0 -1
  47. package/dist/cjs/cli/commands/composition/update.d.ts +0 -7
  48. package/dist/cjs/cli/commands/composition/update.js +0 -1
  49. package/dist/cjs/cli/commands/composition.d.ts +0 -2
  50. package/dist/cjs/cli/commands/composition.js +0 -1
  51. package/dist/cjs/cli/componentDefinitionEngineDataSource.d.ts +0 -7
  52. package/dist/cjs/cli/componentDefinitionEngineDataSource.js +0 -1
  53. package/dist/cjs/cli/componentInstanceEngineDataSource.d.ts +0 -9
  54. package/dist/cjs/cli/componentInstanceEngineDataSource.js +0 -1
  55. package/dist/cjs/cli/fileSyncEngineDataSource.d.ts +0 -9
  56. package/dist/cjs/cli/fileSyncEngineDataSource.js +0 -1
  57. package/dist/cjs/cli/package.d.ts +0 -7
  58. package/dist/cjs/cli/package.js +0 -1
  59. package/dist/cjs/cli/syncEngine.d.ts +0 -49
  60. package/dist/cjs/cli/syncEngine.js +0 -1
  61. package/dist/cjs/cli/syncEngineConsoleLogger.d.ts +0 -5
  62. package/dist/cjs/cli/syncEngineConsoleLogger.js +0 -1
  63. package/dist/cjs/cli/util.d.ts +0 -43
  64. package/dist/cjs/cli/util.js +0 -1
  65. package/dist/cjs/enhancement/EnhancerBuilder.d.ts +0 -66
  66. package/dist/cjs/enhancement/EnhancerBuilder.js +0 -1
  67. package/dist/cjs/enhancement/UniqueBatchEntries.d.ts +0 -17
  68. package/dist/cjs/enhancement/UniqueBatchEntries.js +0 -1
  69. package/dist/cjs/enhancement/batchEnhancer.d.ts +0 -39
  70. package/dist/cjs/enhancement/batchEnhancer.js +0 -1
  71. package/dist/cjs/enhancement/compose.d.ts +0 -6
  72. package/dist/cjs/enhancement/compose.js +0 -1
  73. package/dist/cjs/enhancement/createLimitPolicy.d.ts +0 -8
  74. package/dist/cjs/enhancement/createLimitPolicy.js +0 -1
  75. package/dist/cjs/enhancement/enhance.d.ts +0 -18
  76. package/dist/cjs/enhancement/enhance.js +0 -1
  77. package/dist/cjs/enhancement/localize.d.ts +0 -11
  78. package/dist/cjs/enhancement/localize.js +0 -1
  79. package/dist/cjs/enhancement/walkComponentTree.d.ts +0 -14
  80. package/dist/cjs/enhancement/walkComponentTree.js +0 -1
  81. package/dist/cjs/index.d.ts +0 -17
  82. package/dist/cjs/index.js +0 -1
  83. package/dist/cjs/preview/EventNames.d.ts +0 -1
  84. package/dist/cjs/preview/EventNames.js +0 -1
  85. package/dist/cjs/preview/createEventBus.d.ts +0 -6
  86. package/dist/cjs/preview/createEventBus.js +0 -1
  87. package/dist/cjs/preview/getChannelName.d.ts +0 -1
  88. package/dist/cjs/preview/getChannelName.js +0 -1
  89. package/dist/cjs/preview/subscribeToComposition.d.ts +0 -13
  90. package/dist/cjs/preview/subscribeToComposition.js +0 -1
  91. package/dist/cjs/types/componentDefinitions.d.ts +0 -90
  92. package/dist/cjs/types/componentDefinitions.js +0 -1
  93. package/dist/cjs/types/componentInstances.d.ts +0 -104
  94. package/dist/cjs/types/componentInstances.js +0 -1
  95. package/dist/cjs/types/enhancement.d.ts +0 -79
  96. package/dist/cjs/types/enhancement.js +0 -1
  97. package/dist/cjs/types/index.d.ts +0 -3
  98. package/dist/cjs/types/index.js +0 -1
  99. package/dist/cjs/utils/constants.d.ts +0 -20
  100. package/dist/cjs/utils/constants.js +0 -1
  101. package/dist/cjs/utils/isSystemComponentDefinition.d.ts +0 -2
  102. package/dist/cjs/utils/isSystemComponentDefinition.js +0 -1
  103. package/dist/cjs/utils/mapSlotToPersonalizedVariations.d.ts +0 -7
  104. package/dist/cjs/utils/mapSlotToPersonalizedVariations.js +0 -1
  105. package/dist/esm/CanvasClient.d.ts +0 -50
  106. package/dist/esm/CanvasClient.js +0 -1
  107. package/dist/esm/cli/arraySyncEngineDataSource.d.ts +0 -10
  108. package/dist/esm/cli/arraySyncEngineDataSource.js +0 -1
  109. package/dist/esm/cli/cli.d.ts +0 -3
  110. package/dist/esm/cli/cli.js +0 -1
  111. package/dist/esm/cli/commands/component/_util.d.ts +0 -3
  112. package/dist/esm/cli/commands/component/_util.js +0 -1
  113. package/dist/esm/cli/commands/component/get.d.ts +0 -7
  114. package/dist/esm/cli/commands/component/get.js +0 -1
  115. package/dist/esm/cli/commands/component/list.d.ts +0 -6
  116. package/dist/esm/cli/commands/component/list.js +0 -1
  117. package/dist/esm/cli/commands/component/pull.d.ts +0 -10
  118. package/dist/esm/cli/commands/component/pull.js +0 -1
  119. package/dist/esm/cli/commands/component/push.d.ts +0 -9
  120. package/dist/esm/cli/commands/component/push.js +0 -1
  121. package/dist/esm/cli/commands/component/remove.d.ts +0 -7
  122. package/dist/esm/cli/commands/component/remove.js +0 -1
  123. package/dist/esm/cli/commands/component/update.d.ts +0 -7
  124. package/dist/esm/cli/commands/component/update.js +0 -1
  125. package/dist/esm/cli/commands/component.d.ts +0 -2
  126. package/dist/esm/cli/commands/component.js +0 -1
  127. package/dist/esm/cli/commands/composition/_util.d.ts +0 -3
  128. package/dist/esm/cli/commands/composition/_util.js +0 -1
  129. package/dist/esm/cli/commands/composition/get.d.ts +0 -8
  130. package/dist/esm/cli/commands/composition/get.js +0 -1
  131. package/dist/esm/cli/commands/composition/list.d.ts +0 -8
  132. package/dist/esm/cli/commands/composition/list.js +0 -1
  133. package/dist/esm/cli/commands/composition/pull.d.ts +0 -10
  134. package/dist/esm/cli/commands/composition/pull.js +0 -1
  135. package/dist/esm/cli/commands/composition/push.d.ts +0 -9
  136. package/dist/esm/cli/commands/composition/push.js +0 -1
  137. package/dist/esm/cli/commands/composition/remove.d.ts +0 -7
  138. package/dist/esm/cli/commands/composition/remove.js +0 -1
  139. package/dist/esm/cli/commands/composition/update.d.ts +0 -7
  140. package/dist/esm/cli/commands/composition/update.js +0 -1
  141. package/dist/esm/cli/commands/composition.d.ts +0 -2
  142. package/dist/esm/cli/commands/composition.js +0 -1
  143. package/dist/esm/cli/componentDefinitionEngineDataSource.d.ts +0 -7
  144. package/dist/esm/cli/componentDefinitionEngineDataSource.js +0 -1
  145. package/dist/esm/cli/componentInstanceEngineDataSource.d.ts +0 -9
  146. package/dist/esm/cli/componentInstanceEngineDataSource.js +0 -1
  147. package/dist/esm/cli/fileSyncEngineDataSource.d.ts +0 -9
  148. package/dist/esm/cli/fileSyncEngineDataSource.js +0 -1
  149. package/dist/esm/cli/package.d.ts +0 -7
  150. package/dist/esm/cli/package.js +0 -1
  151. package/dist/esm/cli/syncEngine.d.ts +0 -49
  152. package/dist/esm/cli/syncEngine.js +0 -1
  153. package/dist/esm/cli/syncEngineConsoleLogger.d.ts +0 -5
  154. package/dist/esm/cli/syncEngineConsoleLogger.js +0 -1
  155. package/dist/esm/cli/util.d.ts +0 -43
  156. package/dist/esm/cli/util.js +0 -1
  157. package/dist/esm/enhancement/EnhancerBuilder.d.ts +0 -66
  158. package/dist/esm/enhancement/EnhancerBuilder.js +0 -1
  159. package/dist/esm/enhancement/UniqueBatchEntries.d.ts +0 -17
  160. package/dist/esm/enhancement/UniqueBatchEntries.js +0 -1
  161. package/dist/esm/enhancement/batchEnhancer.d.ts +0 -39
  162. package/dist/esm/enhancement/batchEnhancer.js +0 -1
  163. package/dist/esm/enhancement/compose.d.ts +0 -6
  164. package/dist/esm/enhancement/compose.js +0 -1
  165. package/dist/esm/enhancement/createLimitPolicy.d.ts +0 -8
  166. package/dist/esm/enhancement/createLimitPolicy.js +0 -1
  167. package/dist/esm/enhancement/enhance.d.ts +0 -18
  168. package/dist/esm/enhancement/enhance.js +0 -1
  169. package/dist/esm/enhancement/localize.d.ts +0 -11
  170. package/dist/esm/enhancement/localize.js +0 -1
  171. package/dist/esm/enhancement/walkComponentTree.d.ts +0 -14
  172. package/dist/esm/enhancement/walkComponentTree.js +0 -1
  173. package/dist/esm/index.d.ts +0 -17
  174. package/dist/esm/index.js +0 -1
  175. package/dist/esm/preview/EventNames.d.ts +0 -1
  176. package/dist/esm/preview/EventNames.js +0 -0
  177. package/dist/esm/preview/createEventBus.d.ts +0 -6
  178. package/dist/esm/preview/createEventBus.js +0 -1
  179. package/dist/esm/preview/getChannelName.d.ts +0 -1
  180. package/dist/esm/preview/getChannelName.js +0 -1
  181. package/dist/esm/preview/subscribeToComposition.d.ts +0 -13
  182. package/dist/esm/preview/subscribeToComposition.js +0 -1
  183. package/dist/esm/types/componentDefinitions.d.ts +0 -90
  184. package/dist/esm/types/componentDefinitions.js +0 -0
  185. package/dist/esm/types/componentInstances.d.ts +0 -104
  186. package/dist/esm/types/componentInstances.js +0 -0
  187. package/dist/esm/types/enhancement.d.ts +0 -79
  188. package/dist/esm/types/enhancement.js +0 -0
  189. package/dist/esm/types/index.d.ts +0 -3
  190. package/dist/esm/types/index.js +0 -1
  191. package/dist/esm/utils/constants.d.ts +0 -20
  192. package/dist/esm/utils/constants.js +0 -1
  193. package/dist/esm/utils/isSystemComponentDefinition.d.ts +0 -2
  194. package/dist/esm/utils/isSystemComponentDefinition.js +0 -1
  195. package/dist/esm/utils/mapSlotToPersonalizedVariations.d.ts +0 -7
  196. package/dist/esm/utils/mapSlotToPersonalizedVariations.js +0 -1
@@ -1,79 +0,0 @@
1
- import { LimitPolicy } from '..';
2
- import { ComponentInstance, ComponentParameter } from './componentInstances';
3
- export declare type EnhancerContext = {
4
- preview?: boolean;
5
- };
6
- /** Options passed to a ComponentEnhancer function */
7
- export declare type ComponentEnhancerOptions<TContext extends EnhancerContext = EnhancerContext> = {
8
- component: Readonly<ComponentInstance>;
9
- context: TContext;
10
- };
11
- /**
12
- * A function which is called for each matching component in a composition, which can manipulate the value of a specific key in the component's `data` property.
13
- * Used to enhance layout data with information from other platforms, such as private APIs, where the value is not tied to a parameter
14
- * and is intrinsic to the component itself.
15
- *
16
- * Note: the configuration of enhancers namespaces component enhancers into a named property on the data object to avoid collisions,
17
- * thus an enhancer need not worry about merging values with other enhancers, nor which key it has been registered under.
18
- *
19
- * Return values:
20
- * TValue - sets the configured key in the component's data value to this value
21
- * undefined - do not set the component's data key
22
- */
23
- export declare type ComponentEnhancerFunction<TValue = unknown, TContext extends EnhancerContext = EnhancerContext> = (options: ComponentEnhancerOptions<TContext>) => Promise<TValue | undefined> | TValue | undefined;
24
- /**
25
- * Defines logic to add arbitrary async data to a component's `data` property.
26
- * Used to enhance layout data with information from other platforms, such as private APIs,
27
- * where the value is not tied to a parameter and is intrinsic to the component itself.
28
- */
29
- export declare type ComponentEnhancer<TValue = unknown, TContext extends EnhancerContext = EnhancerContext> = {
30
- /** Function called to enhance a single component in a composition. */
31
- enhanceOne: ComponentEnhancerFunction<TValue, TContext>;
32
- /**
33
- * The limit policy that defines how much concurrency and retry is allowed for this enhancer.
34
- * If the enhancer does not define completeAll(), this limit policy is applied to enhanceOne() calls.
35
- * If the enhancer does define completeAll(), this limit policy is applied to the completeAll() calls.
36
- * If the limit policy is undefined, unbounded concurrency is allowed and no error retrying will occur.
37
- */
38
- limitPolicy?: LimitPolicy;
39
- completeAll?: () => Promise<void>;
40
- };
41
- /** Options passed to a ComponentParameterEnhancer function */
42
- export declare type ComponentParameterEnhancerOptions<TRawValue = unknown, TContext extends EnhancerContext = EnhancerContext> = {
43
- parameter: Readonly<ComponentParameter<TRawValue>>;
44
- parameterName: string;
45
- component: Readonly<ComponentInstance>;
46
- context: TContext;
47
- };
48
- /**
49
- * A function which is called for each component parameter in a component tree, which can manipulate the value of the parameter.
50
- * Used to enhance layout data with information from other platforms, such as CMS, commerce, indexing, etc.
51
- *
52
- * Return values:
53
- * TValue - replaces the original parameter value with this value
54
- * undefined - do not change the original parameter value
55
- * null - sets the parameter value to null, replacing any existing value (i.e. if its value could not be resolved in an external system)
56
- */
57
- export declare type ComponentParameterEnhancerFunction<TRawValue = unknown, TOutputValue = unknown, TContext extends EnhancerContext = EnhancerContext> = (options: ComponentParameterEnhancerOptions<TRawValue, TContext>) => Promise<TOutputValue | undefined | null> | TOutputValue | undefined | null;
58
- /**
59
- * Defines logic to replace the value of a component parameter with arbitrary async data.
60
- * Used to enhance layout data with information from other platforms, such as CMS, commerce, indexing, etc,
61
- * where that data is directly expandable from a parameter value.
62
- */
63
- export declare type ComponentParameterEnhancer<TRawValue = unknown, TOutputValue = unknown, TContext extends EnhancerContext = EnhancerContext> = {
64
- /** Function called to enhance a single parameter to be enhanced. */
65
- enhanceOne: ComponentParameterEnhancerFunction<TRawValue, TOutputValue, TContext>;
66
- /**
67
- * The limit policy that defines how much concurrency and retry is allowed for this enhancer.
68
- * If the enhancer does not define completeAll(), this limit policy is applied to enhanceOne() calls.
69
- * If the enhancer does define completeAll(), this limit policy is applied to the completeAll() calls.
70
- * If the limit policy is undefined, unbounded concurrency is allowed and no error retrying will occur.
71
- */
72
- limitPolicy?: LimitPolicy;
73
- /**
74
- * Function called, if defined, after all enhanceOne() calls have completed for the composition being enhanced.
75
- * Used to enable batching.
76
- * Return the number of batched items processed (or zero if that does not apply).
77
- */
78
- completeAll?: () => Promise<number>;
79
- };
File without changes
@@ -1,3 +0,0 @@
1
- export * from './componentDefinitions';
2
- export * from './componentInstances';
3
- export * from './enhancement';
@@ -1 +0,0 @@
1
- export*from"./componentDefinitions";export*from"./componentInstances";export*from"./enhancement";
@@ -1,20 +0,0 @@
1
- /** Public ID of Canvas personalization component type */
2
- export declare const CANVAS_PERSONALIZE_TYPE = "$personalization";
3
- /** Public ID of Canvas A/B test component type */
4
- export declare const CANVAS_TEST_TYPE = "$test";
5
- /** Public ID of Canvas localization component type */
6
- export declare const CANVAS_LOCALIZATION_TYPE = "$localization";
7
- /** Public ID of the intent tag parameter on the Canvas personalization component type */
8
- export declare const CANVAS_INTENT_TAG_PARAM = "intentTag";
9
- /** Public ID of the locale parameter on Canvas components */
10
- export declare const CANVAS_LOCALE_TAG_PARAM = "locale";
11
- /** Name of the slot on CANVAS_PERSONALIZE_TYPE */
12
- export declare const CANVAS_PERSONALIZE_SLOT = "pz";
13
- /** Name of the slot on CANVAS_TEST_TYPE */
14
- export declare const CANVAS_TEST_SLOT = "test";
15
- /** Name of the slot on CANVAS_TEST_TYPE */
16
- export declare const CANVAS_LOCALIZATION_SLOT = "localized";
17
- /** Constant for a draft composition state. Subject to change. */
18
- export declare const CANVAS_DRAFT_STATE = 0;
19
- /** Constatnt for a published composition state. Subject to change. */
20
- export declare const CANVAS_PUBLISHED_STATE = 64;
@@ -1 +0,0 @@
1
- var CANVAS_PERSONALIZE_TYPE="$personalization",CANVAS_TEST_TYPE="$test",CANVAS_LOCALIZATION_TYPE="$localization",CANVAS_INTENT_TAG_PARAM="intentTag",CANVAS_LOCALE_TAG_PARAM="locale",CANVAS_PERSONALIZE_SLOT="pz",CANVAS_TEST_SLOT="test",CANVAS_LOCALIZATION_SLOT="localized",CANVAS_DRAFT_STATE=0,CANVAS_PUBLISHED_STATE=64;export{CANVAS_PERSONALIZE_TYPE,CANVAS_TEST_TYPE,CANVAS_LOCALIZATION_TYPE,CANVAS_INTENT_TAG_PARAM,CANVAS_LOCALE_TAG_PARAM,CANVAS_PERSONALIZE_SLOT,CANVAS_TEST_SLOT,CANVAS_LOCALIZATION_SLOT,CANVAS_DRAFT_STATE,CANVAS_PUBLISHED_STATE};
@@ -1,2 +0,0 @@
1
- /** Determines if a given Canvas component type is a system-defined type */
2
- export declare const isSystemComponentDefinition: (componentType: string) => boolean;
@@ -1 +0,0 @@
1
- var isSystemComponentDefinition=function(t){return t.startsWith("$")};export{isSystemComponentDefinition};
@@ -1,7 +0,0 @@
1
- import { PersonalizableListItem } from '@uniformdev/optimize-tracker-common';
2
- import { ComponentInstance } from '../types/componentInstances';
3
- /**
4
- * Converts components in a slot into personalized variations (based on each component's intent tag in Canvas) suitable to pass to a personalize component
5
- * Useful when implementing custom personalization settings for Canvas components.
6
- */
7
- export declare function mapSlotToPersonalizedVariations(slot: ComponentInstance[] | undefined): Array<ComponentInstance & PersonalizableListItem>;
@@ -1 +0,0 @@
1
- var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(n){for(var t,a=1,i=arguments.length;a<i;a++)for(var o in t=arguments[a])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)};import{CANVAS_INTENT_TAG_PARAM}from"./constants";function mapSlotToPersonalizedVariations(n){return n?n.map(function(n){return __assign(__assign({},n),{intentTag:null===(n=null===(n=n.parameters)||void 0===n?void 0:n[CANVAS_INTENT_TAG_PARAM])||void 0===n?void 0:n.value})}):[]}export{mapSlotToPersonalizedVariations};