@adobe/alloy 2.32.1-beta.1 → 2.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/components.json +7 -2
  2. package/dist/alloy.js +11283 -11142
  3. package/dist/alloy.min.js +1 -1
  4. package/dist/alloyServiceWorker.js +1 -1
  5. package/dist/types/{core → browser}/src/components/Advertising/constants/index.d.ts +3 -0
  6. package/dist/types/{core → browser}/src/components/Advertising/handlers/createOnBeforeSendEventHandler.d.ts +4 -1
  7. package/dist/types/{core → browser}/src/components/Advertising/handlers/sendAdConversion.d.ts +3 -1
  8. package/dist/types/{core → browser}/src/components/Advertising/handlers/viewThroughHandler.d.ts +3 -1
  9. package/dist/types/{core → browser}/src/components/Advertising/identities/collectAllIdentities.d.ts +1 -1
  10. package/dist/types/browser/src/components/Advertising/identities/collectSurferId.d.ts +15 -0
  11. package/dist/types/browser/src/components/Advertising/identities/createHashedIpHandler.d.ts +9 -0
  12. package/dist/types/browser/src/components/Advertising/identities/initiateAdvertisingIdentityCall.d.ts +5 -0
  13. package/dist/types/{core → browser}/src/components/Advertising/utils/helpers.d.ts +14 -0
  14. package/dist/types/browser/src/components/Advertising/utils/murmurHash128GuavaHex.d.ts +2 -0
  15. package/dist/types/browser/src/components/Personalization/constants/surface.d.ts +4 -0
  16. package/dist/types/browser/src/components/Personalization/dom-actions/dom/isDomElement.d.ts +2 -0
  17. package/dist/types/browser/src/components/Personalization/utils/addRenderAttemptedToDecisions.d.ts +5 -0
  18. package/dist/types/browser/src/components/Personalization/utils/surfaceUtils.d.ts +3 -0
  19. package/dist/types/{core → browser}/src/components/PushNotifications/helpers/saveToIndexedDb.d.ts +1 -1
  20. package/dist/types/{core → browser}/src/components/PushNotifications/index.d.ts +6 -6
  21. package/dist/types/{core → browser}/src/components/PushNotifications/request/createSendPushSubscriptionPayload.d.ts +2 -2
  22. package/dist/types/browser/src/components/PushNotifications/request/createSendPushSubscriptionRequest.d.ts +6 -0
  23. package/dist/types/{core → browser}/src/components/PushNotifications/request/makeSendPushSubscriptionRequest.d.ts +6 -6
  24. package/dist/types/{core → browser}/src/components/PushNotifications/types.d.ts +1 -1
  25. package/dist/types/browser/src/components/componentCreators.d.ts +3 -0
  26. package/dist/types/browser/src/components/requiredComponentCreators.d.ts +1 -0
  27. package/dist/types/core/src/components/Identity/injectAddQueryStringIdentityToPayload.d.ts +2 -1
  28. package/dist/types/core/src/core/componentCreators.d.ts +0 -3
  29. package/dist/types/core/src/core/requiredComponentCreators.d.ts +0 -1
  30. package/dist/types/core/src/types.d.ts +0 -4
  31. package/package.json +2 -2
  32. package/src/components/Advertising/configValidators.js +32 -0
  33. package/src/components/Advertising/constants/index.js +80 -0
  34. package/src/components/Advertising/createComponent.js +24 -0
  35. package/src/components/Advertising/handlers/clickThroughHandler.js +94 -0
  36. package/src/components/Advertising/handlers/createAdConversionHandler.js +50 -0
  37. package/src/components/Advertising/handlers/createOnBeforeSendEventHandler.js +177 -0
  38. package/src/components/Advertising/handlers/sendAdConversion.js +74 -0
  39. package/src/components/Advertising/handlers/viewThroughHandler.js +107 -0
  40. package/src/components/Advertising/identities/collectAllIdentities.js +57 -0
  41. package/src/components/Advertising/identities/collectID5Id.js +133 -0
  42. package/src/components/Advertising/identities/collectRampId.js +265 -0
  43. package/src/components/Advertising/identities/collectSurferId.js +72 -0
  44. package/src/components/Advertising/identities/createHashedIpHandler.js +36 -0
  45. package/src/components/Advertising/identities/initiateAdvertisingIdentityCall.js +153 -0
  46. package/src/components/Advertising/index.js +109 -0
  47. package/src/components/Advertising/utils/advertisingCookieManager.js +92 -0
  48. package/src/components/Advertising/utils/helpers.js +190 -0
  49. package/src/components/Advertising/utils/murmurHash128GuavaHex.js +195 -0
  50. package/src/components/Context/createComponent.js +35 -0
  51. package/src/components/Context/implementationDetails.js +23 -0
  52. package/src/components/Context/index.js +56 -0
  53. package/src/components/Context/injectDevice.js +77 -0
  54. package/src/components/Context/injectEnvironment.js +38 -0
  55. package/src/components/Context/injectHighEntropyUserAgentHints.js +55 -0
  56. package/src/components/Context/injectOneTimeAnalyticsReferrer.js +61 -0
  57. package/src/components/Context/injectPlaceContext.js +38 -0
  58. package/src/components/Context/injectWeb.js +26 -0
  59. package/src/components/Personalization/constants/loggerMessage.js +14 -0
  60. package/src/components/Personalization/constants/scopeType.js +15 -0
  61. package/src/components/Personalization/constants/surface.js +16 -0
  62. package/src/components/Personalization/createApplyPropositions.js +136 -0
  63. package/src/components/Personalization/createClickStorage.js +56 -0
  64. package/src/components/Personalization/createComponent.js +133 -0
  65. package/src/components/Personalization/createFetchDataHandler.js +149 -0
  66. package/src/components/Personalization/createGetPageLocation.js +16 -0
  67. package/src/components/Personalization/createHandleConsentFlicker.js +22 -0
  68. package/src/components/Personalization/createInteractionStorage.js +104 -0
  69. package/src/components/Personalization/createNotificationHandler.js +49 -0
  70. package/src/components/Personalization/createOnClickHandler.js +102 -0
  71. package/src/components/Personalization/createOnDecisionHandler.js +98 -0
  72. package/src/components/Personalization/createPersonalizationDetails.js +138 -0
  73. package/src/components/Personalization/createSetTargetMigration.js +22 -0
  74. package/src/components/Personalization/createViewCacheManager.js +101 -0
  75. package/src/components/Personalization/createViewChangeHandler.js +53 -0
  76. package/src/components/Personalization/dom-actions/action.js +97 -0
  77. package/src/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +37 -0
  78. package/src/components/Personalization/dom-actions/appendHtml.js +42 -0
  79. package/src/components/Personalization/dom-actions/clicks/collectClicks.js +89 -0
  80. package/src/components/Personalization/dom-actions/clicks/collectInteractions.js +113 -0
  81. package/src/components/Personalization/dom-actions/collectInteractions.js +15 -0
  82. package/src/components/Personalization/dom-actions/createPreprocess.js +21 -0
  83. package/src/components/Personalization/dom-actions/createRedirect.js +23 -0
  84. package/src/components/Personalization/dom-actions/dom/createFragment.js +18 -0
  85. package/src/components/Personalization/dom-actions/dom/getAttribute.js +15 -0
  86. package/src/components/Personalization/dom-actions/dom/getChildNodes.js +23 -0
  87. package/src/components/Personalization/dom-actions/dom/getChildren.js +23 -0
  88. package/src/components/Personalization/dom-actions/dom/getElementById.js +21 -0
  89. package/src/components/Personalization/dom-actions/dom/getFirstChild.js +15 -0
  90. package/src/components/Personalization/dom-actions/dom/getNextSibling.js +15 -0
  91. package/src/components/Personalization/dom-actions/dom/getNonce.js +33 -0
  92. package/src/components/Personalization/dom-actions/dom/getParent.js +15 -0
  93. package/src/components/Personalization/dom-actions/dom/helperForEq.js +22 -0
  94. package/src/components/Personalization/dom-actions/dom/index.js +26 -0
  95. package/src/components/Personalization/dom-actions/dom/insertAfter.js +26 -0
  96. package/src/components/Personalization/dom-actions/dom/insertBefore.js +25 -0
  97. package/src/components/Personalization/dom-actions/dom/isDomElement.js +13 -0
  98. package/src/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +37 -0
  99. package/src/components/Personalization/dom-actions/dom/removeAttribute.js +15 -0
  100. package/src/components/Personalization/dom-actions/dom/selectNodesWithEq.js +101 -0
  101. package/src/components/Personalization/dom-actions/dom/setAttribute.js +15 -0
  102. package/src/components/Personalization/dom-actions/dom/setStyle.js +23 -0
  103. package/src/components/Personalization/dom-actions/dom/util.js +17 -0
  104. package/src/components/Personalization/dom-actions/images.js +34 -0
  105. package/src/components/Personalization/dom-actions/index.js +13 -0
  106. package/src/components/Personalization/dom-actions/initDomActionsModules.js +67 -0
  107. package/src/components/Personalization/dom-actions/insertHtmlAfter.js +43 -0
  108. package/src/components/Personalization/dom-actions/insertHtmlBefore.js +40 -0
  109. package/src/components/Personalization/dom-actions/move.js +28 -0
  110. package/src/components/Personalization/dom-actions/prependHtml.js +60 -0
  111. package/src/components/Personalization/dom-actions/rearrangeChildren.js +34 -0
  112. package/src/components/Personalization/dom-actions/remapCustomCodeOffers.js +33 -0
  113. package/src/components/Personalization/dom-actions/remapHeadOffers.js +63 -0
  114. package/src/components/Personalization/dom-actions/replaceHtml.js +20 -0
  115. package/src/components/Personalization/dom-actions/resize.js +28 -0
  116. package/src/components/Personalization/dom-actions/scripts.js +106 -0
  117. package/src/components/Personalization/dom-actions/setAttributes.js +21 -0
  118. package/src/components/Personalization/dom-actions/setHtml.js +27 -0
  119. package/src/components/Personalization/dom-actions/setStyles.js +23 -0
  120. package/src/components/Personalization/dom-actions/setText.js +16 -0
  121. package/src/components/Personalization/dom-actions/swapImage.js +32 -0
  122. package/src/components/Personalization/flicker/index.js +106 -0
  123. package/src/components/Personalization/handlers/createDecorateProposition.js +100 -0
  124. package/src/components/Personalization/handlers/createProcessDomAction.js +79 -0
  125. package/src/components/Personalization/handlers/createProcessHtmlContent.js +60 -0
  126. package/src/components/Personalization/handlers/createProcessInAppMessage.js +91 -0
  127. package/src/components/Personalization/handlers/createProcessPropositions.js +228 -0
  128. package/src/components/Personalization/handlers/createProcessRedirect.js +54 -0
  129. package/src/components/Personalization/handlers/createRenderStatusHandler.js +62 -0
  130. package/src/components/Personalization/handlers/injectCreateProposition.js +121 -0
  131. package/src/components/Personalization/handlers/processDefaultContent.js +20 -0
  132. package/src/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +309 -0
  133. package/src/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +18 -0
  134. package/src/components/Personalization/in-app-message-actions/utils.js +55 -0
  135. package/src/components/Personalization/index.js +223 -0
  136. package/src/components/Personalization/utils/addRenderAttemptedToDecisions.js +15 -0
  137. package/src/components/Personalization/utils/createAsyncArray.js +37 -0
  138. package/src/components/Personalization/utils/isAuthoringModeEnabled.js +15 -0
  139. package/src/components/Personalization/utils/metaUtils.js +27 -0
  140. package/src/components/Personalization/utils/surfaceUtils.js +120 -0
  141. package/src/components/Personalization/validateApplyPropositionsOptions.js +56 -0
  142. package/src/components/PushNotifications/helpers/constants.js +16 -0
  143. package/src/components/PushNotifications/helpers/getPushSubscriptionDetails.js +122 -0
  144. package/src/components/PushNotifications/helpers/readFromIndexedDb.js +50 -0
  145. package/src/components/PushNotifications/helpers/saveToIndexedDb.js +64 -0
  146. package/src/components/PushNotifications/helpers/serviceWorkerNotificationClickListener.js +84 -0
  147. package/src/components/PushNotifications/helpers/serviceWorkerPushListener.js +72 -0
  148. package/src/components/PushNotifications/index.js +128 -0
  149. package/src/components/PushNotifications/request/createSendPushSubscriptionPayload.js +66 -0
  150. package/src/components/PushNotifications/request/createSendPushSubscriptionRequest.js +35 -0
  151. package/src/components/PushNotifications/request/makeSendPushSubscriptionRequest.js +98 -0
  152. package/src/components/PushNotifications/request/makeSendServiceWorkerTrackingData.js +154 -0
  153. package/src/components/PushNotifications/types.js +104 -0
  154. package/src/components/componentCreators.js +3 -0
  155. package/src/components/requiredComponentCreators.js +13 -0
  156. package/src/createEventListeners.js +81 -0
  157. package/src/index.js +5 -1
  158. package/src/serviceWorker.js +2 -2
  159. package/dist/types/core/src/components/Advertising/identities/collectSurferId.d.ts +0 -2
  160. package/dist/types/core/src/components/PushNotifications/request/createSendPushSubscriptionRequest.d.ts +0 -6
  161. /package/dist/types/{core → browser}/src/components/Advertising/configValidators.d.ts +0 -0
  162. /package/dist/types/{core → browser}/src/components/Advertising/createComponent.d.ts +0 -0
  163. /package/dist/types/{core → browser}/src/components/Advertising/handlers/clickThroughHandler.d.ts +0 -0
  164. /package/dist/types/{core → browser}/src/components/Advertising/handlers/createAdConversionHandler.d.ts +0 -0
  165. /package/dist/types/{core → browser}/src/components/Advertising/identities/collectID5Id.d.ts +0 -0
  166. /package/dist/types/{core → browser}/src/components/Advertising/identities/collectRampId.d.ts +0 -0
  167. /package/dist/types/{core → browser}/src/components/Advertising/index.d.ts +0 -0
  168. /package/dist/types/{core → browser}/src/components/Advertising/utils/advertisingCookieManager.d.ts +0 -0
  169. /package/dist/types/{core → browser}/src/components/Context/createComponent.d.ts +0 -0
  170. /package/dist/types/{core → browser}/src/components/Context/implementationDetails.d.ts +0 -0
  171. /package/dist/types/{core → browser}/src/components/Context/index.d.ts +0 -0
  172. /package/dist/types/{core → browser}/src/components/Context/injectDevice.d.ts +0 -0
  173. /package/dist/types/{core → browser}/src/components/Context/injectEnvironment.d.ts +0 -0
  174. /package/dist/types/{core → browser}/src/components/Context/injectHighEntropyUserAgentHints.d.ts +0 -0
  175. /package/dist/types/{core → browser}/src/components/Context/injectOneTimeAnalyticsReferrer.d.ts +0 -0
  176. /package/dist/types/{core → browser}/src/components/Context/injectPlaceContext.d.ts +0 -0
  177. /package/dist/types/{core → browser}/src/components/Context/injectWeb.d.ts +0 -0
  178. /package/dist/types/{core → browser}/src/components/Personalization/constants/loggerMessage.d.ts +0 -0
  179. /package/dist/types/{core → browser}/src/components/Personalization/constants/scopeType.d.ts +0 -0
  180. /package/dist/types/{core → browser}/src/components/Personalization/createApplyPropositions.d.ts +0 -0
  181. /package/dist/types/{core → browser}/src/components/Personalization/createClickStorage.d.ts +0 -0
  182. /package/dist/types/{core → browser}/src/components/Personalization/createComponent.d.ts +0 -0
  183. /package/dist/types/{core → browser}/src/components/Personalization/createFetchDataHandler.d.ts +0 -0
  184. /package/dist/types/{core → browser}/src/components/Personalization/createGetPageLocation.d.ts +0 -0
  185. /package/dist/types/{core → browser}/src/components/Personalization/createHandleConsentFlicker.d.ts +0 -0
  186. /package/dist/types/{core → browser}/src/components/Personalization/createInteractionStorage.d.ts +0 -0
  187. /package/dist/types/{core → browser}/src/components/Personalization/createNotificationHandler.d.ts +0 -0
  188. /package/dist/types/{core → browser}/src/components/Personalization/createOnClickHandler.d.ts +0 -0
  189. /package/dist/types/{core → browser}/src/components/Personalization/createOnDecisionHandler.d.ts +0 -0
  190. /package/dist/types/{core → browser}/src/components/Personalization/createPersonalizationDetails.d.ts +0 -0
  191. /package/dist/types/{core → browser}/src/components/Personalization/createSetTargetMigration.d.ts +0 -0
  192. /package/dist/types/{core → browser}/src/components/Personalization/createViewCacheManager.d.ts +0 -0
  193. /package/dist/types/{core → browser}/src/components/Personalization/createViewChangeHandler.d.ts +0 -0
  194. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/action.d.ts +0 -0
  195. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/addNonceToInlineStyleElements.d.ts +0 -0
  196. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/appendHtml.d.ts +0 -0
  197. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/clicks/collectClicks.d.ts +0 -0
  198. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/clicks/collectInteractions.d.ts +0 -0
  199. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/collectInteractions.d.ts +0 -0
  200. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/createPreprocess.d.ts +0 -0
  201. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/createRedirect.d.ts +0 -0
  202. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/createFragment.d.ts +0 -0
  203. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getAttribute.d.ts +0 -0
  204. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getChildNodes.d.ts +0 -0
  205. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getChildren.d.ts +0 -0
  206. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getElementById.d.ts +0 -0
  207. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getFirstChild.d.ts +0 -0
  208. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getNextSibling.d.ts +0 -0
  209. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getNonce.d.ts +0 -0
  210. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getParent.d.ts +0 -0
  211. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/helperForEq.d.ts +0 -0
  212. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/index.d.ts +0 -0
  213. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/insertAfter.d.ts +0 -0
  214. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/insertBefore.d.ts +0 -0
  215. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/matchesSelectorWithEq.d.ts +0 -0
  216. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/removeAttribute.d.ts +0 -0
  217. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/selectNodesWithEq.d.ts +0 -0
  218. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/setAttribute.d.ts +0 -0
  219. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/setStyle.d.ts +0 -0
  220. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/util.d.ts +0 -0
  221. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/images.d.ts +0 -0
  222. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/index.d.ts +0 -0
  223. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/initDomActionsModules.d.ts +0 -0
  224. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/insertHtmlAfter.d.ts +0 -0
  225. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/insertHtmlBefore.d.ts +0 -0
  226. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/move.d.ts +0 -0
  227. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/prependHtml.d.ts +0 -0
  228. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/rearrangeChildren.d.ts +0 -0
  229. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/remapCustomCodeOffers.d.ts +0 -0
  230. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/remapHeadOffers.d.ts +0 -0
  231. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/replaceHtml.d.ts +0 -0
  232. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/resize.d.ts +0 -0
  233. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/scripts.d.ts +0 -0
  234. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setAttributes.d.ts +0 -0
  235. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setHtml.d.ts +0 -0
  236. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setStyles.d.ts +0 -0
  237. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setText.d.ts +0 -0
  238. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/swapImage.d.ts +0 -0
  239. /package/dist/types/{core → browser}/src/components/Personalization/flicker/index.d.ts +0 -0
  240. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createDecorateProposition.d.ts +0 -0
  241. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessDomAction.d.ts +0 -0
  242. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessHtmlContent.d.ts +0 -0
  243. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessInAppMessage.d.ts +0 -0
  244. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessPropositions.d.ts +0 -0
  245. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessRedirect.d.ts +0 -0
  246. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createRenderStatusHandler.d.ts +0 -0
  247. /package/dist/types/{core → browser}/src/components/Personalization/handlers/injectCreateProposition.d.ts +0 -0
  248. /package/dist/types/{core → browser}/src/components/Personalization/handlers/processDefaultContent.d.ts +0 -0
  249. /package/dist/types/{core → browser}/src/components/Personalization/in-app-message-actions/actions/displayIframeContent.d.ts +0 -0
  250. /package/dist/types/{core → browser}/src/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.d.ts +0 -0
  251. /package/dist/types/{core → browser}/src/components/Personalization/in-app-message-actions/utils.d.ts +0 -0
  252. /package/dist/types/{core → browser}/src/components/Personalization/index.d.ts +0 -0
  253. /package/dist/types/{core → browser}/src/components/Personalization/utils/createAsyncArray.d.ts +0 -0
  254. /package/dist/types/{core → browser}/src/components/Personalization/utils/isAuthoringModeEnabled.d.ts +0 -0
  255. /package/dist/types/{core → browser}/src/components/Personalization/utils/metaUtils.d.ts +0 -0
  256. /package/dist/types/{core → browser}/src/components/Personalization/validateApplyPropositionsOptions.d.ts +0 -0
  257. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/constants.d.ts +0 -0
  258. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/getPushSubscriptionDetails.d.ts +0 -0
  259. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/readFromIndexedDb.d.ts +0 -0
  260. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/serviceWorkerNotificationClickListener.d.ts +0 -0
  261. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/serviceWorkerPushListener.d.ts +0 -0
  262. /package/dist/types/{core → browser}/src/components/PushNotifications/request/makeSendServiceWorkerTrackingData.d.ts +0 -0
  263. /package/dist/types/{core → browser}/src/createEventListeners.d.ts +0 -0
  264. /package/dist/types/core/src/{components/Context → utils}/injectTimestamp.d.ts +0 -0
