@nascentdigital/funnel-ui 4.4.18

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 (467) hide show
  1. package/dist/Tailwind.d.ts +201 -0
  2. package/dist/Tailwind.js +282 -0
  3. package/dist/client/app/AppContainer.d.ts +10 -0
  4. package/dist/client/app/AppContainer.js +22 -0
  5. package/dist/client/app/AppContext.d.ts +11 -0
  6. package/dist/client/app/AppContext.js +6 -0
  7. package/dist/client/app/AppPreview.d.ts +7 -0
  8. package/dist/client/app/AppPreview.js +51 -0
  9. package/dist/client/app/PageContainer.d.ts +8 -0
  10. package/dist/client/app/PageContainer.js +22 -0
  11. package/dist/client/app/index.d.ts +9 -0
  12. package/dist/client/app/index.js +25 -0
  13. package/dist/client/app/useAppConfig.d.ts +2 -0
  14. package/dist/client/app/useAppConfig.js +9 -0
  15. package/dist/client/app/useBrand.d.ts +9 -0
  16. package/dist/client/app/useBrand.js +17 -0
  17. package/dist/client/app/useLanguage.d.ts +2 -0
  18. package/dist/client/app/useLanguage.js +11 -0
  19. package/dist/client/app/usePageData.d.ts +2 -0
  20. package/dist/client/app/usePageData.js +25 -0
  21. package/dist/client/app/usePageUrl.d.ts +1 -0
  22. package/dist/client/app/usePageUrl.js +12 -0
  23. package/dist/client/app/useRegion.d.ts +1 -0
  24. package/dist/client/app/useRegion.js +10 -0
  25. package/dist/client/app/useSite.d.ts +2 -0
  26. package/dist/client/app/useSite.js +13 -0
  27. package/dist/client/atomic/AnimatedText.d.ts +12 -0
  28. package/dist/client/atomic/AnimatedText.js +90 -0
  29. package/dist/client/atomic/MaskedInput.d.ts +20 -0
  30. package/dist/client/atomic/MaskedInput.js +63 -0
  31. package/dist/client/atomic/index.d.ts +2 -0
  32. package/dist/client/atomic/index.js +18 -0
  33. package/dist/client/fields/EmbeddedVideo/EmbeddedPlayer.d.ts +36 -0
  34. package/dist/client/fields/EmbeddedVideo/EmbeddedPlayer.js +2 -0
  35. package/dist/client/fields/EmbeddedVideo/EmbeddedVideo.d.ts +13 -0
  36. package/dist/client/fields/EmbeddedVideo/EmbeddedVideo.js +22 -0
  37. package/dist/client/fields/EmbeddedVideo/EmbeddedVideoContainer.d.ts +7 -0
  38. package/dist/client/fields/EmbeddedVideo/EmbeddedVideoContainer.js +24 -0
  39. package/dist/client/fields/EmbeddedVideo/EmbeddedVideoContext.d.ts +8 -0
  40. package/dist/client/fields/EmbeddedVideo/EmbeddedVideoContext.js +11 -0
  41. package/dist/client/fields/EmbeddedVideo/index.d.ts +4 -0
  42. package/dist/client/fields/EmbeddedVideo/index.js +20 -0
  43. package/dist/client/fields/EmbeddedVideo/useEmbeddedPlayerProgress.d.ts +10 -0
  44. package/dist/client/fields/EmbeddedVideo/useEmbeddedPlayerProgress.js +66 -0
  45. package/dist/client/fields/EmbeddedVideo/useEmbeddedPlayerRef.d.ts +9 -0
  46. package/dist/client/fields/EmbeddedVideo/useEmbeddedPlayerRef.js +29 -0
  47. package/dist/client/fields/EmbeddedVideo/vimeo/VimeoPlayer.d.ts +63 -0
  48. package/dist/client/fields/EmbeddedVideo/vimeo/VimeoPlayer.js +326 -0
  49. package/dist/client/fields/EmbeddedVideo/vimeo/VimeoVideo.d.ts +13 -0
  50. package/dist/client/fields/EmbeddedVideo/vimeo/VimeoVideo.js +60 -0
  51. package/dist/client/fields/EmbeddedVideo/vimeo/index.d.ts +1 -0
  52. package/dist/client/fields/EmbeddedVideo/vimeo/index.js +17 -0
  53. package/dist/client/fields/EmbeddedVideo/youtube/YTApi.d.ts +92 -0
  54. package/dist/client/fields/EmbeddedVideo/youtube/YTApi.js +24 -0
  55. package/dist/client/fields/EmbeddedVideo/youtube/YoutubePlayer.d.ts +56 -0
  56. package/dist/client/fields/EmbeddedVideo/youtube/YoutubePlayer.js +288 -0
  57. package/dist/client/fields/EmbeddedVideo/youtube/YoutubeVideo.d.ts +13 -0
  58. package/dist/client/fields/EmbeddedVideo/youtube/YoutubeVideo.js +71 -0
  59. package/dist/client/fields/EmbeddedVideo/youtube/index.d.ts +3 -0
  60. package/dist/client/fields/EmbeddedVideo/youtube/index.js +19 -0
  61. package/dist/client/fields/LazyVideo.d.ts +8 -0
  62. package/dist/client/fields/LazyVideo.js +100 -0
  63. package/dist/client/fields/index.d.ts +2 -0
  64. package/dist/client/fields/index.js +18 -0
  65. package/dist/client/forms/Form.d.ts +13 -0
  66. package/dist/client/forms/Form.js +68 -0
  67. package/dist/client/forms/FormContext.d.ts +5 -0
  68. package/dist/client/forms/FormContext.js +6 -0
  69. package/dist/client/forms/fields/BooleanField.d.ts +16 -0
  70. package/dist/client/forms/fields/BooleanField.js +47 -0
  71. package/dist/client/forms/fields/EnumField.d.ts +20 -0
  72. package/dist/client/forms/fields/EnumField.js +65 -0
  73. package/dist/client/forms/fields/Field.d.ts +15 -0
  74. package/dist/client/forms/fields/Field.js +39 -0
  75. package/dist/client/forms/fields/FieldErrorController.d.ts +12 -0
  76. package/dist/client/forms/fields/FieldErrorController.js +13 -0
  77. package/dist/client/forms/fields/FieldLayout.d.ts +16 -0
  78. package/dist/client/forms/fields/FieldLayout.js +32 -0
  79. package/dist/client/forms/fields/TextField.d.ts +25 -0
  80. package/dist/client/forms/fields/TextField.js +178 -0
  81. package/dist/client/forms/fields/index.d.ts +2 -0
  82. package/dist/client/forms/fields/index.js +18 -0
  83. package/dist/client/forms/fields/useField.d.ts +2 -0
  84. package/dist/client/forms/fields/useField.js +26 -0
  85. package/dist/client/forms/index.d.ts +4 -0
  86. package/dist/client/forms/index.js +20 -0
  87. package/dist/client/forms/interactive/CheckboxField.d.ts +14 -0
  88. package/dist/client/forms/interactive/CheckboxField.js +19 -0
  89. package/dist/client/forms/interactive/RadioField.d.ts +12 -0
  90. package/dist/client/forms/interactive/RadioField.js +16 -0
  91. package/dist/client/forms/interactive/RadioGroupField.d.ts +12 -0
  92. package/dist/client/forms/interactive/RadioGroupField.js +10 -0
  93. package/dist/client/forms/interactive/SelectField.d.ts +17 -0
  94. package/dist/client/forms/interactive/SelectField.js +16 -0
  95. package/dist/client/forms/interactive/index.d.ts +4 -0
  96. package/dist/client/forms/interactive/index.js +20 -0
  97. package/dist/client/forms/useForm.d.ts +2 -0
  98. package/dist/client/forms/useForm.js +17 -0
  99. package/dist/client/forms/useTempFields.d.ts +7 -0
  100. package/dist/client/forms/useTempFields.js +54 -0
  101. package/dist/client/hooks/assets/index.d.ts +2 -0
  102. package/dist/client/hooks/assets/index.js +18 -0
  103. package/dist/client/hooks/assets/useImageProxy.d.ts +2 -0
  104. package/dist/client/hooks/assets/useImageProxy.js +43 -0
  105. package/dist/client/hooks/assets/useVideoProxy.d.ts +2 -0
  106. package/dist/client/hooks/assets/useVideoProxy.js +43 -0
  107. package/dist/client/hooks/breakpoint/BreakpointContainer.d.ts +9 -0
  108. package/dist/client/hooks/breakpoint/BreakpointContainer.js +39 -0
  109. package/dist/client/hooks/breakpoint/BreakpointContext.d.ts +7 -0
  110. package/dist/client/hooks/breakpoint/BreakpointContext.js +9 -0
  111. package/dist/client/hooks/breakpoint/index.d.ts +3 -0
  112. package/dist/client/hooks/breakpoint/index.js +19 -0
  113. package/dist/client/hooks/breakpoint/useCurrentBreakpoint.d.ts +2 -0
  114. package/dist/client/hooks/breakpoint/useCurrentBreakpoint.js +10 -0
  115. package/dist/client/hooks/index.d.ts +26 -0
  116. package/dist/client/hooks/index.js +42 -0
  117. package/dist/client/hooks/ui-lock/UILockContainer.d.ts +5 -0
  118. package/dist/client/hooks/ui-lock/UILockContainer.js +57 -0
  119. package/dist/client/hooks/ui-lock/UILockContext.d.ts +9 -0
  120. package/dist/client/hooks/ui-lock/UILockContext.js +6 -0
  121. package/dist/client/hooks/ui-lock/UILockRef.d.ts +36 -0
  122. package/dist/client/hooks/ui-lock/UILockRef.js +32 -0
  123. package/dist/client/hooks/ui-lock/index.d.ts +3 -0
  124. package/dist/client/hooks/ui-lock/index.js +19 -0
  125. package/dist/client/hooks/ui-lock/useUILock.d.ts +16 -0
  126. package/dist/client/hooks/ui-lock/useUILock.js +121 -0
  127. package/dist/client/hooks/useCounter.d.ts +11 -0
  128. package/dist/client/hooks/useCounter.js +57 -0
  129. package/dist/client/hooks/useCycle.d.ts +5 -0
  130. package/dist/client/hooks/useCycle.js +15 -0
  131. package/dist/client/hooks/useElementRect.d.ts +2 -0
  132. package/dist/client/hooks/useElementRect.js +63 -0
  133. package/dist/client/hooks/useElementScrolled.d.ts +17 -0
  134. package/dist/client/hooks/useElementScrolled.js +51 -0
  135. package/dist/client/hooks/useElementSelector.d.ts +2 -0
  136. package/dist/client/hooks/useElementSelector.js +160 -0
  137. package/dist/client/hooks/useElementSize.d.ts +2 -0
  138. package/dist/client/hooks/useElementSize.js +64 -0
  139. package/dist/client/hooks/useFindElements.d.ts +9 -0
  140. package/dist/client/hooks/useFindElements.js +147 -0
  141. package/dist/client/hooks/useInViewport.d.ts +16 -0
  142. package/dist/client/hooks/useInViewport.js +46 -0
  143. package/dist/client/hooks/useIsDesktop.d.ts +1 -0
  144. package/dist/client/hooks/useIsDesktop.js +22 -0
  145. package/dist/client/hooks/useKeyboardFocus.d.ts +7 -0
  146. package/dist/client/hooks/useKeyboardFocus.js +40 -0
  147. package/dist/client/hooks/useLatestValue.d.ts +1 -0
  148. package/dist/client/hooks/useLatestValue.js +21 -0
  149. package/dist/client/hooks/useLock.d.ts +13 -0
  150. package/dist/client/hooks/useLock.js +161 -0
  151. package/dist/client/hooks/useMixedResponsiveValue.d.ts +2 -0
  152. package/dist/client/hooks/useMixedResponsiveValue.js +20 -0
  153. package/dist/client/hooks/usePathname.d.ts +9 -0
  154. package/dist/client/hooks/usePathname.js +25 -0
  155. package/dist/client/hooks/useRefElement.d.ts +8 -0
  156. package/dist/client/hooks/useRefElement.js +34 -0
  157. package/dist/client/hooks/useRefresh.d.ts +2 -0
  158. package/dist/client/hooks/useRefresh.js +25 -0
  159. package/dist/client/hooks/useResizeObserver.d.ts +5 -0
  160. package/dist/client/hooks/useResizeObserver.js +179 -0
  161. package/dist/client/hooks/useResponsiveValue.d.ts +2 -0
  162. package/dist/client/hooks/useResponsiveValue.js +16 -0
  163. package/dist/client/hooks/useRouter.d.ts +20 -0
  164. package/dist/client/hooks/useRouter.js +49 -0
  165. package/dist/client/hooks/useSafeLayoutEffect.d.ts +2 -0
  166. package/dist/client/hooks/useSafeLayoutEffect.js +9 -0
  167. package/dist/client/hooks/useTouch.d.ts +2 -0
  168. package/dist/client/hooks/useTouch.js +10 -0
  169. package/dist/client/hooks/useViewportSize.d.ts +7 -0
  170. package/dist/client/hooks/useViewportSize.js +66 -0
  171. package/dist/client/hooks/useWindowScrolled.d.ts +8 -0
  172. package/dist/client/hooks/useWindowScrolled.js +52 -0
  173. package/dist/client/index.d.ts +9 -0
  174. package/dist/client/index.js +25 -0
  175. package/dist/client/interaction/Carousel.d.ts +48 -0
  176. package/dist/client/interaction/Carousel.js +498 -0
  177. package/dist/client/interaction/ClickObserver.d.ts +19 -0
  178. package/dist/client/interaction/ClickObserver.js +76 -0
  179. package/dist/client/interaction/InfiniteScroller.d.ts +9 -0
  180. package/dist/client/interaction/InfiniteScroller.js +47 -0
  181. package/dist/client/interaction/Loader.d.ts +14 -0
  182. package/dist/client/interaction/Loader.js +74 -0
  183. package/dist/client/interaction/Marquee.d.ts +5 -0
  184. package/dist/client/interaction/Marquee.js +26 -0
  185. package/dist/client/interaction/Popup.d.ts +36 -0
  186. package/dist/client/interaction/Popup.js +244 -0
  187. package/dist/client/interaction/Tooltip.d.ts +16 -0
  188. package/dist/client/interaction/Tooltip.js +122 -0
  189. package/dist/client/interaction/UILevel.d.ts +1 -0
  190. package/dist/client/interaction/UILevel.js +2 -0
  191. package/dist/client/interaction/backdrop/BackdropContainer.d.ts +5 -0
  192. package/dist/client/interaction/backdrop/BackdropContainer.js +114 -0
  193. package/dist/client/interaction/backdrop/BackdropContext.d.ts +8 -0
  194. package/dist/client/interaction/backdrop/BackdropContext.js +6 -0
  195. package/dist/client/interaction/backdrop/BackdropEvent.d.ts +64 -0
  196. package/dist/client/interaction/backdrop/BackdropEvent.js +92 -0
  197. package/dist/client/interaction/backdrop/index.d.ts +4 -0
  198. package/dist/client/interaction/backdrop/index.js +20 -0
  199. package/dist/client/interaction/backdrop/useBackdrop.d.ts +13 -0
  200. package/dist/client/interaction/backdrop/useBackdrop.js +58 -0
  201. package/dist/client/interaction/backdrop/useBackdropClick.d.ts +2 -0
  202. package/dist/client/interaction/backdrop/useBackdropClick.js +21 -0
  203. package/dist/client/interaction/backdrop/useBackdropVisible.d.ts +1 -0
  204. package/dist/client/interaction/backdrop/useBackdropVisible.js +30 -0
  205. package/dist/client/interaction/focus/FocusArea.d.ts +10 -0
  206. package/dist/client/interaction/focus/FocusArea.js +38 -0
  207. package/dist/client/interaction/focus/FocusContext.d.ts +7 -0
  208. package/dist/client/interaction/focus/FocusContext.js +7 -0
  209. package/dist/client/interaction/focus/FocusController.d.ts +9 -0
  210. package/dist/client/interaction/focus/FocusController.js +40 -0
  211. package/dist/client/interaction/focus/FocusService.d.ts +20 -0
  212. package/dist/client/interaction/focus/FocusService.js +204 -0
  213. package/dist/client/interaction/focus/LinkedList.d.ts +18 -0
  214. package/dist/client/interaction/focus/LinkedList.js +122 -0
  215. package/dist/client/interaction/focus/index.d.ts +2 -0
  216. package/dist/client/interaction/focus/index.js +18 -0
  217. package/dist/client/interaction/focus/useFocusService.d.ts +2 -0
  218. package/dist/client/interaction/focus/useFocusService.js +14 -0
  219. package/dist/client/interaction/index.d.ts +12 -0
  220. package/dist/client/interaction/index.js +28 -0
  221. package/dist/client/interaction/modal/Modal.d.ts +29 -0
  222. package/dist/client/interaction/modal/Modal.js +136 -0
  223. package/dist/client/interaction/modal/ModalContainer.d.ts +5 -0
  224. package/dist/client/interaction/modal/ModalContainer.js +104 -0
  225. package/dist/client/interaction/modal/ModalContext.d.ts +8 -0
  226. package/dist/client/interaction/modal/ModalContext.js +6 -0
  227. package/dist/client/interaction/modal/ModalEvent.d.ts +39 -0
  228. package/dist/client/interaction/modal/ModalEvent.js +53 -0
  229. package/dist/client/interaction/modal/index.d.ts +2 -0
  230. package/dist/client/interaction/modal/index.js +18 -0
  231. package/dist/client/interaction/paginator/Paginator.d.ts +33 -0
  232. package/dist/client/interaction/paginator/Paginator.js +67 -0
  233. package/dist/client/interaction/paginator/index.d.ts +1 -0
  234. package/dist/client/interaction/paginator/index.js +17 -0
  235. package/dist/client/layouts/MasonaryLayout.d.ts +7 -0
  236. package/dist/client/layouts/MasonaryLayout.js +53 -0
  237. package/dist/client/layouts/index.d.ts +1 -0
  238. package/dist/client/layouts/index.js +17 -0
  239. package/dist/client/refs.d.ts +2 -0
  240. package/dist/client/refs.js +13 -0
  241. package/dist/client/transitions/Revelator.d.ts +42 -0
  242. package/dist/client/transitions/Revelator.js +60 -0
  243. package/dist/client/transitions/SideScroll.d.ts +14 -0
  244. package/dist/client/transitions/SideScroll.js +51 -0
  245. package/dist/client/transitions/StyleInViewport.d.ts +20 -0
  246. package/dist/client/transitions/StyleInViewport.js +66 -0
  247. package/dist/client/transitions/StyleSwitch.d.ts +297 -0
  248. package/dist/client/transitions/StyleSwitch.js +78 -0
  249. package/dist/client/transitions/index.d.ts +6 -0
  250. package/dist/client/transitions/index.js +22 -0
  251. package/dist/client/transitions/parallax/Parallax.d.ts +20 -0
  252. package/dist/client/transitions/parallax/Parallax.js +72 -0
  253. package/dist/client/transitions/parallax/ParallaxContext.d.ts +11 -0
  254. package/dist/client/transitions/parallax/ParallaxContext.js +6 -0
  255. package/dist/client/transitions/parallax/ParallaxItem.d.ts +14 -0
  256. package/dist/client/transitions/parallax/ParallaxItem.js +37 -0
  257. package/dist/client/transitions/parallax/ParallaxRemote.d.ts +29 -0
  258. package/dist/client/transitions/parallax/ParallaxRemote.js +136 -0
  259. package/dist/client/transitions/parallax/ParallaxUtils.d.ts +5 -0
  260. package/dist/client/transitions/parallax/ParallaxUtils.js +19 -0
  261. package/dist/client/transitions/parallax/index.d.ts +2 -0
  262. package/dist/client/transitions/parallax/index.js +18 -0
  263. package/dist/client/transitions/parallax/useDisableParallax.d.ts +4 -0
  264. package/dist/client/transitions/parallax/useDisableParallax.js +13 -0
  265. package/dist/client/transitions/parallax/useParallax.d.ts +2 -0
  266. package/dist/client/transitions/parallax/useParallax.js +18 -0
  267. package/dist/client/transitions/parallax/useTransforms.d.ts +34 -0
  268. package/dist/client/transitions/parallax/useTransforms.js +176 -0
  269. package/dist/client/transitions/reveal/Reveal.d.ts +14 -0
  270. package/dist/client/transitions/reveal/Reveal.js +75 -0
  271. package/dist/client/transitions/reveal/RevealAnimation.d.ts +17 -0
  272. package/dist/client/transitions/reveal/RevealAnimation.js +2 -0
  273. package/dist/client/transitions/reveal/RevealAnimator.d.ts +13 -0
  274. package/dist/client/transitions/reveal/RevealAnimator.js +41 -0
  275. package/dist/client/transitions/reveal/RevealController.d.ts +13 -0
  276. package/dist/client/transitions/reveal/RevealController.js +114 -0
  277. package/dist/client/transitions/reveal/RevealElementAnimator.d.ts +13 -0
  278. package/dist/client/transitions/reveal/RevealElementAnimator.js +65 -0
  279. package/dist/client/transitions/reveal/index.d.ts +2 -0
  280. package/dist/client/transitions/reveal/index.js +18 -0
  281. package/dist/client/utils/OnKey.d.ts +20 -0
  282. package/dist/client/utils/OnKey.js +33 -0
  283. package/dist/client/utils/SharedMutationObserver.d.ts +20 -0
  284. package/dist/client/utils/SharedMutationObserver.js +202 -0
  285. package/dist/client/utils/index.d.ts +2 -0
  286. package/dist/client/utils/index.js +18 -0
  287. package/dist/server/atomic/Markup.d.ts +14 -0
  288. package/dist/server/atomic/Markup.js +34 -0
  289. package/dist/server/atomic/NascentLogo.d.ts +6 -0
  290. package/dist/server/atomic/NascentLogo.js +9 -0
  291. package/dist/server/atomic/index.d.ts +2 -0
  292. package/dist/server/atomic/index.js +18 -0
  293. package/dist/server/blocks/Block.d.ts +16 -0
  294. package/dist/server/blocks/Block.js +92 -0
  295. package/dist/server/blocks/Clients.d.ts +33 -0
  296. package/dist/server/blocks/Clients.js +82 -0
  297. package/dist/server/blocks/Editorial.d.ts +33 -0
  298. package/dist/server/blocks/Editorial.js +80 -0
  299. package/dist/server/blocks/Form.d.ts +46 -0
  300. package/dist/server/blocks/Form.js +74 -0
  301. package/dist/server/blocks/FormMessage.d.ts +15 -0
  302. package/dist/server/blocks/FormMessage.js +37 -0
  303. package/dist/server/blocks/MediaLayout.d.ts +309 -0
  304. package/dist/server/blocks/MediaLayout.js +105 -0
  305. package/dist/server/blocks/Message.d.ts +76 -0
  306. package/dist/server/blocks/Message.js +352 -0
  307. package/dist/server/blocks/Outcome.d.ts +84 -0
  308. package/dist/server/blocks/Outcome.js +489 -0
  309. package/dist/server/blocks/OutcomeDetail.d.ts +303 -0
  310. package/dist/server/blocks/OutcomeDetail.js +63 -0
  311. package/dist/server/blocks/Projects.d.ts +43 -0
  312. package/dist/server/blocks/Projects.js +109 -0
  313. package/dist/server/blocks/Stat.d.ts +325 -0
  314. package/dist/server/blocks/Stat.js +107 -0
  315. package/dist/server/blocks/Stats.d.ts +36 -0
  316. package/dist/server/blocks/Stats.js +79 -0
  317. package/dist/server/blocks/Testimonial.d.ts +30 -0
  318. package/dist/server/blocks/Testimonial.js +68 -0
  319. package/dist/server/blocks/ValueProp.d.ts +43 -0
  320. package/dist/server/blocks/ValueProp.js +125 -0
  321. package/dist/server/blocks/index.d.ts +13 -0
  322. package/dist/server/blocks/index.js +29 -0
  323. package/dist/server/data/PrePaginator.d.ts +8 -0
  324. package/dist/server/data/PrePaginator.js +30 -0
  325. package/dist/server/data/index.d.ts +1 -0
  326. package/dist/server/data/index.js +17 -0
  327. package/dist/server/entities/Client.d.ts +327 -0
  328. package/dist/server/entities/Client.js +118 -0
  329. package/dist/server/entities/ClientBadge.d.ts +293 -0
  330. package/dist/server/entities/ClientBadge.js +37 -0
  331. package/dist/server/entities/Person.d.ts +314 -0
  332. package/dist/server/entities/Person.js +98 -0
  333. package/dist/server/entities/Project.d.ts +329 -0
  334. package/dist/server/entities/Project.js +112 -0
  335. package/dist/server/entities/UniqueSellingPoint.d.ts +327 -0
  336. package/dist/server/entities/UniqueSellingPoint.js +119 -0
  337. package/dist/server/entities/index.d.ts +6 -0
  338. package/dist/server/entities/index.js +22 -0
  339. package/dist/server/entities/previews/MessagePreview.d.ts +299 -0
  340. package/dist/server/entities/previews/MessagePreview.js +41 -0
  341. package/dist/server/entities/previews/PagePreview.d.ts +10 -0
  342. package/dist/server/entities/previews/PagePreview.js +42 -0
  343. package/dist/server/entities/previews/index.d.ts +2 -0
  344. package/dist/server/entities/previews/index.js +18 -0
  345. package/dist/server/fields/Caption.d.ts +13 -0
  346. package/dist/server/fields/Caption.js +45 -0
  347. package/dist/server/fields/Description.d.ts +13 -0
  348. package/dist/server/fields/Description.js +46 -0
  349. package/dist/server/fields/FreeFormContent.d.ts +17 -0
  350. package/dist/server/fields/FreeFormContent.js +43 -0
  351. package/dist/server/fields/Headline.d.ts +13 -0
  352. package/dist/server/fields/Headline.js +46 -0
  353. package/dist/server/fields/Icon.d.ts +10 -0
  354. package/dist/server/fields/Icon.js +39 -0
  355. package/dist/server/fields/Link.d.ts +16 -0
  356. package/dist/server/fields/Link.js +61 -0
  357. package/dist/server/fields/Quote.d.ts +13 -0
  358. package/dist/server/fields/Quote.js +46 -0
  359. package/dist/server/fields/RichText.d.ts +296 -0
  360. package/dist/server/fields/RichText.js +217 -0
  361. package/dist/server/fields/Title.d.ts +292 -0
  362. package/dist/server/fields/Title.js +38 -0
  363. package/dist/server/fields/Visual.d.ts +12 -0
  364. package/dist/server/fields/Visual.js +66 -0
  365. package/dist/server/fields/index.d.ts +10 -0
  366. package/dist/server/fields/index.js +26 -0
  367. package/dist/server/index.d.ts +9 -0
  368. package/dist/server/index.js +25 -0
  369. package/dist/server/panels/BlockPanel.d.ts +14 -0
  370. package/dist/server/panels/BlockPanel.js +56 -0
  371. package/dist/server/panels/MessagePanel.d.ts +31 -0
  372. package/dist/server/panels/MessagePanel.js +81 -0
  373. package/dist/server/panels/VisualPanel.d.ts +36 -0
  374. package/dist/server/panels/VisualPanel.js +143 -0
  375. package/dist/server/panels/index.d.ts +3 -0
  376. package/dist/server/panels/index.js +19 -0
  377. package/dist/server/schema/Anchor.d.ts +7 -0
  378. package/dist/server/schema/Anchor.js +24 -0
  379. package/dist/server/schema/AspectRatio.d.ts +9 -0
  380. package/dist/server/schema/AspectRatio.js +43 -0
  381. package/dist/server/schema/BlockConfig.d.ts +56 -0
  382. package/dist/server/schema/BlockConfig.js +192 -0
  383. package/dist/server/schema/CollectionSchema.d.ts +4 -0
  384. package/dist/server/schema/CollectionSchema.js +15 -0
  385. package/dist/server/schema/ItemAlignment.d.ts +12 -0
  386. package/dist/server/schema/ItemAlignment.js +42 -0
  387. package/dist/server/schema/ItemPosition.d.ts +6 -0
  388. package/dist/server/schema/ItemPosition.js +25 -0
  389. package/dist/server/schema/ItemSize.d.ts +6 -0
  390. package/dist/server/schema/ItemSize.js +24 -0
  391. package/dist/server/schema/TextAlignment.d.ts +6 -0
  392. package/dist/server/schema/TextAlignment.js +22 -0
  393. package/dist/server/schema/index.d.ts +8 -0
  394. package/dist/server/schema/index.js +24 -0
  395. package/dist/server/sections/index.d.ts +1 -0
  396. package/dist/server/sections/index.js +17 -0
  397. package/dist/server/sections/renderSection.d.ts +6 -0
  398. package/dist/server/sections/renderSection.js +19 -0
  399. package/dist/server/transitions/Slide.d.ts +293 -0
  400. package/dist/server/transitions/Slide.js +31 -0
  401. package/dist/server/transitions/index.d.ts +3 -0
  402. package/dist/server/transitions/index.js +19 -0
  403. package/dist/styles/app/AppPreview.css +49 -0
  404. package/dist/styles/app/_index.css +1 -0
  405. package/dist/styles/base/_index.css +2 -0
  406. package/dist/styles/base/global.css +9 -0
  407. package/dist/styles/base/tailwind.css +3 -0
  408. package/dist/styles/blocks/Block-layout.css +244 -0
  409. package/dist/styles/blocks/Block-spacing.css +150 -0
  410. package/dist/styles/blocks/Block-theming.css +14 -0
  411. package/dist/styles/blocks/Clients.css +10 -0
  412. package/dist/styles/blocks/Editorial.css +133 -0
  413. package/dist/styles/blocks/Form.css +13 -0
  414. package/dist/styles/blocks/MediaLayout.css +215 -0
  415. package/dist/styles/blocks/Message.css +353 -0
  416. package/dist/styles/blocks/Outcome.css +83 -0
  417. package/dist/styles/blocks/Projects.css +18 -0
  418. package/dist/styles/blocks/Stat.css +45 -0
  419. package/dist/styles/blocks/Stats.css +38 -0
  420. package/dist/styles/blocks/Testimonial.css +323 -0
  421. package/dist/styles/blocks/ValueProp.css +135 -0
  422. package/dist/styles/blocks/_index.css +14 -0
  423. package/dist/styles/components/_index.css +3 -0
  424. package/dist/styles/components/container.css +58 -0
  425. package/dist/styles/components/divider.css +6 -0
  426. package/dist/styles/components/embed/VimeoPlayer.css +49 -0
  427. package/dist/styles/components/embed/YoutubePlayer.css +72 -0
  428. package/dist/styles/components/embed/_index.css +2 -0
  429. package/dist/styles/entities/Client.css +5 -0
  430. package/dist/styles/entities/ClientBadge.css +14 -0
  431. package/dist/styles/entities/Person.css +76 -0
  432. package/dist/styles/entities/Project.css +44 -0
  433. package/dist/styles/entities/UniqueSellingPoint.css +54 -0
  434. package/dist/styles/entities/_index.css +5 -0
  435. package/dist/styles/fields/Caption.css +23 -0
  436. package/dist/styles/fields/Description.css +23 -0
  437. package/dist/styles/fields/FreeFormContent.css +24 -0
  438. package/dist/styles/fields/Headline.css +38 -0
  439. package/dist/styles/fields/Icon.css +20 -0
  440. package/dist/styles/fields/LazyVideo.css +12 -0
  441. package/dist/styles/fields/Link.css +16 -0
  442. package/dist/styles/fields/Quote.css +48 -0
  443. package/dist/styles/fields/RichText.css +243 -0
  444. package/dist/styles/fields/Title.css +17 -0
  445. package/dist/styles/fields/Visual.css +27 -0
  446. package/dist/styles/fields/_index.css +11 -0
  447. package/dist/styles/index.css +9 -0
  448. package/dist/styles/layouts/MasonryLayout.css +24 -0
  449. package/dist/styles/layouts/_index.css +1 -0
  450. package/dist/styles/panels/MessagePanel.css +56 -0
  451. package/dist/styles/panels/VisualPanel.css +58 -0
  452. package/dist/styles/panels/_index.css +2 -0
  453. package/dist/styles/utilities/_index.css +7 -0
  454. package/dist/styles/utilities/ellipsis.css +7 -0
  455. package/dist/styles/utilities/fade.css +16 -0
  456. package/dist/styles/utilities/glass.css +8 -0
  457. package/dist/styles/utilities/interpolate.css +22 -0
  458. package/dist/styles/utilities/masks.css +18 -0
  459. package/dist/styles/utilities/stacked.css +24 -0
  460. package/dist/styles/utilities/text-gradient.css +37 -0
  461. package/dist/types/HTMLBlockElement.d.ts +6 -0
  462. package/dist/types/HTMLBlockElement.js +2 -0
  463. package/dist/types/HTMLElements.d.ts +129 -0
  464. package/dist/types/HTMLElements.js +2 -0
  465. package/dist/types/index.d.ts +2 -0
  466. package/dist/types/index.js +18 -0
  467. package/package.json +73 -0