@@ -0,0 +1,22 @@
1
+ /*
2
+ Copyright 2022 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { noop } from "@adobe/alloy-core/utils";
14
+
15
+ export default ({ targetMigrationEnabled }) => {
16
+ if (targetMigrationEnabled) {
17
+ return (request) => {
18
+ request.getPayload().mergeMeta({ target: { migration: true } });
19
+ };
20
+ }
21
+ return noop;
22
+ };
@@ -0,0 +1,101 @@
1
+ /*
2
+ Copyright 2020 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { groupBy } from "@adobe/alloy-core/utils";
14
+ import defer from "@adobe/alloy-core/utils/defer.js";
15
+ import { DEFAULT_CONTENT_ITEM } from "@adobe/alloy-core/constants/schema.js";
16
+ import { VIEW_SCOPE_TYPE } from "./constants/scopeType.js";
17
+
18
+ export default ({ createProposition }) => {
19
+ let cacheUpdateCreatedAtLeastOnce = false;
20
+ let viewStoragePromise = Promise.resolve({});
21
+
22
+ const getViewPropositions = (viewStorage, viewName) => {
23
+ const viewPropositions = viewStorage[viewName.toLowerCase()];
24
+ if (viewPropositions && viewPropositions.length > 0) {
25
+ return viewPropositions;
26
+ }
27
+
28
+ const emptyViewProposition = createProposition(
29
+ {
30
+ scope: viewName,
31
+ scopeDetails: {
32
+ characteristics: {
33
+ scopeType: VIEW_SCOPE_TYPE,
34
+ },
35
+ },
36
+ items: [
37
+ {
38
+ schema: DEFAULT_CONTENT_ITEM,
39
+ },
40
+ ],
41
+ },
42
+ false,
43
+ );
44
+ return [emptyViewProposition];
45
+ };
46
+
47
+ // This should be called before making the request to experience edge.
48
+ const createCacheUpdate = (viewName) => {
49
+ const updateCacheDeferred = defer();
50
+
51
+ cacheUpdateCreatedAtLeastOnce = true;
52
+
53
+ // Additional updates will merge the new view propositions with the old.
54
+ // i.e. if there are new "cart" view propositions they will overwrite the
55
+ // old "cart" view propositions, but if there are no new "cart" view
56
+ // propositions the old "cart" view propositions will remain.
57
+ viewStoragePromise = viewStoragePromise.then((oldViewStorage) => {
58
+ return updateCacheDeferred.promise
59
+ .then((newViewStorage) => {
60
+ return { ...oldViewStorage, ...newViewStorage };
61
+ })
62
+ .catch(() => oldViewStorage);
63
+ });
64
+
65
+ return {
66
+ update(viewPropositions) {
67
+ const viewPropositionsWithScope = viewPropositions.filter(
68
+ (proposition) => proposition.getScope(),
69
+ );
70
+ const newViewStorage = groupBy(
71
+ viewPropositionsWithScope,
72
+ (proposition) => proposition.getScope().toLowerCase(),
73
+ );
74
+ updateCacheDeferred.resolve(newViewStorage);
75
+ if (viewName) {
76
+ return getViewPropositions(newViewStorage, viewName);
77
+ }
78
+ return [];
79
+ },
80
+ cancel() {
81
+ updateCacheDeferred.reject();
82
+ },
83
+ };
84
+ };
85
+
86
+ const getView = (viewName) => {
87
+ return viewStoragePromise.then((viewStorage) =>
88
+ getViewPropositions(viewStorage, viewName),
89
+ );
90
+ };
91
+
92
+ const isInitialized = () => {
93
+ return cacheUpdateCreatedAtLeastOnce;
94
+ };
95
+
96
+ return {
97
+ createCacheUpdate,
98
+ getView,
99
+ isInitialized,
100
+ };
101
+ };
@@ -0,0 +1,53 @@
1
+ /*
2
+ Copyright 2020 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ export default ({ processPropositions, viewCache, logger }) => {
14
+ return ({ personalizationDetails, onResponse }) => {
15
+ let returnedPropositions;
16
+ let returnedDecisions;
17
+ const viewName = personalizationDetails.getViewName();
18
+
19
+ onResponse(() => {
20
+ return {
21
+ propositions: returnedPropositions,
22
+ decisions: returnedDecisions,
23
+ };
24
+ });
25
+
26
+ return viewCache.getView(viewName).then((propositions) => {
27
+ let render;
28
+ if (personalizationDetails.isRenderDecisions()) {
29
+ ({ render, returnedPropositions, returnedDecisions } =
30
+ processPropositions(propositions));
31
+
32
+ logger.logOnContentRendering({
33
+ status: "rendering-started",
34
+ message: `Started rendering propositions for view scope - ${viewName}.`,
35
+ logLevel: "info",
36
+ detail: {
37
+ scope: viewName,
38
+ propositions: propositions.map((proposition) =>
39
+ proposition.toJSON(),
40
+ ),
41
+ },
42
+ });
43
+
44
+ return render();
45
+ }
46
+ ({ returnedPropositions, returnedDecisions } = processPropositions(
47
+ [],
48
+ propositions,
49
+ ));
50
+ return [];
51
+ });
52
+ };
53
+ };
@@ -0,0 +1,97 @@
1
+ /*
2
+ Copyright 2019 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { awaitSelector } from "@adobe/alloy-core/utils/dom";
14
+ import { hideElements, showElements } from "../flicker/index.js";
15
+ import { selectNodesWithEq } from "./dom/index.js";
16
+
17
+ export { default as setText } from "./setText.js";
18
+ export { default as setHtml } from "./setHtml.js";
19
+ export { default as appendHtml } from "./appendHtml.js";
20
+ export { default as prependHtml } from "./prependHtml.js";
21
+ export { default as replaceHtml } from "./replaceHtml.js";
22
+ export { default as insertHtmlBefore } from "./insertHtmlBefore.js";
23
+ export { default as insertHtmlAfter } from "./insertHtmlAfter.js";
24
+ export { default as setStyles } from "./setStyles.js";
25
+ export { default as setAttributes } from "./setAttributes.js";
26
+ export { default as swapImage } from "./swapImage.js";
27
+ export { default as rearrangeChildren } from "./rearrangeChildren.js";
28
+
29
+ /**
30
+ * Renders content into a container element.
31
+ *
32
+ * @param {Object} params
33
+ * @param {Element[]} params.containers
34
+ * @param {string} params.content
35
+ * @param {(element: Element) => void} params.decorateProposition
36
+ * @param {(container: Element, content: string, decorateProposition: (element: Element) => void) => Promise<void>} params.renderFunc
37
+ * @returns {Promise<void>} A promise that resolves when the content is rendered.
38
+ */
39
+ const renderContent = ({
40
+ containers,
41
+ content,
42
+ decorateProposition,
43
+ renderFunc,
44
+ renderStatusHandler,
45
+ alwaysRender,
46
+ }) => {
47
+ const executions = containers
48
+ .filter(
49
+ (element) => alwaysRender || renderStatusHandler.shouldRender(element),
50
+ )
51
+ .map(async (container) => {
52
+ await renderFunc(container, content, decorateProposition);
53
+ renderStatusHandler.markAsRendered(container);
54
+ });
55
+
56
+ return Promise.all(executions);
57
+ };
58
+
59
+ /**
60
+ * Creates an action function that renders content into a container element.
61
+ *
62
+ * @param {Function} renderFunc - The function that performs the rendering.
63
+ * @param {boolean} alwaysRender - Whether to always render the content, even if it has already been rendered.
64
+ */
65
+ export const createAction = (renderFunc, alwaysRender = false) => {
66
+ /**
67
+ * Renders content into a container element.
68
+ *
69
+ * @param {{ selector: string, prehidingSelector: string, content: string }} itemData - The item data containing the container selector and prehiding selector.
70
+ * @param {(element: Element) => void} createDecorateProposition
71
+ * @param {{ shouldRender: (element: Element) => boolean, markAsRendered: (element: Element) => void }} renderStatusHandler
72
+ */
73
+ return async (itemData, decorateProposition, renderStatusHandler) => {
74
+ const {
75
+ selector: containerSelector,
76
+ prehidingSelector,
77
+ content,
78
+ } = itemData;
79
+ hideElements(prehidingSelector);
80
+ try {
81
+ const containers = await awaitSelector(
82
+ containerSelector,
83
+ selectNodesWithEq,
84
+ );
85
+ renderContent({
86
+ containers,
87
+ content,
88
+ decorateProposition,
89
+ renderFunc,
90
+ renderStatusHandler,
91
+ alwaysRender,
92
+ });
93
+ } finally {
94
+ showElements(prehidingSelector);
95
+ }
96
+ };
97
+ };
@@ -0,0 +1,37 @@
1
+ /*
2
+ Copyright 2019 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { selectNodes } from "@adobe/alloy-core/utils/dom";
14
+ import { STYLE } from "@adobe/alloy-core/constants/tagName.js";
15
+ import { SRC } from "@adobe/alloy-core/constants/elementAttribute.js";
16
+ import { getAttribute, getNonce } from "./dom/index.js";
17
+
18
+ const is = (element, tagName) => element.tagName === tagName;
19
+ const isInlineStyleElement = (element) =>
20
+ is(element, STYLE) && !getAttribute(element, SRC);
21
+
22
+ export default (fragment) => {
23
+ const styleNodes = selectNodes(STYLE, fragment);
24
+ const { length } = styleNodes;
25
+ const nonce = getNonce();
26
+ if (!nonce) {
27
+ return;
28
+ }
29
+
30
+ for (let i = 0; i < length; i += 1) {
31
+ const element = styleNodes[i];
32
+ if (!isInlineStyleElement(element)) {
33
+ continue;
34
+ }
35
+ element.nonce = nonce;
36
+ }
37
+ };
@@ -0,0 +1,42 @@
1
+ /*
2
+ Copyright 2019 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { appendNode } from "@adobe/alloy-core/utils/dom";
14
+ import { createFragment, getChildNodes } from "./dom/index.js";
15
+ import { loadImages } from "./images.js";
16
+ import addNonceToInlineStyleElements from "./addNonceToInlineStyleElements.js";
17
+ import {
18
+ executeInlineScripts,
19
+ executeRemoteScripts,
20
+ getInlineScripts,
21
+ getRemoteScriptsUrls,
22
+ } from "./scripts.js";
23
+
24
+ export default (container, html, decorateProposition) => {
25
+ const fragment = createFragment(html);
26
+ addNonceToInlineStyleElements(fragment);
27
+ const elements = getChildNodes(fragment);
28
+ const scripts = getInlineScripts(fragment);
29
+ const scriptsUrls = getRemoteScriptsUrls(fragment);
30
+
31
+ loadImages(fragment);
32
+
33
+ elements.forEach((element) => {
34
+ appendNode(container, element);
35
+ });
36
+
37
+ decorateProposition(container);
38
+
39
+ executeInlineScripts(container, scripts);
40
+
41
+ return executeRemoteScripts(scriptsUrls);
42
+ };
@@ -0,0 +1,89 @@
1
+ /*
2
+ Copyright 2019 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import matchesSelectorWithEq from "../dom/matchesSelectorWithEq.js";
14
+ import { VIEW_SCOPE_TYPE } from "../../constants/scopeType.js";
15
+ import { cleanMetas, dedupeMetas } from "../../utils/metaUtils.js";
16
+
17
+ const getMetasIfMatches = (clickedElement, selector, getClickMetas) => {
18
+ const { documentElement } = document;
19
+ let element = clickedElement;
20
+ let i = 0;
21
+
22
+ while (element && element !== documentElement) {
23
+ if (matchesSelectorWithEq(selector, element)) {
24
+ const matchedMetas = getClickMetas(selector);
25
+ const returnValue = {
26
+ metas: matchedMetas,
27
+ };
28
+ const foundMetaWithLabel = matchedMetas.find(
29
+ (meta) => meta.trackingLabel,
30
+ );
31
+ if (foundMetaWithLabel) {
32
+ returnValue.label = foundMetaWithLabel.trackingLabel;
33
+ returnValue.weight = i;
34
+ }
35
+ const foundMetaWithScopeTypeView = matchedMetas.find(
36
+ (meta) => meta.scopeType === VIEW_SCOPE_TYPE,
37
+ );
38
+ if (foundMetaWithScopeTypeView) {
39
+ returnValue.viewName = foundMetaWithScopeTypeView.scope;
40
+ returnValue.weight = i;
41
+ }
42
+ return returnValue;
43
+ }
44
+
45
+ element = element.parentNode;
46
+ i += 1;
47
+ }
48
+
49
+ return {
50
+ metas: null,
51
+ };
52
+ };
53
+
54
+ export default (clickedElement, selectors, getClickMetas) => {
55
+ const result = [];
56
+ let resultLabel = "";
57
+ let resultLabelWeight = Number.MAX_SAFE_INTEGER;
58
+ let resultViewName;
59
+ let resultViewNameWeight = Number.MAX_SAFE_INTEGER;
60
+
61
+ for (let i = 0; i < selectors.length; i += 1) {
62
+ const { metas, label, weight, viewName } = getMetasIfMatches(
63
+ clickedElement,
64
+ selectors[i],
65
+ getClickMetas,
66
+ );
67
+
68
+ if (!metas) {
69
+ continue;
70
+ }
71
+
72
+ if (label && weight <= resultLabelWeight) {
73
+ resultLabel = label;
74
+ resultLabelWeight = weight;
75
+ }
76
+ if (viewName && weight <= resultViewNameWeight) {
77
+ resultViewName = viewName;
78
+ resultViewNameWeight = weight;
79
+ }
80
+ result.push(...cleanMetas(metas));
81
+ }
82
+
83
+ return {
84
+ decisionsMeta: dedupeMetas(result),
85
+ propositionActionLabel: resultLabel,
86
+ propositionActionToken: undefined,
87
+ viewName: resultViewName,
88
+ };
89
+ };
@@ -0,0 +1,113 @@
1
+ /*
2
+ Copyright 2019 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { VIEW_SCOPE_TYPE } from "../../constants/scopeType.js";
14
+ import getAttribute from "../dom/getAttribute.js";
15
+ import {
16
+ CLICK_LABEL_DATA_ATTRIBUTE,
17
+ CLICK_TOKEN_DATA_ATTRIBUTE,
18
+ INTERACT_ID_DATA_ATTRIBUTE,
19
+ } from "../../handlers/createDecorateProposition.js";
20
+ import { cleanMetas } from "../../utils/metaUtils.js";
21
+ import {
22
+ ALWAYS,
23
+ DECORATED_ELEMENTS_ONLY,
24
+ } from "@adobe/alloy-core/constants/propositionInteractionType.js";
25
+
26
+ const getInteractionDetail = (clickedElement) => {
27
+ const { documentElement } = document;
28
+ let element = clickedElement;
29
+
30
+ const interactIds = new Set();
31
+ let clickLabel;
32
+ let clickToken;
33
+
34
+ while (
35
+ element &&
36
+ element !== documentElement &&
37
+ !(element instanceof ShadowRoot)
38
+ ) {
39
+ const interactId = getAttribute(element, INTERACT_ID_DATA_ATTRIBUTE);
40
+
41
+ if (interactId) {
42
+ interactIds.add(interactId);
43
+ }
44
+
45
+ clickLabel =
46
+ clickLabel || getAttribute(element, CLICK_LABEL_DATA_ATTRIBUTE);
47
+
48
+ clickToken =
49
+ clickToken || getAttribute(element, CLICK_TOKEN_DATA_ATTRIBUTE);
50
+
51
+ element = element.parentNode;
52
+ }
53
+
54
+ return { interactIds: [...interactIds], clickLabel, clickToken };
55
+ };
56
+
57
+ const extractViewName = (metas) => {
58
+ const foundMetaWithScopeTypeView = metas.find(
59
+ (meta) => meta.scopeType === VIEW_SCOPE_TYPE,
60
+ );
61
+
62
+ return foundMetaWithScopeTypeView
63
+ ? foundMetaWithScopeTypeView.scope
64
+ : undefined;
65
+ };
66
+
67
+ const createMetaFilter =
68
+ (autoCollectPropositionInteractions, clickLabel, clickToken) => (meta) => {
69
+ const { scopeDetails = {} } = meta;
70
+ const { decisionProvider } = scopeDetails;
71
+ if (autoCollectPropositionInteractions[decisionProvider] === ALWAYS) {
72
+ return true;
73
+ }
74
+
75
+ return (
76
+ autoCollectPropositionInteractions[decisionProvider] ===
77
+ DECORATED_ELEMENTS_ONLY &&
78
+ (clickLabel || clickToken)
79
+ );
80
+ };
81
+
82
+ export default (
83
+ clickedElement,
84
+ getInteractionMetas,
85
+ autoCollectPropositionInteractions,
86
+ ) => {
87
+ const {
88
+ interactIds,
89
+ clickLabel = "",
90
+ clickToken,
91
+ } = getInteractionDetail(clickedElement);
92
+
93
+ const metasMatchingConfigurationOptions = createMetaFilter(
94
+ autoCollectPropositionInteractions,
95
+ clickLabel,
96
+ clickToken,
97
+ );
98
+
99
+ if (interactIds.length === 0) {
100
+ return {};
101
+ }
102
+
103
+ const metas = getInteractionMetas(interactIds).filter(
104
+ metasMatchingConfigurationOptions,
105
+ );
106
+
107
+ return {
108
+ decisionsMeta: cleanMetas(metas),
109
+ propositionActionLabel: clickLabel,
110
+ propositionActionToken: clickToken,
111
+ viewName: extractViewName(metas),
112
+ };
113
+ };
@@ -0,0 +1,15 @@
1
+ /*
2
+ Copyright 2019 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ export default (container, content, decorateProposition) => {
14
+ decorateProposition(container);
15
+ };
@@ -0,0 +1,21 @@
1
+ /*
2
+ Copyright 2023 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ export default (preprocessors) => (action) => {
14
+ if (!action) {
15
+ return action;
16
+ }
17
+ return preprocessors.reduce(
18
+ (processed, fn) => ({ ...processed, ...fn(processed) }),
19
+ action,
20
+ );
21
+ };
@@ -0,0 +1,23 @@
1
+ /*
2
+ Copyright 2019 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ export default (window) =>
14
+ (url, preserveHistory = false) => {
15
+ if (preserveHistory) {
16
+ window.location.href = url;
17
+ } else {
18
+ window.location.replace(url);
19
+ }
20
+ // Return a promise that never resolves because redirects never complete
21
+ // within the current page.
22
+ return new Promise(() => {});
23
+ };
@@ -0,0 +1,18 @@
1
+ /*
2
+ Copyright 2019 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { createNode } from "@adobe/alloy-core/utils/dom";
14
+ import { DIV } from "@adobe/alloy-core/constants/tagName.js";
15
+
16
+ export default (content = "undefined") => {
17
+ return createNode(DIV, {}, { innerHTML: content });
18
+ };
@@ -0,0 +1,15 @@
1
+ /*
2
+ Copyright 2019 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ export default (element, name) => {
14
+ return element.getAttribute(name);
15
+ };
@@ -0,0 +1,23 @@
1
+ /*
2
+ Copyright 2019 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { toArray } from "@adobe/alloy-core/utils";
14
+
15
+ export default (element) => {
16
+ const { childNodes } = element;
17
+
18
+ if (childNodes) {
19
+ return toArray(childNodes);
20
+ }
21
+
22
+ return [];
23
+ };