@@ -0,0 +1,147 @@
1
+ 'use client';
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useFindElements = useFindElements;
5
+ const funnel_core_1 = require("@nascentdigital/funnel-core");
6
+ const react_1 = require("react");
7
+ // hook
8
+ function useFindElements(selector) {
9
+ // bind state + hooks
10
+ const [matches, setMatches] = (0, react_1.useState)([]);
11
+ const observer = SharedElementsObserver.instance;
12
+ // monitor for element changes
13
+ (0, react_1.useLayoutEffect)(() => {
14
+ // bind selector (and return unsubscribe)
15
+ return observer.subscribe(selector, elements => setMatches(elements.slice()));
16
+ }, [observer, selector]);
17
+ // return element
18
+ return matches;
19
+ }
20
+ class SharedElementsObserver {
21
+ static get instance() {
22
+ // create if required
23
+ if (!SharedElementsObserver._instance) {
24
+ SharedElementsObserver._instance = new SharedElementsObserver();
25
+ }
26
+ // throw if we don't have the instance
27
+ const instance = SharedElementsObserver._instance;
28
+ if (!instance) {
29
+ throw new funnel_core_1.IllegalStateError('Unable to instantiate SharedElementsObserver');
30
+ }
31
+ // return instance
32
+ return instance;
33
+ }
34
+ constructor() {
35
+ // initialize instance
36
+ this._observations = new Map();
37
+ this._observer = typeof window === 'undefined'
38
+ ? undefined
39
+ : new MutationObserver(mutations => this.onMutate(mutations));
40
+ }
41
+ subscribe(selector, onChange) {
42
+ // skip if there's no observer
43
+ const { _observer, _observations } = this;
44
+ if (!_observer) {
45
+ console.warn('[useFindElements/subscribe] attempt to subscribe before observer');
46
+ return funnel_core_1.Fn.NoOp;
47
+ }
48
+ // start observing if there are no active callbacks
49
+ if (_observations.size === 0) {
50
+ _observer.observe(document, { attributes: false, childList: true, subtree: true });
51
+ }
52
+ // get observation (or create it)
53
+ let observationGroup = _observations.get(selector);
54
+ if (!observationGroup) {
55
+ observationGroup = {
56
+ selector,
57
+ matches: document.querySelectorAll(selector).values().toArray().map(element => ({
58
+ id: funnel_core_1.Value.uuid(),
59
+ element: element
60
+ })),
61
+ subscribers: []
62
+ };
63
+ _observations.set(selector, observationGroup);
64
+ }
65
+ // add subscriber to list
66
+ const { matches, subscribers } = observationGroup;
67
+ const subscriber = {
68
+ id: funnel_core_1.Value.uuid(),
69
+ onChange
70
+ };
71
+ subscribers.push(subscriber);
72
+ // perform immediate callback
73
+ subscriber.onChange(matches);
74
+ // return unsubscribe
75
+ return () => this.unsubscribe(selector, subscriber.id);
76
+ }
77
+ unsubscribe(selector, subscriberId) {
78
+ // skip if there's no observer
79
+ const { _observer, _observations } = this;
80
+ if (!_observer) {
81
+ console.warn('[useFindElements/unsubscribe] cannot unsubscribe before init', selector);
82
+ return;
83
+ }
84
+ // skip if it's not bound
85
+ const observationGroup = _observations.get(selector);
86
+ if (!observationGroup) {
87
+ console.warn('[useFindElements/unsubscribe] ignoring unbound subscribers:', selector);
88
+ return;
89
+ }
90
+ // or remove list if it's the last one
91
+ const { subscribers } = observationGroup;
92
+ if (subscribers.length === 1) {
93
+ // prune entry
94
+ _observations.delete(selector);
95
+ // stop observer if there are no more entries
96
+ if (_observations.size === 0) {
97
+ _observer.disconnect();
98
+ }
99
+ }
100
+ // or just remove it
101
+ else {
102
+ observationGroup.subscribers = subscribers.filter(subscriber => subscriber.id !== subscriberId);
103
+ }
104
+ }
105
+ onMutate(mutations) {
106
+ // look for removed matches
107
+ const removedElements = mutations.flatMap(mutation => Array.from(mutation.removedNodes));
108
+ const observationGroups = this._observations.values().toArray();
109
+ if (removedElements.length > 0) {
110
+ observationGroups.forEach(observationGroup => {
111
+ // skip if there are no elements to prune
112
+ const { matches, subscribers } = observationGroup;
113
+ if (matches.length === 0) {
114
+ return;
115
+ }
116
+ // clear any removed nodes
117
+ const prunedMatches = matches.filter(({ element }) => !removedElements.some(removedElement => removedElement === element || removedElement.contains(element)));
118
+ if (prunedMatches.length < matches.length) {
119
+ // update elements list
120
+ observationGroup.matches = prunedMatches;
121
+ // raise change
122
+ subscribers.forEach(subscriber => subscriber.onChange(prunedMatches));
123
+ }
124
+ });
125
+ }
126
+ // look for added nodes
127
+ const addedElements = mutations.flatMap(mutation => Array.from(mutation.addedNodes));
128
+ if (addedElements.length > 0) {
129
+ observationGroups.forEach(({ selector, matches, subscribers }) => {
130
+ // find any matching elements
131
+ const newElements = addedElements
132
+ .flatMap(addedElement => addedElement.querySelectorAll(selector).values().toArray())
133
+ .filter(newElement => !matches.some(({ element }) => element === newElement));
134
+ // add new elements (if any)
135
+ if (newElements.length > 0) {
136
+ // track new elements
137
+ matches.push(...newElements.map(element => ({
138
+ id: funnel_core_1.Value.uuid(),
139
+ element
140
+ })));
141
+ // notify subscribers
142
+ subscribers.forEach(subscriber => subscriber.onChange(matches));
143
+ }
144
+ });
145
+ }
146
+ }
147
+ }
@@ -0,0 +1,16 @@
1
+ import { UseInViewOptions } from 'motion/react';
2
+ import { RefObject } from 'react';
3
+ export declare function useInViewport({ scrollerRef, targetRef, targetId, once, threshold, padding }: useInViewport.Options): (boolean | undefined)[];
4
+ export declare namespace useInViewport {
5
+ type Options = {
6
+ scrollerRef?: RefObject<HTMLElement | null>;
7
+ targetRef: RefObject<HTMLElement | null>;
8
+ targetId: string;
9
+ once?: boolean;
10
+ threshold?: Threshold;
11
+ padding?: Padding;
12
+ };
13
+ type Threshold = UseInViewOptions['amount'];
14
+ type PaddingValue = `${number}${'px' | '%'}`;
15
+ type Padding = `${PaddingValue}` | `${PaddingValue} ${PaddingValue}` | `${PaddingValue} ${PaddingValue} ${PaddingValue} ${PaddingValue}`;
16
+ }
@@ -0,0 +1,46 @@
1
+ 'use client';
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useInViewport = useInViewport;
5
+ const funnel_core_1 = require("@nascentdigital/funnel-core");
6
+ const react_1 = require("motion/react");
7
+ const react_2 = require("react");
8
+ // hook
9
+ function useInViewport({ scrollerRef, targetRef, targetId, once, threshold, padding }) {
10
+ // bind refs + hooks
11
+ const [initial, setInitial] = (0, react_2.useState)(true);
12
+ const [inViewport, setInViewport] = (0, react_2.useState)();
13
+ const initializedRef = (0, react_2.useRef)(false);
14
+ const visible = (0, react_1.useInView)(targetRef, {
15
+ root: scrollerRef,
16
+ once,
17
+ amount: threshold,
18
+ margin: padding
19
+ });
20
+ // animate on entry
21
+ (0, react_2.useLayoutEffect)(() => {
22
+ // skip if not bound
23
+ const element = document.getElementById(targetId);
24
+ if (!element) {
25
+ return;
26
+ }
27
+ // use DOM to calculate for initial render (avoids false negatives)
28
+ if (!initializedRef.current) {
29
+ // mark as initialized
30
+ initializedRef.current = true;
31
+ // check client is in viewport
32
+ const elementRect = funnel_core_1.Rect.fromRect(element.getBoundingClientRect());
33
+ const viewportRect = new funnel_core_1.Rect(0, 0, window.innerWidth || document.documentElement.clientWidth, window.innerHeight || document.documentElement.clientHeight);
34
+ const intersectsViewport = viewportRect.overlaps(elementRect);
35
+ // update state
36
+ setInViewport(intersectsViewport);
37
+ }
38
+ // or just update based on visibility
39
+ else {
40
+ setInViewport(visible);
41
+ setInitial(false);
42
+ }
43
+ }, [targetId, visible]);
44
+ // return visibility
45
+ return [inViewport, initial];
46
+ }
@@ -0,0 +1 @@
1
+ export declare function useIsDesktop(): boolean | undefined;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useIsDesktop = useIsDesktop;
4
+ const breakpoint_1 = require("./breakpoint");
5
+ // hook
6
+ function useIsDesktop() {
7
+ // get current breakpoint
8
+ const breakpoint = (0, breakpoint_1.useCurrentBreakpoint)();
9
+ // skip if indeterminate
10
+ if (!breakpoint) {
11
+ return undefined;
12
+ }
13
+ // otherwise, return based on breakpoint
14
+ switch (breakpoint) {
15
+ case 'md':
16
+ case 'lg':
17
+ case 'xl':
18
+ return true;
19
+ default:
20
+ return false;
21
+ }
22
+ }
@@ -0,0 +1,7 @@
1
+ export declare function useKeyboardFocus<TElement extends HTMLElement>(element?: TElement | null): useKeyboardFocus.Result;
2
+ export declare namespace useKeyboardFocus {
3
+ type Result = {
4
+ hasKeyboardFocus?: boolean;
5
+ keyboardFocusElement?: HTMLElement;
6
+ };
7
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useKeyboardFocus = useKeyboardFocus;
4
+ const react_1 = require("react");
5
+ // hook
6
+ function useKeyboardFocus(element) {
7
+ // create state
8
+ const [hasKeyboardFocus, setHasKeyboardFocus] = (0, react_1.useState)();
9
+ const [keyboardFocusElement, setKeyboardFocusElement] = (0, react_1.useState)();
10
+ // bind watcher (if ready/required)
11
+ (0, react_1.useEffect)(() => {
12
+ // ignore if no element or we're not watching
13
+ if (!element) {
14
+ return;
15
+ }
16
+ // add listeners on mount
17
+ const onFocusIn = (e) => {
18
+ var _a;
19
+ setHasKeyboardFocus(true);
20
+ setKeyboardFocusElement((_a = e.target) !== null && _a !== void 0 ? _a : undefined);
21
+ };
22
+ const onFocusOut = () => {
23
+ setHasKeyboardFocus(false);
24
+ setKeyboardFocusElement(undefined);
25
+ };
26
+ element.addEventListener('focusin', onFocusIn);
27
+ element.addEventListener('focusout', onFocusOut);
28
+ // TODO: check children for focus
29
+ // remove listeners on unmount
30
+ return () => {
31
+ element.removeEventListener('focusin', onFocusIn);
32
+ element.removeEventListener('focusout', onFocusOut);
33
+ };
34
+ }, [element]);
35
+ // return state and setter
36
+ return {
37
+ hasKeyboardFocus,
38
+ keyboardFocusElement
39
+ };
40
+ }
@@ -0,0 +1 @@
1
+ export declare function useLatestValue<TValue>(value: TValue): TValue;
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useLatestValue = useLatestValue;
5
+ const funnel_core_1 = require("@nascentdigital/funnel-core");
6
+ const react_1 = require("react");
7
+ // hook
8
+ function useLatestValue(value) {
9
+ // fetch prev value
10
+ const prevValueRef = (0, react_1.useRef)(value);
11
+ const prevValue = prevValueRef.current;
12
+ // return prev if it's unchanged
13
+ if (value === prevValue || funnel_core_1.Value.equals(value, prevValue)) {
14
+ return prevValue;
15
+ }
16
+ // or update and return the new value
17
+ else {
18
+ prevValueRef.current = value;
19
+ return value;
20
+ }
21
+ }
@@ -0,0 +1,13 @@
1
+ import { Tagged } from 'type-fest';
2
+ export interface Lock {
3
+ readonly status: Lock.Status;
4
+ readonly isLocked: boolean;
5
+ lock(): Promise<void>;
6
+ unlock(): void;
7
+ }
8
+ export declare namespace Lock {
9
+ type Id = Tagged<string, 'Lock.Id'>;
10
+ function Id(value: string): Id;
11
+ type Status = 'unlocked' | 'locked' | 'waiting' | 'disposed';
12
+ }
13
+ export declare function useLock(id: Lock.Id): Lock;
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Lock = void 0;
4
+ exports.useLock = useLock;
5
+ const funnel_core_1 = require("@nascentdigital/funnel-core");
6
+ const react_1 = require("react");
7
+ var Lock;
8
+ (function (Lock) {
9
+ function Id(value) {
10
+ return value;
11
+ }
12
+ Lock.Id = Id;
13
+ })(Lock || (exports.Lock = Lock = {}));
14
+ // hook
15
+ function useLock(id) {
16
+ // obtain lock
17
+ const lock = (0, react_1.useMemo)(() => LockCoordinator.resolve(id).obtainLock(), [id]);
18
+ // release lock on unmount (might clear context)
19
+ (0, react_1.useEffect)(() => {
20
+ return () => LockCoordinator.resolve(id).releaseLock(lock);
21
+ }, [id, lock]);
22
+ // return lock
23
+ return lock;
24
+ }
25
+ class LockCoordinator {
26
+ constructor(id) {
27
+ this.id = id;
28
+ // initialize instance variables
29
+ this._locks = new Set();
30
+ this._lockDeferrals = [];
31
+ }
32
+ obtainLock() {
33
+ // create new lock
34
+ const lock = new LockImpl(this);
35
+ // bind it
36
+ const { id, _locks } = this;
37
+ _locks.add(lock);
38
+ console.debug(`[LockCoordinator/${id}/obtainLock] creating new lock:`, lock);
39
+ // return it
40
+ return lock;
41
+ }
42
+ releaseLock(lock) {
43
+ // remove it from the queue (if any)
44
+ const { id, _locks, _lockDeferrals } = this;
45
+ const queueIndex = _lockDeferrals.findIndex(lockDeferral => lockDeferral.lock === lock);
46
+ if (queueIndex >= 0) {
47
+ console.debug(`[LockCoordinator/${id}/releaseLock] removing lock from deferrals:`, lock);
48
+ _lockDeferrals.splice(queueIndex, 1);
49
+ }
50
+ // remove it from the lock set
51
+ _locks.delete(lock);
52
+ console.debug(`[LockCoordinator/${id}/releaseLock] releasing old lock:`, lock);
53
+ // destroy context if it's empty
54
+ if (_locks.size === 0) {
55
+ console.debug(`[LockCoordinator/${id}/releaseLock] destroying empty context`);
56
+ LockCoordinator._coordinators.delete(id);
57
+ }
58
+ }
59
+ getLockStatus(lock) {
60
+ // disposed if it's not bound
61
+ if (!this._locks.has(lock)) {
62
+ return 'disposed';
63
+ }
64
+ // locked if active
65
+ else if (this._activeLock === lock) {
66
+ return 'locked';
67
+ }
68
+ // waiting if queued
69
+ else if (this._lockDeferrals.some(lockDeferral => lockDeferral.lock === lock)) {
70
+ return 'waiting';
71
+ }
72
+ // otherwise, unlocked
73
+ else {
74
+ return 'unlocked';
75
+ }
76
+ }
77
+ activateLock(lock) {
78
+ // throw if attempting to activate disposed lock
79
+ const { _locks, _lockDeferrals, _activeLock } = this;
80
+ if (!_locks.has(lock)) {
81
+ throw new funnel_core_1.InvalidOperationError('Attempt to lock disposed Lock instance');
82
+ }
83
+ // return immediately if there's no active lock (OR this lock is already it)
84
+ else if (!_activeLock || _activeLock === lock) {
85
+ // make lock active
86
+ this._activeLock = lock;
87
+ // return undefined (indicates there's no deferral)
88
+ return undefined;
89
+ }
90
+ // find deferral (or queue a new one)
91
+ let lockDeferral = _lockDeferrals.find(lockDeferral => lockDeferral.lock === lock);
92
+ if (!lockDeferral) {
93
+ // create deferral
94
+ lockDeferral = {
95
+ lock,
96
+ deferral: new funnel_core_1.Deferral()
97
+ };
98
+ // queue it
99
+ _lockDeferrals.push(lockDeferral);
100
+ }
101
+ // return deferral
102
+ return lockDeferral.deferral;
103
+ }
104
+ deactivateLock(lock) {
105
+ // throw if not active
106
+ const { _activeLock, _lockDeferrals } = this;
107
+ if (_activeLock !== lock) {
108
+ throw new funnel_core_1.InvalidOperationError('Attempt to unlock Lock that is not active');
109
+ }
110
+ // activate next deferred lock
111
+ else if (_lockDeferrals.length > 0) {
112
+ // remove deferral
113
+ const [lockDeferral] = _lockDeferrals.splice(0, 1);
114
+ // move lock to active
115
+ this._activeLock = lockDeferral.lock;
116
+ // resolve deferral
117
+ lockDeferral.deferral.resolve();
118
+ }
119
+ // otherwise, just clear active lock
120
+ else {
121
+ delete this._activeLock;
122
+ }
123
+ }
124
+ static resolve(id) {
125
+ // get context (or create one)
126
+ const { _coordinators } = this;
127
+ let lockContext = _coordinators.get(id);
128
+ if (!lockContext) {
129
+ console.debug(`[LockCoordinator/${id}/releaseLock] creating new context`);
130
+ lockContext = new LockCoordinator(id);
131
+ _coordinators.set(id, lockContext);
132
+ }
133
+ // return context
134
+ return lockContext;
135
+ }
136
+ }
137
+ LockCoordinator._coordinators = new Map();
138
+ // lock
139
+ class LockImpl {
140
+ constructor(_context) {
141
+ this._context = _context;
142
+ }
143
+ get isLocked() {
144
+ return this.status === 'locked';
145
+ }
146
+ get status() {
147
+ return this._context.getLockStatus(this);
148
+ }
149
+ async lock() {
150
+ // try to activate
151
+ const deferral = this._context.activateLock(this);
152
+ // await if there's a deferral
153
+ if (deferral) {
154
+ await deferral.promise;
155
+ }
156
+ // now we're locked
157
+ }
158
+ unlock() {
159
+ this._context.deactivateLock(this);
160
+ }
161
+ }
@@ -0,0 +1,2 @@
1
+ import { MixedResponsiveValue } from '@nascentdigital/funnel-core';
2
+ export declare function useMixedResponsiveValue<T>(value: MixedResponsiveValue<T>): T | undefined;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useMixedResponsiveValue = useMixedResponsiveValue;
4
+ const funnel_core_1 = require("@nascentdigital/funnel-core");
5
+ const breakpoint_1 = require("./breakpoint");
6
+ // hook
7
+ function useMixedResponsiveValue(value) {
8
+ // get current breakpoint
9
+ const breakpoint = (0, breakpoint_1.useCurrentBreakpoint)();
10
+ // if value is not a responsive value, just return raw value
11
+ if (!funnel_core_1.ResponsiveValue.isResponsive(value)) {
12
+ return value;
13
+ }
14
+ // exit it if no current breakpoint
15
+ if (!breakpoint) {
16
+ return undefined;
17
+ }
18
+ // resolve value for current breakpoint
19
+ return funnel_core_1.ResponsiveValue.resolve(value, breakpoint);
20
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Next.js `usePath()` wrapper to avoid mismatch with rewrites.
3
+ *
4
+ * This is to be used as a workaround for hydration errors when the pathname on the server does not match what is
5
+ * on the client.
6
+ *
7
+ * Source: https://nextjs.org/docs/app/api-reference/functions/use-pathname#avoid-hydration-mismatch-with-rewrites
8
+ */
9
+ export declare function usePathname(): string;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.usePathname = usePathname;
4
+ const navigation_1 = require("next/navigation");
5
+ const react_1 = require("react");
6
+ /**
7
+ * Next.js `usePath()` wrapper to avoid mismatch with rewrites.
8
+ *
9
+ * This is to be used as a workaround for hydration errors when the pathname on the server does not match what is
10
+ * on the client.
11
+ *
12
+ * Source: https://nextjs.org/docs/app/api-reference/functions/use-pathname#avoid-hydration-mismatch-with-rewrites
13
+ */
14
+ function usePathname() {
15
+ // get pathname from Next.js
16
+ const pathname = (0, navigation_1.usePathname)();
17
+ // state holds the browser pathname (defaults to '#' while its getting ready)
18
+ const [clientPathname, setClientPathname] = (0, react_1.useState)('#');
19
+ // update path name to be the pathname found in browser
20
+ (0, react_1.useEffect)(() => {
21
+ setClientPathname(pathname);
22
+ }, [pathname]);
23
+ // return the client pathname that is found in browser
24
+ return clientPathname;
25
+ }
@@ -0,0 +1,8 @@
1
+ import { Callback } from '@nascentdigital/funnel-core';
2
+ import { SharedMutationObserver } from '../utils';
3
+ export declare function useRefElement<TElement extends HTMLElement = HTMLElement>({ watch }?: useRefElement.Options): [Callback<TElement | null>, TElement | null];
4
+ export declare namespace useRefElement {
5
+ type Options = {
6
+ watch?: SharedMutationObserver.Scope | SharedMutationObserver.Scope[];
7
+ };
8
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useRefElement = useRefElement;
4
+ const react_1 = require("react");
5
+ const utils_1 = require("../utils");
6
+ // hook
7
+ function useRefElement({ watch = 'children' } = {}) {
8
+ // create state
9
+ const [, setUpdatedAt] = (0, react_1.useState)(0);
10
+ const [element, setElement] = (0, react_1.useState)(null);
11
+ // create ref callback function
12
+ const setRef = (0, react_1.useCallback)((node) => {
13
+ setElement(node);
14
+ }, []);
15
+ // bind watcher (if ready/required)
16
+ (0, react_1.useEffect)(() => {
17
+ // ignore if no element or we're not watching
18
+ if (!element || !watch) {
19
+ return;
20
+ }
21
+ // watch element for changes
22
+ const watchScope = typeof watch === 'string'
23
+ ? [watch]
24
+ : watch.length === 0
25
+ ? ['children']
26
+ : watch;
27
+ const subscription = utils_1.SharedMutationObserver.instance.watch(element, watchScope)
28
+ .subscribe(change => setUpdatedAt(Date.now()));
29
+ // unsubscribe on unmount
30
+ return () => subscription.unsubscribe();
31
+ }, [element, watch]);
32
+ // return state and setter
33
+ return [setRef, element];
34
+ }
@@ -0,0 +1,2 @@
1
+ import { Duration } from '@nascentdigital/funnel-core';
2
+ export declare function useRefresh(period: Duration): void;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useRefresh = useRefresh;
4
+ const funnel_core_1 = require("@nascentdigital/funnel-core");
5
+ const react_1 = require("react");
6
+ const rxjs_1 = require("rxjs");
7
+ const useTouch_1 = require("./useTouch");
8
+ // hook
9
+ function useRefresh(period) {
10
+ // bind state, memoize touch, and return it
11
+ const touch = (0, useTouch_1.useTouch)();
12
+ // bind timer
13
+ (0, react_1.useEffect)(() => {
14
+ // for period to be at least 1s
15
+ let timeout = funnel_core_1.Duration.toMilliseconds(period);
16
+ if (timeout < 1000) {
17
+ console.warn('[useRefresh] period must be at lest 1s between refreshes - correcting');
18
+ timeout = 1000;
19
+ }
20
+ // setup interval
21
+ const subscription = (0, rxjs_1.interval)(timeout).subscribe(() => touch());
22
+ // destroy on unmount
23
+ return () => subscription.unsubscribe();
24
+ }, [touch, period]);
25
+ }
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export declare function useResizeObserver<T extends Element>(target: React.RefObject<T> | React.ForwardedRef<T> | T | null, callback: useResizeObserver.Callback): ResizeObserver | undefined;
3
+ export declare namespace useResizeObserver {
4
+ type Callback = (entry: ResizeObserverEntry, observer: ResizeObserver) => any;
5
+ }